diff --git a/DEPS b/DEPS index a2c7605..1cff200 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '2563601fc2b0505619f905f86bd249ae630197cc', + 'skia_revision': 'ad61192eda55a71de9253b6204ed5490867b4f36', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '284d332aea2933638c8823f0306ead9458161a38', + 'catapult_revision': '8c0ad1433895cf7544fffdb9f463d1f1aec457e9', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -224,7 +224,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'd311569d89bea47cca74b81f17c497e6a528356a', # commit position 15034 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '155a5b4ffc713e5a6ee24c52b2d620c561b3a772', # commit position 15051 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'),
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc index b3bfde5..ba6b0317 100644 --- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc +++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/chromeos/login/startup_utils.h" @@ -20,6 +21,10 @@ namespace em = enterprise_management; +namespace { +const char kDMTokenCheckHistogram[] = "Enterprise.EnrolledPolicyHasDMToken"; +} + namespace policy { DeviceCloudPolicyStoreChromeOS::DeviceCloudPolicyStoreChromeOS( @@ -29,7 +34,6 @@ : device_settings_service_(device_settings_service), install_attributes_(install_attributes), background_task_runner_(background_task_runner), - enrollment_validation_done_(false), weak_factory_(this) { device_settings_service_->AddObserver(this); } @@ -136,87 +140,95 @@ } void DeviceCloudPolicyStoreChromeOS::UpdateFromService() { - const em::PolicyData* policy_data = device_settings_service_->policy_data(); - const chromeos::DeviceSettingsService::Status status = - device_settings_service_->status(); - if (!install_attributes_->IsEnterpriseDevice()) { status_ = STATUS_BAD_STATE; NotifyStoreError(); return; } - // For enterprise devices, once per session, validate internal consistency of - // enrollment state (DM token must be present on enrolled devices) and in case - // of failure set flag to indicate that recovery is required. - switch (status) { - case chromeos::DeviceSettingsService::STORE_SUCCESS: - case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: - case chromeos::DeviceSettingsService::STORE_NO_POLICY: - case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: - case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: { - if (!enrollment_validation_done_) { - enrollment_validation_done_ = true; - const bool has_dm_token = - status == chromeos::DeviceSettingsService::STORE_SUCCESS && - policy_data && - policy_data->has_request_token(); + CheckDMToken(); + UpdateStatusFromService(); - // At the time LoginDisplayHostImpl decides whether enrollment flow is - // to be started, policy hasn't been read yet. To work around this, - // once the need for recovery is detected upon policy load, a flag is - // stored in prefs which is accessed by LoginDisplayHostImpl early - // during (next) boot. - if (!has_dm_token) { - LOG(ERROR) << "Device policy read on enrolled device yields " - << "no DM token! Status: " << status << "."; - chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); - } - UMA_HISTOGRAM_BOOLEAN("Enterprise.EnrolledPolicyHasDMToken", - has_dm_token); - } - break; + const chromeos::DeviceSettingsService::Status service_status = + device_settings_service_->status(); + if (service_status == chromeos::DeviceSettingsService::STORE_SUCCESS) { + policy_ = base::MakeUnique<em::PolicyData>(); + const em::PolicyData* policy_data = device_settings_service_->policy_data(); + if (policy_data) + policy_->MergeFrom(*policy_data); + + PolicyMap new_policy_map; + if (is_managed()) { + DecodeDevicePolicy(*device_settings_service_->device_settings(), + &new_policy_map); } - case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: - case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: - case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: - // Do nothing for write errors or transient read errors. - break; + policy_map_.Swap(&new_policy_map); + + NotifyStoreLoaded(); + return; } + NotifyStoreError(); +} - switch (status) { - case chromeos::DeviceSettingsService::STORE_SUCCESS: { +void DeviceCloudPolicyStoreChromeOS::UpdateStatusFromService() { + switch (device_settings_service_->status()) { + case chromeos::DeviceSettingsService::STORE_SUCCESS: status_ = STATUS_OK; - policy_.reset(new em::PolicyData()); - if (policy_data) - policy_->MergeFrom(*policy_data); - - PolicyMap new_policy_map; - if (is_managed()) { - DecodeDevicePolicy(*device_settings_service_->device_settings(), - &new_policy_map); - } - policy_map_.Swap(&new_policy_map); - - NotifyStoreLoaded(); return; - } case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: status_ = STATUS_BAD_STATE; - break; + return; case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: status_ = STATUS_STORE_ERROR; - break; + return; case chromeos::DeviceSettingsService::STORE_NO_POLICY: case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: status_ = STATUS_LOAD_ERROR; + return; + } + NOTREACHED(); +} + +void DeviceCloudPolicyStoreChromeOS::CheckDMToken() { + const chromeos::DeviceSettingsService::Status service_status = + device_settings_service_->status(); + switch (service_status) { + case chromeos::DeviceSettingsService::STORE_SUCCESS: + case chromeos::DeviceSettingsService::STORE_KEY_UNAVAILABLE: + case chromeos::DeviceSettingsService::STORE_NO_POLICY: + case chromeos::DeviceSettingsService::STORE_INVALID_POLICY: + case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: + // Continue with the check below. break; + case chromeos::DeviceSettingsService::STORE_POLICY_ERROR: + case chromeos::DeviceSettingsService::STORE_OPERATION_FAILED: + case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: + // Don't check for write errors or transient read errors. + return; } - NotifyStoreError(); + if (dm_token_checked_) { + return; + } + dm_token_checked_ = true; + + // At the time LoginDisplayHostImpl decides whether enrollment flow is to be + // started, policy hasn't been read yet. To work around this, once the need + // for recovery is detected upon policy load, a flag is stored in prefs which + // is accessed by LoginDisplayHostImpl early during (next) boot. + const em::PolicyData* policy_data = device_settings_service_->policy_data(); + if (service_status == chromeos::DeviceSettingsService::STORE_SUCCESS && + policy_data && policy_data->has_request_token()) { + UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, true); + } else { + LOG(ERROR) << "Device policy read on enrolled device yields " + << "no DM token! Status: " << service_status << "."; + chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); + UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, false); + } } } // namespace policy
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h index e16bd7a..544ff61 100644 --- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h +++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h
@@ -30,7 +30,7 @@ namespace policy { // CloudPolicyStore implementation for device policy on Chrome OS. Policy is -// stored/loaded via DBus to/from session_manager. +// stored/loaded via D-Bus to/from session_manager. class DeviceCloudPolicyStoreChromeOS : public CloudPolicyStore, public chromeos::DeviceSettingsService::Observer { @@ -73,14 +73,22 @@ // Re-syncs policy and status from |device_settings_service_|. void UpdateFromService(); + // Set |status_| based on device_settings_service_->status(). + void UpdateStatusFromService(); + + // For enterprise devices, once per session, validate internal consistency of + // enrollment state (DM token must be present on enrolled devices) and in case + // of failure set flag to indicate that recovery is required. + void CheckDMToken(); + + // Whether DM token check has yet been done. + bool dm_token_checked_ = false; + chromeos::DeviceSettingsService* device_settings_service_; chromeos::InstallAttributes* install_attributes_; scoped_refptr<base::SequencedTaskRunner> background_task_runner_; - // Whether enterprise enrollment validation has yet been done. - bool enrollment_validation_done_; - base::WeakPtrFactory<DeviceCloudPolicyStoreChromeOS> weak_factory_; DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyStoreChromeOS);
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 02faf8a6..7b79425 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -240,24 +240,6 @@ optional string verification_key_hash = 9; } -// This message contains the information which is signed by the verification -// key during policy key rotation. It is included in serialized form in -// PolicyFetchResponse below. A signature of the serialized form is included -// in the new_public_key_verification_data_signature field. For backward -// compatibility reasons, a signature over just {new_public_key, domain} fields -// is included in new_public_key_verification_signature_DEPRECATED field. -message PublicKeyVerificationData { - // The new public policy key after a key rotation. - optional bytes new_public_key = 1; - - // The domain of the device/user. - optional string domain = 2; - - // The version number of the new_public_key. This must be monotonically - // increasing (within a domain). - optional int32 new_public_key_version = 3; -} - // This message customizes how the device behaves when it is disabled by its // owner. The message will be sent as part of the DeviceState fetched during // normal operation and as part of the DeviceStateRetrievalResponse fetched when @@ -432,10 +414,9 @@ } message PolicyFetchResponse { - // Since a single policy request may ask for multiple policies, we - // provide separate error code for each individual policy fetch. - - // We will use standard HTTP Status Code as error code. + // Since a single policy request may ask for multiple policies, DM server + // provides separate error codes (making use of standard HTTP Status Codes) + // for each individual policy fetch. optional int32 error_code = 1; // Human readable error message for customer support purpose. @@ -458,15 +439,14 @@ // DEPRECATED: Exists only to support older clients. This signature is similar // to new_public_key_verification_data_signature, but is computed over - // PublicKeyVerificationData proto with version field unset. - // In other words, DMServer sets the new public key value, and domain value - // and then produces this signature. + // DEPRECATEDPolicyPublicKeyAndDomain (which is equivalent to + // PublicKeyVerificationData proto with version field unset). optional bytes new_public_key_verification_signature_deprecated = 7 [deprecated = true]; - // This is a serialized |PublicKeyVerificationData| protobuf - // (defined above). See comments for |new_public_key_verification_signature| - // field for details on how this data is signed. + // This is a serialized |PublicKeyVerificationData| protobuf (defined + // below). See comments for |new_public_key_verification_data_signature| field + // for details on how this data is signed. // Please note that |new_public_key| is also included inside this data // field. Thus we have new public key signed with old version of private key // (if client indicated to us that it has old key version), and @@ -508,11 +488,27 @@ // PolicyFetchResponse). optional bytes new_public_key = 1; - // The domain associated with this key (should match the domain portion of - // the username field of the policy). + // The domain associated with this key (should match the domain portion of the + // username field of the policy). optional string domain = 2; } +// This message contains the information which is signed by the verification key +// during policy key rotation. It is included in serialized form in +// PolicyFetchResponse above. A signature of the serialized form is included in +// the new_public_key_verification_data_signature field. +message PublicKeyVerificationData { + // The new public policy key after a key rotation. + optional bytes new_public_key = 1; + + // The domain of the device/user. + optional string domain = 2; + + // The version number of the new_public_key. This must be monotonically + // increasing (within a domain). + optional int32 new_public_key_version = 3; +} + // Request from device to server for reading policies. message DevicePolicyRequest { // The policy fetch request. If this field exists, the request must
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation.html b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation.html index 4cb2286..e7d028e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-log-before-frame-navigation.html
@@ -31,7 +31,7 @@ for (var i = 0; i < messages.length; ++i) { var m = messages[i]; InspectorTest.addResult("Message[" + i + "]:"); - InspectorTest.addResult("Message: " + WebInspector.displayNameForURL(m.url) + ":" + m.line + " " + m.messageText); + InspectorTest.addResult("Message: " + Bindings.displayNameForURL(m.url) + ":" + m.line + " " + m.messageText); } InspectorTest.addResult("TEST COMPLETE."); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dedicated-workers-list.html b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dedicated-workers-list.html index fac49a7..cef8ac3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dedicated-workers-list.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dedicated-workers-list.html
@@ -34,7 +34,7 @@ function didDisableWorkerInspection() { - InspectorTest.addSniffer(WebInspector.SubTargetsManager.prototype, "_attachedToTarget", workerCreated, true); + InspectorTest.addSniffer(SDK.SubTargetsManager.prototype, "_attachedToTarget", workerCreated, true); InspectorTest.TargetAgent.setAutoAttach(true, true); InspectorTest.addResult("Worker inspection enabled"); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html index 4d854391..f955fa9d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/dynamic-scripts.html
@@ -50,8 +50,8 @@ function step3() { - var panel = WebInspector.panels.sources; - var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network); + var panel = UI.panels.sources; + var uiSourceCodes = Workspace.workspace.uiSourceCodesForProjectType(Workspace.projectTypes.Network); var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.name(); }); urls.sort();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/filtered-item-selection-dialog-filtering.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/filtered-item-selection-dialog-filtering.html index 435c4fa4..8c79670a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/filtered-item-selection-dialog-filtering.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/filtered-item-selection-dialog-filtering.html
@@ -11,7 +11,7 @@ var overrideShowMatchingItems = true; var history = []; - var StubDelegate = class extends WebInspector.FilteredListWidget.Delegate { + var StubDelegate = class extends UI.FilteredListWidget.Delegate { constructor() { super(history); @@ -36,7 +36,7 @@ UnitTest.addResult("Input:" + JSON.stringify(input)); - var filteredSelectionDialog = new WebInspector.FilteredListWidget(delegate); + var filteredSelectionDialog = new UI.FilteredListWidget(delegate); filteredSelectionDialog.showAsDialog(); var promise = UnitTest.addSniffer(filteredSelectionDialog, "_itemsFilteredForTest").then(accept); filteredSelectionDialog.setQuery(query);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js index 89ad76e..bb1ca19 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
@@ -131,25 +131,25 @@ if (description) UnitTest.addResult(description); - WebInspector.settings = new WebInspector.Settings(new WebInspector.SettingsStorage( + Common.settings = new Common.Settings(new Common.SettingsStorage( {}, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference, InspectorFrontendHost.clearPreferences)); - WebInspector.viewManager = new WebInspector.ViewManager(); - WebInspector.initializeUIUtils(document, WebInspector.settings.createSetting("uiTheme", "default")); - WebInspector.installComponentRootStyles(document.body); + UI.viewManager = new UI.ViewManager(); + UI.initializeUIUtils(document, Common.settings.createSetting("uiTheme", "default")); + UI.installComponentRootStyles(document.body); - WebInspector.zoomManager = new WebInspector.ZoomManager(window, InspectorFrontendHost); - WebInspector.inspectorView = WebInspector.InspectorView.instance(); - WebInspector.ContextMenu.initialize(); - WebInspector.ContextMenu.installHandler(document); - WebInspector.Tooltip.installHandler(document); + UI.zoomManager = new UI.ZoomManager(window, InspectorFrontendHost); + UI.inspectorView = UI.InspectorView.instance(); + UI.ContextMenu.initialize(); + UI.ContextMenu.installHandler(document); + UI.Tooltip.installHandler(document); - var rootView = new WebInspector.RootView(); - WebInspector.inspectorView.show(rootView.element); + var rootView = new UI.RootView(); + UI.inspectorView.show(rootView.element); rootView.attachToDocument(document); Promise.all(lazyModules.map(lazyModule => window.runtime.loadModulePromise(lazyModule))).then(test); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/static-viewport-control.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/static-viewport-control.html index 9afa1da..493b6805 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/static-viewport-control.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/static-viewport-control.html
@@ -12,13 +12,13 @@ items[i].style.height = (heights[i] = (i % 4) ? 50 : 28) + "px"; items[i].textContent = i; } - var viewport = new WebInspector.StaticViewportControl({ + var viewport = new UI.StaticViewportControl({ fastItemHeight: i => heights[i], itemCount: _ => items.length, itemElement: i => items[i] }); viewport.element.style.height = "300px"; - WebInspector.inspectorView.element.appendChild(viewport.element); + UI.inspectorView.element.appendChild(viewport.element); viewport.refresh(); dumpViewport();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint-expected.txt index c3ecf07..5b37e11 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint-expected.txt
@@ -1,4 +1,4 @@ -Tests that the hint displays properly on a WebInspector.TextPrompt with autocomplete. +Tests that the hint displays properly on a UI.TextPrompt with autocomplete. Requesting completions Text:testT TextWithCurrentSuggestion:testT
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint.html index 75c65df..5934f409 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt-hint.html
@@ -13,10 +13,10 @@ console.error("completionsDone called too early!"); UnitTest.completeTest(); } - var prompt = new WebInspector.TextPrompt(); + var prompt = new UI.TextPrompt(); prompt.initialize(completions); var element = createElement("div"); - WebInspector.inspectorView.element.appendChild(element); + UI.inspectorView.element.appendChild(element); var proxy = prompt.attachAndStartEditing(element); prompt.setText("testT"); prompt.complete(); @@ -113,6 +113,6 @@ </script> </head> <body> -<p>Tests that the hint displays properly on a WebInspector.TextPrompt with autocomplete.</p> +<p>Tests that the hint displays properly on a UI.TextPrompt with autocomplete.</p> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt.html index c2588cf..21f7ac1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt.html
@@ -6,11 +6,11 @@ <script> function test() { var suggestions = ["heyoo", "hey it's a suggestion", "hey another suggestion"]; - var prompt = new WebInspector.TextPrompt(); + var prompt = new UI.TextPrompt(); prompt.initialize((element, range, force, callback) => callback(suggestions)); prompt.setSuggestBoxEnabled(true); var div = document.createElement("div"); - WebInspector.inspectorView.element.appendChild(div); + UI.inspectorView.element.appendChild(div); prompt.attachAndStartEditing(div); prompt.setText("hey"); prompt.complete();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/trie.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/trie.html index f0a2ec5..c6f5582 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/trie.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/trie.html
@@ -10,7 +10,7 @@ UnitTest.runTests([ function testAddWord() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "hello"); hasWord(trie, "he"); hasWord(trie, "hello"); @@ -19,7 +19,7 @@ function testAddWords() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); addWord(trie, "bar"); addWord(trie, "bazz"); @@ -32,7 +32,7 @@ function testRemoveWord() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); removeWord(trie, "f"); removeWord(trie, "fo"); @@ -44,7 +44,7 @@ function testAddAfterRemove() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); removeWord(trie, "foo"); addWord(trie, "bar"); @@ -54,7 +54,7 @@ function testWordOverwrite() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); addWord(trie, "foo"); removeWord(trie, "foo"); @@ -63,7 +63,7 @@ function testRemoveNonExisting() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); removeWord(trie, "bar"); removeWord(trie, "baz"); @@ -72,7 +72,7 @@ function testEmptyWord() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, ""); hasWord(trie, ""); removeWord(trie, ""); @@ -81,7 +81,7 @@ function testAllWords() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); addWord(trie, "bar"); addWord(trie, "bazzz"); @@ -97,7 +97,7 @@ function testOneCharWords() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "a"); addWord(trie, "b"); addWord(trie, "c"); @@ -106,7 +106,7 @@ function testChainWords() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "f"); addWord(trie, "fo"); addWord(trie, "foo"); @@ -116,7 +116,7 @@ function testClearTrie() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "foo"); addWord(trie, "bar"); words(trie); @@ -126,7 +126,7 @@ function testLongestPrefix() { - var trie = new WebInspector.Trie(); + var trie = new Common.Trie(); addWord(trie, "fo"); addWord(trie, "food"); longestPrefix(trie, "fear", false);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-iframe-manifests.html b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-iframe-manifests.html index 64cd6e5..5f54396 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-iframe-manifests.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-iframe-manifests.html
@@ -10,7 +10,7 @@ var frameId2; var frameId3; - WebInspector.viewManager.showView("resources"); + UI.viewManager.showView("resources"); InspectorTest.dumpApplicationCache(); InspectorTest.createAndNavigateIFrame("resources/page-with-manifest.php?manifestId=1", step1);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-manifest-with-non-existing-file.html b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-manifest-with-non-existing-file.html index b8869df2..306555c5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-manifest-with-non-existing-file.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-manifest-with-non-existing-file.html
@@ -10,7 +10,7 @@ var frameId2; var frameId3; - WebInspector.viewManager.showView("resources"); + UI.viewManager.showView("resources"); InspectorTest.startApplicationCacheStatusesRecording(); InspectorTest.dumpApplicationCache(); InspectorTest.createAndNavigateIFrame("resources/page-with-manifest.php?manifestId=with-non-existing-file", step1);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-swap.html b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-swap.html index 98f35dc..7d3c575f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-swap.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-swap.html
@@ -10,7 +10,7 @@ var frameId1; var frameId2; - WebInspector.viewManager.showView("resources"); + UI.viewManager.showView("resources"); InspectorTest.startApplicationCacheStatusesRecording(); InspectorTest.dumpApplicationCache(); InspectorTest.createAndNavigateIFrame("resources/with-versioned-manifest.php", step1);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-test.js index 0695440..0fe0642 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/appcache/appcache-test.js
@@ -31,7 +31,7 @@ InspectorTest.createAndNavigateIFrame = function(url, callback) { - InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameNavigated", frameNavigated); + InspectorTest.addSniffer(SDK.ResourceTreeModel.prototype, "_frameNavigated", frameNavigated); InspectorTest.evaluateInPage("createAndNavigateIFrame(unescape('" + escape(url) + "'))"); function frameNavigated(frame) @@ -44,7 +44,7 @@ { var frame = InspectorTest.resourceTreeModel.frameForId(frameId) InspectorTest.evaluateInPage("navigateIFrame(unescape('" + escape(frame.name) +"'), unescape('" + escape(url) + "'))"); - InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameNavigated", frameNavigated); + InspectorTest.addSniffer(SDK.ResourceTreeModel.prototype, "_frameNavigated", frameNavigated); function frameNavigated(frame) { @@ -56,7 +56,7 @@ { var frame = InspectorTest.resourceTreeModel.frameForId(frameId) InspectorTest.evaluateInPage("removeIFrame(unescape('" + escape(frame.name) +"'))"); - InspectorTest.addSniffer(WebInspector.ResourceTreeModel.prototype, "_frameDetached", frameDetached); + InspectorTest.addSniffer(SDK.ResourceTreeModel.prototype, "_frameDetached", frameDetached); function frameDetached(frame) { @@ -81,7 +81,7 @@ InspectorTest.dumpApplicationCacheTree = function() { InspectorTest.addResult("Dumping application cache tree:"); - var applicationCacheTreeElement = WebInspector.panels.resources.applicationCacheListTreeElement; + var applicationCacheTreeElement = UI.panels.resources.applicationCacheListTreeElement; if (!applicationCacheTreeElement.childCount()) { InspectorTest.addResult(" (empty)"); return; @@ -127,7 +127,7 @@ InspectorTest.dumpApplicationCacheModel = function() { InspectorTest.addResult("Dumping application cache model:"); - var model = WebInspector.panels.resources._applicationCacheModel; + var model = UI.panels.resources._applicationCacheModel; var frameIds = []; for (var frameId in model._manifestURLsByFrame) @@ -154,15 +154,15 @@ InspectorTest.waitForFrameManifestURLAndStatus = function(frameId, manifestURL, status, callback) { - var frameManifestStatus = WebInspector.panels.resources._applicationCacheModel.frameManifestStatus(frameId); - var frameManifestURL = WebInspector.panels.resources._applicationCacheModel.frameManifestURL(frameId); + var frameManifestStatus = UI.panels.resources._applicationCacheModel.frameManifestStatus(frameId); + var frameManifestURL = UI.panels.resources._applicationCacheModel.frameManifestURL(frameId); if (frameManifestStatus === status && frameManifestURL.indexOf(manifestURL) !== -1) { callback(); return; } var handler = InspectorTest.waitForFrameManifestURLAndStatus.bind(this, frameId, manifestURL, status, callback); - InspectorTest.addSniffer(WebInspector.ApplicationCacheModel.prototype, "_frameManifestUpdated", handler); + InspectorTest.addSniffer(SDK.ApplicationCacheModel.prototype, "_frameManifestUpdated", handler); } InspectorTest.startApplicationCacheStatusesRecording = function() @@ -188,7 +188,7 @@ } } - InspectorTest.addSniffer(WebInspector.ApplicationCacheModel.prototype, "_frameManifestUpdated", addRecord, true); + InspectorTest.addSniffer(SDK.ApplicationCacheModel.prototype, "_frameManifestUpdated", addRecord, true); } InspectorTest.ensureFrameStatusEventsReceived = function(frameId, count, callback)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-data.html b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-data.html index f1566961..428b457 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-data.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-data.html
@@ -5,7 +5,7 @@ <script> function test() { - var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(WebInspector.targetManager.mainTarget()); + var cacheStorageModel = SDK.ServiceWorkerCacheModel.fromTarget(SDK.targetManager.mainTarget()); cacheStorageModel.enable(); function errorAndExit(error)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html index f9d11be..54fc1a22 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html
@@ -5,7 +5,7 @@ <script> function test() { - var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(WebInspector.targetManager.mainTarget()); + var cacheStorageModel = SDK.ServiceWorkerCacheModel.fromTarget(SDK.targetManager.mainTarget()); cacheStorageModel.enable(); function errorAndExit(error)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-entry-deletion.html b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-entry-deletion.html index 57caaee..01e08ec9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-entry-deletion.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-entry-deletion.html
@@ -5,7 +5,7 @@ <script> function test() { - var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(WebInspector.targetManager.mainTarget()); + var cacheStorageModel = SDK.ServiceWorkerCacheModel.fromTarget(SDK.targetManager.mainTarget()); cacheStorageModel.enable(); function errorAndExit(error)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-names.html b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-names.html index 61bf78e..8b960a0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-names.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-names.html
@@ -5,7 +5,7 @@ <script> function test() { - var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(WebInspector.targetManager.mainTarget()); + var cacheStorageModel = SDK.ServiceWorkerCacheModel.fromTarget(SDK.targetManager.mainTarget()); cacheStorageModel.enable(); function errorAndExit(error)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js index 849fd86..1f6c7cb3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/cache-storage/cache-storage-test.js
@@ -7,11 +7,11 @@ InspectorTest.dumpCacheTree = function() { - WebInspector.panels.resources.cacheStorageListTreeElement.expand(); + UI.panels.resources.cacheStorageListTreeElement.expand(); InspectorTest.addResult("Dumping CacheStorage tree:"); - var cachesTreeElement = WebInspector.panels.resources.cacheStorageListTreeElement; + var cachesTreeElement = UI.panels.resources.cacheStorageListTreeElement; var promise = new Promise(function(resolve, reject) { - InspectorTest.addSnifferPromise(WebInspector.ServiceWorkerCacheModel.prototype, "_updateCacheNames").then(crawlCacheTree).catch(reject); + InspectorTest.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, "_updateCacheNames").then(crawlCacheTree).catch(reject); function crawlCacheTree() { @@ -27,7 +27,7 @@ var cacheTreeElement = cachesTreeElement.childAt(i); InspectorTest.addResult(" cache: " + cacheTreeElement.title); var view = cacheTreeElement._view; - InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheView.prototype, "_updateDataCallback", addDataResult, false); + InspectorTest.addSniffer(Resources.ServiceWorkerCacheView.prototype, "_updateDataCallback", addDataResult, false); if (!view) cacheTreeElement.onselect(false); else @@ -65,22 +65,22 @@ } } }); - WebInspector.panels.resources.cacheStorageListTreeElement._refreshCaches(); + UI.panels.resources.cacheStorageListTreeElement._refreshCaches(); return promise; } // If optionalEntry is not specified, then the whole cache is deleted. InspectorTest.deleteCacheFromInspector = function(cacheName, optionalEntry) { - WebInspector.panels.resources.cacheStorageListTreeElement.expand(); + UI.panels.resources.cacheStorageListTreeElement.expand(); if (optionalEntry) { InspectorTest.addResult("Deleting CacheStorage entry " + optionalEntry + " in cache " + cacheName); } else { InspectorTest.addResult("Deleting CacheStorage cache " + cacheName); } - var cachesTreeElement = WebInspector.panels.resources.cacheStorageListTreeElement; + var cachesTreeElement = UI.panels.resources.cacheStorageListTreeElement; var promise = new Promise(function(resolve, reject) { - InspectorTest.addSnifferPromise(WebInspector.ServiceWorkerCacheModel.prototype, "_updateCacheNames") + InspectorTest.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, "_updateCacheNames") .then(function() { if (!cachesTreeElement.childCount()) { reject("Error: Could not find CacheStorage cache " + cacheName); @@ -94,14 +94,14 @@ continue; if (!optionalEntry) { // Here we're deleting the whole cache. - InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheModel.prototype, "_cacheRemoved", resolve) + InspectorTest.addSniffer(SDK.ServiceWorkerCacheModel.prototype, "_cacheRemoved", resolve) cacheTreeElement._clearCache(); return; } // Here we're deleting only the entry. We verify that it is present in the table. var view = cacheTreeElement._view; - InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheView.prototype, "_updateDataCallback", deleteEntryOrReject, false); + InspectorTest.addSniffer(Resources.ServiceWorkerCacheView.prototype, "_updateDataCallback", deleteEntryOrReject, false); if (!view) cacheTreeElement.onselect(false); else @@ -124,13 +124,13 @@ reject("Error: Could not find CacheStorage cache " + cacheName); }).catch(reject); }); - WebInspector.panels.resources.cacheStorageListTreeElement._refreshCaches(); + UI.panels.resources.cacheStorageListTreeElement._refreshCaches(); return promise; } InspectorTest.waitForCacheRefresh = function(callback) { - InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheModel.prototype, "_updateCacheNames", callback, false); + InspectorTest.addSniffer(SDK.ServiceWorkerCacheModel.prototype, "_updateCacheNames", callback, false); } InspectorTest.createCache = function(cacheName)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/command-line-api-inspect.html b/third_party/WebKit/LayoutTests/http/tests/inspector/command-line-api-inspect.html index 8ee9b7d4..14b9931 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/command-line-api-inspect.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/command-line-api-inspect.html
@@ -11,7 +11,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_inspectRequested", sniffInspect, true); + InspectorTest.addSniffer(SDK.RuntimeModel.prototype, "_inspectRequested", sniffInspect, true); function sniffInspect(objectId, hints) { @@ -34,19 +34,19 @@ InspectorTest.runTestSuite([ function testRevealElement(next) { - InspectorTest.addSniffer(WebInspector.Revealer, "revealPromise", step2, true); + InspectorTest.addSniffer(Common.Revealer, "revealPromise", step2, true); evalAndDump("inspect($('#p1'))"); function step2(node, revealPromise) { - if (!(node instanceof WebInspector.RemoteObject)) + if (!(node instanceof SDK.RemoteObject)) return; revealPromise.then(step3); } function step3() { - InspectorTest.addResult("Selected node id: '" + WebInspector.panels.elements.selectedDOMNode().getAttribute("id") + "'."); + InspectorTest.addResult("Selected node id: '" + UI.panels.elements.selectedDOMNode().getAttribute("id") + "'."); next(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html b/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html index 397c7f3..81924dc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html
@@ -13,8 +13,8 @@ { InspectorTest.createWorkspace(); var target = InspectorTest.createMockTarget(InspectorTest._mockTargetId++); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); userCallback(target); } @@ -85,7 +85,7 @@ "mappings":"AAASA,QAAAA,IAAG,CAACC,CAAD,CAAaC,CAAb,CACZ,CACI,MAAOD,EAAP,CAAoBC,CADxB,CAIA,IAAIC,OAAS;A", "sources":["example.js"] }; - var mapping = new WebInspector.TextSourceMap("compiled.js", "source-map.json", mappingPayload); + var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json", mappingPayload); checkMapping(0, 9, "example.js", 0, 9, mapping); checkMapping(0, 13, "example.js", 0, 13, mapping); @@ -110,7 +110,7 @@ "mappings":"AAAA,C,CAAE;", "sources":["example.js"] }; - var mapping = new WebInspector.TextSourceMap("compiled.js", "source-map.json", mappingPayload); + var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json", mappingPayload); checkMapping(0, 0, "example.js", 0, 0, mapping); var entry = mapping.findEntry(0, 1); InspectorTest.assertTrue(!entry.sourceURL); @@ -124,7 +124,7 @@ "mappings":"AAAA;;;CACA", "sources":["example.js"] }; - var mapping = new WebInspector.TextSourceMap("compiled.js", "source-map.json", mappingPayload); + var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json", mappingPayload); checkMapping(0, 0, "example.js", 0, 0, mapping); checkReverseMapping(3, 1, "example.js", 1, mapping); next(); @@ -147,7 +147,7 @@ } } ]}; - var mapping = new WebInspector.TextSourceMap("compiled.js", "source-map.json", mappingPayload); + var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json", mappingPayload); InspectorTest.assertEquals(2, mapping.sourceURLs().length); checkMapping(0, 0, "source1.js", 0, 0, mapping); checkMapping(0, 1, "source1.js", 2, 1, mapping); @@ -158,13 +158,13 @@ function testResolveSourceMapURL(next) { - var func = WebInspector.ParsedURL.completeURL; + var func = Common.ParsedURL.completeURL; InspectorTest.addResult("http://example.com/map.json === " + func("http://example.com/script.js", "http://example.com/map.json")); InspectorTest.addResult("http://example.com/map.json === " + func("http://example.com/script.js", "/map.json")); InspectorTest.addResult("http://example.com/maps/map.json === " + func("http://example.com/scripts/script.js", "../maps/map.json")); function testCompleteURL(base, lhs, rhs) { - var actual = WebInspector.ParsedURL.completeURL(base, lhs); + var actual = Common.ParsedURL.completeURL(base, lhs); InspectorTest.addResult(lhs + " resolves to " + actual + "===" + rhs + " passes: " + (actual === rhs)); } @@ -240,12 +240,12 @@ function originalUISourceCodeAdded(uiSourceCode) { InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(originalResourceUISourceCodeAdded); - InspectorTest.addMockUISourceCodeToWorkspace("compiled.js", WebInspector.resourceTypes.Script, ""); + InspectorTest.addMockUISourceCodeToWorkspace("compiled.js", Common.resourceTypes.Script, ""); } function originalResourceUISourceCodeAdded(uiSourceCode) { - InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(stubUISourceCodeAdded, 1, WebInspector.projectTypes.Service); + InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(stubUISourceCodeAdded, 1, Workspace.projectTypes.Service); originalUISourceCode = uiSourceCode; } @@ -311,7 +311,7 @@ }); InspectorTest.testDebuggerWorkspaceBinding._targetToData.get(target)._parsedScriptSource({ data: script }); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(originalResourceUISourceCodeAdded); - InspectorTest.addMockUISourceCodeToWorkspace("compiled.js", WebInspector.resourceTypes.Script, ""); + InspectorTest.addMockUISourceCodeToWorkspace("compiled.js", Common.resourceTypes.Script, ""); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(firstUISourceCodeAdded); } @@ -445,7 +445,7 @@ "sources":["example.js"], "sourceRoot":"/" }; - var mapping = new WebInspector.TextSourceMap("compiled.js", "source-map.json", mappingPayload); + var mapping = new SDK.TextSourceMap("compiled.js", "source-map.json", mappingPayload); checkMapping(0, 9, "/example.js", 0, 9, mapping); checkReverseMapping(0, 0, "/example.js", 0, mapping); next(); @@ -458,7 +458,7 @@ "sources":["example.js"], "sourcesContent":["var i = 0;"] }; - var mapping = new WebInspector.TextSourceMap("example.js", "source-map.json",mappingPayload); + var mapping = new SDK.TextSourceMap("example.js", "source-map.json",mappingPayload); checkMapping(0, 9, "example.js", 0, 9, mapping); checkReverseMapping(0, 0, "example.js", 0, mapping); next(); @@ -500,7 +500,7 @@ "mappings": ";AAAA;;AAGA,kBAAA,dAAMA;AAAN,AACE,IAAAC,uBAAA;AAAA,AAAA", "names": ["name1", "generated31465"] }; - var mapping = new WebInspector.TextSourceMap("chrome_issue_611738.js", "chrome_issue_611738.js.map", mappingPayload); + var mapping = new SDK.TextSourceMap("chrome_issue_611738.js", "chrome_issue_611738.js.map", mappingPayload); mapping.mappings().forEach(function(entry) { const name = entry.name ? "'" + entry.name + "'" : "[no name assigned]"; InspectorTest.addResult(entry.lineNumber + ":" + entry.columnNumber + " > " + name);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-cd-completions.html b/third_party/WebKit/LayoutTests/http/tests/inspector/console-cd-completions.html index c61a971..caf9c44 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-cd-completions.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-cd-completions.html
@@ -92,7 +92,7 @@ { InspectorTest.changeExecutionContext("myIFrame"); - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "myGlob").then(checkCompletions.bind(this)); + Components.JavaScriptAutocomplete.completionsForExpression("", "myGlob").then(checkCompletions.bind(this)); function checkCompletions(completions) { InspectorTest.addResult("myGlob completions:") @@ -103,7 +103,7 @@ function requestIFrameCompletions() { InspectorTest.changeExecutionContext("top"); - WebInspector.JavaScriptAutocomplete.completionsForExpression("myIFrame.", "").then(checkIframeCompletions.bind(this)); + Components.JavaScriptAutocomplete.completionsForExpression("myIFrame.", "").then(checkIframeCompletions.bind(this)); } function checkIframeCompletions(completions) @@ -117,7 +117,7 @@ function requestProxyCompletions() { InspectorTest.changeExecutionContext("top"); - WebInspector.JavaScriptAutocomplete.completionsForExpression("window.proxy2.", "").then(checkProxyCompletions.bind(this)); + Components.JavaScriptAutocomplete.completionsForExpression("window.proxy2.", "").then(checkProxyCompletions.bind(this)); } function checkProxyCompletions(completions) @@ -137,7 +137,7 @@ function requestMyClassWithMixinCompletions() { InspectorTest.changeExecutionContext("top"); - WebInspector.JavaScriptAutocomplete.completionsForExpression("window.x.", "").then(checkMyClassWithMixinCompletions.bind(this)); + Components.JavaScriptAutocomplete.completionsForExpression("window.x.", "").then(checkMyClassWithMixinCompletions.bind(this)); } function checkMyClassWithMixinCompletions(completions) @@ -151,7 +151,7 @@ function requestObjectCompletions() { InspectorTest.changeExecutionContext("top"); - WebInspector.JavaScriptAutocomplete.completionsForExpression("Object.", "").then(checkObjectCompletions.bind(this)); + Components.JavaScriptAutocomplete.completionsForExpression("Object.", "").then(checkObjectCompletions.bind(this)); } function checkObjectCompletions(completions)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html index fbb08c2..5765551 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-show-all-messages.html
@@ -7,12 +7,12 @@ function test() { - var checkbox = WebInspector.ConsoleView.instance()._showAllMessagesCheckbox.inputElement; + var checkbox = Console.ConsoleView.instance()._showAllMessagesCheckbox.inputElement; //we can't use usual InspectorTest.dumpConsoleMessages(), because it dumps url of message and it flakes in case of iframe function dumpVisibleConsoleMessageText() { - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) { InspectorTest.addResult(messageViews[i].consoleMessage().messageText); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js index e6d36ad..5112766 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js
@@ -8,7 +8,7 @@ var executionContexts = InspectorTest.mainTarget.runtimeModel.executionContexts(); for (var context of executionContexts) { if (context.isDefault) { - WebInspector.context.setFlavor(WebInspector.ExecutionContext, context); + UI.context.setFlavor(SDK.ExecutionContext, context); return; } } @@ -20,7 +20,7 @@ InspectorTest.selectMainExecutionContext(); callback = InspectorTest.safeWrap(callback); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); consoleView._prompt._appendCommand(code, true); InspectorTest.addConsoleViewSniffer(function(commandResult) { callback(commandResult.toMessageElement().deepTextContent()); @@ -33,7 +33,7 @@ override(viewMessage); }; - InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_consoleMessageAddedForTest", sniffer, opt_sticky); + InspectorTest.addSniffer(Console.ConsoleView.prototype, "_consoleMessageAddedForTest", sniffer, opt_sticky); } InspectorTest.evaluateInConsoleAndDump = function(code, callback, dontForceMainContext) @@ -73,7 +73,7 @@ InspectorTest.fixConsoleViewportDimensions = function(width, height) { - var viewport = WebInspector.ConsoleView.instance()._viewport; + var viewport = Console.ConsoleView.instance()._viewport; viewport.element.style.width = width + "px"; viewport.element.style.height = height + "px"; viewport.element.style.position = "absolute"; @@ -82,7 +82,7 @@ InspectorTest.consoleMessagesCount = function() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); return consoleView._consoleMessages.length; } @@ -96,7 +96,7 @@ formatter = formatter || InspectorTest.prepareConsoleMessageText; var result = []; InspectorTest.disableConsoleViewport(); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); if (consoleView._needsFullUpdate) consoleView._updateMessageList(); var viewMessages = consoleView._visibleViewMessages; @@ -160,7 +160,7 @@ InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate, results) { if (forceInvalidate) - WebInspector.ConsoleView.instance()._viewport.invalidate(); + Console.ConsoleView.instance()._viewport.invalidate(); var table = viewMessage.element(); var headers = table.querySelectorAll("th > div:first-child"); if (!headers.length) @@ -199,7 +199,7 @@ InspectorTest.dumpConsoleMessagesWithStyles = function(sortMessages) { var result = []; - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) { var element = messageViews[i].element(); var messageText = InspectorTest.prepareConsoleMessageText(element); @@ -212,7 +212,7 @@ InspectorTest.dumpConsoleMessagesWithClasses = function(sortMessages) { var result = []; - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) { var element = messageViews[i].element(); var contentElement = messageViews[i].contentElement(); @@ -227,14 +227,14 @@ InspectorTest.dumpConsoleClassesBrief = function() { - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) InspectorTest.addResult(messageViews[i].toMessageElement().className); } InspectorTest.dumpConsoleCounters = function() { - var counter = WebInspector.Main.WarningErrorCounter._instanceForTest; + var counter = Main.Main.WarningErrorCounter._instanceForTest; for (var index = 0; index < counter._titles.length; ++index) InspectorTest.addResult(counter._titles[index]); InspectorTest.dumpConsoleClassesBrief(); @@ -242,8 +242,8 @@ InspectorTest.expandConsoleMessages = function(callback, deepFilter, sectionFilter) { - WebInspector.ConsoleView.instance()._viewportThrottler.flush(); - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + Console.ConsoleView.instance()._viewportThrottler.flush(); + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; // Initiate round-trips to fetch necessary data for further rendering. for (var i = 0; i < messageViews.length; ++i) @@ -283,10 +283,10 @@ InspectorTest.expandGettersInConsoleMessages = function(callback) { - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; var properties = []; var propertiesCount = 0; - InspectorTest.addSniffer(WebInspector.ObjectPropertyTreeElement.prototype, "_updateExpandable", propertyExpandableUpdated); + InspectorTest.addSniffer(Components.ObjectPropertyTreeElement.prototype, "_updateExpandable", propertyExpandableUpdated); for (var i = 0; i < messageViews.length; ++i) { var element = messageViews[i].element(); for (var node = element; node; node = node.traverseNextNode(element)) { @@ -306,14 +306,14 @@ properties[i].click(); InspectorTest.deprecatedRunAfterPendingDispatches(callback); } else { - InspectorTest.addSniffer(WebInspector.ObjectPropertyTreeElement.prototype, "_updateExpandable", propertyExpandableUpdated); + InspectorTest.addSniffer(Components.ObjectPropertyTreeElement.prototype, "_updateExpandable", propertyExpandableUpdated); } } } InspectorTest.expandConsoleMessagesErrorParameters = function(callback) { - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; // Initiate round-trips to fetch necessary data for further rendering. for (var i = 0; i < messageViews.length; ++i) messageViews[i].element(); @@ -322,7 +322,7 @@ InspectorTest.waitForRemoteObjectsConsoleMessages = function(callback) { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; ++i) messages[i].toMessageElement(); InspectorTest.deprecatedRunAfterPendingDispatches(callback); @@ -330,11 +330,11 @@ InspectorTest.checkConsoleMessagesDontHaveParameters = function() { - var messageViews = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messageViews = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) { var m = messageViews[i].consoleMessage(); InspectorTest.addResult("Message[" + i + "]:"); - InspectorTest.addResult("Message: " + WebInspector.displayNameForURL(m.url) + ":" + m.line + " " + m.message); + InspectorTest.addResult("Message: " + Bindings.displayNameForURL(m.url) + ":" + m.line + " " + m.message); if ("_parameters" in m) { if (m._parameters) InspectorTest.addResult("FAILED: message parameters list is not empty: " + m.parameters); @@ -350,11 +350,11 @@ { var fulfill; var promise = new Promise(x => fulfill = x); - var editor = WebInspector.ConsoleView.instance()._prompt._editor; + var editor = Console.ConsoleView.instance()._prompt._editor; if (editor) fulfill(editor); else - InspectorTest.addSniffer(WebInspector.ConsolePrompt.prototype, "_editorSetForTest", _ => fulfill(editor)) + InspectorTest.addSniffer(Console.ConsolePrompt.prototype, "_editorSetForTest", _ => fulfill(editor)) return promise; } @@ -393,7 +393,7 @@ InspectorTest.changeExecutionContext = function(namePrefix) { - var selector = WebInspector.ConsoleView.instance()._consoleContextSelector._selectElement; + var selector = Console.ConsoleView.instance()._consoleContextSelector._selectElement; var option = selector.firstChild; while (option) { if (option.textContent && option.textContent.startsWith(namePrefix)) @@ -405,12 +405,12 @@ return; } option.selected = true; - WebInspector.ConsoleView.instance()._consoleContextSelector._executionContextChanged(); + Console.ConsoleView.instance()._consoleContextSelector._executionContextChanged(); } InspectorTest.waitForConsoleMessages = function(expectedCount, callback) { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); checkAndReturn(); function checkAndReturn()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-in-errors-with-trace.html b/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-in-errors-with-trace.html index f80e019..6c521d9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-in-errors-with-trace.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-in-errors-with-trace.html
@@ -8,20 +8,20 @@ function test() { InspectorTest.evaluateInPage("foo()", step1); - WebInspector.inspectorView._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, panelChanged); + UI.inspectorView._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, panelChanged); function panelChanged() { - InspectorTest.addResult("Panel " + WebInspector.inspectorView._tabbedPane._currentTab.id + " was opened."); + InspectorTest.addResult("Panel " + UI.inspectorView._tabbedPane._currentTab.id + " was opened."); InspectorTest.completeTest(); } var clickTarget; function step1() { - var firstMessageEl = WebInspector.ConsoleView.instance()._visibleViewMessages[0].element(); + var firstMessageEl = Console.ConsoleView.instance()._visibleViewMessages[0].element(); clickTarget = firstMessageEl.querySelectorAll(".console-message-text a")[1]; - WebInspector.inspectorView.showPanel("console").then(testClickTarget); + UI.inspectorView.showPanel("console").then(testClickTarget); } function testClickTarget()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-on-messages-before-inspection.html b/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-on-messages-before-inspection.html index 98aba50..9943e28 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-on-messages-before-inspection.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console/console-links-on-messages-before-inspection.html
@@ -13,11 +13,11 @@ function test() { - var mainTarget = WebInspector.targetManager.mainTarget(); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(mainTarget); - var message = new WebInspector.ConsoleMessage(mainTarget, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Log, "hello?", null, " http://127.0.0.1:8000/inspector/resources/source2.js"); + var mainTarget = SDK.targetManager.mainTarget(); + var debuggerModel = SDK.DebuggerModel.fromTarget(mainTarget); + var message = new SDK.ConsoleMessage(mainTarget, SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Log, "hello?", null, " http://127.0.0.1:8000/inspector/resources/source2.js"); mainTarget.consoleModel.addMessage(message); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, onScriptAdded); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, onScriptAdded); InspectorTest.dumpConsoleMessages(); InspectorTest.evaluateInPage("loadScript()"); @@ -28,7 +28,7 @@ return; InspectorTest.addResult("script was added"); - var message = WebInspector.ConsoleView.instance()._visibleViewMessages[0]; + var message = Console.ConsoleView.instance()._visibleViewMessages[0]; var anchorElement = message.element().querySelector(".console-message-url"); anchorElement.click(); } @@ -39,11 +39,11 @@ InspectorTest.completeTest(); }; - WebInspector.inspectorView._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, panelChanged); + UI.inspectorView._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, panelChanged); function panelChanged() { - InspectorTest.addResult("Panel " + WebInspector.inspectorView._tabbedPane._currentTab.id + " was opened"); + InspectorTest.addResult("Panel " + UI.inspectorView._tabbedPane._currentTab.id + " was opened"); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js index 3bca4378..405a79ff 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger-test.js
@@ -12,10 +12,10 @@ console.assert(InspectorTest.debuggerModel.debuggerEnabled(), "Debugger has to be enabled"); if (quiet !== undefined) InspectorTest._quiet = quiet; - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); - InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_pausedScript", InspectorTest._pausedScript, true); - InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_resumedScript", InspectorTest._resumedScript, true); + InspectorTest.addSniffer(SDK.DebuggerModel.prototype, "_pausedScript", InspectorTest._pausedScript, true); + InspectorTest.addSniffer(SDK.DebuggerModel.prototype, "_resumedScript", InspectorTest._resumedScript, true); InspectorTest.safeWrap(callback)(); }; @@ -29,7 +29,7 @@ InspectorTest.completeDebuggerTest = function() { - WebInspector.breakpointManager.setBreakpointsActive(true); + Bindings.breakpointManager.setBreakpointsActive(true); InspectorTest.resumeExecution(InspectorTest.completeTest.bind(InspectorTest)); }; @@ -166,15 +166,15 @@ InspectorTest.resumeExecution = function(callback) { - if (WebInspector.panels.sources.paused()) - WebInspector.panels.sources._togglePause(); + if (UI.panels.sources.paused()) + UI.panels.sources._togglePause(); InspectorTest.waitUntilResumed(callback); }; InspectorTest.waitUntilPausedAndDumpStackAndResume = function(callback, options) { InspectorTest.waitUntilPaused(paused); - InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "_updateDebuggerButtonsAndStatus", setStatus); + InspectorTest.addSniffer(Sources.SourcesPanel.prototype, "_updateDebuggerButtonsAndStatus", setStatus); var caption; var callFrames; @@ -211,22 +211,22 @@ InspectorTest.stepOver = function() { - Promise.resolve().then(function(){WebInspector.panels.sources._stepOver()}); + Promise.resolve().then(function(){UI.panels.sources._stepOver()}); }; InspectorTest.stepInto = function() { - Promise.resolve().then(function(){WebInspector.panels.sources._stepInto()}); + Promise.resolve().then(function(){UI.panels.sources._stepInto()}); }; InspectorTest.stepOut = function() { - Promise.resolve().then(function(){WebInspector.panels.sources._stepOut()}); + Promise.resolve().then(function(){UI.panels.sources._stepOut()}); }; InspectorTest.togglePause = function() { - Promise.resolve().then(function(){WebInspector.panels.sources._togglePause()}); + Promise.resolve().then(function(){UI.panels.sources._togglePause()}); }; InspectorTest.waitUntilPausedAndPerformSteppingActions = function(actions, callback) @@ -290,17 +290,17 @@ var frame = callFrames[i]; var location = locationFunction.call(frame); var script = location.script(); - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location); - var isFramework = WebInspector.blackboxManager.isBlackboxedRawLocation(location); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location); + var isFramework = Bindings.blackboxManager.isBlackboxedRawLocation(location); if (options.dropFrameworkCallFrames && isFramework) continue; var url; var lineNumber; - if (uiLocation && uiLocation.uiSourceCode.project().type() !== WebInspector.projectTypes.Debugger) { + if (uiLocation && uiLocation.uiSourceCode.project().type() !== Workspace.projectTypes.Debugger) { url = uiLocation.uiSourceCode.name(); lineNumber = uiLocation.lineNumber + 1; } else { - url = WebInspector.displayNameForURL(script.sourceURL); + url = Bindings.displayNameForURL(script.sourceURL); lineNumber = location.lineNumber + 1; } var s = (isFramework ? " * " : " ") + (printed++) + ") " + frame.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) + ")"; @@ -319,14 +319,14 @@ function runtimeCallFramePosition() { - return new WebInspector.DebuggerModel.Location(debuggerModel, this.scriptId, this.lineNumber, this.columnNumber); + return new SDK.DebuggerModel.Location(debuggerModel, this.scriptId, this.lineNumber, this.columnNumber); } results.push("Call stack:"); - printCallFrames(callFrames, WebInspector.DebuggerModel.CallFrame.prototype.location, WebInspector.DebuggerModel.CallFrame.prototype.returnValue); + printCallFrames(callFrames, SDK.DebuggerModel.CallFrame.prototype.location, SDK.DebuggerModel.CallFrame.prototype.returnValue); while (asyncStackTrace) { results.push(" [" + (asyncStackTrace.description || "Async Call") + "]"); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget()); + var debuggerModel = SDK.DebuggerModel.fromTarget(SDK.targetManager.mainTarget()); var printed = printCallFrames(asyncStackTrace.callFrames, runtimeCallFramePosition); if (!printed) results.pop(); @@ -348,8 +348,8 @@ { if (!InspectorTest._quiet) InspectorTest.addResult("Script execution paused."); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(this.target()); - InspectorTest._pausedScriptArguments = [WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel, callFrames), reason, breakpointIds, asyncStackTrace, auxData]; + var debuggerModel = SDK.DebuggerModel.fromTarget(this.target()); + InspectorTest._pausedScriptArguments = [SDK.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel, callFrames), reason, breakpointIds, asyncStackTrace, auxData]; if (InspectorTest._waitUntilPausedCallback) { var callback = InspectorTest._waitUntilPausedCallback; delete InspectorTest._waitUntilPausedCallback; @@ -371,7 +371,7 @@ InspectorTest.showUISourceCode = function(uiSourceCode, callback) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; panel.showUISourceCode(uiSourceCode); var sourceFrame = panel.visibleView; if (sourceFrame.loaded) @@ -400,10 +400,10 @@ InspectorTest.waitForScriptSource = function(scriptName, callback) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var uiSourceCodes = panel._workspace.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { - if (uiSourceCodes[i].project().type() === WebInspector.projectTypes.Service) + if (uiSourceCodes[i].project().type() === Workspace.projectTypes.Service) continue; if (uiSourceCodes[i].name() === scriptName) { callback(uiSourceCodes[i]); @@ -411,7 +411,7 @@ } } - InspectorTest.addSniffer(WebInspector.SourcesView.prototype, "_addUISourceCode", InspectorTest.waitForScriptSource.bind(InspectorTest, scriptName, callback)); + InspectorTest.addSniffer(Sources.SourcesView.prototype, "_addUISourceCode", InspectorTest.waitForScriptSource.bind(InspectorTest, scriptName, callback)); }; InspectorTest.setBreakpoint = function(sourceFrame, lineNumber, condition, enabled) @@ -427,7 +427,7 @@ InspectorTest.dumpBreakpointSidebarPane = function(title) { - var paneElement = self.runtime.sharedInstance(WebInspector.JavaScriptBreakpointsSidebarPane).element; + var paneElement = self.runtime.sharedInstance(Sources.JavaScriptBreakpointsSidebarPane).element; InspectorTest.addResult("Breakpoint sidebar pane " + (title || "")); InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElement)); }; @@ -448,7 +448,7 @@ InspectorTest.scopeChainSections = function() { - var children = self.runtime.sharedInstance(WebInspector.ScopeChainSidebarPane).contentElement.children; + var children = self.runtime.sharedInstance(Sources.ScopeChainSidebarPane).contentElement.children; var sections = []; for (var i = 0; i < children.length; ++i) sections.push(children[i]._section); @@ -528,17 +528,17 @@ InspectorTest.createScriptMock = function(url, startLine, startColumn, isContentScript, source, target, preRegisterCallback) { - target = target || WebInspector.targetManager.mainTarget(); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + target = target || SDK.targetManager.mainTarget(); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); var scriptId = ++InspectorTest._lastScriptId + ""; var lineCount = source.computeLineEndings().length; var endLine = startLine + lineCount - 1; var endColumn = lineCount === 1 ? startColumn + source.length : source.length - source.computeLineEndings()[lineCount - 2]; var hasSourceURL = !!source.match(/\/\/#\ssourceURL=\s*(\S*?)\s*$/m) || !!source.match(/\/\/@\ssourceURL=\s*(\S*?)\s*$/m); - var script = new WebInspector.Script(debuggerModel, scriptId, url, startLine, startColumn, endLine, endColumn, 0, "", isContentScript, false, undefined, hasSourceURL); + var script = new SDK.Script(debuggerModel, scriptId, url, startLine, startColumn, endLine, endColumn, 0, "", isContentScript, false, undefined, hasSourceURL); script.requestContent = function() { - var trimmedSource = WebInspector.Script._trimSourceURLComment(source); + var trimmedSource = SDK.Script._trimSourceURLComment(source); return Promise.resolve(trimmedSource); }; if (preRegisterCallback) @@ -566,9 +566,9 @@ InspectorTest.scriptFormatter = function() { - return self.runtime.allInstances(WebInspector.SourcesView.EditorAction).then(function(editorActions) { + return self.runtime.allInstances(Sources.SourcesView.EditorAction).then(function(editorActions) { for (var i = 0; i < editorActions.length; ++i) { - if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAction) + if (editorActions[i] instanceof Sources.ScriptFormatterEditorAction) return editorActions[i]; } return null; @@ -581,18 +581,18 @@ callback(target.runtimeModel.executionContexts()[0]); return; } - target.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.ExecutionContextCreated, contextCreated); + target.runtimeModel.addEventListener(SDK.RuntimeModel.Events.ExecutionContextCreated, contextCreated); function contextCreated() { - target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events.ExecutionContextCreated, contextCreated); + target.runtimeModel.removeEventListener(SDK.RuntimeModel.Events.ExecutionContextCreated, contextCreated); callback(target.runtimeModel.executionContexts()[0]); } } InspectorTest.selectThread = function(target) { - var threadsPane = self.runtime.sharedInstance(WebInspector.ThreadsSidebarPane); + var threadsPane = self.runtime.sharedInstance(Sources.ThreadsSidebarPane); var listItem = threadsPane._listItemForTarget(target); threadsPane._onListItemClick(listItem); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html index a9ce3eb5..9e8d764 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/debugger/fetch-breakpoints.html
@@ -11,7 +11,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane); InspectorTest.runDebuggerTestSuite([ function testFetchBreakpoint(next) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js index 28f561e..baba1f27 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js
@@ -4,12 +4,12 @@ InspectorTest.inlineStyleSection = function() { - return WebInspector.panels.elements._stylesWidget._sectionBlocks[0].sections[0]; + return UI.panels.elements._stylesWidget._sectionBlocks[0].sections[0]; } InspectorTest.computedStyleWidget = function() { - return WebInspector.panels.elements._computedStyleWidget; + return UI.panels.elements._computedStyleWidget; } InspectorTest.dumpComputedStyle = function(doNotAutoExpand) @@ -18,7 +18,7 @@ var treeOutline = computed._propertiesOutline; var children = treeOutline.rootElement().children(); for (var treeElement of children) { - var property = treeElement[WebInspector.ComputedStyleWidget._propertySymbol]; + var property = treeElement[Elements.ComputedStyleWidget._propertySymbol]; if (property.name === "width" || property.name === "height") continue; var dumpText = ""; @@ -50,7 +50,7 @@ var treeOutline = computed._propertiesOutline; var children = treeOutline.rootElement().children(); for (var treeElement of children) { - var property = treeElement[WebInspector.ComputedStyleWidget._propertySymbol]; + var property = treeElement[Elements.ComputedStyleWidget._propertySymbol]; if (property.name === name) return treeElement; } @@ -59,7 +59,7 @@ InspectorTest.firstMatchedStyleSection = function() { - return WebInspector.panels.elements._stylesWidget._sectionBlocks[0].sections[1]; + return UI.panels.elements._stylesWidget._sectionBlocks[0].sections[1]; } InspectorTest.firstMediaTextElementInSection = function(section) @@ -168,7 +168,7 @@ InspectorTest.selectNode = function(node) { - return WebInspector.Revealer.revealPromise(node); + return Common.Revealer.revealPromise(node); } InspectorTest.selectNodeWithId = function(idValue, callback) @@ -189,7 +189,7 @@ callback(); return; } - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_nodeStylesUpdatedForTest", sniff); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_nodeStylesUpdatedForTest", sniff); })(null); } @@ -220,17 +220,17 @@ InspectorTest.waitForSelectorCommitted = function(callback) { - InspectorTest.addSniffer(WebInspector.StylePropertiesSection.prototype, "_editingSelectorCommittedForTest", callback); + InspectorTest.addSniffer(Elements.StylePropertiesSection.prototype, "_editingSelectorCommittedForTest", callback); } InspectorTest.waitForMediaTextCommitted = function(callback) { - InspectorTest.addSniffer(WebInspector.StylePropertiesSection.prototype, "_editingMediaTextCommittedForTest", callback); + InspectorTest.addSniffer(Elements.StylePropertiesSection.prototype, "_editingMediaTextCommittedForTest", callback); } InspectorTest.waitForStyleApplied = function(callback) { - InspectorTest.addSniffer(WebInspector.StylePropertyTreeElement.prototype, "styleTextAppliedForTest", callback); + InspectorTest.addSniffer(Elements.StylePropertyTreeElement.prototype, "styleTextAppliedForTest", callback); } InspectorTest.selectNodeAndWaitForStyles = function(idValue, callback) @@ -265,7 +265,7 @@ function nodeFound(node) { targetNode = node; - WebInspector.Revealer.reveal(node); + Common.Revealer.reveal(node); } function stylesUpdated() @@ -292,19 +292,19 @@ InspectorTest.firstElementsTreeOutline = function() { - return WebInspector.panels.elements._treeOutlines[0]; + return UI.panels.elements._treeOutlines[0]; } InspectorTest.filterMatchedStyles = function(text) { var regex = text ? new RegExp(text, "i") : null; InspectorTest.addResult("Filtering styles by: " + text); - WebInspector.panels.elements._stylesWidget.onFilterChanged(regex); + UI.panels.elements._stylesWidget.onFilterChanged(regex); } InspectorTest.dumpRenderedMatchedStyles = function() { - var sectionBlocks = WebInspector.panels.elements._stylesWidget._sectionBlocks; + var sectionBlocks = UI.panels.elements._stylesWidget._sectionBlocks; for (var block of sectionBlocks) { for (var section of block.sections) { // Skip sections which were filtered out. @@ -352,7 +352,7 @@ InspectorTest.dumpSelectedElementStyles = function(excludeComputed, excludeMatched, omitLonghands, includeSelectorGroupMarks) { - var sectionBlocks = WebInspector.panels.elements._stylesWidget._sectionBlocks; + var sectionBlocks = UI.panels.elements._stylesWidget._sectionBlocks; if (!excludeComputed) InspectorTest.dumpComputedStyle(); for (var block of sectionBlocks) { @@ -402,7 +402,7 @@ if (!anchor) return element.textContent; var anchorText = anchor.textContent; - var uiLocation = anchor[WebInspector.Linkifier._uiLocationSymbol]; + var uiLocation = anchor[Components.Linkifier._uiLocationSymbol]; var anchorTarget = uiLocation ? (uiLocation.uiSourceCode.name() + ":" + (uiLocation.lineNumber + 1) + ":" + (uiLocation.columnNumber + 1)) : ""; return anchorText + " -> " + anchorTarget; } @@ -433,13 +433,13 @@ InspectorTest.eventListenersWidget = function() { - WebInspector.viewManager.showView("elements.eventListeners"); - return self.runtime.sharedInstance(WebInspector.EventListenersWidget); + UI.viewManager.showView("elements.eventListeners"); + return self.runtime.sharedInstance(Elements.EventListenersWidget); } InspectorTest.showEventListenersWidget = function() { - return WebInspector.viewManager.showView("elements.eventListeners"); + return UI.viewManager.showView("elements.eventListeners"); } InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback) @@ -479,7 +479,7 @@ // FIXME: this returns the first tree item found (may fail for same-named properties in a style). InspectorTest.getMatchedStylePropertyTreeItem = function(propertyName) { - var sectionBlocks = WebInspector.panels.elements._stylesWidget._sectionBlocks; + var sectionBlocks = UI.panels.elements._stylesWidget._sectionBlocks; for (var block of sectionBlocks) { for (var section of block.sections) { var treeItem = InspectorTest.getFirstPropertyTreeItemForSection(section, propertyName); @@ -623,7 +623,7 @@ { var hasHighlights = false; - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", didUpdate); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", didUpdate); function didUpdate() { @@ -638,7 +638,7 @@ function print(treeItem, prefix, depth) { if (!treeItem.root) { - var elementXPath = WebInspector.DOMPresentationUtils.xPath(treeItem.node(), true); + var elementXPath = Components.DOMPresentationUtils.xPath(treeItem.node(), true); var highlightedElements = treeItem.listItemElement.querySelectorAll(".dom-update-highlight"); for (var i = 0; i < highlightedElements.length; ++i) { var element = highlightedElements[i]; @@ -906,7 +906,7 @@ if (message) InspectorTest.addResult(message + ":"); var result = []; - var crumbs = WebInspector.panels.elements._breadcrumbs.crumbsElement; + var crumbs = UI.panels.elements._breadcrumbs.crumbsElement; var crumb = crumbs.lastChild; while (crumb) { result.unshift(crumb.textContent); @@ -926,15 +926,15 @@ InspectorTest.addNewRuleInStyleSheet = function(styleSheetHeader, selector, callback) { - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback)); - WebInspector.panels.elements._stylesWidget._createNewRuleInStyleSheet(styleSheetHeader); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback)); + UI.panels.elements._stylesWidget._createNewRuleInStyleSheet(styleSheetHeader); } InspectorTest.addNewRule = function(selector, callback) { // Click "Add new rule". document.querySelector(".styles-pane-toolbar").shadowRoot.querySelector(".largeicon-add").click(); - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback)); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback)); } function onBlankSection(selector, callback) @@ -964,7 +964,7 @@ InspectorTest.waitForAnimationAdded = function(callback) { - InspectorTest.addSniffer(WebInspector.AnimationTimeline.prototype, "_addAnimationGroup", callback); + InspectorTest.addSniffer(Animation.AnimationTimeline.prototype, "_addAnimationGroup", callback); } InspectorTest.dumpAnimationTimeline = function(timeline)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/event-listeners-framework-with-service-worker.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/event-listeners-framework-with-service-worker.html index 6a2d349..6fc7701 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/event-listeners-framework-with-service-worker.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/event-listeners-framework-with-service-worker.html
@@ -7,18 +7,18 @@ <script> function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(false); + Common.settingForTest("showEventListenersForAncestors").set(false); var scriptURL = "http://127.0.0.1:8000/inspector/service-workers/resources/service-worker-empty.js"; var scope = "http://127.0.0.1:8000/inspector/service-workers/resources/scope1/"; InspectorTest.waitForServiceWorker(step1); InspectorTest.registerServiceWorker(scriptURL, scope); - var objectEventListenersPane = self.runtime.sharedInstance(WebInspector.ObjectEventListenersSidebarPane); + var objectEventListenersPane = self.runtime.sharedInstance(Sources.ObjectEventListenersSidebarPane); function isDedicatedWorker() { - var target = WebInspector.context.flavor(WebInspector.ExecutionContext).target(); + var target = UI.context.flavor(SDK.ExecutionContext).target(); return InspectorTest.isDedicatedWorker(target); } @@ -33,7 +33,7 @@ InspectorTest.selectThread(executionContext.target()); InspectorTest.addResult("Context is dedicated worker: " + isDedicatedWorker()); InspectorTest.addResult("Dumping listeners"); - WebInspector.viewManager.showView("sources.globalListeners").then(() => { + UI.viewManager.showView("sources.globalListeners").then(() => { objectEventListenersPane.update(); InspectorTest.expandAndDumpEventListeners(objectEventListenersPane._eventListenersView, step3); }); @@ -42,7 +42,7 @@ function step3() { InspectorTest.addResult("Selecting main thread"); - InspectorTest.selectThread(WebInspector.targetManager.mainTarget()); + InspectorTest.selectThread(SDK.targetManager.mainTarget()); InspectorTest.addResult("Context is dedicated worker: " + isDedicatedWorker()); InspectorTest.addResult("Dumping listeners"); InspectorTest.expandAndDumpEventListeners(objectEventListenersPane._eventListenersView, step4);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html index 145442f9..0316f04 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html
@@ -41,8 +41,8 @@ function fileSystemCreated() { - var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystemPath); - uiSourceCode = WebInspector.workspace.uiSourceCode(fileSystemProjectId, "file:///var/www/foo.css"); + var fileSystemProjectId = Bindings.FileSystemWorkspaceBinding.projectId(fileSystemPath); + uiSourceCode = Workspace.workspace.uiSourceCode(fileSystemProjectId, "file:///var/www/foo.css"); InspectorTest.showUISourceCode(uiSourceCode, didShowScriptSource); } @@ -50,7 +50,7 @@ { dumpUISourceCodeContents(); InspectorTest.addResult("Loading stylesheet with sourceURL:"); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, stylesheetLoaded); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, stylesheetLoaded); InspectorTest.evaluateInPage("loadStylesheet()"); } @@ -58,7 +58,7 @@ { if (!event.data.sourceURL.includes("foo.css")) return; - InspectorTest.cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, stylesheetLoaded); + InspectorTest.cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, stylesheetLoaded); InspectorTest.addResult("Stylesheet loaded."); InspectorTest.selectNodeAndWaitForStyles("inspected", nodeSelected); } @@ -77,7 +77,7 @@ treeElement.valueElement.textContent = "green"; treeElement.valueElement.firstChild.select(); treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); - uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, stylesEdited, this); + uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted, stylesEdited, this); } function stylesEdited()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-deprecated.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-deprecated.html index c4b68f1..0dc9983 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-deprecated.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-deprecated.html
@@ -21,7 +21,7 @@ function test() { InspectorTest.evaluateInPage("addStylesheet()"); - InspectorTest.addSniffer(WebInspector.CSSWorkspaceBinding.prototype, "updateLocations", sourceMappingSniffer, true); + InspectorTest.addSniffer(Bindings.CSSWorkspaceBinding.prototype, "updateLocations", sourceMappingSniffer, true); function sourceMappingSniffer(header) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-sourcemap-header-deprecated.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-sourcemap-header-deprecated.html index 23036d2..034c2f6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-sourcemap-header-deprecated.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/selector-line-sourcemap-header-deprecated.html
@@ -14,8 +14,8 @@ function test() { - WebInspector.settingForTest("cssSourceMapsEnabled").set(true); - InspectorTest.addSniffer(WebInspector.CSSWorkspaceBinding.prototype, "updateLocations", step1); + Common.settingForTest("cssSourceMapsEnabled").set(true); + InspectorTest.addSniffer(Bindings.CSSWorkspaceBinding.prototype, "updateLocations", step1); InspectorTest.evaluateInPage("addStylesheet()"); function step1()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/stylesheet-tracking.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/stylesheet-tracking.html index 52ae18c..87a38a2 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/stylesheet-tracking.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/stylesheet-tracking.html
@@ -69,8 +69,8 @@ { var inspectedNode; - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetAdded, null); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, styleSheetRemoved, null); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, styleSheetAdded, null); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, styleSheetRemoved, null); var headers = InspectorTest.cssModel.styleSheetHeaders(); InspectorTest.addResult(headers.length + " headers known:"); sortAndDumpData(headers);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html index d654b4fa..a7a1fbc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html
@@ -18,13 +18,13 @@ InspectorTest.addResult("Creating filesystem with the SCSS file..."); var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.addFile("update-locations-on-filesystem-scss-load.scss", ["a {", " foo: bar;", "/* COMMENT */", " font-size: 12px;", "}"].join("\n")); - fs.addFileMapping(WebInspector.ParsedURL.completeURL(InspectorTest.mainTarget.inspectedURL(), "resources/source/"), "/"); + fs.addFileMapping(Common.ParsedURL.completeURL(InspectorTest.mainTarget.inspectedURL(), "resources/source/"), "/"); fs.reportCreated(fileSystemCreated); function fileSystemCreated() { InspectorTest.addResult("Loading raw css with mapping..."); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetAdded); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, styleSheetAdded); InspectorTest.evaluateInPage("loadCSS()"); } @@ -34,9 +34,9 @@ { InspectorTest.addResult("Stylesheet was added, dumping location:"); var header = event.data; - var cssLocation = new WebInspector.CSSLocation(header, 0, 1); - liveLocation = WebInspector.cssWorkspaceBinding.createLiveLocation(cssLocation, function() {}, new WebInspector.LiveLocationPool()); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapAttached, afterBind); + var cssLocation = new SDK.CSSLocation(header, 0, 1); + liveLocation = Bindings.cssWorkspaceBinding.createLiveLocation(cssLocation, function() {}, new Bindings.LiveLocationPool()); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, afterBind); dumpLiveLocation(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/extensions-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/extensions-test.js index fe3aa776..6b31771 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/extensions-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/extensions-test.js
@@ -11,9 +11,9 @@ var initialize_ExtensionsTest = function() { -WebInspector.extensionServer._registerHandler("evaluateForTestInFrontEnd", onEvaluate); +Extensions.extensionServer._registerHandler("evaluateForTestInFrontEnd", onEvaluate); -WebInspector.extensionServer._extensionAPITestHook = function(extensionServerClient, coreAPI) +Extensions.extensionServer._extensionAPITestHook = function(extensionServerClient, coreAPI) { window.webInspector = coreAPI; window._extensionServerForTests = extensionServerClient; @@ -22,14 +22,14 @@ InspectorTest._replyToExtension = function(requestId, port) { - WebInspector.extensionServer._dispatchCallback(requestId, port); + Extensions.extensionServer._dispatchCallback(requestId, port); } function onEvaluate(message, port) { function reply(param) { - WebInspector.extensionServer._dispatchCallback(message.requestId, port, param); + Extensions.extensionServer._dispatchCallback(message.requestId, port, param); } try { @@ -43,8 +43,8 @@ InspectorTest.showPanel = function(panelId) { if (panelId === "extension") - panelId = WebInspector.inspectorView._tabbedPane._tabs[WebInspector.inspectorView._tabbedPane._tabs.length - 1].id; - return WebInspector.inspectorView.showPanel(panelId); + panelId = UI.inspectorView._tabbedPane._tabs[UI.inspectorView._tabbedPane._tabs.length - 1].id; + return UI.inspectorView.showPanel(panelId); } InspectorTest.runExtensionTests = function() @@ -58,7 +58,7 @@ pageURL.replace(/\/inspector\/extensions\/[^/]*$/, "/http/tests")) + "/inspector/resources/extension-main.html"; InspectorFrontendAPI.addExtensions([{ startPage: extensionURL, name: "test extension", exposeWebInspectorNamespace: true }]); - WebInspector.extensionServer.initializeExtensions(); + Extensions.extensionServer.initializeExtensions(); }); } @@ -71,6 +71,6 @@ var test = function() { - WebInspector.moduleSetting("shortcutPanelSwitch").set(true); + Common.moduleSetting("shortcutPanelSwitch").set(true); InspectorTest.runExtensionTests(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-data.html b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-data.html index eb5fa82..09aa702b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-data.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-data.html
@@ -11,7 +11,7 @@ var databaseName = "testDatabase"; var objectStoreName = "testObjectStore"; var indexName = "testIndexName"; - var databaseId = new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseName); + var databaseId = new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseName); function addIDBValues(count, callback) { @@ -71,7 +71,7 @@ } } - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", fillDatabase, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", fillDatabase, false); function fillDatabase() { @@ -95,19 +95,19 @@ function refreshDatabaseNames() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", refreshDatabase, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", refreshDatabase, false); indexedDBModel.refreshDatabaseNames(); } function refreshDatabase() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, runObjectStoreTests); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, runObjectStoreTests); indexedDBModel.refreshDatabase(databaseId); } function runObjectStoreTests() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, runObjectStoreTests); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, runObjectStoreTests); loadValuesAndDump(false, null, 0, 2, step2) function step2() @@ -187,11 +187,11 @@ InspectorTest.addResult("Cleared data from objectStore"); function step1() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step2); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step2); indexedDBModel.refreshDatabase(databaseId); } function step2() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step2); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step2); loadValuesAndDump(false, null, 0, 10, step3); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-names.html b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-names.html index 94b1e59..3dc2327 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-names.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-names.html
@@ -19,7 +19,7 @@ InspectorTest.addResult(""); } - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); function step2() { @@ -29,7 +29,7 @@ function step3() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step4, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step4, false); indexedDBModel.refreshDatabaseNames(); } @@ -41,7 +41,7 @@ function step5() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step6, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step6, false); indexedDBModel.refreshDatabaseNames(); } @@ -53,7 +53,7 @@ function step7() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step8, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step8, false); indexedDBModel.refreshDatabaseNames(); } @@ -65,7 +65,7 @@ function step9() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step10, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step10, false); indexedDBModel.refreshDatabaseNames(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-structure.html b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-structure.html index 3afb7594..028ca8f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-structure.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/database-structure.html
@@ -9,7 +9,7 @@ var mainFrameId = InspectorTest.resourceTreeModel.mainFrame.id; var databaseName = "testDatabase1"; var securityOrigin = "http://127.0.0.1:8000"; - var databaseId = new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseName); + var databaseId = new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseName); function dumpDatabase() { @@ -45,7 +45,7 @@ InspectorTest.addResult(""); } - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); function step2() { @@ -54,7 +54,7 @@ function step3() { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step4, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step4, false); indexedDBModel.refreshDatabaseNames(); } @@ -62,13 +62,13 @@ { dumpDatabase(); - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step5); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step5); indexedDBModel.refreshDatabase(databaseId); } function step5() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step5); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step5); dumpDatabase(); InspectorTest.createObjectStore(mainFrameId, databaseName, "testObjectStore1", "test.key.path", true, step6); @@ -76,13 +76,13 @@ function step6() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step7); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step7); indexedDBModel.refreshDatabase(databaseId); } function step7() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step7); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step7); dumpDatabase(); InspectorTest.createObjectStore(mainFrameId, databaseName, "testObjectStore2", null, false, step8); @@ -90,13 +90,13 @@ function step8() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step9); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step9); indexedDBModel.refreshDatabase(databaseId); } function step9() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step9); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step9); dumpDatabase(); InspectorTest.createObjectStoreIndex(mainFrameId, databaseName, "testObjectStore2", "testIndexName1", "", false, true, step10); @@ -104,13 +104,13 @@ function step10() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step11); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step11); indexedDBModel.refreshDatabase(databaseId); } function step11() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step11); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step11); dumpDatabase(); InspectorTest.createObjectStoreIndex(mainFrameId, databaseName, "testObjectStore2", "testIndexName2", ["key.path1", "key.path2"], true, false, step12); @@ -118,13 +118,13 @@ function step12() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step13); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step13); indexedDBModel.refreshDatabase(databaseId); } function step13() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step13); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step13); dumpDatabase(); InspectorTest.deleteObjectStoreIndex(mainFrameId, databaseName, "testObjectStore2", "testIndexName2", step14); @@ -132,13 +132,13 @@ function step14() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step15); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step15); indexedDBModel.refreshDatabase(databaseId); } function step15() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step15); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step15); dumpDatabase(); InspectorTest.deleteObjectStoreIndex(mainFrameId, databaseName, "testObjectStore2", "testIndexName1", step16); @@ -146,13 +146,13 @@ function step16() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step17); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step17); indexedDBModel.refreshDatabase(databaseId); } function step17() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step17); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step17); dumpDatabase(); InspectorTest.deleteObjectStore(mainFrameId, databaseName, "testObjectStore2", step18); @@ -160,13 +160,13 @@ function step18() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step19); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step19); indexedDBModel.refreshDatabase(databaseId); } function step19() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step19); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step19); dumpDatabase(); InspectorTest.deleteObjectStore(mainFrameId, databaseName, "testObjectStore1", step20); @@ -174,13 +174,13 @@ function step20() { - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step21); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step21); indexedDBModel.refreshDatabase(databaseId); } function step21() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, step21); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, step21); dumpDatabase(); InspectorTest.deleteDatabase(mainFrameId, databaseName, step22); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js index 19f74ec..9a85f61 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js
@@ -4,7 +4,7 @@ InspectorTest.dumpIndexedDBTree = function() { InspectorTest.addResult("Dumping IndexedDB tree:"); - var indexedDBTreeElement = WebInspector.panels.resources.indexedDBListTreeElement; + var indexedDBTreeElement = UI.panels.resources.indexedDBListTreeElement; if (!indexedDBTreeElement.childCount()) { InspectorTest.addResult(" (empty)"); return; @@ -101,7 +101,7 @@ InspectorTest.createIndexedDBModel = function() { - var indexedDBModel = new WebInspector.IndexedDBModel(WebInspector.targetManager.mainTarget(), InspectorTest.securityOriginManager); + var indexedDBModel = new Resources.IndexedDBModel(SDK.targetManager.mainTarget(), InspectorTest.securityOriginManager); indexedDBModel.enable(); return indexedDBModel; };
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/resources-panel.html b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/resources-panel.html index 0c0f721..4c28029 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/resources-panel.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/resources-panel.html
@@ -46,31 +46,31 @@ } // Start with non-resources panel. - WebInspector.viewManager.showView("console"); + UI.viewManager.showView("console"); - InspectorTest.addSniffer(WebInspector.IndexedDBTreeElement.prototype, "_indexedDBAdded", indexedDBAdded, true); + InspectorTest.addSniffer(Resources.IndexedDBTreeElement.prototype, "_indexedDBAdded", indexedDBAdded, true); function indexedDBAdded() { InspectorTest.addResult("Database added."); } - InspectorTest.addSniffer(WebInspector.IndexedDBTreeElement.prototype, "_indexedDBRemoved", indexedDBRemoved, true); + InspectorTest.addSniffer(Resources.IndexedDBTreeElement.prototype, "_indexedDBRemoved", indexedDBRemoved, true); function indexedDBRemoved() { InspectorTest.addResult("Database removed."); } - InspectorTest.addSniffer(WebInspector.IndexedDBTreeElement.prototype, "_indexedDBLoaded", indexedDBLoaded, true); + InspectorTest.addSniffer(Resources.IndexedDBTreeElement.prototype, "_indexedDBLoaded", indexedDBLoaded, true); function indexedDBLoaded() { InspectorTest.addResult("Database loaded."); } // Switch to resources panel. - WebInspector.viewManager.showView("resources"); + UI.viewManager.showView("resources"); InspectorTest.addResult("Expanded IndexedDB tree element."); - WebInspector.panels.resources.indexedDBListTreeElement.expand(); + UI.panels.resources.indexedDBListTreeElement.expand(); InspectorTest.dumpIndexedDBTree(); InspectorTest.addResult("Created database."); createDatabase(databaseCreated); @@ -78,13 +78,13 @@ function databaseCreated() { indexedDBModel = InspectorTest.indexedDBModel(); - indexedDBModel.addEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, databaseLoaded); - WebInspector.panels.resources.indexedDBListTreeElement.refreshIndexedDB(); + indexedDBModel.addEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, databaseLoaded); + UI.panels.resources.indexedDBListTreeElement.refreshIndexedDB(); } function databaseLoaded() { - indexedDBModel.removeEventListener(WebInspector.IndexedDBModel.Events.DatabaseLoaded, databaseLoaded); + indexedDBModel.removeEventListener(Resources.IndexedDBModel.Events.DatabaseLoaded, databaseLoaded); InspectorTest.dumpIndexedDBTree(); InspectorTest.addResult("Navigated to another security origin."); InspectorTest.navigate(withoutIndexedDBURL, navigatedAway); @@ -106,14 +106,14 @@ function databaseDeleted() { - WebInspector.panels.resources.indexedDBListTreeElement.refreshIndexedDB(); - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", databaseNamesLoadedAfterDeleting, false); + UI.panels.resources.indexedDBListTreeElement.refreshIndexedDB(); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", databaseNamesLoadedAfterDeleting, false); } function databaseNamesLoadedAfterDeleting() { InspectorTest.dumpIndexedDBTree(); - WebInspector.panels.resources.indexedDBListTreeElement.collapse(); + UI.panels.resources.indexedDBListTreeElement.collapse(); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/upgrade-events.html b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/upgrade-events.html index 425f097d..1e266ee 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/upgrade-events.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/indexeddb/upgrade-events.html
@@ -10,7 +10,7 @@ var securityOrigin = "http://127.0.0.1:8000"; var databaseName = "testDatabase - " + self.location; var objectStoreName = "testObjectStore"; - var databaseId = new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseName); + var databaseId = new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseName); function onConsoleError(callback) { var old = console.error; @@ -50,7 +50,7 @@ } } - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", fillDatabase, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", fillDatabase, false); function fillDatabase() { @@ -113,7 +113,7 @@ function checkDatabaseDoesExist(callback) { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); indexedDBModel.refreshDatabaseNames(); function step2() @@ -126,7 +126,7 @@ function checkDatabaseDoesNotExist(callback) { - InspectorTest.addSniffer(WebInspector.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); + InspectorTest.addSniffer(Resources.IndexedDBModel.prototype, "_updateOriginDatabaseNames", step2, false); indexedDBModel.refreshDatabaseNames(); function step2()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspect-element.html b/third_party/WebKit/LayoutTests/http/tests/inspector/inspect-element.html index 22d12bba..bf197625 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspect-element.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspect-element.html
@@ -7,14 +7,14 @@ function test() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged, this); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged, this); function selectedNodeChanged(event) { var node = event.data.node; if (!node) return; if (node.getAttribute("id") == "div") { - InspectorTest.addResult(WebInspector.DOMPresentationUtils.fullQualifiedSelector(node)); + InspectorTest.addResult(Components.DOMPresentationUtils.fullQualifiedSelector(node)); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js index e119673..abeb5df 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -321,7 +321,7 @@ InspectorTest.expandAndDumpEventListeners = function(eventListenersView, callback) { - InspectorTest.addSniffer(WebInspector.EventListenersView.prototype, "_eventListenersArrivedForTest", listenersArrived); + InspectorTest.addSniffer(Components.EventListenersView.prototype, "_eventListenersArrivedForTest", listenersArrived); function listenersArrived() { @@ -365,7 +365,7 @@ titleText = treeElement.title.firstChild.textContent + " [mapped]"; else titleText = treeElement.title; - if (treeElement._nodeType === WebInspector.NavigatorView.Types.FileSystem || treeElement._nodeType === WebInspector.NavigatorView.Types.FileSystemFolder) { + if (treeElement._nodeType === Sources.NavigatorView.Types.FileSystem || treeElement._nodeType === Sources.NavigatorView.Types.FileSystemFolder) { var hasMappedFiles = treeElement.listItemElement.classList.contains("has-mapped-files"); if (!hasMappedFiles) titleText += " [dimmed]"; @@ -392,7 +392,7 @@ InspectorTest.dumpNavigatorViewInMode = function(view, mode) { - InspectorTest.addResult(view instanceof WebInspector.SourcesNavigatorView ? "Sources:" : "Content Scripts:"); + InspectorTest.addResult(view instanceof Sources.SourcesNavigatorView ? "Sources:" : "Content Scripts:"); view._groupByFrame = mode.includes("frame"); view._groupByDomain = mode.includes("domain"); view._groupByFolder = mode.includes("folder"); @@ -427,8 +427,8 @@ { InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); - if (WebInspector.panels.network) - WebInspector.panels.network._networkLogView.reset(); + if (UI.panels.network) + UI.panels.network._networkLogView.reset(); InspectorTest.PageAgent.reload(hardReload, scriptToEvaluateOnLoad, scriptPreprocessor); } @@ -457,7 +457,7 @@ InspectorTest.deprecatedRunAfterPendingDispatches = function(callback) { var barrier = new CallbackBarrier(); - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); for (var i = 0; i < targets.length; ++i) targets[i]._deprecatedRunAfterPendingDispatches(barrier.createCallback()); barrier.callWhenDone(InspectorTest.safeWrap(callback)); @@ -596,7 +596,7 @@ InspectorTest.addConsoleSniffer = function(override, opt_sticky) { - InspectorTest.addSniffer(WebInspector.ConsoleModel.prototype, "addMessage", override, opt_sticky); + InspectorTest.addSniffer(SDK.ConsoleModel.prototype, "addMessage", override, opt_sticky); } InspectorTest.override = function(receiver, methodName, override, opt_sticky) @@ -681,12 +681,12 @@ InspectorTest.hideInspectorView = function() { - WebInspector.inspectorView.element.setAttribute("style", "display:none !important"); + UI.inspectorView.element.setAttribute("style", "display:none !important"); } InspectorTest.mainFrame = function() { - return WebInspector.ResourceTreeModel.fromTarget(InspectorTest.mainTarget).mainFrame; + return SDK.ResourceTreeModel.fromTarget(InspectorTest.mainTarget).mainFrame; } InspectorTest.StringOutputStream = function(callback) @@ -734,7 +734,7 @@ * @constructor * @param {!string} dirPath * @param {!string} name - * @param {!function(?WebInspector.TempFile)} callback + * @param {!function(?Bindings.TempFile)} callback */ InspectorTest.TempFileMock = function(dirPath, name) { @@ -785,8 +785,8 @@ }, /** - * @param {!WebInspector.OutputStream} outputStream - * @param {!WebInspector.OutputStreamDelegate} delegate + * @param {!Common.OutputStream} outputStream + * @param {!Bindings.OutputStreamDelegate} delegate */ copyToOutputStream: function(outputStream, delegate) { @@ -880,7 +880,7 @@ } } -WebInspector.targetManager.observeTargets({ +SDK.targetManager.observeTargets({ targetAdded: function(target) { if (InspectorTest.CSSAgent) @@ -900,14 +900,14 @@ InspectorTest.TargetAgent = target.targetAgent(); InspectorTest.consoleModel = target.consoleModel; - InspectorTest.networkManager = WebInspector.NetworkManager.fromTarget(target); - InspectorTest.securityOriginManager = WebInspector.SecurityOriginManager.fromTarget(target); - InspectorTest.resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); - InspectorTest.networkLog = WebInspector.NetworkLog.fromTarget(target); - InspectorTest.debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + InspectorTest.networkManager = SDK.NetworkManager.fromTarget(target); + InspectorTest.securityOriginManager = SDK.SecurityOriginManager.fromTarget(target); + InspectorTest.resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); + InspectorTest.networkLog = SDK.NetworkLog.fromTarget(target); + InspectorTest.debuggerModel = SDK.DebuggerModel.fromTarget(target); InspectorTest.runtimeModel = target.runtimeModel; - InspectorTest.domModel = WebInspector.DOMModel.fromTarget(target); - InspectorTest.cssModel = WebInspector.CSSModel.fromTarget(target); + InspectorTest.domModel = SDK.DOMModel.fromTarget(target); + InspectorTest.cssModel = SDK.CSSModel.fromTarget(target); InspectorTest.powerProfiler = target.powerProfiler; InspectorTest.cpuProfilerModel = target.cpuProfilerModel; InspectorTest.heapProfilerModel = target.heapProfilerModel; @@ -1043,10 +1043,10 @@ for (var i = 0; i < InspectorTest._panelsToPreload.length; ++i) { lastLoadedPanel = InspectorTest._panelsToPreload[i]; - promises.push(WebInspector.inspectorView.panel(lastLoadedPanel)); + promises.push(UI.inspectorView.panel(lastLoadedPanel)); } - var testPath = WebInspector.settings.createSetting("testPath", "").get(); + var testPath = Common.settings.createSetting("testPath", "").get(); // 2. Show initial panel based on test path. var initialPanelByFolder = { @@ -1070,7 +1070,7 @@ for (var folder in initialPanelByFolder) { if (testPath.indexOf(folder + "/") !== -1) { lastLoadedPanel = initialPanelByFolder[folder]; - promises.push(WebInspector.inspectorView.panel(lastLoadedPanel)); + promises.push(UI.inspectorView.panel(lastLoadedPanel)); break; } } @@ -1078,7 +1078,7 @@ // 3. Run test function. Promise.all(promises).then(() => { if (lastLoadedPanel) - WebInspector.inspectorView.showPanel(lastLoadedPanel).then(testFunction); + UI.inspectorView.showPanel(lastLoadedPanel).then(testFunction); else testFunction(); }).catch(function(e) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/isolated-filesystem-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/isolated-filesystem-test.js index bddcffbb12..623abb4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/isolated-filesystem-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/isolated-filesystem-test.js
@@ -23,14 +23,14 @@ fileSystemName: this.fileSystemPath } }); - WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, created); + Workspace.isolatedFileSystemManager.addEventListener(Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, created); function created(event) { var fileSystem = event.data; if (fileSystem.path() !== fileSystemPath) return; - WebInspector.isolatedFileSystemManager.removeEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, created); + Workspace.isolatedFileSystemManager.removeEventListener(Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, created); callback(fileSystem); } }, @@ -43,10 +43,10 @@ addFileMapping: function(urlPrefix, pathPrefix) { - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); fileSystemMapping.addFileSystem(this.fileSystemPath); fileSystemMapping.addFileMapping(this.fileSystemPath, urlPrefix, pathPrefix); - WebInspector.fileSystemMapping._loadFromSettings(); + Workspace.fileSystemMapping._loadFromSettings(); }, /**
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js index 11bdda6..cc28419 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js
@@ -3,14 +3,14 @@ InspectorTest.layerTreeModel = function() { if (!InspectorTest._layerTreeModel) - InspectorTest._layerTreeModel = WebInspector.LayerTreeModel.fromTarget(InspectorTest.mainTarget); + InspectorTest._layerTreeModel = Layers.LayerTreeModel.fromTarget(InspectorTest.mainTarget); return InspectorTest._layerTreeModel; } InspectorTest.labelForLayer = function(layer) { var node = layer.nodeForSelfOrAncestor(); - var label = node ? WebInspector.DOMPresentationUtils.fullQualifiedSelector(node, false) : "<invalid node id>"; + var label = node ? Components.DOMPresentationUtils.fullQualifiedSelector(node, false) : "<invalid node id>"; var height = layer.height(); var width = layer.width(); if (height <= 200 && width <= 200) @@ -41,7 +41,7 @@ if (!prefix) prefix = ""; if (!root) - root = WebInspector.panels.layers._layers3DView._rotatingContainerElement; + root = UI.panels.layers._layers3DView._rotatingContainerElement; if (root.__layer) InspectorTest.addResult(prefix + InspectorTest.labelForLayer(root.__layer)); for (var element = root.firstElementChild; element; element = element.nextSibling) @@ -52,11 +52,11 @@ { function eventHandler() { - InspectorTest.layerTreeModel().removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler); + InspectorTest.layerTreeModel().removeEventListener(Layers.LayerTreeModel.Events.LayerTreeChanged, eventHandler); callback(); } InspectorTest.evaluateInPage(expression, function() { - InspectorTest.layerTreeModel().addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler); + InspectorTest.layerTreeModel().addEventListener(Layers.LayerTreeModel.Events.LayerTreeChanged, eventHandler); }); } @@ -81,11 +81,11 @@ InspectorTest.requestLayers = function(callback) { - InspectorTest.layerTreeModel().addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged); + InspectorTest.layerTreeModel().addEventListener(Layers.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged); InspectorTest.layerTreeModel().enable(); function onLayerTreeChanged() { - InspectorTest.layerTreeModel().removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged); + InspectorTest.layerTreeModel().removeEventListener(Layers.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged); callback(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/live-edit-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/live-edit-test.js index 2d83981..108b5d0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/live-edit-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/live-edit-test.js
@@ -8,7 +8,7 @@ var column = line.indexOf(string); if (column === -1) continue; - range = new WebInspector.TextRange(i, column, i, column + string.length); + range = new Common.TextRange(i, column, i, column + string.length); var newRange = sourceFrame._textEditor.editRange(range, replacement); break; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/modify-cross-domain-rule.html b/third_party/WebKit/LayoutTests/http/tests/inspector/modify-cross-domain-rule.html index 6d67687..2728c6f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/modify-cross-domain-rule.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/modify-cross-domain-rule.html
@@ -12,7 +12,7 @@ var rule; var matchedStyleResult; - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); function onStyleSheetChanged(event) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network-preflight-options.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network-preflight-options.html index b615d35..0f8dc6a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network-preflight-options.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network-preflight-options.html
@@ -77,7 +77,7 @@ InspectorTest.completeTest(); } } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequest); InspectorTest.evaluateInPage("doCrossOriginXHR();"); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js index 92d9867..470d3d7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js
@@ -54,12 +54,12 @@ InspectorTest.recordNetwork = function() { - WebInspector.panels.network._networkLogView.setRecording(true); + UI.panels.network._networkLogView.setRecording(true); } InspectorTest.networkRequests = function() { - return WebInspector.NetworkLog.requests(); + return SDK.NetworkLog.requests(); } InspectorTest.dumpNetworkRequests = function()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/download.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/download.html index 5bd2c5e..6c14b7a6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/download.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/download.html
@@ -11,9 +11,9 @@ function test() { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "responseReceived", responseReceived); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "responseReceived", responseReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); InspectorTest.evaluateInPage("loadIFrameWithDownload()"); function responseReceived(requestId, time, resourceType, response)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html index 367a03f..801cb8e5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html
@@ -18,8 +18,8 @@ } InspectorTest.addResult(event.type.toString() + ": " + request.name()); } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestStarted, onRequest); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequest); InspectorTest.evaluateInPage("createIFrame()"); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/har-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/har-content.html index b8e2e87..97bd774 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/har-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/har-content.html
@@ -14,9 +14,9 @@ function step2() { - var writer = new WebInspector.HARWriter(); + var writer = new Network.HARWriter(); var stream = new InspectorTest.StringOutputStream(onSaved); - writer.write(stream, InspectorTest.networkRequests(), new WebInspector.Progress()); + writer.write(stream, InspectorTest.networkRequests(), new Common.Progress()); } function dumpContent(content)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html index f42f98c1..5e869df7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html
@@ -8,7 +8,7 @@ function createNetworkRequestWithJSONMIMEType(type) { InspectorTest.addResult("Creating a NetworkRequest with type: " + type); - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), 0, 'http://localhost'); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), 0, 'http://localhost'); request.mimeType = type; request._content = '{"number": 42}'; return request; @@ -17,11 +17,11 @@ function testPreviewer(request) { return new Promise(function(done) { - var previewView = new WebInspector.RequestPreviewView(request, null); + var previewView = new Network.RequestPreviewView(request, null); previewView._createPreviewView(function(previewer) { - InspectorTest.addResult("Its previewer is searchable: " + (previewer && previewer instanceof WebInspector.SearchableView)); - InspectorTest.addResult("Its previewer is the JSON previewer: " + (previewer && previewer._searchProvider && previewer._searchProvider instanceof WebInspector.JSONView)); + InspectorTest.addResult("Its previewer is searchable: " + (previewer && previewer instanceof UI.SearchableView)); + InspectorTest.addResult("Its previewer is the JSON previewer: " + (previewer && previewer._searchProvider && previewer._searchProvider instanceof Network.JSONView)); done(); }); });
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/load-resource-for-frontend.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/load-resource-for-frontend.html index fbf587a..1a2c69e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/load-resource-for-frontend.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/load-resource-for-frontend.html
@@ -15,7 +15,7 @@ function testLoadForURL(url, headers, next) { InspectorTest.addResult("Loading resource from " + url); - WebInspector.ResourceLoader.load(url, headers, callback); + Host.ResourceLoader.load(url, headers, callback); function callback(statusCode, headers, content) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason.html index 582f325..56541d8 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-blocked-reason.html
@@ -22,7 +22,7 @@ { var requestName; var nextStep; - var blockedSetting = WebInspector.settingForTest("blockedURLs"); + var blockedSetting = Common.settingForTest("blockedURLs"); function onRequest(event) { @@ -34,7 +34,7 @@ nextStep(); } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequest); function testBlockedURL(patterns, url, next) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html index 8939041..307641d6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-choose-preview-view.html
@@ -8,7 +8,7 @@ function createNetworkRequest(mimeType, content, statusCode) { InspectorTest.addResult("Creating a NetworkRequest with mimeType: " + mimeType); - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), 0, 'http://localhost'); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), 0, 'http://localhost'); InspectorTest.addResult("Content: " + content.replace(/\0/g, "**NULL**")); request.mimeType = mimeType; request._content = content; @@ -21,14 +21,14 @@ { if (!previewer) return "** NONE **"; - if (previewer instanceof WebInspector.SearchableView) + if (previewer instanceof UI.SearchableView) return "SearchableView > " + getViewName(previewer._searchProvider); return previewer.contentElement.className; } function testPreviewer(request, callback) { - var previewView = new WebInspector.RequestPreviewView(request, new WebInspector.RequestResponseView(request)); + var previewView = new Network.RequestPreviewView(request, new Network.RequestResponseView(request)); previewView._createPreviewView(function(previewer) { InspectorTest.addResult("Its previewer type: " + getViewName(previewer));
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html index 89b36ac0..5012aa2 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-columns-visible.html
@@ -29,7 +29,7 @@ if (request.name() !== "empty.html?xhr") return; xhrRequestFinished = true; - WebInspector.panels.network._networkLogView._refresh(); + UI.panels.network._networkLogView._refresh(); checkComplete(); } @@ -44,8 +44,8 @@ } InspectorTest.recordNetwork(); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequestFinished); - InspectorTest.addSniffer(WebInspector.panels.network._networkLogView._dataGrid, "insertChild", onNodeInserted, true); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequestFinished); + InspectorTest.addSniffer(UI.panels.network._networkLogView._dataGrid, "insertChild", onNodeInserted, true); InspectorTest.NetworkAgent.setCacheDisabled(true, InspectorTest.evaluateInPage.bind(null, "sendXHRRequest()")); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html index 8775eea..2ed2c63 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-datareceived.html
@@ -12,10 +12,10 @@ function test() { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "responseReceived", responseReceived); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "dataReceived", dataReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "responseReceived", responseReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "dataReceived", dataReceived); InspectorTest.evaluateInPage("loadIFrame()"); var encodedBytesReceived = 0; @@ -49,7 +49,7 @@ function dataReceived(requestId, time, dataLength, encodedDataLength) { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "dataReceived", dataReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "dataReceived", dataReceived); var request = InspectorTest.networkLog.requestForId(requestId); if (/resource\.php/.exec(request.url)) encodedBytesReceived += encodedDataLength;
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-internals.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-internals.html index 93f3e0a..516e385 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-internals.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters-internals.html
@@ -14,10 +14,10 @@ InspectorTest.makeFetch("resources/cyrillic.html", {}, ensureAllResources); var filterArray = [ { - filterType: WebInspector.NetworkLogView.FilterType.Domain, + filterType: Network.NetworkLogView.FilterType.Domain, filterValue: "127.0.0.1" } ,{ - filterType: WebInspector.NetworkLogView.FilterType.Scheme, + filterType: Network.NetworkLogView.FilterType.Scheme, filterValue: "http" } ]; @@ -38,12 +38,12 @@ } InspectorTest.addResult(""); - WebInspector.NetworkPanel.revealAndFilter(filterArray); + Network.NetworkPanel.revealAndFilter(filterArray); - var nodes = WebInspector.panels.network._networkLogView._nodesByRequestId.valuesArray(); + var nodes = UI.panels.network._networkLogView._nodesByRequestId.valuesArray(); var foundNodesCount = 0; for (var i = 0; i < nodes.length; i++) { - if (!nodes[i][WebInspector.NetworkLogView._isFilteredOutSymbol]) + if (!nodes[i][Network.NetworkLogView._isFilteredOutSymbol]) foundNodesCount++; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html index a7c25f2..dcc93600 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-filters.html
@@ -62,10 +62,10 @@ setNetworkLogFilter(filterObj.filterText, filterObj.isRegex); - var nodes = WebInspector.panels.network._networkLogView._nodesByRequestId.valuesArray(); + var nodes = UI.panels.network._networkLogView._nodesByRequestId.valuesArray(); var foundNodesCount = 0; for (var i = 0; i < nodes.length; i++) { - if (!nodes[i][WebInspector.NetworkLogView._isFilteredOutSymbol]) + if (!nodes[i][Network.NetworkLogView._isFilteredOutSymbol]) foundNodesCount++; } @@ -81,10 +81,10 @@ */ function setNetworkLogFilter(value, isRegex) { - WebInspector.panels.network._networkLogView._textFilterUI._filterInputElement.value = value; - WebInspector.panels.network._networkLogView._textFilterUI._regexCheckBox.checked = isRegex; - WebInspector.panels.network._networkLogView._textFilterUI._valueChanged(); - WebInspector.panels.network._networkLogView._filterChanged(null); // event not used in this method, so passing null + UI.panels.network._networkLogView._textFilterUI._filterInputElement.value = value; + UI.panels.network._networkLogView._textFilterUI._regexCheckBox.checked = isRegex; + UI.panels.network._networkLogView._textFilterUI._valueChanged(); + UI.panels.network._networkLogView._filterChanged(null); // event not used in this method, so passing null } } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator-from-console.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator-from-console.html index c9a5cd69..6083f33 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator-from-console.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator-from-console.html
@@ -9,12 +9,12 @@ function step1() { - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestStarted, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, onRequest); var str = ""; str += "var s = document.createElement(\"script\");"; str += "s.src = \"resources/silent_script.js\";"; str += "document.head.appendChild(s);"; - WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(str, "console", true, undefined, undefined, undefined, undefined, function(){}); + UI.context.flavor(SDK.ExecutionContext).evaluate(str, "console", true, undefined, undefined, undefined, undefined, function(){}); } function onRequest(event)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator.html index b3a27cb..28ed497 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-initiator.html
@@ -29,7 +29,7 @@ /*function step1() { - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequest); InspectorTest.evaluateInPage("addClassToDiv()", step2); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource.html index 80a6844..6c01a8a7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-memory-cached-resource.html
@@ -28,7 +28,7 @@ function step1() { - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequest); InspectorTest.reloadPage(step2); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-recording-after-reload-with-screenshots-enabled.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-recording-after-reload-with-screenshots-enabled.html index f13eb23..0ed4f0e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-recording-after-reload-with-screenshots-enabled.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-recording-after-reload-with-screenshots-enabled.html
@@ -6,16 +6,16 @@ function test() { - WebInspector.panels.network._networkRecordFilmStripSetting.set(true); + UI.panels.network._networkRecordFilmStripSetting.set(true); - WebInspector.NetworkPanel._displayScreenshotDelay = 0; + Network.NetworkPanel._displayScreenshotDelay = 0; InspectorTest.resourceTreeModel.reloadPage(); InspectorTest.runWhenPageLoads(() => setTimeout(checkRecording, 50)); function checkRecording() { - InspectorTest.addResult(WebInspector.panels.network._networkLogView._recording ? "Still recording" : "Not recording"); + InspectorTest.addResult(UI.panels.network._networkLogView._recording ? "Still recording" : "Not recording"); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-revision-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-revision-content.html index cfffb1d..12992403 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-revision-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-revision-content.html
@@ -15,7 +15,7 @@ function test() { InspectorTest.recordNetwork(); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, step2); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, step2); InspectorTest.evaluateInPage("loadStylesheet()"); var resource; @@ -25,7 +25,7 @@ if (eventUISourceCode.url().indexOf("style.css") == -1) return; var request = InspectorTest.networkRequests().pop(); - uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(request.url); + uiSourceCode = Workspace.workspace.uiSourceCodeForURL(request.url); if (!uiSourceCode) return; uiSourceCode.addRevision("");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-type.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-type.html index 3e8ab4d..22ca4d65 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-type.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-request-type.html
@@ -47,7 +47,7 @@ nextStep(); } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestStarted, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, onRequest); var requestName = "empty-script.js"; var nextStep = step1;
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-data-received-async-response-type-blob.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-data-received-async-response-type-blob.html index f8ade8e..9e1596b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-data-received-async-response-type-blob.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-data-received-async-response-type-blob.html
@@ -6,7 +6,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "dataReceived", dataReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "dataReceived", dataReceived); InspectorTest.recordNetwork(); InspectorTest.makeXHR("GET", "resources/resource.php", true, undefined, undefined, [], false, undefined, "blob", function () { });
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-replay.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-replay.html index 4b7bf3a..b51ce94 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-replay.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xhr-replay.html
@@ -39,7 +39,7 @@ originalRequest = lastRequest(); dumpRequest(originalRequest); InspectorTest.NetworkAgent.replayXHR(originalRequest.requestId); - InspectorTest.addSniffer(WebInspector.NetworkLogView.prototype, "_appendRequest", step3); + InspectorTest.addSniffer(Network.NetworkLogView.prototype, "_appendRequest", step3); } function step3()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xsl-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xsl-content.html index acba882..935fad5c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xsl-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-xsl-content.html
@@ -17,7 +17,7 @@ var resultsOutput = []; InspectorTest.recordNetwork(); InspectorTest.evaluateInPage("loadIframe()"); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFinished", loadingFinished, true); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished", loadingFinished, true); function loadingFinished(requestId) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/ping.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/ping.html index 24b08d1..a7e4d503 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/ping.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/ping.html
@@ -20,7 +20,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "requestWillBeSent", step2); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "requestWillBeSent", step2); InspectorTest.evaluateInPage("navigateLink()"); function step2()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/preview-searchable.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/preview-searchable.html index 39a66c04..415b6d9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/preview-searchable.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/preview-searchable.html
@@ -25,13 +25,13 @@ function previewViewHandled(searches, callback, view) { - var isSearchable = (view instanceof WebInspector.SearchableView); + var isSearchable = (view instanceof UI.SearchableView); var compontentView = view; var typeName = "unknown"; if (isSearchable) compontentView = view._searchProvider; - if (compontentView instanceof WebInspector.ResourceSourceFrame) { + if (compontentView instanceof SourceFrame.ResourceSourceFrame) { typeName = "ResourceSourceFrame"; compontentView._ensureContentLoaded(); if (!compontentView.loaded) { @@ -39,15 +39,15 @@ InspectorTest.addSniffer(compontentView, "onTextEditorContentSet", previewViewHandled.bind(this, searches, callback, view)); return; } - } else if (compontentView instanceof WebInspector.XMLView) { + } else if (compontentView instanceof Network.XMLView) { typeName = "XMLView"; - } else if(compontentView instanceof WebInspector.JSONView) { + } else if(compontentView instanceof Network.JSONView) { typeName = "JSONView"; - } else if(compontentView instanceof WebInspector.RequestHTMLView) { + } else if(compontentView instanceof Network.RequestHTMLView) { typeName = "RequestHTMLView"; - } else if(compontentView instanceof WebInspector.EmptyWidget) { + } else if(compontentView instanceof UI.EmptyWidget) { typeName = "EmptyWidget"; - } else if(compontentView instanceof WebInspector.RequestHTMLView) { + } else if(compontentView instanceof Network.RequestHTMLView) { typeName = "RequestHTMLView"; } @@ -62,8 +62,8 @@ function trySearches(request, searches, callback) { - InspectorTest.addSniffer(WebInspector.RequestPreviewView.prototype, "_previewViewHandledForTest", previewViewHandled.bind(this, searches, callback)); - var networkPanel = WebInspector.panels.network; + InspectorTest.addSniffer(Network.RequestPreviewView.prototype, "_previewViewHandledForTest", previewViewHandled.bind(this, searches, callback)); + var networkPanel = UI.panels.network; networkPanel._showRequest(request); var itemView = networkPanel._networkItemView; itemView._selectTab("preview"); @@ -74,7 +74,7 @@ var url = "data:" + contentType + "," + encodeURIComponent(content); InspectorTest.makeSimpleXHR("GET", url, true, function() { var request = InspectorTest.findRequestsByURLPattern(new RegExp(url.escapeForRegExp()))[0]; - request._resourceType = WebInspector.resourceTypes.Document; + request._resourceType = Common.resourceTypes.Document; trySearches(request, searches, callback); }); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html index cf35a30..c4ae8ed9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-name-path.html
@@ -10,12 +10,12 @@ */ function createNetworkRequestForURLAndDumpNameAndPath(url, targetUrl) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); var currentTargetURL = mainTarget.inspectedURL(); if (targetUrl) mainTarget.setInspectedURL(targetUrl); InspectorTest.addResult("Dumping request name and path for url: " + url); - var request = new WebInspector.NetworkRequest(mainTarget, 0, url); + var request = new SDK.NetworkRequest(mainTarget, 0, url); InspectorTest.addResult(" name = " + request.name()); InspectorTest.addResult(" path = " + request.path()); InspectorTest.addResult(" targetUrl = " + (targetUrl ? targetUrl : currentTargetURL)); @@ -24,7 +24,7 @@ } // Save the target URL to ensure test works well with other tests. - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); var originalTargetURL = mainTarget.inspectedURL(); mainTarget.setInspectedURL("http://127.0.0.1/aFolder/aTest.html");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-parameters-decoding.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-parameters-decoding.html index b5cba81..2088425 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-parameters-decoding.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/request-parameters-decoding.html
@@ -7,7 +7,7 @@ function test() { var value = "Test+%21%40%23%24%25%5E%26*%28%29_%2B+parameters."; - var parameterElement = WebInspector.RequestHeadersView.prototype._formatParameter(value, "", true); + var parameterElement = Network.RequestHeadersView.prototype._formatParameter(value, "", true); InspectorTest.addResult("Original value: " + value); InspectorTest.addResult("Decoded value: " + parameterElement.textContent); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/resource-priority.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/resource-priority.html index adaa087..8018de0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/resource-priority.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/resource-priority.html
@@ -63,7 +63,7 @@ "sendStyleRequest", "createIFrame" ]; - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestStarted, onRequestStarted); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, onRequestStarted); var nextAction = 0; performNextRequest(); @@ -71,7 +71,7 @@ function performNextRequest() { if (nextAction >= actions.length) { - InspectorTest.networkManager.removeEventListener(WebInspector.NetworkManager.Events.RequestStarted, onRequestStarted); + InspectorTest.networkManager.removeEventListener(SDK.NetworkManager.Events.RequestStarted, onRequestStarted); InspectorTest.completeTest(); return; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny.html index 079775a9..82a05e0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny.html
@@ -11,9 +11,9 @@ function test() { - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "responseReceived", responseReceived); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); - InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "responseReceived", responseReceived); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFailed", loadingFailed); + InspectorTest.addSniffer(SDK.NetworkDispatcher.prototype, "loadingFinished", loadingFinished); InspectorTest.evaluateInPage("loadIFrameWithDownload()"); function responseReceived(requestId, time, resourceType, response)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-absolute-paths.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-absolute-paths.html index 49696e2..d20228f8 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-absolute-paths.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-absolute-paths.html
@@ -13,7 +13,7 @@ time: null }; - var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Workspace()); + var automappingTest = new InspectorTest.AutomappingTest(new Workspace.Workspace()); automappingTest.addNetworkResources({ // Make sure main resource gets mapped. "file:///usr/local/node/app.js": app_js,
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-dynamic-uisourcecodes.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-dynamic-uisourcecodes.html index 8f20327..0507310 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-dynamic-uisourcecodes.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-dynamic-uisourcecodes.html
@@ -13,7 +13,7 @@ time: new Date("December 1, 1989") }; - var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Workspace()); + var automappingTest = new InspectorTest.AutomappingTest(new Workspace.Workspace()); var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.reportCreated(onFileSystemCreated);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-git-folders.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-git-folders.html index 7f1d5bad..5eeee0d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-git-folders.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-git-folders.html
@@ -8,7 +8,7 @@ function test() { - var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Workspace()); + var automappingTest = new InspectorTest.AutomappingTest(new Workspace.Workspace()); var reset_css = { content: "* { margin: 0 }",
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html index ff31efa..38996e1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sane.html
@@ -10,7 +10,7 @@ { var timestamp = new Date("December 1, 1989"); var index_html = { - contentType: WebInspector.resourceTypes.Document, + contentType: Common.resourceTypes.Document, content: "<body>this is main resource</body>", time: timestamp }; @@ -19,7 +19,7 @@ time: null }; var bar_css = { - contentType: WebInspector.resourceTypes.Stylesheet, + contentType: Common.resourceTypes.Stylesheet, content: "* { box-sizing: border-box }", time: timestamp }; @@ -27,7 +27,7 @@ var sources_module_json = { content: "module descriptor 2" }; var bazContent = "alert(1);"; - var automappingTest = new InspectorTest.AutomappingTest(new WebInspector.Workspace()); + var automappingTest = new InspectorTest.AutomappingTest(new Workspace.Workspace()); automappingTest.addNetworkResources({ // Make sure main resource gets mapped. "http://example.com": index_html,
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sourcemap.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sourcemap.html index 836b730..ffcf0ac 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sourcemap.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-sourcemap.html
@@ -37,7 +37,7 @@ function onFileSystemCreated() { - var automappingTest = new InspectorTest.AutomappingTest(WebInspector.workspace); + var automappingTest = new InspectorTest.AutomappingTest(Workspace.workspace); automappingTest.waitUntilMappingIsStabilized(InspectorTest.completeTest.bind(InspectorTest)); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-test.js index cff411a..fc8b806 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/automapping-test.js
@@ -14,7 +14,7 @@ { if (!timeOverrides) { timeOverrides = new Map(); - originalRequestMetadata = InspectorTest.override(WebInspector.ContentProviderBasedProject.prototype, "requestMetadata", overrideTime, true); + originalRequestMetadata = InspectorTest.override(Bindings.ContentProviderBasedProject.prototype, "requestMetadata", overrideTime, true); } for (var url in urlToTime) timeOverrides.set(url, urlToTime[url]); @@ -31,18 +31,18 @@ { if (!timeOverride && !metadata) return null; - return new WebInspector.UISourceCodeMetadata(timeOverride, metadata ? metadata.contentSize : null); + return new Workspace.UISourceCodeMetadata(timeOverride, metadata ? metadata.contentSize : null); } } InspectorTest.AutomappingTest = function(workspace) { this._workspace = workspace; - this._networkProject = new WebInspector.ContentProviderBasedProject(this._workspace, "AUTOMAPPING", WebInspector.projectTypes.Network, "simple website"); - if (workspace !== WebInspector.workspace) - new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager, this._workspace); + this._networkProject = new Bindings.ContentProviderBasedProject(this._workspace, "AUTOMAPPING", Workspace.projectTypes.Network, "simple website"); + if (workspace !== Workspace.workspace) + new Bindings.FileSystemWorkspaceBinding(Workspace.isolatedFileSystemManager, this._workspace); this._failedBindingsCount = 0; - this._automapping = new WebInspector.Automapping(this._workspace, this._onBindingAdded.bind(this), this._onBindingRemoved.bind(this)); + this._automapping = new Persistence.Automapping(this._workspace, this._onBindingAdded.bind(this), this._onBindingRemoved.bind(this)); InspectorTest.addSniffer(this._automapping, "_onBindingFailedForTest", this._onBindingFailed.bind(this), true); InspectorTest.addSniffer(this._automapping, "_onSweepHappenedForTest", this._onSweepHappened.bind(this), true); } @@ -58,9 +58,9 @@ { for (var url in assets) { var asset = assets[url]; - var contentType = asset.contentType || WebInspector.resourceTypes.Script; - var contentProvider = new WebInspector.StaticContentProvider(url, contentType, Promise.resolve(asset.content)); - var metadata = typeof asset.content === "string" || asset.time ? new WebInspector.UISourceCodeMetadata(asset.time, asset.content.length) : null; + var contentType = asset.contentType || Common.resourceTypes.Script; + var contentProvider = new Common.StaticContentProvider(url, contentType, Promise.resolve(asset.content)); + var metadata = typeof asset.content === "string" || asset.time ? new Workspace.UISourceCodeMetadata(asset.time, asset.content.length) : null; var uiSourceCode = this._networkProject.createUISourceCode(url, contentType); this._networkProject.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata); } @@ -100,7 +100,7 @@ { if (!this._stabilizedCallback || this._automapping._sweepThrottler._process) return; - var networkUISourceCodes = this._workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network); + var networkUISourceCodes = this._workspace.uiSourceCodesForProjectType(Workspace.projectTypes.Network); var stabilized = this._failedBindingsCount + this._automapping._bindings.size === networkUISourceCodes.length; if (stabilized) { InspectorTest.addResult("Mapping has stabilized.");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-bind-dirty-sourcecode.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-bind-dirty-sourcecode.html index aed0741a..fd54606 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-bind-dirty-sourcecode.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-do-not-bind-dirty-sourcecode.html
@@ -19,15 +19,15 @@ function waitForUISourceCodes(next) { Promise.all([ - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network) .then(uiSourceCode => uiSourceCode.setWorkingCopy("dirty.")), - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) ]).then(next); }, function addFileSystemMapping(next) { - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); next(); },
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-go-to-file-dialog.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-go-to-file-dialog.html index 6b4c794..cff9cfb 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-go-to-file-dialog.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-go-to-file-dialog.html
@@ -18,8 +18,8 @@ function waitForUISourceCodes(next) { Promise.all([ - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network), - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network), + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) ]).then(next); }, @@ -31,7 +31,7 @@ function addFileSystemMapping(next) { - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); InspectorTest.waitForBinding("foo.js").then(next); }, @@ -44,14 +44,14 @@ function dumpGoToSourceDialog() { - WebInspector.panels.sources._sourcesView.showOpenResourceDialog(); - var dialog = WebInspector.OpenResourceDialog._instanceForTest; + UI.panels.sources._sourcesView.showOpenResourceDialog(); + var dialog = Sources.OpenResourceDialog._instanceForTest; var keys = []; for (var i = 0; i < dialog.itemCount(); ++i) keys.push(dialog.itemKeyAt(i)); keys.sort(); InspectorTest.addResult(keys.join("\n")); - WebInspector.Dialog._instance.detach(); + UI.Dialog._instance.detach(); } }; </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html index 8781b18..1f6b599 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-merge-editor-tabs.html
@@ -22,7 +22,7 @@ function openNetworkTab(next) { - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network) .then(code => InspectorTest.showUISourceCodePromise(code)) .then(onNetworkTab); @@ -36,7 +36,7 @@ function openFileSystemTab(next) { - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) .then(onFileSystemSourceCode) .then(onFileSystemTab); @@ -49,7 +49,7 @@ function onFileSystemTab(sourceFrame) { fileSystemSourceFrame = sourceFrame; - fileSystemSourceFrame.setSelection(new WebInspector.TextRange(2, 0, 2, 5)); + fileSystemSourceFrame.setSelection(new Common.TextRange(2, 0, 2, 5)); fileSystemSourceFrame.scrollToLine(2); dumpSourceFrame(fileSystemSourceFrame); dumpEditorTabs(); @@ -60,7 +60,7 @@ function addFileMapping(next) { InspectorTest.waitForBinding("foo.js").then(onBindingCreated); - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingCreated() { @@ -72,15 +72,15 @@ function removeFileMapping(next) { - WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); - WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); + Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingRemoved(event) { var binding = event.data; if (binding.network.name() !== "foo.js") return - WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); + Persistence.persistence.removeEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); dumpEditorTabs(); dumpSourceFrame(fileSystemSourceFrame); next(); @@ -90,7 +90,7 @@ function dumpEditorTabs() { - var editorContainer = WebInspector.panels.sources._sourcesView._editorContainer; + var editorContainer = UI.panels.sources._sourcesView._editorContainer; var openedUISourceCodes = editorContainer._tabIds.keysArray(); openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url())); InspectorTest.addResult("Opened tabs: ");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html index 5ca9ecc..131578944 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html
@@ -21,7 +21,7 @@ function setBreakpointInFileSystemUISourceCode(next) { - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) .then(code => InspectorTest.showUISourceCodePromise(code)) .then(onSourceFrame); @@ -36,7 +36,7 @@ function addFileMapping(next) { InspectorTest.waitForBinding("foo.js").then(onBindingCreated); - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingCreated(binding) { @@ -47,15 +47,15 @@ function removeFileMapping(next) { - WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); - WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); + Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingRemoved(event) { var binding = event.data; if (binding.network.name() !== "foo.js") return - WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); + Persistence.persistence.removeEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); dumpBreakpointSidebarPane(); next(); } @@ -64,7 +64,7 @@ function dumpBreakpointSidebarPane() { - var sidebarPane = self.runtime.sharedInstance(WebInspector.JavaScriptBreakpointsSidebarPane) + var sidebarPane = self.runtime.sharedInstance(Sources.JavaScriptBreakpointsSidebarPane) var breakpoints = sidebarPane._items.keysArray(); for (var breakpoint of breakpoints) InspectorTest.addResult(" " + breakpoint.uiSourceCode().url() +":" + breakpoint.lineNumber());
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html index 1c58f43..405c2cfd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html
@@ -11,8 +11,8 @@ function test() { Runtime.experiments.enableForTest("persistence2"); - var sourcesNavigator = new WebInspector.SourcesNavigatorView(); - sourcesNavigator.show(WebInspector.inspectorView.element); + var sourcesNavigator = new Sources.SourcesNavigatorView(); + sourcesNavigator.show(UI.inspectorView.element); var fs = new InspectorTest.TestFileSystem("file:///var/www"); var fsEntry = InspectorTest.addFooJSFile(fs); @@ -25,8 +25,8 @@ function waitForUISourceCodes(next) { var promises = [ - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network), - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network), + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) ]; Promise.all(promises).then(onUISourceCodesAdded); @@ -40,7 +40,7 @@ function addFileMapping(next) { InspectorTest.waitForBinding("foo.js").then(onBindingCreated); - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingCreated(binding) { @@ -51,15 +51,15 @@ function removeFileMapping(next) { - WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); - WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); + Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingRemoved(event) { var binding = event.data; if (binding.network.name() !== "foo.js") return - WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); + Persistence.persistence.removeEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); InspectorTest.dumpNavigatorView(sourcesNavigator); next(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-rename-mapped-file.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-rename-mapped-file.html index 766a219..326cb302 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-rename-mapped-file.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-rename-mapped-file.html
@@ -15,7 +15,7 @@ fs.addFileMapping("http://127.0.0.1:8000", "/"); fs.reportCreated(function () { }); InspectorTest.waitForBinding("foo.js").then(onBindingCreated); - WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); + Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingRemoved, onBindingRemoved); function onBindingCreated(binding) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-search-across-all-files.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-search-across-all-files.html index 4e29651b..f6fbcd10 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-search-across-all-files.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-search-across-all-files.html
@@ -13,15 +13,15 @@ { var fs = new InspectorTest.TestFileSystem("file:///var/www"); var fsEntry = InspectorTest.addFooJSFile(fs); - var scope = new WebInspector.SourcesSearchScope(); + var scope = new Sources.SourcesSearchScope(); fs.reportCreated(function() { }); InspectorTest.runTestSuite([ function waitForUISourceCodes(next) { Promise.all([ - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network), - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network), + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.FileSystem) ]).then(next); }, @@ -29,7 +29,7 @@ function addFileMapping(next) { - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); InspectorTest.waitForBinding("foo.js").then(next); }, @@ -38,7 +38,7 @@ function dumpSearchResults(next) { - var searchConfig = new WebInspector.SearchConfig("window.foo f:foo", true, false); + var searchConfig = new Workspace.SearchConfig("window.foo f:foo", true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); } @@ -49,7 +49,7 @@ function reply() { var paths = ["/var/www" + fsEntry.fullPath]; - WebInspector.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); + Workspace.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); } } };
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html index 75d9890..5fad5aa 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-nodejs.html
@@ -10,7 +10,7 @@ function test() { // Pretend we are running under V8 front-end. - WebInspector.targetManager.mainTarget().setIsNodeJSForTest(); + SDK.targetManager.mainTarget().setIsNodeJSForTest(); var content = [ '', @@ -18,8 +18,8 @@ '//TODO' ].join("\n"); - var fsContent = WebInspector.Persistence._NodeShebang + content; - var nodeContent = WebInspector.Persistence._NodePrefix + content + WebInspector.Persistence._NodeSuffix; + var fsContent = Persistence.Persistence._NodeShebang + content; + var nodeContent = Persistence.Persistence._NodePrefix + content + Persistence.Persistence._NodeSuffix; InspectorTest.addResult("Initial fileSystem content:"); InspectorTest.addResult(indent(fsContent)); @@ -27,10 +27,10 @@ InspectorTest.addResult(indent(nodeContent)); // Add network UISourceCode. - var networkProject = WebInspector.NetworkProject.forTarget(WebInspector.targetManager.mainTarget()); - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(WebInspector.targetManager.mainTarget()); + var networkProject = Bindings.NetworkProject.forTarget(SDK.targetManager.mainTarget()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(SDK.targetManager.mainTarget()); var mainFrame = resourceTreeModel.mainFrame; - var contentProvider = new WebInspector.StaticContentProvider("http://127.0.0.1:8000/nodejs.js", WebInspector.resourceTypes.Script, () => Promise.resolve(nodeContent)); + var contentProvider = new Common.StaticContentProvider("http://127.0.0.1:8000/nodejs.js", Common.resourceTypes.Script, () => Promise.resolve(nodeContent)); networkProject.addFile(contentProvider, mainFrame, false); // Add filesystem UISourceCode and mapping. @@ -51,7 +51,7 @@ { InspectorTest.addResult("\nRunning: Edit network uiSourceCode"); nodeContent = nodeContent.replace("//TODO", "network();\n//TODO"); - InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_contentSyncedForTest", onSynced); + InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced); binding.network.addRevision(nodeContent); function onSynced() @@ -65,7 +65,7 @@ { InspectorTest.addResult("\nRunning: Edit fileSystem uiSourceCode"); fsContent = fsContent.replace("//TODO", "filesystem();\n//TODO"); - InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_contentSyncedForTest", onSynced); + InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced); fsEntry.setContent(fsContent); function onSynced()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content.html index e3620dc..bcfc0511 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content.html
@@ -24,7 +24,7 @@ function addFileMapping(next) { InspectorTest.waitForBinding("foo.js").then(onBindingCreated); - WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); + Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); function onBindingCreated(binding) { @@ -37,7 +37,7 @@ function changeFileSystem(next) { - InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_contentSyncedForTest", onSynced); + InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced); fsEntry.setContent("window.foo3 = 3;"); function onSynced() @@ -50,7 +50,7 @@ function changeNetworkUISourceCode(next) { - InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_contentSyncedForTest", onSynced); + InspectorTest.addSniffer(Persistence.Persistence.prototype, "_contentSyncedForTest", onSynced); networkCode.addRevision("window.foo2 = 2;"); function onSynced()
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-opens-network-uisourcecode.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-opens-network-uisourcecode.html index 3b42f2cc..7dc5a8e6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-opens-network-uisourcecode.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-opens-network-uisourcecode.html
@@ -21,14 +21,14 @@ InspectorTest.addResult("Binding created: " + binding); dumpEditorTabs("Opened tabs before opening any UISourceCodes:"); InspectorTest.addResult("request open uiSourceCode: " + binding.fileSystem.url()); - WebInspector.panels.sources.showUISourceCode(binding.fileSystem, 0, 0); + UI.panels.sources.showUISourceCode(binding.fileSystem, 0, 0); dumpEditorTabs("Opened tabs after opening UISourceCode:"); InspectorTest.completeTest(); } function dumpEditorTabs(title) { - var editorContainer = WebInspector.panels.sources._sourcesView._editorContainer; + var editorContainer = UI.panels.sources._sourcesView._editorContainer; var openedUISourceCodes = editorContainer._tabIds.keysArray(); openedUISourceCodes.sort((a, b) => a.url().compareTo(b.url())); InspectorTest.addResult(title);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html index 0ae49dcb..31146e5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-tabs-order.html
@@ -33,9 +33,9 @@ function openNetworkFiles(next) { Promise.all([ - InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.Network), - InspectorTest.waitForUISourceCode("bar.js", WebInspector.projectTypes.Network), - InspectorTest.waitForUISourceCode("baz.js", WebInspector.projectTypes.Network) + InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTypes.Network), + InspectorTest.waitForUISourceCode("bar.js", Workspace.projectTypes.Network), + InspectorTest.waitForUISourceCode("baz.js", Workspace.projectTypes.Network) ]).then(onUISourceCodes); function onUISourceCodes(uiSourceCodes) @@ -70,7 +70,7 @@ function dumpTabs(title) { - var tabbedPane = WebInspector.panels.sources._sourcesView._editorContainer._tabbedPane; + var tabbedPane = UI.panels.sources._sourcesView._editorContainer._tabbedPane; var tabs = tabbedPane._tabs; InspectorTest.addResult(title); for (var i = 0; i < tabs.length; ++i) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-test.js index c2d5452..6d8b302 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-test.js
@@ -3,7 +3,7 @@ InspectorTest.preloadModule("persistence"); InspectorTest.preloadModule("sources"); -WebInspector.PersistenceBinding.prototype.toString = function() +Persistence.PersistenceBinding.prototype.toString = function() { var lines = [ "{", @@ -17,9 +17,9 @@ InspectorTest.waitForBinding = function(fileName) { - var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); + var uiSourceCodes = Workspace.workspace.uiSourceCodes(); for (var uiSourceCode of uiSourceCodes) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (!binding) continue; if (uiSourceCode.name() === fileName) @@ -27,7 +27,7 @@ } var fulfill; var promise = new Promise(x => fulfill = x); - WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, onBindingCreated); + Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingCreated, onBindingCreated); return promise; function onBindingCreated(event) @@ -35,21 +35,21 @@ var binding = event.data; if (binding.network.name() !== fileName && binding.fileSystem.name() !== fileName) return; - WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingCreated, onBindingCreated); + Persistence.persistence.removeEventListener(Persistence.Persistence.Events.BindingCreated, onBindingCreated); fulfill(binding); } } InspectorTest.waitForUISourceCode = function(name, projectType) { - var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); + var uiSourceCodes = Workspace.workspace.uiSourceCodes(); var uiSourceCode = uiSourceCodes.find(filterCode); if (uiSourceCode) return Promise.resolve(uiSourceCode); var fulfill; var promise = new Promise(x => fulfill = x); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, onUISourceCode); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, onUISourceCode); return promise; function onUISourceCode(event) @@ -57,7 +57,7 @@ var uiSourceCode = event.data; if (!filterCode(uiSourceCode)) return; - WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, onUISourceCode); + Workspace.workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, onUISourceCode); fulfill(uiSourceCode); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html index 72bd3e8..2dcdd00d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-conversion.html
@@ -51,7 +51,7 @@ } addCookieHeadersToRequest(findRequestByURL(/inspector-test\.js$/)); - var log = (new WebInspector.HARLog(InspectorTest.networkRequests())).build(); + var log = (new SDK.HARLog(InspectorTest.networkRequests())).build(); // Filter out favicon.ico requests that only appear on certain platforms. log.entries = log.entries.filter(function(entry) { return !/favicon\.ico$/.test(entry.request.url);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-headers.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-headers.html index f6c441c..7889d1e6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-headers.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-har-headers.html
@@ -34,7 +34,7 @@ request._transferSize = 539; // 39 = header size at the end of the day } - var testRequest = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), "testRequest", "http://example.com/inspector-test.js", 1); + var testRequest = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), "testRequest", "http://example.com/inspector-test.js", 1); setRequestValues(testRequest); var headersText = testRequest.requestHeadersText(); var requestResults = { @@ -60,7 +60,7 @@ "_transferSize": "formatAsTypeName", "_error": "skip" }; - InspectorTest.addObject(new WebInspector.HAREntry(testRequest).build(), stillNondeterministic, "", "HAR:"); + InspectorTest.addObject(new SDK.HAREntry(testRequest).build(), stillNondeterministic, "", "HAR:"); InspectorTest.completeTest(); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters-ipv6.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters-ipv6.html index a11f9cb..ad15adb 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters-ipv6.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters-ipv6.html
@@ -12,13 +12,13 @@ function test() { InspectorTest.evaluateInPage("submit()"); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequestFinished); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequestFinished); function onRequestFinished(event) { var request = event.data; InspectorTest.addResult(request.url); - InspectorTest.addObject(new WebInspector.HAREntry(request).build(), InspectorTest.HARPropertyFormatters); + InspectorTest.addObject(new SDK.HAREntry(request).build(), InspectorTest.HARPropertyFormatters); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters.html index e154aaf6..0a0b31ba 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-parameters.html
@@ -12,13 +12,13 @@ function test() { InspectorTest.evaluateInPage("submit()"); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequestFinished); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequestFinished); function onRequestFinished(event) { var request = event.data; InspectorTest.addResult(request.url); - InspectorTest.addObject(new WebInspector.HAREntry(request).build(), InspectorTest.HARPropertyFormatters); + InspectorTest.addObject(new SDK.HAREntry(request).build(), InspectorTest.HARPropertyFormatters); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html index 7ba9934d..d1dcca9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-request-content-while-loading.html
@@ -14,7 +14,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.ResourceTreeFrame.prototype, "_addRequest", requestAdded, true); + InspectorTest.addSniffer(SDK.ResourceTreeFrame.prototype, "_addRequest", requestAdded, true); InspectorTest.addSniffer(InspectorTest.PageAgent, "getResourceContent", pageAgentGetResourceContentCalled, true); InspectorTest.evaluateInPage("loadStylesheet()"); var contentWasRequested = false;
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-document-url.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-document-url.html index 5734d47..93522c647 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-document-url.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-document-url.html
@@ -14,12 +14,12 @@ function test() { - InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.FrameNavigated, waitForResources); + InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForResources); InspectorTest.evaluateInPage("loadIframe()"); function waitForResources() { - InspectorTest.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.Events.FrameNavigated, waitForResources); + InspectorTest.resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForResources); InspectorTest.runAfterResourcesAreFinished(["dummy-iframe.html", "inspector-test.js", "resources-test.js", "resource-tree-test.js"], dump); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-events.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-events.html index bc84c5f6..076a696 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-events.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-events.html
@@ -15,10 +15,10 @@ // Reset resourceTreeModel. InspectorTest.resourceTreeModel.mainFrame._remove(); - for (var eventName in WebInspector.ResourceTreeModel.Events) - InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events[eventName], eventHandler.bind(this, eventName)); - for (var eventName in WebInspector.SecurityOriginManager.Events) - InspectorTest.securityOriginManager.addEventListener(WebInspector.SecurityOriginManager.Events[eventName], eventHandler.bind(this, eventName)); + for (var eventName in SDK.ResourceTreeModel.Events) + InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events[eventName], eventHandler.bind(this, eventName)); + for (var eventName in SDK.SecurityOriginManager.Events) + InspectorTest.securityOriginManager.addEventListener(SDK.SecurityOriginManager.Events[eventName], eventHandler.bind(this, eventName)); function eventHandler(eventName, event) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-in-crafted-frame.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-in-crafted-frame.html index acf5dd1c..0791ea9c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-in-crafted-frame.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-frame-in-crafted-frame.html
@@ -17,8 +17,8 @@ function test() { - for (var eventName in WebInspector.ResourceTreeModel.Events) - InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events[eventName], eventHandler.bind(this, eventName)); + for (var eventName in SDK.ResourceTreeModel.Events) + InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events[eventName], eventHandler.bind(this, eventName)); var frames = []; function frameId(frame) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html index e7f0aac..e3c96a1d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-invalid-mime-type-css-content.html
@@ -19,7 +19,7 @@ cssResource = resource; } InspectorTest.addResult(cssResource.url); - InspectorTest.assertEquals(cssResource.resourceType(), WebInspector.resourceTypes.Stylesheet, "Resource type should be Stylesheet."); + InspectorTest.assertEquals(cssResource.resourceType(), Common.resourceTypes.Stylesheet, "Resource type should be Stylesheet."); InspectorTest.assertTrue(!cssResource.failed, "Resource loading failed."); cssResource.requestContent().then(step2); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-non-unique-url.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-non-unique-url.html index a7c1fd8..238c635 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-non-unique-url.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-non-unique-url.html
@@ -13,7 +13,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.FrameTreeElement.prototype, "appendResource", onResource, true); + InspectorTest.addSniffer(Resources.FrameTreeElement.prototype, "appendResource", onResource, true); var cssRequestsCount = 0; function onResource(resource)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js index fe83187b..fc91a23 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js
@@ -64,10 +64,10 @@ dump(children[i], prefix + " "); } - dump(WebInspector.panels.resources.resourcesListTreeElement, ""); + dump(UI.panels.resources.resourcesListTreeElement, ""); if (!InspectorTest._testSourceNavigator) { - InspectorTest._testSourceNavigator = new WebInspector.SourcesNavigatorView(); - InspectorTest._testSourceNavigator.show(WebInspector.inspectorView.element); + InspectorTest._testSourceNavigator = new Sources.SourcesNavigatorView(); + InspectorTest._testSourceNavigator.show(UI.inspectorView.element); } InspectorTest.dumpNavigatorViewInAllModes(InspectorTest._testSourceNavigator); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resources-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/resources-test.js index 3137be5..16359f4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/resources-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resources-test.js
@@ -11,7 +11,7 @@ InspectorTest.runAfterCachedResourcesProcessed = function(callback) { if (!InspectorTest.resourceTreeModel._cachedResourcesProcessed) - InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded, callback); + InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.CachedResourcesLoaded, callback); else callback(); } @@ -28,13 +28,13 @@ resourceURLsMap.delete(url); } if (!resourceURLsMap.size) { - InspectorTest.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.Events.ResourceAdded, checkResources); + InspectorTest.resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.ResourceAdded, checkResources); callback(); } } checkResources(); if (resourceURLsMap.size) - InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.ResourceAdded, checkResources); + InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.ResourceAdded, checkResources); } InspectorTest.showResource = function(resourceURL, callback) @@ -53,8 +53,8 @@ var resource = InspectorTest.resourceMatchingURL(resourceURL); if (!resource) return; - WebInspector.panels.resources.showResource(resource, 1); - var sourceFrame = WebInspector.panels.resources._resourceViewForResource(resource); + UI.panels.resources.showResource(resource, 1); + var sourceFrame = UI.panels.resources._resourceViewForResource(resource); if (sourceFrame.loaded) callbackWrapper(sourceFrame); else @@ -79,17 +79,17 @@ InspectorTest.databaseModel = function() { - return WebInspector.DatabaseModel.fromTarget(InspectorTest.mainTarget); + return Resources.DatabaseModel.fromTarget(InspectorTest.mainTarget); } InspectorTest.domStorageModel = function() { - return WebInspector.DOMStorageModel.fromTarget(InspectorTest.mainTarget); + return Resources.DOMStorageModel.fromTarget(InspectorTest.mainTarget); } InspectorTest.indexedDBModel = function() { - return WebInspector.IndexedDBModel.fromTarget(InspectorTest.mainTarget); + return Resources.IndexedDBModel.fromTarget(InspectorTest.mainTarget); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-non-existing-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-non-existing-resource.html index b3b85e2c..a61cf79c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-non-existing-resource.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-non-existing-resource.html
@@ -12,7 +12,7 @@ function step2() { - var resource = WebInspector.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); + var resource = Bindings.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); var url = "http://127.0.0.1:8000/inspector/search/resources/non-existing.js"; InspectorTest.PageAgent.searchInResource(resource.frameId, url, text, step3); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html index ef3351d..57e07961 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-resource.html
@@ -11,7 +11,7 @@ function step2() { - resource = WebInspector.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); + resource = Bindings.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); InspectorTest.addResult(resource.url); // This file should not match search query.
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html index 7e24bae0..844bc7a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-in-static.html
@@ -12,13 +12,13 @@ function step2() { - resource = WebInspector.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); + resource = Bindings.resourceForURL("http://127.0.0.1:8000/inspector/search/resources/search.js"); resource.requestContent().then(step3); } function step3() { - staticContentProvider = WebInspector.StaticContentProvider.fromString("", WebInspector.resourceTypes.Script, resource.content); + staticContentProvider = Common.StaticContentProvider.fromString("", Common.resourceTypes.Script, resource.content); InspectorTest.addResult(resource.url); var text = "searchTestUniqueString";
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-test.js index 2cdb4e3..1a477862 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/search-test.js
@@ -29,7 +29,7 @@ InspectorTest.runSearchAndDumpResults = function(scope, searchConfig, sortByURI, callback) { var searchResults = []; - var progress = new WebInspector.Progress(); + var progress = new Common.Progress(); scope.performSearch(searchConfig, progress, searchResultCallback, searchFinishedCallback); function searchResultCallback(searchResult) @@ -81,7 +81,7 @@ var oldLines = []; for (var i = 0; i < editor.linesCount; ++i) oldLines.push(editor.line(i)); - var searchableView = WebInspector.panels.sources.sourcesView().searchableView(); + var searchableView = UI.panels.sources.sourcesView().searchableView(); searchableView.showSearchField(); searchableView._caseSensitiveButton.setToggled(searchConfig.caseSensitive);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-1.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-1.html index 794d1fb..c6e6b2d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-1.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-1.html
@@ -9,15 +9,15 @@ function test() { - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); InspectorTest.showScriptSource("search.js", didShowScriptSource); function didShowScriptSource(sourceFrame) { - var searchConfig = new WebInspector.SearchableView.SearchConfig("REPLACEME1", true, false); + var searchConfig = new UI.SearchableView.SearchConfig("REPLACEME1", true, false); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "REPLACED", false); - var searchConfig = new WebInspector.SearchableView.SearchConfig("REPLACEME2", true, false); + var searchConfig = new UI.SearchableView.SearchConfig("REPLACEME2", true, false); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "REPLACED", true); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-2.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-2.html index 52065004..a360d81 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-2.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-2.html
@@ -9,15 +9,15 @@ function test() { - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); InspectorTest.showScriptSource("search.js", didShowScriptSource); function didShowScriptSource(sourceFrame) { - var searchConfig = new WebInspector.SearchableView.SearchConfig("replaceMe1", false, false); + var searchConfig = new UI.SearchableView.SearchConfig("replaceMe1", false, false); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "replaced", false); - var searchConfig = new WebInspector.SearchableView.SearchConfig("replaceMe2", false, false); + var searchConfig = new UI.SearchableView.SearchConfig("replaceMe2", false, false); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "replaced", true); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-3.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-3.html index ce4fb9a..3cab193 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-3.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-3.html
@@ -9,15 +9,15 @@ function test() { - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); InspectorTest.showScriptSource("search.js", didShowScriptSource); function didShowScriptSource(sourceFrame) { - var searchConfig = new WebInspector.SearchableView.SearchConfig("(REPLACE)ME[38]", true, true); + var searchConfig = new UI.SearchableView.SearchConfig("(REPLACE)ME[38]", true, true); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "$1D", false); - var searchConfig = new WebInspector.SearchableView.SearchConfig("(REPLACE)ME[45]", true, true); + var searchConfig = new UI.SearchableView.SearchConfig("(REPLACE)ME[45]", true, true); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "$1D", true); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-4.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-4.html index af725941..f8a497e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-4.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-replace-4.html
@@ -9,15 +9,15 @@ function test() { - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); InspectorTest.showScriptSource("search.js", didShowScriptSource); function didShowScriptSource(sourceFrame) { - var searchConfig = new WebInspector.SearchableView.SearchConfig("(replac)eMe[38]", false, true); + var searchConfig = new UI.SearchableView.SearchConfig("(replac)eMe[38]", false, true); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "$1d", false); - var searchConfig = new WebInspector.SearchableView.SearchConfig("(replace)Me[45]", false, true); + var searchConfig = new UI.SearchableView.SearchConfig("(replace)Me[45]", false, true); InspectorTest.replaceAndDumpChange(sourceFrame, searchConfig, "$1d", true); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-search.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-search.html index 275004f1..60ab338 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-search.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-search.html
@@ -22,8 +22,8 @@ var searchResults = sourceFrame._searchResults; for (var i = 0; i < searchResults.length; ++i) { var range = searchResults[i]; - var prefixRange = new WebInspector.TextRange(range.startLine, 0, range.startLine, range.startColumn); - var postfixRange = new WebInspector.TextRange(range.endLine, range.endColumn, range.endLine, sourceFrame._textEditor.line(range.endLine).length); + var prefixRange = new Common.TextRange(range.startLine, 0, range.startLine, range.startColumn); + var postfixRange = new Common.TextRange(range.endLine, range.endColumn, range.endLine, sourceFrame._textEditor.line(range.endLine).length); var prefix = sourceFrame._textEditor.text(prefixRange); var result = sourceFrame._textEditor.text(range); var postfix = sourceFrame._textEditor.text(postfixRange); @@ -31,7 +31,7 @@ } } - WebInspector.viewManager.showView("sources"); + UI.viewManager.showView("sources"); InspectorTest.showScriptSource("search.js", didShowScriptSource); function didShowScriptSource(sourceFrame) @@ -40,7 +40,7 @@ function testSearch(next) { var query = "searchTestUniqueString"; - var searchConfig = new WebInspector.SearchableView.SearchConfig(query, false, false); + var searchConfig = new UI.SearchableView.SearchConfig(query, false, false); dumpSearchResultsForConfig(sourceFrame, searchConfig); next(); }, @@ -48,7 +48,7 @@ function testSearchCaseSensitive(next) { var query = "SEARCHTestUniqueString"; - var searchConfig = new WebInspector.SearchableView.SearchConfig(query, true, false); + var searchConfig = new UI.SearchableView.SearchConfig(query, true, false); dumpSearchResultsForConfig(sourceFrame, searchConfig); next(); }, @@ -56,7 +56,7 @@ function testSearchRegex(next) { var query = "searchTestUnique.*"; - var searchConfig = new WebInspector.SearchableView.SearchConfig(query, false, true); + var searchConfig = new UI.SearchableView.SearchConfig(query, false, true); dumpSearchResultsForConfig(sourceFrame, searchConfig); next(); }, @@ -64,7 +64,7 @@ function testSearchCaseSensitiveRegex(next) { var query = "searchTestUnique.*"; - var searchConfig = new WebInspector.SearchableView.SearchConfig(query, true, true); + var searchConfig = new UI.SearchableView.SearchConfig(query, true, true); dumpSearchResultsForConfig(sourceFrame, searchConfig); next(); }, @@ -72,7 +72,7 @@ function testSearchConsequent(next) { var query = "AAAAA"; - var searchConfig = new WebInspector.SearchableView.SearchConfig(query, false, false); + var searchConfig = new UI.SearchableView.SearchConfig(query, false, false); dumpSearchResultsForConfig(sourceFrame, searchConfig); next(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html index 9dfea0af..c1cb631 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html
@@ -9,7 +9,7 @@ <script> function test() { - var scope = new WebInspector.SourcesSearchScope(); + var scope = new Sources.SourcesSearchScope(); var names = ["search.html", "search.js", "search.css"]; var fs = new InspectorTest.TestFileSystem("file:///var/www"); @@ -29,12 +29,12 @@ function onAllResourcesLoaded() { - WebInspector.viewManager.showView("sources.search"); + UI.viewManager.showView("sources.search"); fs.reportCreated(fileSystemCreated); function fileSystemCreated() { - InspectorTest.addResult("Total uiSourceCodes: " + WebInspector.workspace.uiSourceCodes().length); + InspectorTest.addResult("Total uiSourceCodes: " + Workspace.workspace.uiSourceCodes().length); InspectorTest.runTestSuite(testSuite); } } @@ -57,7 +57,7 @@ var paths = []; for (var i = 0; i < names.length; ++i) paths.push("/var/www/" + names[i]); - WebInspector.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); + Workspace.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); } } @@ -65,98 +65,98 @@ function testIgnoreCase(next) { var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testCaseSensitive(next) { var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, false, false); + var searchConfig = new Workspace.SearchConfig(query, false, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileHTML(next) { var query = "searchTest" + "UniqueString" + " file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileJS(next) { var query = "file:js " + "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileHTMLJS(next) { var query = "file:js " + "searchTest" + "UniqueString" + " file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueries(next) { var query = "searchTest" + "Unique" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileHTML(next) { var query = "file:html " + "searchTest" + "Unique" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileHTML_SEARCH(next) { var query = "file:html " + "searchTest" + "Unique" + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileJS_SEARCH_HTML(next) { var query = "file:js " + "searchTest" + "Unique" + " space" + " String" + " file:search file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileHTML(next) { var query = "searchTest" + "Unique" + " file:html " + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileHTML_SEARCH(next) { var query = "searchTest" + "Unique" + " file:html " + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileJS_SEARCH_HTML(next) { var query = "file:js " + "searchTest" + "Unique" + " file:html " + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileSEARCH_NOT_JS_NOT_CSS(next) { var query = "searchTest" + "UniqueString" + " file:search -file:js -file:css"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileNotCSS(next) { var query = "searchTest" + "Unique" + " -file:css " + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, @@ -164,14 +164,14 @@ { InspectorTest.addResult("Running a file query with existing project name first:"); var query = "searchTest" + "Unique" + " file:www"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, step2); function step2() { InspectorTest.addResult("Running a file query with non-existing project name now:"); query = "searchTest" + "Unique" + " file:zzz"; - searchConfig = new WebInspector.SearchConfig(query, true, false); + searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); } }, @@ -189,7 +189,7 @@ uiSourceCode.setWorkingCopy("FOO " + "searchTest" + "UniqueString" + " BAR"); var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); } ];
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html index 9bfdb20..6e22009 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html
@@ -9,7 +9,7 @@ <script> function test() { - var scope = new WebInspector.SourcesSearchScope(); + var scope = new Sources.SourcesSearchScope(); var fs = new InspectorTest.TestFileSystem("file:///var/www"); var names = ["search.html", "search.js", "search.css"]; var resources = {}; @@ -39,7 +39,7 @@ function fileSystemCreated() { - WebInspector.viewManager.showView("sources.search"); + UI.viewManager.showView("sources.search"); var uiSourceCodes = InspectorTest.fileSystemUISourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { @@ -65,8 +65,8 @@ function addNetworkUISourceCode(url, content) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, content); - var networkProject = WebInspector.NetworkProject.forTarget(WebInspector.targetManager.mainTarget()); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, content); + var networkProject = Bindings.NetworkProject.forTarget(SDK.targetManager.mainTarget()); var uiSourceCode = networkProject.addFile(contentProvider, InspectorTest.mainFrame(), false); return uiSourceCode; } @@ -80,7 +80,7 @@ var paths = []; for (var i = 0; i < names.length; ++i) paths.push("/var/www/" + names[i]); - WebInspector.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); + Workspace.isolatedFileSystemManager._onSearchCompleted({data: {requestId: requestId, fileSystemPath: path, files: paths}}); } } @@ -88,7 +88,7 @@ function testSearch(next) { var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, false, next); }, @@ -98,7 +98,7 @@ jsNetworkUISourceCode.setWorkingCopy("FOO " + "searchTest" + "UniqueString" + " BAR"); var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, false, next); } ];
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope.html index 8e6bbaa..190412d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope.html
@@ -9,8 +9,8 @@ <script> function test() { - WebInspector.viewManager.showView("sources.search"); - var scope = new WebInspector.SourcesSearchScope(); + UI.viewManager.showView("sources.search"); + var scope = new Sources.SourcesSearchScope(); InspectorTest.runAfterResourcesAreFinished(["search.html", "search.js", "search.css"], step2) function step2() @@ -19,91 +19,91 @@ function testIgnoreCase(next) { var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testCaseSensitive(next) { var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, false, false); + var searchConfig = new Workspace.SearchConfig(query, false, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileHTML(next) { var query = "searchTest" + "UniqueString" + " file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileJS(next) { var query = "file:js " + "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testFileHTMLJS(next) { var query = "file:js " + "searchTest" + "UniqueString" + " file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueries(next) { var query = "searchTest" + "Unique" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileHTML(next) { var query = "file:html " + "searchTest" + "Unique" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileHTML_SEARCH(next) { var query = "file:html " + "searchTest" + "Unique" + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSpaceQueriesFileJS_SEARCH_HTML(next) { var query = "file:js " + "searchTest" + "Unique" + " space" + " String" + " file:search file:html"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileHTML(next) { var query = "searchTest" + "Unique" + " file:html" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileHTML_SEARCH(next) { var query = "searchTest" + "Unique" + " file:html" + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileJS_SEARCH_HTML(next) { var query = "file:js " + "searchTest" + "Unique" + " file:html" + " space" + " String" + " file:search"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, function testSeveralQueriesFileNotCSS(next) { var query = "searchTest" + "Unique" + " -file:css" + " space" + " String"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); }, @@ -111,14 +111,14 @@ { InspectorTest.addResult("Running a file query with existing project name first:"); var query = "searchTest" + "Unique" + " file:127.0.0.1"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, step2); function step2() { InspectorTest.addResult("Running a file query with non-existing project name now:"); query = "searchTest" + "Unique" + " file:128.0.0.1"; - searchConfig = new WebInspector.SearchConfig(query, true, false); + searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); } }, @@ -131,7 +131,7 @@ { sourceFrame.uiSourceCode().setWorkingCopy("FOO " + "searchTest" + "UniqueString" + " BAR"); var query = "searchTest" + "UniqueString"; - var searchConfig = new WebInspector.SearchConfig(query, true, false); + var searchConfig = new Workspace.SearchConfig(query, true, false); InspectorTest.runSearchAndDumpResults(scope, searchConfig, true, next); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/security-test.js index 7131d1d5..03368934 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security-test.js
@@ -3,9 +3,9 @@ InspectorTest.preloadPanel("security"); InspectorTest.dumpSecurityPanelSidebarOrigins = function() { - for (var key in WebInspector.SecurityPanelSidebarTree.OriginGroupName) { - var originGroupName = WebInspector.SecurityPanelSidebarTree.OriginGroupName[key]; - var originGroup = WebInspector.SecurityPanel._instance()._sidebarTree._originGroups.get(originGroupName); + for (var key in Security.SecurityPanelSidebarTree.OriginGroupName) { + var originGroupName = Security.SecurityPanelSidebarTree.OriginGroupName[key]; + var originGroup = Security.SecurityPanel._instance()._sidebarTree._originGroups.get(originGroupName); if (originGroup.hidden) continue; InspectorTest.addResult("Group: " + originGroupName); @@ -16,10 +16,10 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ InspectorTest.dispatchRequestFinished = function(request) { - InspectorTest.networkManager.dispatchEventToListeners(WebInspector.NetworkManager.Events.RequestFinished, request); + InspectorTest.networkManager.dispatchEventToListeners(SDK.NetworkManager.Events.RequestFinished, request); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-and-passive-subresources-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-and-passive-subresources-with-cert-errors.html index 85135ac..5c1d345 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-and-passive-subresources-with-cert-errors.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-and-passive-subresources-with-cert-errors.html
@@ -8,12 +8,12 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: true, displayedContentWithCertErrors: true, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html index d73bbf8c..b687fa0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/active-subresource-with-cert-errors.html
@@ -8,12 +8,12 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: true, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/blank-origins-not-shown.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/blank-origins-not-shown.html index e8f725e..4fdbb573 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/blank-origins-not-shown.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/blank-origins-not-shown.html
@@ -5,10 +5,10 @@ <script> function test() { - var request1 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/foo.jpg", "https://foo.test", 0, 0, null); + var request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/foo.jpg", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request1); - var request2 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAPElEQVR42mNgQAMZGRn/GfABkIIdO3b8x6kQpgAEsCpEVgADKAqxKcBQCCLwARRFIBodYygiyiSCighhAO4e2jskhrm3AAAAAElFTkSuQmCC", "https://foo.test", 0, 0, null); + var request2 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAPElEQVR42mNgQAMZGRn/GfABkIIdO3b8x6kQpgAEsCpEVgADKAqxKcBQCCLwARRFIBodYygiyiSCighhAO4e2jskhrm3AAAAAElFTkSuQmCC", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request2); InspectorTest.dumpSecurityPanelSidebarOrigins();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/blocked-mixed-content-and-subresources-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/blocked-mixed-content-and-subresources-with-cert-errors.html index 5711ca4c..130e078 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/blocked-mixed-content-and-subresources-with-cert-errors.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/blocked-mixed-content-and-subresources-with-cert-errors.html
@@ -7,14 +7,14 @@ { /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: true, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); request.setBlockedReason(Protocol.Network.BlockedReason.MixedContent); request.mixedContentType = "blockable"; InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/failed-request.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/failed-request.html index 3e87652..4f856cc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/failed-request.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/failed-request.html
@@ -5,11 +5,11 @@ <script> function test() { - var request1 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/foo.jpg", "https://foo.test", 0, 0, null); + var request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/foo.jpg", "https://foo.test", 0, 0, null); request1.setSecurityState(Protocol.Security.SecurityState.Secure); InspectorTest.dispatchRequestFinished(request1); - var request2 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://does-not-resolve.test", "https://does-not-resolve.test", 0, 0, null); + var request2 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://does-not-resolve.test", "https://does-not-resolve.test", 0, 0, null); // Leave the security state unknown. InspectorTest.dispatchRequestFinished(request2);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/interstitial-sidebar.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/interstitial-sidebar.html index db0e960..916d422 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/interstitial-sidebar.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/interstitial-sidebar.html
@@ -6,26 +6,26 @@ function test() { - var request1 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/", "https://foo.test", 0, 0, null); + var request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/", "https://foo.test", 0, 0, null); request1.setSecurityState(Protocol.Security.SecurityState.Secure); InspectorTest.dispatchRequestFinished(request1); - var request2 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://bar.test/foo.jpg", "https://bar.test", 0, 0, null); + var request2 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://bar.test/foo.jpg", "https://bar.test", 0, 0, null); request2.setSecurityState(Protocol.Security.SecurityState.Secure); InspectorTest.dispatchRequestFinished(request2); InspectorTest.addResult("Before interstitial is shown:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._sidebarTree.element); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarTree.element); // Test that the sidebar is hidden when an interstitial is shown. https://crbug.com/559150 - InspectorTest.mainTarget.model(WebInspector.ResourceTreeModel).dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.InterstitialShown); + InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListeners(SDK.ResourceTreeModel.Events.InterstitialShown); InspectorTest.addResult("After interstitial is shown:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._sidebarTree.element); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarTree.element); // Test that the sidebar is shown again when the interstitial is hidden. https://crbug.com/559150 - InspectorTest.mainTarget.model(WebInspector.ResourceTreeModel).dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.InterstitialHidden); + InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListeners(SDK.ResourceTreeModel.Events.InterstitialHidden); InspectorTest.addResult("After interstitial is hidden:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._sidebarTree.element); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._sidebarTree.element); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-reload.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-reload.html index c8f331cf..c71a431 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-reload.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-active-and-passive-reload.html
@@ -8,26 +8,26 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: true, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); // At this point, the page has mixed content but no mixed requests have been recorded, so the user should be prompted to refresh. - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); // Now simulate a refresh. - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); - var passive = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var passive = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); passive.mixedContentType = "optionally-blockable"; InspectorTest.dispatchRequestFinished(passive); - var active = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var active = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); active.mixedContentType = "blockable"; InspectorTest.dispatchRequestFinished(active); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-and-subresources-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-and-subresources-with-cert-errors.html index e7e6ed8..3e7fde9b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-and-subresources-with-cert-errors.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-and-subresources-with-cert-errors.html
@@ -8,12 +8,12 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: true, displayedMixedContent: true, ranContentWithCertErrors: true, displayedContentWithCertErrors: true, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Insecure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html index 8ca63c379..102cdae 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/mixed-content-reload.html
@@ -8,22 +8,22 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: true, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); // At this point, the page has mixed content but no mixed requests have been recorded, so the user should be prompted to refresh. - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); // Now simulate a refresh. - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Neutral, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); request.mixedContentType = "optionally-blockable"; InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-group-names-unique.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-group-names-unique.html index e4282b56..4663a38 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-group-names-unique.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-group-names-unique.html
@@ -5,11 +5,11 @@ <script> function test() { - var originGroupNameSize = Object.keys(WebInspector.SecurityPanelSidebarTree.OriginGroupName).length; + var originGroupNameSize = Object.keys(Security.SecurityPanelSidebarTree.OriginGroupName).length; var deduplicatedNames = new Set(); - for (var key in WebInspector.SecurityPanelSidebarTree.OriginGroupName) { - var name = WebInspector.SecurityPanelSidebarTree.OriginGroupName[key]; + for (var key in Security.SecurityPanelSidebarTree.OriginGroupName) { + var name = Security.SecurityPanelSidebarTree.OriginGroupName[key]; deduplicatedNames.add(name); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-view-then-interstitial.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-view-then-interstitial.html index daffe5d..186fa7a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-view-then-interstitial.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/origin-view-then-interstitial.html
@@ -5,22 +5,22 @@ <script> function test() { - var request1 = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/", "https://foo.test", 0, 0, null); + var request1 = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "https://foo.test/", "https://foo.test", 0, 0, null); request1.setSecurityState(Protocol.Security.SecurityState.Secure); InspectorTest.dispatchRequestFinished(request1); InspectorTest.addResult("Before selecting origin view:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._visibleView.contentElement); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._visibleView.contentElement); - WebInspector.SecurityPanel._instance()._sidebarTree._elementsByOrigin.get("https://foo.test").select(); + Security.SecurityPanel._instance()._sidebarTree._elementsByOrigin.get("https://foo.test").select(); InspectorTest.addResult("Panel on origin view before interstitial:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._visibleView.contentElement); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._visibleView.contentElement); // Test that the panel transitions to an origin view when an interstitial is shown. https://crbug.com/559150 - InspectorTest.mainTarget.model(WebInspector.ResourceTreeModel).dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.InterstitialShown); + InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListeners(SDK.ResourceTreeModel.Events.InterstitialShown); InspectorTest.addResult("After interstitial is shown:"); - InspectorTest.dumpDeepInnerHTML(WebInspector.SecurityPanel._instance()._visibleView.contentElement); + InspectorTest.dumpDeepInnerHTML(Security.SecurityPanel._instance()._visibleView.contentElement); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/passive-subresource-with-cert-errors.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/passive-subresource-with-cert-errors.html index 364c330..56912dc6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/passive-subresource-with-cert-errors.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/passive-subresource-with-cert-errors.html
@@ -8,12 +8,12 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: true, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.None, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.None, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-all-resources-secure.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-all-resources-secure.html index a6a19247..68aad98 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-all-resources-secure.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-all-resources-secure.html
@@ -8,12 +8,12 @@ /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-blocked-mixed-content.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-blocked-mixed-content.html index 548c876..7479aafb 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-blocked-mixed-content.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-blocked-mixed-content.html
@@ -7,20 +7,20 @@ { /** @type {!Protocol.Security.InsecureContentStatus} */ var insecureContentStatus = { ranMixedContent: false, displayedMixedContent: false, ranContentWithCertErrors: false, displayedContentWithCertErrors: false, ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral }; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); request.setBlockedReason(Protocol.Network.BlockedReason.MixedContent); request.mixedContentType = "blockable"; InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); // Test that the explanations are cleared on navigation. Regression test for https://crbug.com/601944. - InspectorTest.mainTarget.model(WebInspector.ResourceTreeModel).dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.MainFrameNavigated, InspectorTest.resourceTreeModel.mainFrame); - explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + InspectorTest.mainTarget.model(SDK.ResourceTreeModel).dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNavigated, InspectorTest.resourceTreeModel.mainFrame); + explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-explanation-ordering.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-explanation-ordering.html index 82c5f22f..2c4ae5f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-explanation-ordering.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-explanation-ordering.html
@@ -31,12 +31,12 @@ } ]; - InspectorTest.mainTarget.model(WebInspector.SecurityModel).dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, new WebInspector.PageSecurityState(Protocol.Security.SecurityState.Secure, explanations, insecureContentStatus, true)); + InspectorTest.mainTarget.model(Security.SecurityModel).dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, explanations, insecureContentStatus, true)); - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://foo.test", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); - var explanations = WebInspector.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); + var explanations = Security.SecurityPanel._instance()._mainView.contentElement.getElementsByClassName("security-explanation"); for (var i = 0; i < explanations.length; i++) InspectorTest.dumpDeepInnerHTML(explanations[i]); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-state-comparator.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-state-comparator.html index 1be90db5..2163856 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-state-comparator.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-state-comparator.html
@@ -17,20 +17,20 @@ InspectorTest.assertEquals(ordering.length, Object.keys(Protocol.Security.SecurityState).length); for (var i = 0; i < ordering.length; i++) { - InspectorTest.assertEquals(WebInspector.SecurityModel.SecurityStateComparator(ordering[i], ordering[i]), 0, "Security state comparison failed when checking that \"" + ordering[i] + "\" == \"" + ordering[i] + "\""); + InspectorTest.assertEquals(Security.SecurityModel.SecurityStateComparator(ordering[i], ordering[i]), 0, "Security state comparison failed when checking that \"" + ordering[i] + "\" == \"" + ordering[i] + "\""); } for (var i = 0; i < ordering.length; i++) { var j; for (j = 0; j < i; j++) { - InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: 1)"); + InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: 1)"); } - InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: 0)"); + InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: 0)"); for (j = i + 1; j < ordering.length; j++) { - InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(WebInspector.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: -1)"); + InspectorTest.addResult("Sign of SecurityStateComparator(\"" + ordering[i] + "\",\"" + ordering[j] + "\"): " + Math.sign(Security.SecurityModel.SecurityStateComparator(ordering[i], ordering[j])) + " (expected: -1)"); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource.html b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource.html index 237a4ff4..e667fd3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/security/security-unknown-resource.html
@@ -5,7 +5,7 @@ <script> function test() { - var request = new WebInspector.NetworkRequest(InspectorTest.mainTarget, 0, "http://unknown", "https://foo.test", 0, 0, null); + var request = new SDK.NetworkRequest(InspectorTest.mainTarget, 0, "http://unknown", "https://foo.test", 0, 0, null); InspectorTest.dispatchRequestFinished(request); InspectorTest.dumpSecurityPanelSidebarOrigins();
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-agents.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-agents.html index 00cda46..49c41b1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-agents.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-agents.html
@@ -9,7 +9,7 @@ var scriptURL = "http://127.0.0.1:8000/inspector/service-workers/resources/service-worker-empty.js"; var scope = "http://127.0.0.1:8000/inspector/service-workers/resources/scope1/"; - InspectorTest.addSniffer(WebInspector.MainConnection.prototype, "sendMessage", function(messageString) { + InspectorTest.addSniffer(SDK.MainConnection.prototype, "sendMessage", function(messageString) { var message = JSON.parse(messageString); if (!messageString.includes("Target.sendMessageToTarget")) return; @@ -28,9 +28,9 @@ function step1(target) { InspectorTest.addResult("Suspending targets."); - WebInspector.targetManager.suspendAllTargets(); + SDK.targetManager.suspendAllTargets(); InspectorTest.addResult("Resuming targets."); - WebInspector.targetManager.resumeAllTargets(); + SDK.targetManager.resumeAllTargets(); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-manager.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-manager.html index 079e1b98..b2cc1385 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-manager.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-worker-manager.html
@@ -10,12 +10,12 @@ var scope = "http://127.0.0.1:8000/inspector/service-workers/resources/scope1/"; InspectorTest.registerServiceWorker(scriptURL, scope); - WebInspector.targetManager.observeTargets({ + SDK.targetManager.observeTargets({ targetAdded: function(target) { InspectorTest.addResult("Target added: " + target.name() + "; type: " + InspectorTest.describeTargetType(target)); if (InspectorTest.isDedicatedWorker(target)) { - var serviceWorkerManager = WebInspector.targetManager.mainTarget().serviceWorkerManager; + var serviceWorkerManager = SDK.targetManager.mainTarget().serviceWorkerManager; // Allow agents to do rountrips. InspectorTest.deprecatedRunAfterPendingDispatches(function() { for (var registration of serviceWorkerManager.registrations().valuesArray()) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html index 444bdc74..ac59b8e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html
@@ -23,7 +23,7 @@ function waitForWorkerActivated(scope) { return new Promise(function(resolve) { - InspectorTest.addSniffer(WebInspector.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, false); + InspectorTest.addSniffer(Resources.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, false); function updateRegistration(registration) { if (registration.scopeURL == scope) { @@ -34,12 +34,12 @@ } } } - InspectorTest.addSniffer(WebInspector.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, false); + InspectorTest.addSniffer(Resources.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, false); }}); } function installNewWorkerDetector(scope) { var workerIdSet = {}; - InspectorTest.addSniffer(WebInspector.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); + InspectorTest.addSniffer(Resources.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); function updateRegistration(registration) { if (registration.scopeURL == scope) { @@ -53,7 +53,7 @@ } } installNewWorkerDetector(scope); - WebInspector.inspectorView.showPanel("sources") + UI.inspectorView.showPanel("sources") .then(() => waitForWorkerActivated(scope)) .then(function(){ InspectorTest.addResult("The first ServiceWorker is activated."); @@ -66,7 +66,7 @@ .then(function() { InspectorTest.addResult("The second frame loaded."); InspectorTest.addResult("Check \"Force update on page load\" check box"); - WebInspector.settings.settingForTest("serviceWorkerUpdateOnReload").set(true); + Common.settings.settingForTest("serviceWorkerUpdateOnReload").set(true); return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]); }) .then(function() { @@ -76,7 +76,7 @@ .then(function() { InspectorTest.addResult("The fourth frame loaded. The third worker must be activated before here."); InspectorTest.addResult("Uncheck \"Force update on page load\" check box"); - WebInspector.settings.settingForTest("serviceWorkerUpdateOnReload").set(false); + Common.settings.settingForTest("serviceWorkerUpdateOnReload").set(false); return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]); }) .then(function() { @@ -90,7 +90,7 @@ InspectorTest.deleteServiceWorkerRegistration(scope); InspectorTest.completeTest(); }); - WebInspector.panels.resources.serviceWorkersTreeElement.select(); + UI.panels.resources.serviceWorkersTreeElement.select(); InspectorTest.registerServiceWorker(scriptURL, scope); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-redundant.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-redundant.html index 6acddb6..092bdbf 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-redundant.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-redundant.html
@@ -30,7 +30,7 @@ InspectorTest.evaluateInPage("frontendReopeningCount", function(result) { if (result._description == "0") { - InspectorTest.addSniffer(WebInspector.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); + InspectorTest.addSniffer(Resources.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); function updateRegistration(registration) { if (registration.scopeURL != scope) @@ -68,11 +68,11 @@ InspectorTest.evaluateInPage("reopenFrontend()"); } } - WebInspector.panels.resources.serviceWorkersTreeElement.select(); + UI.panels.resources.serviceWorkersTreeElement.select(); InspectorTest.registerServiceWorker(scriptURL, scope); } else { InspectorTest.addResult("DevTools frontend is reopened."); - WebInspector.panels.resources.serviceWorkersTreeElement.select(); + UI.panels.resources.serviceWorkersTreeElement.select(); InspectorTest.addResult("==== ServiceWorkersView ===="); InspectorTest.addResult(InspectorTest.dumpServiceWorkersView([scope])); InspectorTest.addResult("============================");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-test.js index d728811..83f57c71 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-test.js
@@ -22,7 +22,7 @@ return InspectorTest.isDedicatedWorker(target) && InspectorTest.isServiceWorker(target.parentTarget()); } - WebInspector.targetManager.observeTargets({ + SDK.targetManager.observeTargets({ targetAdded: function(target) { if (isRightTarget(target) && callback) { @@ -36,7 +36,7 @@ InspectorTest.dumpServiceWorkersView = function() { - var swView = WebInspector.panels.resources.visibleView; + var swView = UI.panels.resources.visibleView; return swView._reportView._sectionList.childTextNodes().map(function(node) { return node.textContent.replace(/Received.*/, "Received").replace(/#\d+/, "#N"); }).join("\n"); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-view.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-view.html index 23f1c5f..8f4aec5b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-view.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-view.html
@@ -11,9 +11,9 @@ var scope1 = "http://127.0.0.1:8000/inspector/service-workers/resources/scope1/"; var scope2 = "http://127.0.0.1:8000/inspector/service-workers/resources/scope2/"; var step = 0; - WebInspector.ServiceWorkersView._noThrottle = true; + Resources.ServiceWorkersView._noThrottle = true; - InspectorTest.addSniffer(WebInspector.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); + InspectorTest.addSniffer(Resources.ServiceWorkersView.prototype, "_updateRegistration", updateRegistration, true); function updateRegistration(registration) { for (var version of registration.versions.values()) { @@ -42,7 +42,7 @@ } InspectorTest.addResult("Select ServiceWorkers tree element."); - WebInspector.panels.resources.serviceWorkersTreeElement.select(); + UI.panels.resources.serviceWorkersTreeElement.select(); InspectorTest.addResult("Register ServiceWorker for scope1"); InspectorTest.registerServiceWorker(scriptURL, scope1); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/user-agent-override.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/user-agent-override.html index 277eea6..355837e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/user-agent-override.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/user-agent-override.html
@@ -15,7 +15,7 @@ { if (InspectorTest.isServiceWorker(target)) { resolve(); - WebInspector.targetManager.unobserveTargets(sniffer); + SDK.targetManager.unobserveTargets(sniffer); } }, @@ -23,20 +23,20 @@ { } }; - WebInspector.targetManager.observeTargets(sniffer); + SDK.targetManager.observeTargets(sniffer); }); } function waitForConsoleMessage(regex) { return new Promise(function(resolve) { - WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, sniff); + SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, sniff); function sniff(e) { if (e.data && regex.test(e.data.messageText)) { resolve(e.data); - WebInspector.multitargetConsoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, sniff); + SDK.multitargetConsoleModel.removeEventListener(SDK.ConsoleModel.Events.MessageAdded, sniff); } } }); @@ -48,7 +48,7 @@ var originalUserAgent = navigator.userAgent; InspectorTest.addResult("Enable emulation and set User-Agent override"); - WebInspector.multitargetNetworkManager.setUserAgentOverride(userAgentString); + SDK.multitargetNetworkManager.setUserAgentOverride(userAgentString); InspectorTest.registerServiceWorker(scriptURL, scope) .then(waitForTarget) @@ -57,7 +57,7 @@ .then(function(msg) { InspectorTest.addResult("Overriden user agent: " + msg.messageText); InspectorTest.addResult("Disable emulation"); - WebInspector.multitargetNetworkManager.setUserAgentOverride(""); + SDK.multitargetNetworkManager.setUserAgentOverride(""); return InspectorTest.unregisterServiceWorker(scope); }) .then(function() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js index 625a7a6..3b0d95e4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js
@@ -6,9 +6,9 @@ { var originalPosition = text1.indexOf(testToken); InspectorTest.assertTrue(originalPosition !== -1); - var originalLocation = WebInspector.Formatter.positionToLocation(text1.computeLineEndings(), originalPosition); + var originalLocation = Sources.Formatter.positionToLocation(text1.computeLineEndings(), originalPosition); var formattedLocation = mapping.originalToFormatted(originalLocation[0], originalLocation[1]); - var formattedPosition = WebInspector.Formatter.locationToPosition(text2.computeLineEndings(), formattedLocation[0], formattedLocation[1]); + var formattedPosition = Sources.Formatter.locationToPosition(text2.computeLineEndings(), formattedLocation[0], formattedLocation[1]); var expectedFormattedPosition = text2.indexOf(testToken); if (expectedFormattedPosition === formattedPosition) InspectorTest.addResult(String.sprintf("Correct mapping for <%s>", testToken)); @@ -18,7 +18,7 @@ InspectorTest.testPrettyPrint = function(mimeType, text, mappingQueries, next) { - new WebInspector.ScriptFormatter(mimeType, text, didFormatContent); + new Sources.ScriptFormatter(mimeType, text, didFormatContent); function didFormatContent(formattedSource, mapping) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-image.html b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-image.html index c48c49e..aa91248 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-image.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-image.html
@@ -14,9 +14,9 @@ function test() { - WebInspector.settingForTest("enableAsyncStackTraces").set(true); + Common.settingForTest("enableAsyncStackTraces").set(true); InspectorTest.evaluateInPage("testFunction()"); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, requestFinished); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, requestFinished); function requestFinished(event) { @@ -24,9 +24,9 @@ return; var initiatorInfo = event.data.initiatorInfo(); - var element = new WebInspector.Linkifier().linkifyScriptLocation(InspectorTest.mainTarget, initiatorInfo.scriptId, initiatorInfo.url, initiatorInfo.lineNumber - 1, initiatorInfo.columnNumber - 1); + var element = new Components.Linkifier().linkifyScriptLocation(InspectorTest.mainTarget, initiatorInfo.scriptId, initiatorInfo.url, initiatorInfo.lineNumber - 1, initiatorInfo.columnNumber - 1); InspectorTest.addResult(element.textContent); - WebInspector.settingForTest("enableAsyncStackTraces").set(false); + Common.settingForTest("enableAsyncStackTraces").set(false); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator.html b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator.html index 8a8902e..e7bd3abca 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator.html
@@ -39,7 +39,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.DebuggerAgent.setAsyncCallStackDepth(0); InspectorTest.runTestFunctionAndWaitUntilPaused(step2); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/source-map-http-header.html b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/source-map-http-header.html index be331c22..b3bf4ff5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/source-map-http-header.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/source-map-http-header.html
@@ -16,9 +16,9 @@ { InspectorTest.addResult("Reloading..."); - var mainTarget = WebInspector.targetManager.mainTarget(); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(mainTarget); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, onScriptAdded); + var mainTarget = SDK.targetManager.mainTarget(); + var debuggerModel = SDK.DebuggerModel.fromTarget(mainTarget); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, onScriptAdded); function onScriptAdded(event) { var script = event.data;
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html index 52fdc716..52626ee 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/worker-debugging-script-mapping.html
@@ -19,7 +19,7 @@ { InspectorTest.evaluateInPage("installWorker()"); InspectorTest.waitUntilPaused(paused); - InspectorTest.addSniffer(WebInspector.CompilerScriptMapping.prototype, "_sourceMapLoaded", sourceMapLoaded); + InspectorTest.addSniffer(Bindings.CompilerScriptMapping.prototype, "_sourceMapLoaded", sourceMapLoaded); } var callFrames;
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/ui-source-code-highlight.php b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/ui-source-code-highlight.php index a8499832..402f8b7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources/ui-source-code-highlight.php +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources/ui-source-code-highlight.php
@@ -5,15 +5,15 @@ function test() { - var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); + var uiSourceCodes = Workspace.workspace.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; if (!/.php$/.test(uiSourceCode.url())) continue; - if (uiSourceCode.project().type() !== WebInspector.projectTypes.Network) + if (uiSourceCode.project().type() !== Workspace.projectTypes.Network) continue; - InspectorTest.addResult("Highlight mimeType: " + WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + InspectorTest.addResult("Highlight mimeType: " + Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); InspectorTest.completeTest(); return; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/resources/stacktrace-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/resources/stacktrace-test.js index 1b12829c..8ba3046 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/resources/stacktrace-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/stacktraces/resources/stacktrace-test.js
@@ -2,10 +2,10 @@ InspectorTest.addConsoleSniffer(addMessage); function addMessage(message) { - var viewMessages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var viewMessages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var m = viewMessages[i].consoleMessage(); - InspectorTest.addResult("Message[" + i + "]: " + WebInspector.displayNameForURL(m.url) + ":" + m.line + " " + m.messageText); + InspectorTest.addResult("Message[" + i + "]: " + Bindings.displayNameForURL(m.url) + ":" + m.line + " " + m.messageText); var trace = m.stackTrace ? m.stackTrace.callFrames : null; if (!trace) { InspectorTest.addResult("FAIL: no stack trace attached to message #" + i);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html b/third_party/WebKit/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html index 900197eb..ac86145 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/stylesheet-source-mapping.html
@@ -10,21 +10,21 @@ var contentReceived; var finalMappedLocation; var target = InspectorTest.createWorkspaceWithTarget(); - var cssModel = WebInspector.CSSModel.fromTarget(target); - WebInspector.cssWorkspaceBinding = InspectorTest.testCSSWorkspaceBinding; + var cssModel = SDK.CSSModel.fromTarget(target); + Bindings.cssWorkspaceBinding = InspectorTest.testCSSWorkspaceBinding; InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(cssUISourceCodeAdded); const styleSheetURL = "http://localhost:8000/inspector/resources/example.css"; const sourceMapURL = "example.css.map"; const styleSheetId = "1"; - InspectorTest.addSniffer(WebInspector.CSSWorkspaceBinding.TargetInfo.prototype, "_updateLocations", locationsUpdated, true); + InspectorTest.addSniffer(Bindings.CSSWorkspaceBinding.TargetInfo.prototype, "_updateLocations", locationsUpdated, true); cssModel._styleSheetAdded(createMockStyleSheetHeader(styleSheetURL, sourceMapURL)); function locationsUpdated() { var header = cssModel.styleSheetHeaderForId(styleSheetId); - var uiLocation = InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new WebInspector.CSSLocation(header, 2, 3)); + var uiLocation = InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new SDK.CSSLocation(header, 2, 3)); if (uiLocation.uiSourceCode.url().indexOf(".scss") === -1) return; finalMappedLocation = uiLocation.uiSourceCode.url() + ":" + uiLocation.lineNumber + ":" + uiLocation.columnNumber; @@ -49,7 +49,7 @@ { const documentURL = "http://localhost:8000/inspector/stylesheet-source-mapping.html"; const frame = InspectorTest.resourceTreeModel.mainFrame; - var resource = new WebInspector.Resource(target, null, url, documentURL, frame.id, frame.loaderId, WebInspector.resourceTypes.Stylesheet, mimeType); + var resource = new SDK.Resource(target, null, url, documentURL, frame.id, frame.loaderId, Common.resourceTypes.Stylesheet, mimeType); resource.requestContent = function() { return Promise.resolve(content); @@ -67,7 +67,7 @@ function rawLocationToUILocation(line, column) { var header = cssModel.styleSheetHeaderForId(styleSheetId); - return InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new WebInspector.CSSLocation(header, line, column)); + return InspectorTest.testCSSWorkspaceBinding.rawLocationToUILocation(new SDK.CSSLocation(header, line, column)); } function scssUISourceCodeAdded(uiSourceCode)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/template-content-inspect-crash.html b/third_party/WebKit/LayoutTests/http/tests/inspector/template-content-inspect-crash.html index b4923f9..c61ef8c6 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/template-content-inspect-crash.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/template-content-inspect-crash.html
@@ -9,7 +9,7 @@ { InspectorTest.expandElementsTree(function() { var contentNode = InspectorTest.expandedNodeWithId("tpl").templateContent(); - WebInspector.panels.elements.selectDOMNode(contentNode, true); + UI.panels.elements.selectDOMNode(contentNode, true); InspectorTest.evaluateInConsole("$0", callback); });
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js index f4beaf57..0adef3b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
@@ -8,7 +8,7 @@ var initialize_Timeline = function() { InspectorTest.preloadPanel("timeline"); -WebInspector.TempFile = InspectorTest.TempFileMock; +Bindings.TempFile = InspectorTest.TempFileMock; // Scrub values when printing out these properties in the record or data field. InspectorTest.timelinePropertyFormatters = { @@ -69,24 +69,24 @@ } InspectorTest.preloadPanel("timeline"); -WebInspector.TempFile = InspectorTest.TempFileMock; +Bindings.TempFile = InspectorTest.TempFileMock; InspectorTest.createTracingModel = function() { - return new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing")); + return new SDK.TracingModel(new Bindings.TempFileBackingStorage("tracing")); } InspectorTest.tracingModel = function() { - return WebInspector.panels.timeline._tracingModel; + return UI.panels.timeline._tracingModel; } InspectorTest.invokeWithTracing = function(functionName, callback, additionalCategories, enableJSSampling) { - var categories = "-*,disabled-by-default-devtools.timeline*,devtools.timeline," + WebInspector.TracingModel.TopLevelEventCategory; + var categories = "-*,disabled-by-default-devtools.timeline*,devtools.timeline," + SDK.TracingModel.TopLevelEventCategory; if (additionalCategories) categories += "," + additionalCategories; - var timelinePanel = WebInspector.panels.timeline; + var timelinePanel = UI.panels.timeline; var timelineController = InspectorTest.timelineController(); timelinePanel._timelineController = timelineController; timelineController._startRecordingWithCategories(categories, enableJSSampling, tracingStarted); @@ -98,19 +98,19 @@ function onPageActionsDone() { - InspectorTest.addSniffer(WebInspector.panels.timeline, "loadingComplete", callback) + InspectorTest.addSniffer(UI.panels.timeline, "loadingComplete", callback) timelineController.stopRecording(); } } InspectorTest.timelineModel = function() { - return WebInspector.panels.timeline._model; + return UI.panels.timeline._model; } InspectorTest.timelineFrameModel = function() { - return WebInspector.panels.timeline._frameModel; + return UI.panels.timeline._frameModel; } InspectorTest.setTraceEvents = function(timelineModel, tracingModel, events) @@ -123,29 +123,29 @@ InspectorTest.createTimelineModelWithEvents = function(events) { - var tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing")); - var timelineModel = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.visibleEventsFilter()); + var tracingModel = new SDK.TracingModel(new Bindings.TempFileBackingStorage("tracing")); + var timelineModel = new TimelineModel.TimelineModel(Timeline.TimelineUIUtils.visibleEventsFilter()); InspectorTest.setTraceEvents(timelineModel, tracingModel, events); return timelineModel; } InspectorTest.timelineController = function() { - var mainTarget = WebInspector.targetManager.mainTarget(); - var timelinePanel = WebInspector.panels.timeline; - return new WebInspector.TimelineController(mainTarget, timelinePanel, timelinePanel._tracingModel); + var mainTarget = SDK.targetManager.mainTarget(); + var timelinePanel = UI.panels.timeline; + return new Timeline.TimelineController(mainTarget, timelinePanel, timelinePanel._tracingModel); } InspectorTest.startTimeline = function(callback) { - var panel = WebInspector.panels.timeline; + var panel = UI.panels.timeline; InspectorTest.addSniffer(panel, "recordingStarted", callback); panel._toggleRecording(); }; InspectorTest.stopTimeline = function(callback) { - var panel = WebInspector.panels.timeline; + var panel = UI.panels.timeline; function didStop() { InspectorTest.deprecatedRunAfterPendingDispatches(callback); @@ -184,7 +184,7 @@ InspectorTest.loadTimelineRecords = function(records) { - var model = WebInspector.panels.timeline._model; + var model = UI.panels.timeline._model; model.reset(); records.forEach(model._addRecord, model); } @@ -210,9 +210,9 @@ InspectorTest.detailsTextForTraceEvent = function(traceEvent) { - return WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(traceEvent, - WebInspector.targetManager.mainTarget(), - new WebInspector.Linkifier()); + return Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(traceEvent, + SDK.targetManager.mainTarget(), + new Components.Linkifier()); } InspectorTest.printTimelineRecordsWithDetails = function(typeName) @@ -223,7 +223,7 @@ return; var event = record.traceEvent(); InspectorTest.addResult("Text details for " + record.type() + ": " + InspectorTest.detailsTextForTraceEvent(event)); - if (WebInspector.TimelineData.forEvent(event).warning) + if (TimelineModel.TimelineData.forEvent(event).warning) InspectorTest.addResult(record.type() + " has a warning"); } @@ -233,8 +233,8 @@ InspectorTest.walkTimelineEventTree = function(callback) { var model = InspectorTest.timelineModel(); - var view = new WebInspector.EventsTimelineTreeView(model, WebInspector.panels.timeline._filters, null); - var selection = WebInspector.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime()); + var view = new Timeline.EventsTimelineTreeView(model, UI.panels.timeline._filters, null); + var selection = Timeline.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime()); view.updateContents(selection); InspectorTest.walkTimelineEventTreeUnderNode(callback, view._currentTree, 0); } @@ -278,9 +278,9 @@ message = "----" + message; if (level > 0) message = message + "> "; - if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp - || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) { - message += WebInspector.TimelineUIUtils.eventTitle(record.traceEvent()); + if (record.type() === TimelineModel.TimelineModel.RecordType.TimeStamp + || record.type() === TimelineModel.TimelineModel.RecordType.ConsoleTime) { + message += Timeline.TimelineUIUtils.eventTitle(record.traceEvent()); } else { message += record.type(); } @@ -306,7 +306,7 @@ prefix = "----" + prefix; if (level > 0) prefix = prefix + "> "; - InspectorTest.addResult(prefix + record.type() + ": " + (WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(record.traceEvent(), null) || "")); + InspectorTest.addResult(prefix + record.type() + ": " + (Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(record.traceEvent(), null) || "")); var numChildren = record.children() ? record.children().length : 0; for (var i = 0; i < numChildren; ++i) @@ -339,7 +339,7 @@ data: traceEvent.args["data"] || traceEvent.args, endTime: traceEvent.endTime || traceEvent.startTime, frameId: frameId, - stackTrace: WebInspector.TimelineData.forEvent(traceEvent).stackTrace, + stackTrace: TimelineModel.TimelineData.forEvent(traceEvent).stackTrace, startTime: traceEvent.startTime, type: traceEvent.name, }; @@ -407,7 +407,7 @@ InspectorTest.dumpInvalidations = function(recordType, index, comment) { var record = InspectorTest.findTimelineRecord(recordType, index || 0); - InspectorTest.addArray(WebInspector.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", comment); + InspectorTest.addArray(TimelineModel.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", comment); } InspectorTest.FakeFileReader.prototype = { @@ -454,14 +454,14 @@ InspectorTest.loadTimeline = function(timelineData) { - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; function createFileReader(file, delegate) { return new InspectorTest.FakeFileReader(timelineData, delegate, timeline._saveToFile.bind(timeline)); } - InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", createFileReader); + InspectorTest.override(Timeline.TimelineLoader, "_createFileReader", createFileReader); timeline._loadFromFile({}); }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame-error.html b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame-error.html index 673d0c4c..786d88e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame-error.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame-error.html
@@ -22,12 +22,12 @@ var frame = websocketFrames[i]; var result = String.sprintf("%d-%s: %s", (i + 1), frame.type, frame.text); InspectorTest.addResult(result); - if (frame.type == WebInspector.NetworkRequest.WebSocketFrameType.Error) + if (frame.type == SDK.NetworkRequest.WebSocketFrameType.Error) InspectorTest.completeTest(); } } } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestUpdated, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestUpdated, onRequest); InspectorTest.evaluateInPage("sendMessages()"); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame.html b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame.html index 117aeba..4c1dee63 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-frame.html
@@ -28,7 +28,7 @@ for (var i = 0; i < websocketFrames.length; i++) { var frame = websocketFrames[i]; frames[i] = String.sprintf("%d-%s: %s", (i + 1), frame.type, frame.text); - if (frame.type !== WebInspector.NetworkRequest.WebSocketFrameType.Send && frame.text === "exit") + if (frame.type !== SDK.NetworkRequest.WebSocketFrameType.Send && frame.text === "exit") done = true; } if (JSON.stringify(frames) === JSON.stringify(previous_frames)) { @@ -40,7 +40,7 @@ if (done) InspectorTest.completeTest(); } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestUpdated, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestUpdated, onRequest); InspectorTest.evaluateInPage("sendMessages()"); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake-expected.txt index ae01a94..d670fd9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake-expected.txt
@@ -4,7 +4,6 @@ onopen Tests that WebSocket handshake information is passed to Web Inspector. -log: log: requestMethod: GET log: requestHeaders log: Accept-Encoding: gzip, deflate
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake.html b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake.html index f2f5000..55f2985 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/websocket/websocket-handshake.html
@@ -59,8 +59,7 @@ InspectorTest.completeTest(); } } - console.log(WebInspector.Network); - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestUpdated, onRequest); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestUpdated, onRequest); InspectorTest.evaluateInPage('sendMessages()'); } </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/workspace-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/workspace-test.js index cf1fe06..569c8ef 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/workspace-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/workspace-test.js
@@ -6,20 +6,20 @@ InspectorTest.testFileSystemWorkspaceBinding.dispose(); if (InspectorTest.testNetworkMapping) InspectorTest.testNetworkMapping.dispose(); - WebInspector.fileSystemMapping.resetForTesting(); + Workspace.fileSystemMapping.resetForTesting(); - InspectorTest.testTargetManager = new WebInspector.TargetManager(); - InspectorTest.testWorkspace = new WebInspector.Workspace(); - InspectorTest.testFileSystemWorkspaceBinding = new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager, InspectorTest.testWorkspace); - InspectorTest.testNetworkMapping = new WebInspector.NetworkMapping(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testFileSystemWorkspaceBinding, WebInspector.fileSystemMapping); - InspectorTest.testNetworkProjectManager = new WebInspector.NetworkProjectManager(InspectorTest.testTargetManager, InspectorTest.testWorkspace); - InspectorTest.testDebuggerWorkspaceBinding = new WebInspector.DebuggerWorkspaceBinding(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping); - InspectorTest.testCSSWorkspaceBinding = new WebInspector.CSSWorkspaceBinding(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping); + InspectorTest.testTargetManager = new SDK.TargetManager(); + InspectorTest.testWorkspace = new Workspace.Workspace(); + InspectorTest.testFileSystemWorkspaceBinding = new Bindings.FileSystemWorkspaceBinding(Workspace.isolatedFileSystemManager, InspectorTest.testWorkspace); + InspectorTest.testNetworkMapping = new Bindings.NetworkMapping(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testFileSystemWorkspaceBinding, Workspace.fileSystemMapping); + InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager(InspectorTest.testTargetManager, InspectorTest.testWorkspace); + InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceBinding(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping); + InspectorTest.testCSSWorkspaceBinding = new Bindings.CSSWorkspaceBinding(InspectorTest.testTargetManager, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping); InspectorTest.testTargetManager.observeTargets({ targetAdded: function(target) { - InspectorTest.testNetworkProject = WebInspector.NetworkProject.forTarget(target); + InspectorTest.testNetworkProject = Bindings.NetworkProject.forTarget(target); }, targetRemoved: function(target) @@ -29,34 +29,34 @@ if (ignoreEvents) return; - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); } InspectorTest._mockTargetId = 1; InspectorTest._pageCapabilities = - WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM | - WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log | - WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker; + SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | + SDK.Target.Capability.JS | SDK.Target.Capability.Log | + SDK.Target.Capability.Network | SDK.Target.Capability.Worker; InspectorTest.createMockTarget = function(id, debuggerModelConstructor, capabilities) { capabilities = capabilities || InspectorTest._pageCapabilities; - var MockTarget = class extends WebInspector.Target { + var MockTarget = class extends SDK.Target { constructor(name, connectionFactory, callback) { super(InspectorTest.testTargetManager, name, capabilities, connectionFactory, null, callback); this._inspectedURL = InspectorTest.mainTarget.inspectedURL(); - this.consoleModel = new WebInspector.ConsoleModel(this); - this.networkManager = new WebInspector.NetworkManager(this); - this.runtimeModel = new WebInspector.RuntimeModel(this); - this.securityOriginManager = WebInspector.SecurityOriginManager.fromTarget(this); - this.resourceTreeModel = new WebInspector.ResourceTreeModel(this, this.networkManager, this.securityOriginManager); + this.consoleModel = new SDK.ConsoleModel(this); + this.networkManager = new SDK.NetworkManager(this); + this.runtimeModel = new SDK.RuntimeModel(this); + this.securityOriginManager = SDK.SecurityOriginManager.fromTarget(this); + this.resourceTreeModel = new SDK.ResourceTreeModel(this, this.networkManager, this.securityOriginManager); this.resourceTreeModel._cachedResourcesProcessed = true; this.resourceTreeModel._frameAttached("42", 0); - this.debuggerModel = debuggerModelConstructor ? new debuggerModelConstructor(this) : new WebInspector.DebuggerModel(this); - this._modelByConstructor.set(WebInspector.DebuggerModel, this.debuggerModel); - this.domModel = new WebInspector.DOMModel(this); - this.cssModel = new WebInspector.CSSModel(this, this.domModel); + this.debuggerModel = debuggerModelConstructor ? new debuggerModelConstructor(this) : new SDK.DebuggerModel(this); + this._modelByConstructor.set(SDK.DebuggerModel, this.debuggerModel); + this.domModel = new SDK.DOMModel(this); + this.cssModel = new SDK.CSSModel(this, this.domModel); } _loadedWithCapabilities() @@ -64,7 +64,7 @@ } }; - var target = new MockTarget("mock-target-" + id, (params) => new WebInspector.StubConnection(params)); + var target = new MockTarget("mock-target-" + id, (params) => new SDK.StubConnection(params)); InspectorTest.testTargetManager.addTarget(target); return target; } @@ -79,18 +79,18 @@ InspectorTest.waitForWorkspaceUISourceCodeAddedEvent = function(callback, count, projectType) { InspectorTest.uiSourceCodeAddedEventsLeft = count || 1; - InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); function uiSourceCodeAdded(event) { if (projectType && event.data.project().type() !== projectType) return; - if (!projectType && event.data.project().type() === WebInspector.projectTypes.Service) + if (!projectType && event.data.project().type() === Workspace.projectTypes.Service) return; if (!(--InspectorTest.uiSourceCodeAddedEventsLeft)) { - InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, InspectorTest._defaultWorkspaceEventHandler); } callback(event.data); } @@ -99,16 +99,16 @@ InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent = function(callback, count) { InspectorTest.uiSourceCodeRemovedEventsLeft = count || 1; - InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); + InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); function uiSourceCodeRemoved(event) { - if (event.data.project().type() === WebInspector.projectTypes.Service) + if (event.data.project().type() === Workspace.projectTypes.Service) return; if (!(--InspectorTest.uiSourceCodeRemovedEventsLeft)) { - InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); + InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, InspectorTest._defaultWorkspaceEventHandler); } callback(event.data); } @@ -116,20 +116,20 @@ InspectorTest.addMockUISourceCodeToWorkspace = function(url, type, content) { - var mockContentProvider = WebInspector.StaticContentProvider.fromString(url, type, content); + var mockContentProvider = Common.StaticContentProvider.fromString(url, type, content); InspectorTest.testNetworkProject.addFile(mockContentProvider, null, false); } InspectorTest.addMockUISourceCodeViaNetwork = function(url, type, content, target) { - var mockContentProvider = WebInspector.StaticContentProvider.fromString(url, type, content); + var mockContentProvider = Common.StaticContentProvider.fromString(url, type, content); InspectorTest.testNetworkProject.addFile(mockContentProvider, target.resourceTreeModel.mainFrame, false); } InspectorTest._defaultWorkspaceEventHandler = function(event) { var uiSourceCode = event.data; - if (uiSourceCode.project().type() === WebInspector.projectTypes.Service) + if (uiSourceCode.project().type() === Workspace.projectTypes.Service) return; InspectorTest.addResult(`Workspace event: ${event.type.toString()}: ${uiSourceCode.url()}.`); } @@ -142,13 +142,13 @@ InspectorTest.dumpUISourceCode = function(uiSourceCode, callback) { InspectorTest.addResult("UISourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode)); - if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script || uiSourceCode.contentType() === WebInspector.resourceTypes.Document) - InspectorTest.addResult("UISourceCode is content script: " + (uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts)); + if (uiSourceCode.contentType() === Common.resourceTypes.Script || uiSourceCode.contentType() === Common.resourceTypes.Document) + InspectorTest.addResult("UISourceCode is content script: " + (uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts)); uiSourceCode.requestContent().then(didRequestContent); function didRequestContent(content, contentEncoded) { - InspectorTest.addResult("Highlighter type: " + WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + InspectorTest.addResult("Highlighter type: " + Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); InspectorTest.addResult("UISourceCode content: " + content); callback(); } @@ -157,7 +157,7 @@ InspectorTest.fileSystemUISourceCodes = function() { var uiSourceCodes = []; - var fileSystemProjects = WebInspector.workspace.projectsForType(WebInspector.projectTypes.FileSystem); + var fileSystemProjects = Workspace.workspace.projectsForType(Workspace.projectTypes.FileSystem); for (var project of fileSystemProjects) uiSourceCodes = uiSourceCodes.concat(project.uiSourceCodes()); return uiSourceCodes; @@ -166,7 +166,7 @@ InspectorTest.refreshFileSystemProjects = function(callback) { var barrier = new CallbackBarrier(); - var projects = WebInspector.workspace.projects(); + var projects = Workspace.workspace.projects(); for (var i = 0; i < projects.length; ++i) projects[i].refresh("/", barrier.createCallback()); barrier.callWhenDone(callback); @@ -174,19 +174,19 @@ InspectorTest.waitForGivenUISourceCode = function(name, callback) { - var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); + var uiSourceCodes = Workspace.workspace.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { if (uiSourceCodes[i].name() === name) { setImmediate(callback); return; } } - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); function uiSourceCodeAdded(event) { if (event.data.name() === name) { - WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + Workspace.workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); setImmediate(callback); } }
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html index 02d39bb..f0dff03 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/linkifier.html
@@ -52,29 +52,29 @@ } } - uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(InspectorTest.mainTarget.inspectedURL()); + uiSourceCode = Workspace.workspace.uiSourceCodeForURL(InspectorTest.mainTarget.inspectedURL()); var linkifyMe = "at triggerError (http://localhost/show/:22:11)"; - var fragment = WebInspector.linkifyStringAsFragment(linkifyMe); + var fragment = Components.linkifyStringAsFragment(linkifyMe); var anchor = fragment.querySelector('a'); InspectorTest.addResult("The string \"" + linkifyMe + " \" linkifies to url: " + anchor.href); InspectorTest.addResult("The lineNumber is " + anchor.lineNumber + " with type " + (typeof anchor.lineNumber)); InspectorTest.addResult("The columnNumber is " + anchor.columnNumber + " with type " + (typeof anchor.columnNumber)); - linkifier = new WebInspector.Linkifier(); + linkifier = new Components.Linkifier(); var count1 = liveLocationsCount(); - link = linkifier.linkifyScriptLocation(WebInspector.targetManager.mainTarget(), null, InspectorTest.mainTarget.inspectedURL(), 8, 0, "dummy-class"); + link = linkifier.linkifyScriptLocation(SDK.targetManager.mainTarget(), null, InspectorTest.mainTarget.inspectedURL(), 8, 0, "dummy-class"); var count2 = liveLocationsCount(); InspectorTest.addResult("listeners added on raw source code: " + (count2 - count1)); InspectorTest.addResult("original location: " + link.textContent); - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); } function uiSourceCodeScriptFormatted() { InspectorTest.addResult("pretty printed location: " + link.textContent); - scriptFormatter._discardFormattedUISourceCodeScript(WebInspector.panels.sources.visibleView.uiSourceCode()); + scriptFormatter._discardFormattedUISourceCodeScript(UI.panels.sources.visibleView.uiSourceCode()); InspectorTest.addResult("reverted location: " + link.textContent); var count1 = liveLocationsCount(); @@ -88,7 +88,7 @@ function liveLocationsCount() { - return WebInspector.debuggerWorkspaceBinding._ensureInfoForScript(script)._locations.size; + return Bindings.debuggerWorkspaceBinding._ensureInfoForScript(script)._locations.size; } }
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1.html index f035a49..044afb0 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-1.html
@@ -24,8 +24,8 @@ var test = function() { - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; var scriptFormatter; var sourceFrame; @@ -58,7 +58,7 @@ function resumed() { - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); } @@ -73,7 +73,7 @@ { InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed"); scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode()); - InspectorTest.addSniffer(WebInspector.JavaScriptBreakpointsSidebarPane.prototype, "didReceiveBreakpointLineForTest", onBreakpointsUpdated); + InspectorTest.addSniffer(Sources.JavaScriptBreakpointsSidebarPane.prototype, "didReceiveBreakpointLineForTest", onBreakpointsUpdated); } function onBreakpointsUpdated()
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html index 1fd2bcce..adec6b5 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html
@@ -24,8 +24,8 @@ var test = function() { - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; var scriptFormatter; InspectorTest.runDebuggerTestSuite([ @@ -44,14 +44,14 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Adding breakpoint."); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 11, "", true); } function breakpointResolved() { InspectorTest.addResult("Formatting."); - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); } @@ -62,7 +62,7 @@ InspectorTest.removeBreakpoint(formattedSourceFrame, 13); InspectorTest.addResult("Unformatting."); scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode()); - var breakpoints = WebInspector.breakpointManager._storage._setting.get(); + var breakpoints = Bindings.breakpointManager._storage._setting.get(); InspectorTest.assertEquals(breakpoints.length, 0, "There should not be any breakpoints in the storage."); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console.html index c0f8db7a..a4bdc3e33 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-console.html
@@ -23,7 +23,7 @@ var test = function() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var sourceFrame; var scriptFormatter; @@ -69,7 +69,7 @@ function dumpConsoleMessageURLs() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; ++i) { var element = messages[i].toMessageElement(); var anchor = element.querySelector(".console-message-url");
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/tabbed-pane-closeable-persistence-restore.html b/third_party/WebKit/LayoutTests/inspector-enabled/tabbed-pane-closeable-persistence-restore.html index a8eca7c..c43f836 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/tabbed-pane-closeable-persistence-restore.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/tabbed-pane-closeable-persistence-restore.html
@@ -11,7 +11,7 @@ function test() { - var drawer = WebInspector.inspectorView._drawerTabbedLocation.tabbedPane(); + var drawer = UI.inspectorView._drawerTabbedLocation.tabbedPane(); InspectorTest.addResult("Has sensors tab: " + drawer.hasTab("sensors")); InspectorTest.addResult("Has rendering tab: " + drawer.hasTab("rendering")); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js b/third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js index 3d6942e..b78b51f 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js +++ b/third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/resources/heap-snapshot-common.js
@@ -4,6 +4,11 @@ if (!window.WebInspector) window.WebInspector = {}; + +self['Common'] = {}; +self['Profiler'] = {}; +self['HeapSnapshotWorker'] = {}; + InspectorTest.importScript("../../../../../Source/devtools/front_end/platform/utilities.js"); InspectorTest.importScript("../../../../../Source/devtools/front_end/common/UIString.js"); InspectorTest.importScript("../../../../../Source/devtools/front_end/profiler/HeapSnapshotCommon.js"); @@ -20,7 +25,7 @@ InspectorTest._takeHeapSnapshotInternal = function(command, callback) { - var loader = new WebInspector.HeapSnapshotLoader(); + var loader = new HeapSnapshotWorker.HeapSnapshotLoader(); InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(messageObject) { loader.write(messageObject["params"]["chunk"]);
diff --git a/third_party/WebKit/LayoutTests/inspector/agents-enable-disable.html b/third_party/WebKit/LayoutTests/inspector/agents-enable-disable.html index c12ae82..239c9fb 100644 --- a/third_party/WebKit/LayoutTests/inspector/agents-enable-disable.html +++ b/third_party/WebKit/LayoutTests/inspector/agents-enable-disable.html
@@ -21,7 +21,7 @@ InspectorTest.completeTest(); } - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); targets.forEach(function(target) { var agentNames = Object.keys(target._agents).filter(function(agentName) { var agent = target._agents[agentName];
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-KeyframeEffectReadOnly-crash.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-KeyframeEffectReadOnly-crash.html index 2e35c38..225f34b6 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-KeyframeEffectReadOnly-crash.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-KeyframeEffectReadOnly-crash.html
@@ -24,8 +24,8 @@ function test() { - WebInspector.viewManager.showView("animations"); - var timeline = self.runtime.sharedInstance(WebInspector.AnimationTimeline); + UI.viewManager.showView("animations"); + var timeline = self.runtime.sharedInstance(Animation.AnimationTimeline); InspectorTest.evaluateInPage("startAnimationWithKeyframeEffect()"); InspectorTest.waitForAnimationAdded(step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-empty-web-animations.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-empty-web-animations.html index 1f092fe..0a35e90 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-empty-web-animations.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-empty-web-animations.html
@@ -15,10 +15,10 @@ function test() { - WebInspector.viewManager.showView("animations"); - var timeline = self.runtime.sharedInstance(WebInspector.AnimationTimeline); + UI.viewManager.showView("animations"); + var timeline = self.runtime.sharedInstance(Animation.AnimationTimeline); InspectorTest.evaluateInPage("startAnimation()"); - InspectorTest.addSniffer(WebInspector.AnimationModel.prototype, "animationStarted", animationStarted); + InspectorTest.addSniffer(Animation.AnimationModel.prototype, "animationStarted", animationStarted); function animationStarted() {
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-animations.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-animations.html index f24bb00..9067d7eb 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-animations.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-animations.html
@@ -62,9 +62,9 @@ var groupIds = []; var i = 0; var stepNumber = 0; - var model = WebInspector.AnimationModel.fromTarget(InspectorTest.mainTarget); + var model = Animation.AnimationModel.fromTarget(InspectorTest.mainTarget); model.ensureEnabled(); - model.addEventListener(WebInspector.AnimationModel.Events.AnimationGroupStarted, groupStarted); + model.addEventListener(Animation.AnimationModel.Events.AnimationGroupStarted, groupStarted); // Each step triggers a new animation group. var steps = [ "restartAnimation('node1', 'expandWidth')",
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-transitions.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-transitions.html index 9c29216..a41746a33 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-transitions.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-transitions.html
@@ -56,9 +56,9 @@ var groupIds = []; var i = 0; var stepNumber = 0; - var model = WebInspector.AnimationModel.fromTarget(InspectorTest.mainTarget); + var model = Animation.AnimationModel.fromTarget(InspectorTest.mainTarget); model.ensureEnabled(); - model.addEventListener(WebInspector.AnimationModel.Events.AnimationGroupStarted, groupStarted); + model.addEventListener(Animation.AnimationModel.Events.AnimationGroupStarted, groupStarted); // Each step triggers a new transition group. var steps = [ "resetElement('node1'); startTransition('node1')",
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html index af0420e..33f3fd3 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html
@@ -44,9 +44,9 @@ function startTransition() { - var model = WebInspector.AnimationModel.fromTarget(InspectorTest.mainTarget); + var model = Animation.AnimationModel.fromTarget(InspectorTest.mainTarget); model.ensureEnabled(); - model.addEventListener(WebInspector.AnimationModel.Events.AnimationGroupStarted, groupStarted); + model.addEventListener(Animation.AnimationModel.Events.AnimationGroupStarted, groupStarted); InspectorTest.evaluateInPage("startCSSTransition()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline.html index 40b3f6ca..2d1a5b5 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-timeline.html
@@ -56,13 +56,13 @@ function test() { // Override timeline width for testing - WebInspector.AnimationTimeline.prototype.width = function() { return 1000; } + Animation.AnimationTimeline.prototype.width = function() { return 1000; } // Override animation color for testing // FIXME: Set animation name of Web Animation instead; not supported yet - WebInspector.AnimationUI.Color = function() { return "black"; } + Animation.AnimationUI.Color = function() { return "black"; } - WebInspector.viewManager.showView("animations"); - var timeline = self.runtime.sharedInstance(WebInspector.AnimationTimeline); + UI.viewManager.showView("animations"); + var timeline = self.runtime.sharedInstance(Animation.AnimationTimeline); InspectorTest.evaluateInPage("startAnimationWithDelay()"); InspectorTest.waitForAnimationAdded(step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-web-anim-negative-start-time.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-web-anim-negative-start-time.html index ce843a0..fde793b8 100644 --- a/third_party/WebKit/LayoutTests/inspector/animation/animation-web-anim-negative-start-time.html +++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-web-anim-negative-start-time.html
@@ -22,13 +22,13 @@ function test() { // Override timeline width for testing - WebInspector.AnimationTimeline.prototype.width = function() { return 50; } + Animation.AnimationTimeline.prototype.width = function() { return 50; } // Override animation color for testing // FIXME: Set animation name of Web Animation instead; not supported yet - WebInspector.AnimationUI.Color = function() { return "black"; } + Animation.AnimationUI.Color = function() { return "black"; } - WebInspector.viewManager.showView("animations"); - var timeline = self.runtime.sharedInstance(WebInspector.AnimationTimeline); + UI.viewManager.showView("animations"); + var timeline = self.runtime.sharedInstance(Animation.AnimationTimeline); InspectorTest.evaluateInPage("startAnimation()"); InspectorTest.waitForAnimationAdded(step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/audits/audits-empty-stylesheet.html b/third_party/WebKit/LayoutTests/inspector/audits/audits-empty-stylesheet.html index ab4ce984..2a11d0e 100644 --- a/third_party/WebKit/LayoutTests/inspector/audits/audits-empty-stylesheet.html +++ b/third_party/WebKit/LayoutTests/inspector/audits/audits-empty-stylesheet.html
@@ -14,7 +14,7 @@ function step1() { - WebInspector.AuditRuleResult.resourceDomain = function() { + Audits.AuditRuleResult.resourceDomain = function() { return "[domain]"; };
diff --git a/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-functional.html b/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-functional.html index 11ab274..ce53f03 100644 --- a/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-functional.html +++ b/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-functional.html
@@ -53,7 +53,7 @@ { InspectorTest.reloadPage(onPageReloaded); var pendingStyleSheetsCount = 4; - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_styleSheetAdded", maybeStylesheetsLoaded, true); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_styleSheetAdded", maybeStylesheetsLoaded, true); var pageReloaded = false; function onPageReloaded() @@ -68,7 +68,7 @@ return; if (InspectorTest.cssModel.styleSheetHeaders().length !== pendingStyleSheetsCount) return; - WebInspector.AuditRuleResult.resourceDomain = function() { + Audits.AuditRuleResult.resourceDomain = function() { return "[domain]"; };
diff --git a/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-noimages-functional.html b/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-noimages-functional.html index 5596e66..edfdb02 100644 --- a/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-noimages-functional.html +++ b/third_party/WebKit/LayoutTests/inspector/audits/audits-panel-noimages-functional.html
@@ -22,14 +22,14 @@ var test = function() { InspectorTest.reloadPage(); - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_styleSheetAdded", onStyleSheetAdded, true); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_styleSheetAdded", onStyleSheetAdded, true); var pendingStyleSheetsCount = 5; function onStyleSheetAdded() { if (--pendingStyleSheetsCount) return; - WebInspector.AuditRuleResult.resourceDomain = function() { + Audits.AuditRuleResult.resourceDomain = function() { return "[domain]"; };
diff --git a/third_party/WebKit/LayoutTests/inspector/audits/audits-test.js b/third_party/WebKit/LayoutTests/inspector/audits/audits-test.js index 6e05ea1..4fbeb52a 100644 --- a/third_party/WebKit/LayoutTests/inspector/audits/audits-test.js +++ b/third_party/WebKit/LayoutTests/inspector/audits/audits-test.js
@@ -5,8 +5,8 @@ InspectorTest.collectAuditResults = function(callback) { - WebInspector.panels.audits.showResults(WebInspector.panels.audits._auditResultsTreeElement.firstChild().results); - var trees = WebInspector.panels.audits.visibleView.element.querySelectorAll(".audit-result-tree"); + UI.panels.audits.showResults(UI.panels.audits._auditResultsTreeElement.firstChild().results); + var trees = UI.panels.audits.visibleView.element.querySelectorAll(".audit-result-tree"); for (var i = 0; i < trees.length; ++i) { var liElements = trees[i].shadowRoot.querySelectorAll("li"); for (var j = 0; j < liElements.length; ++j) { @@ -15,15 +15,15 @@ } } InspectorTest.deprecatedRunAfterPendingDispatches(function() { - InspectorTest.collectTextContent(WebInspector.panels.audits.visibleView.element, ""); + InspectorTest.collectTextContent(UI.panels.audits.visibleView.element, ""); callback(); }); } InspectorTest.launchAllAudits = function(shouldReload, callback) { - InspectorTest.addSniffer(WebInspector.AuditController.prototype, "_auditFinishedCallback", callback); - var launcherView = WebInspector.panels.audits._launcherView; + InspectorTest.addSniffer(Audits.AuditController.prototype, "_auditFinishedCallback", callback); + var launcherView = UI.panels.audits._launcherView; launcherView._selectAllClicked(true); launcherView._auditPresentStateElement.checked = !shouldReload; launcherView._launchButtonClicked();
diff --git a/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader-expected.txt b/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader-expected.txt index 526afbd..05a9d67 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader-expected.txt
@@ -1,7 +1,7 @@ This tests that ChunkedFileReader properly re-assembles chunks, especially in case these contain multibyte characters. -WebInspector.OutputStreamDelegate.onTransferStarted() called +Bindings.OutputStreamDelegate.onTransferStarted() called Chunks transferred: 40 -WebInspector.OutputStreamDelegate.onTransferFinished() called +Bindings.OutputStreamDelegate.onTransferFinished() called DONE
diff --git a/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader.html b/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader.html index 148fec8..4226238 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader.html +++ b/third_party/WebKit/LayoutTests/inspector/components/chunked-file-reader.html
@@ -16,18 +16,18 @@ InspectorTest.TestOutputStreamDelegate.prototype = { onTransferStarted: function() { - InspectorTest.addResult("WebInspector.OutputStreamDelegate.onTransferStarted() called"); + InspectorTest.addResult("Bindings.OutputStreamDelegate.onTransferStarted() called"); }, onTransferFinished: function() { InspectorTest.addResult("Chunks transferred: " + this._chunkCount); - InspectorTest.addResult("WebInspector.OutputStreamDelegate.onTransferFinished() called"); + InspectorTest.addResult("Bindings.OutputStreamDelegate.onTransferFinished() called"); this._doneCallback(); }, /** - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred: function(reader) { @@ -35,12 +35,12 @@ }, /** - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} event */ onError: function(reader, event) { - InspectorTest.addResult("WebInspector.OutputStreamDelegate.onError() called"); + InspectorTest.addResult("Bindings.OutputStreamDelegate.onError() called"); this._doneCallback(); } }; @@ -58,8 +58,8 @@ // Most of the characters above will be encoded as 2 bytes, so make sure we use odd // chunk size to cause chunk boundaries sometimes to happen between chaacter bytes. var chunkSize = 5; - var reader = new WebInspector.ChunkedFileReader(blob, chunkSize, new InspectorTest.TestOutputStreamDelegate(onTransferFinished)); - var output = new WebInspector.StringOutputStream(); + var reader = new Bindings.ChunkedFileReader(blob, chunkSize, new InspectorTest.TestOutputStreamDelegate(onTransferFinished)); + var output = new Common.StringOutputStream(); reader.start(output); function onTransferFinished() {
diff --git a/third_party/WebKit/LayoutTests/inspector/components/color-expected.txt b/third_party/WebKit/LayoutTests/inspector/components/color-expected.txt index eb75fee2..2b37d8a 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/color-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/components/color-expected.txt
@@ -1,4 +1,4 @@ -Tests WebInspector.Color +Tests Common.Color Dumping 'red' in different formats: - rgb(255, 0, 0)
diff --git a/third_party/WebKit/LayoutTests/inspector/components/color.html b/third_party/WebKit/LayoutTests/inspector/components/color.html index 4c54b2d..ca3196d 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/color.html +++ b/third_party/WebKit/LayoutTests/inspector/components/color.html
@@ -7,12 +7,12 @@ { function dumpColor(colorText) { - var color = WebInspector.Color.parse(colorText); + var color = Common.Color.parse(colorText); InspectorTest.addResult("Dumping '" + colorText + "' in different formats:"); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.RGB)); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.RGBA)); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.HSL)); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.HSLA)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.RGB)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.RGBA)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.HSL)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.HSLA)); var hsv = color.hsva(); var hsvString = String.sprintf("hsv(%d, %d%, %d%)", Math.round(hsv[0] * 360), Math.round(hsv[1] * 100), Math.round(hsv[2] * 100)); @@ -21,9 +21,9 @@ var hsvaString = String.sprintf("hsva(%d, %d%, %d%, %f)", Math.round(hsva[0] * 360), Math.round(hsva[1] * 100), Math.round(hsva[2] * 100), hsva[3]); InspectorTest.addResult(" - " + hsvaString); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.HEX)); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.ShortHEX)); - InspectorTest.addResult(" - " + color.asString(WebInspector.Color.Format.Nickname)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.HEX)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.ShortHEX)); + InspectorTest.addResult(" - " + color.asString(Common.Color.Format.Nickname)); InspectorTest.addResult(" - default: " + color.asString()); InspectorTest.addResult(" - inverse color: " + color.invert().asString()); @@ -53,6 +53,6 @@ </script> </head> <body onload="runTest()"> -<p>Tests WebInspector.Color</p> +<p>Tests Common.Color</p> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/components/cookie-parser.html b/third_party/WebKit/LayoutTests/inspector/components/cookie-parser.html index e6348cce..1f13279 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/cookie-parser.html +++ b/third_party/WebKit/LayoutTests/inspector/components/cookie-parser.html
@@ -30,14 +30,14 @@ InspectorTest.parseAndDumpCookie = function(header) { - var parser = new WebInspector.CookieParser(); + var parser = new SDK.CookieParser(); InspectorTest.addResult("source: " + header); InspectorTest.dumpCookies(parser.parseCookie(header)); } InspectorTest.parseAndDumpSetCookie = function(header) { - var parser = new WebInspector.CookieParser(); + var parser = new SDK.CookieParser(); InspectorTest.addResult("source: " + header); InspectorTest.dumpCookies(parser.parseSetCookie(header)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/components/css-shadow-model.html b/third_party/WebKit/LayoutTests/inspector/components/css-shadow-model.html index a1f825e6..a3b0070 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/css-shadow-model.html +++ b/third_party/WebKit/LayoutTests/inspector/components/css-shadow-model.html
@@ -88,7 +88,7 @@ function dumpCSSLength(lengthText) { - var length = WebInspector.CSSLength.parse(lengthText); + var length = Common.CSSLength.parse(lengthText); var statusText = length !== null ? "Succeeded: " + length.asCSSText() : "Failed"; InspectorTest.addResult("\"" + lengthText + "\", Parsing " + statusText); } @@ -105,7 +105,7 @@ function dumpShadow(shadowText, isBoxShadow) { - var shadows = isBoxShadow ? WebInspector.CSSShadowModel.parseBoxShadow(shadowText) : WebInspector.CSSShadowModel.parseTextShadow(shadowText); + var shadows = isBoxShadow ? Common.CSSShadowModel.parseBoxShadow(shadowText) : Common.CSSShadowModel.parseTextShadow(shadowText); var output = []; for (var i = 0; i < shadows.length; i++) output.push(shadows[i].asCSSText());
diff --git a/third_party/WebKit/LayoutTests/inspector/components/datagrid-autosize.html b/third_party/WebKit/LayoutTests/inspector/components/datagrid-autosize.html index 95226bd9..595bbad 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/datagrid-autosize.html +++ b/third_party/WebKit/LayoutTests/inspector/components/datagrid-autosize.html
@@ -8,7 +8,7 @@ { function testAutoSize(widths, minPercent, maxPercent) { InspectorTest.addResult("Auto sizing " + JSON.stringify(widths) + ", minPercent=" + minPercent + ", maxPercent=" + maxPercent); - var result = WebInspector.DataGrid.prototype._autoSizeWidths(widths, minPercent, maxPercent); + var result = UI.DataGrid.prototype._autoSizeWidths(widths, minPercent, maxPercent); InspectorTest.addResult(" " + JSON.stringify(result)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/components/datagrid.html b/third_party/WebKit/LayoutTests/inspector/components/datagrid.html index 180c0eb5..22171814 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/datagrid.html +++ b/third_party/WebKit/LayoutTests/inspector/components/datagrid.html
@@ -43,13 +43,13 @@ } var columns = [{id: "id"}]; - var dataGrid = new WebInspector.DataGrid(columns); - var a = new WebInspector.DataGridNode({id: "a"}); - var aa = new WebInspector.DataGridNode({id: "aa"}); - var aaa = new WebInspector.DataGridNode({id: "aaa"}); - var aab = new WebInspector.DataGridNode({id: "aab"}); - var ab = new WebInspector.DataGridNode({id: "ab"}); - var b = new WebInspector.DataGridNode({id: "b"}); + var dataGrid = new UI.DataGrid(columns); + var a = new UI.DataGridNode({id: "a"}); + var aa = new UI.DataGridNode({id: "aa"}); + var aaa = new UI.DataGridNode({id: "aaa"}); + var aab = new UI.DataGridNode({id: "aab"}); + var ab = new UI.DataGridNode({id: "ab"}); + var b = new UI.DataGridNode({id: "b"}); var root = dataGrid.rootNode(); @@ -83,7 +83,7 @@ dumpNodes(); attach(aa, aaa); attach(aa, aab); - var aac = new WebInspector.DataGridNode({id: "aac"}); + var aac = new UI.DataGridNode({id: "aac"}); attach(aa, aac); dumpNodes(); attach(aa, aac, 0); @@ -108,9 +108,9 @@ dumpNodes(); var columns = [{id: "id"}]; - var dataGrid = new WebInspector.DataGrid(columns); - var a = new WebInspector.DataGridNode({id: "a", secondCol: "a foo"}); - var b = new WebInspector.DataGridNode({id: "b", secondCol: "b foo"}); + var dataGrid = new UI.DataGrid(columns); + var a = new UI.DataGridNode({id: "a", secondCol: "a foo"}); + var b = new UI.DataGridNode({id: "b", secondCol: "b foo"}); var root = dataGrid.rootNode(); attach(root, a); dumpNodes();
diff --git a/third_party/WebKit/LayoutTests/inspector/components/file-path-scoring.html b/third_party/WebKit/LayoutTests/inspector/components/file-path-scoring.html index 6f0177e..6675502 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/file-path-scoring.html +++ b/third_party/WebKit/LayoutTests/inspector/components/file-path-scoring.html
@@ -42,10 +42,10 @@ function runQuery(paths, query, expected) { - var scorer = new WebInspector.FilePathScoreFunction(query); + var scorer = new Sources.FilePathScoreFunction(query); var bestScore = -1; var bestIndex = -1; - var filter = WebInspector.FilteredListWidget.filterRegex(query); + var filter = UI.FilteredListWidget.filterRegex(query); for(var i = 0; i < paths.length; ++i) { if (!filter.test(paths[i])) continue;
diff --git a/third_party/WebKit/LayoutTests/inspector/components/geometry.html b/third_party/WebKit/LayoutTests/inspector/components/geometry.html index 9d7131e..8c4ba73 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/geometry.html +++ b/third_party/WebKit/LayoutTests/inspector/components/geometry.html
@@ -9,9 +9,9 @@ function testVectorLength(next) { var testVectors = [ - new WebInspector.Geometry.Vector(3, 4, 5), - new WebInspector.Geometry.Vector(-1, 0, -1), - new WebInspector.Geometry.Vector(6, -2, 3) + new Common.Geometry.Vector(3, 4, 5), + new Common.Geometry.Vector(-1, 0, -1), + new Common.Geometry.Vector(6, -2, 3) ]; InspectorTest.addResult("Testing vector length"); for (var i = 0; i < testVectors.length; ++i) @@ -23,9 +23,9 @@ function testVectorNormalize(next) { var testVectors = [ - new WebInspector.Geometry.Vector(3, 4, 5), - new WebInspector.Geometry.Vector(-1, 0, -1), - new WebInspector.Geometry.Vector(6, -2, 3) + new Common.Geometry.Vector(3, 4, 5), + new Common.Geometry.Vector(-1, 0, -1), + new Common.Geometry.Vector(6, -2, 3) ]; var eps = 1e-05; @@ -34,7 +34,7 @@ InspectorTest.assertTrue(Math.abs(testVectors[i].length() - 1) <= eps, "Length of normalized vector is not 1") } - var zeroVector = new WebInspector.Geometry.Vector(0, 0, 0); + var zeroVector = new Common.Geometry.Vector(0, 0, 0); zeroVector.normalize(); InspectorTest.assertTrue(zeroVector.length() <= eps, "Zero vector after normalization isn't zero vector"); next(); @@ -43,19 +43,19 @@ function testScalarProduct(next) { var vectorsU = [ - new WebInspector.Geometry.Vector(3, 4, 5), - new WebInspector.Geometry.Vector(-1, 0, -1), - new WebInspector.Geometry.Vector(6, -2, 3) + new Common.Geometry.Vector(3, 4, 5), + new Common.Geometry.Vector(-1, 0, -1), + new Common.Geometry.Vector(6, -2, 3) ]; var vectorsV = [ - new WebInspector.Geometry.Vector(1, 10, -5), - new WebInspector.Geometry.Vector(2, 3, 4), - new WebInspector.Geometry.Vector(0, 0, 0) + new Common.Geometry.Vector(1, 10, -5), + new Common.Geometry.Vector(2, 3, 4), + new Common.Geometry.Vector(0, 0, 0) ]; for (var i = 0; i < vectorsU.length; ++i) - InspectorTest.addResult("Scalar Product:" + WebInspector.Geometry.scalarProduct(vectorsU[i], vectorsV[i])) + InspectorTest.addResult("Scalar Product:" + Common.Geometry.scalarProduct(vectorsU[i], vectorsV[i])) next(); }, @@ -63,19 +63,19 @@ function testCrossProduct(next) { var vectorsU = [ - new WebInspector.Geometry.Vector(3, 4, 5), - new WebInspector.Geometry.Vector(-1, 0, -1), - new WebInspector.Geometry.Vector(6, -2, 3) + new Common.Geometry.Vector(3, 4, 5), + new Common.Geometry.Vector(-1, 0, -1), + new Common.Geometry.Vector(6, -2, 3) ]; var vectorsV = [ - new WebInspector.Geometry.Vector(1, 10, -5), - new WebInspector.Geometry.Vector(2, 3, 4), - new WebInspector.Geometry.Vector(0, 0, 0) + new Common.Geometry.Vector(1, 10, -5), + new Common.Geometry.Vector(2, 3, 4), + new Common.Geometry.Vector(0, 0, 0) ]; for (var i = 0; i < vectorsU.length; ++i) { - var result = WebInspector.Geometry.crossProduct(vectorsU[i], vectorsV[i]); + var result = Common.Geometry.crossProduct(vectorsU[i], vectorsV[i]); InspectorTest.addResult(String.sprintf("Cross Product: [%.4f, %.4f, %.4f]", result.x, result.y, result.z)); } @@ -85,21 +85,21 @@ function testCalculateAngle(next) { var vectorsU = [ - new WebInspector.Geometry.Vector(3, 4, 5), - new WebInspector.Geometry.Vector(-1, 0, -1), - new WebInspector.Geometry.Vector(1, 1, 0), - new WebInspector.Geometry.Vector(6, -2, 3), + new Common.Geometry.Vector(3, 4, 5), + new Common.Geometry.Vector(-1, 0, -1), + new Common.Geometry.Vector(1, 1, 0), + new Common.Geometry.Vector(6, -2, 3), ]; var vectorsV = [ - new WebInspector.Geometry.Vector(-3, -4, -5), - new WebInspector.Geometry.Vector(2, 3, 4), - new WebInspector.Geometry.Vector(-1, 1, 0), - new WebInspector.Geometry.Vector(0, 0, 0), + new Common.Geometry.Vector(-3, -4, -5), + new Common.Geometry.Vector(2, 3, 4), + new Common.Geometry.Vector(-1, 1, 0), + new Common.Geometry.Vector(0, 0, 0), ]; for (var i = 0; i < vectorsU.length; ++i) - InspectorTest.addResult(String.sprintf("Calculate angle: %.4f", WebInspector.Geometry.calculateAngle(vectorsU[i], vectorsV[i]))); + InspectorTest.addResult(String.sprintf("Calculate angle: %.4f", Common.Geometry.calculateAngle(vectorsU[i], vectorsV[i]))); next(); }, @@ -108,7 +108,7 @@ { var angles = [Math.PI, Math.PI / 4, Math.PI / 6]; for (var i = 0; i < angles.length; ++i) - InspectorTest.addResult(String.sprintf("deg: %.4f", WebInspector.Geometry.radiansToDegrees(angles[i]))); + InspectorTest.addResult(String.sprintf("deg: %.4f", Common.Geometry.radiansToDegrees(angles[i]))); next(); }, @@ -117,7 +117,7 @@ { var angles = [-30, 0, 30, 90, 180]; for (var i = 0; i < angles.length; ++i) - InspectorTest.addResult(String.sprintf("rad: %.4f", WebInspector.Geometry.degreesToRadians(angles[i]))); + InspectorTest.addResult(String.sprintf("rad: %.4f", Common.Geometry.degreesToRadians(angles[i]))); next(); }, @@ -133,7 +133,7 @@ ]; for (var i = 0; i < rotationMatrices.length; ++i) { - var angles = WebInspector.Geometry.EulerAngles.fromRotationMatrix(new WebKitCSSMatrix(rotationMatrices[i])); + var angles = Common.Geometry.EulerAngles.fromRotationMatrix(new WebKitCSSMatrix(rotationMatrices[i])); InspectorTest.addResult(String.sprintf("Euler angles: %.4f %.4f %.4f", angles.alpha, angles.beta, angles.gamma)); } next(); @@ -142,13 +142,13 @@ function testEulerAnglesToRotate3DString(next) { var angles = [ - new WebInspector.Geometry.EulerAngles(0, 0, 0), - new WebInspector.Geometry.EulerAngles(1, 2, 3), - new WebInspector.Geometry.EulerAngles(-1, -2, 3), - new WebInspector.Geometry.EulerAngles(-1, 2, -3), - new WebInspector.Geometry.EulerAngles(0, 1, 2), - new WebInspector.Geometry.EulerAngles(1, 0, 2), - new WebInspector.Geometry.EulerAngles(1, 2, 0) + new Common.Geometry.EulerAngles(0, 0, 0), + new Common.Geometry.EulerAngles(1, 2, 3), + new Common.Geometry.EulerAngles(-1, -2, 3), + new Common.Geometry.EulerAngles(-1, 2, -3), + new Common.Geometry.EulerAngles(0, 1, 2), + new Common.Geometry.EulerAngles(1, 0, 2), + new Common.Geometry.EulerAngles(1, 2, 0) ]; for (var i = 0; i < angles.length; ++i) {
diff --git a/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer-expected.txt b/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer-expected.txt index 6403624..996dbd2 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer-expected.txt
@@ -1,4 +1,4 @@ -Test WebInspector.TextUtils.BalancedJSONTokenizer. +Test Common.TextUtils.BalancedJSONTokenizer. Running: testMatchQuotes
diff --git a/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer.html b/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer.html index 895cd7a..50d03e1 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer.html +++ b/third_party/WebKit/LayoutTests/inspector/components/json-balanced-tokenizer.html
@@ -24,7 +24,7 @@ for (var i = 0; i < testStrings.length; ++i) { var string = JSON.stringify(testStrings[i]); InspectorTest.addResult("\nParsing " + string); - var tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest)); + var tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest)); var result = tokenizer.write(string); if (!result) InspectorTest.addResult(`tokenizer.write() returned ${result}, true expected`); @@ -43,7 +43,7 @@ for (var i = 0; i < testData.length; ++i) { var string = JSON.stringify(testData[i]); InspectorTest.addResult("\nParsing " + string); - var tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest)); + var tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest)); var result = tokenizer.write(string); if (!result) InspectorTest.addResult(`tokenizer.write() returned ${result}, false expected`); @@ -62,7 +62,7 @@ for (var i = 0; i < testData.length; ++i) { var string = JSON.stringify(testData[i]); InspectorTest.addResult("\nParsing " + string); - var tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); + var tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); var result = tokenizer.write(string); var expectedResult = !(testData[i] instanceof Array); if (result != expectedResult) @@ -86,14 +86,14 @@ {"etc":{"\\\\\"":"\\\\\""}} ]; var string = JSON.stringify(testStrings); - var tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); + var tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); InspectorTest.addResult("\nRunning at once:"); var result = tokenizer.write(string); if (result) InspectorTest.addResult(`tokenizer.write() returned ${result}, false expected`); for (var sample of [3, 15, 50]) { - tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); + tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); InspectorTest.addResult("\nRunning by " + sample + ":"); for (var i = 0; i < string.length; i += sample) { var result = tokenizer.write(string.substring(i, i + sample)); @@ -109,7 +109,7 @@ { var testString = "[{a: 'b'}], {'x': {a: 'b'}}"; InspectorTest.addResult("\nParsing " + testString); - var tokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); + var tokenizer = new Common.TextUtils.BalancedJSONTokenizer(InspectorTest.addResult.bind(InspectorTest), true); var result = tokenizer.write(testString); InspectorTest.addResult(`tokenizer.write() returned ${result}, false expected`); next(); @@ -119,7 +119,7 @@ </script> <body onload="runTest()"> -Test WebInspector.TextUtils.BalancedJSONTokenizer. +Test Common.TextUtils.BalancedJSONTokenizer. </p> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/components/linkifier.html b/third_party/WebKit/LayoutTests/inspector/components/linkifier.html index 628ecdf4b..dd50816 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/linkifier.html +++ b/third_party/WebKit/LayoutTests/inspector/components/linkifier.html
@@ -16,7 +16,7 @@ function debuggerTest() { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); var url = target.inspectedURL(); var scripts = InspectorTest.debuggerModel.scripts; for (var scriptId in scripts) { @@ -29,7 +29,7 @@ dumpLiveLocationsCount(); - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); InspectorTest.addResult("Created linkifier"); dumpLiveLocationsCount(); @@ -54,15 +54,15 @@ dumpLiveLocationsCount(); // Ensures urls with lots of slashes does not bog down the regex. - WebInspector.linkifyStringAsFragment("/".repeat(1000)); - WebInspector.linkifyStringAsFragment("/a/".repeat(1000)); + Components.linkifyStringAsFragment("/".repeat(1000)); + Components.linkifyStringAsFragment("/a/".repeat(1000)); InspectorTest.completeTest(); } function dumpLiveLocationsCount() { - InspectorTest.addResult("Live locations count: " + WebInspector.debuggerWorkspaceBinding._ensureInfoForScript(script)._locations.size); + InspectorTest.addResult("Live locations count: " + Bindings.debuggerWorkspaceBinding._ensureInfoForScript(script)._locations.size); InspectorTest.addResult(""); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/components/minimum-size.html b/third_party/WebKit/LayoutTests/inspector/components/minimum-size.html index a74bec9..461fb6c5 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/minimum-size.html +++ b/third_party/WebKit/LayoutTests/inspector/components/minimum-size.html
@@ -26,14 +26,14 @@ } InspectorTest.addResult("Creating simple hierarchy"); - var splitWidget = new WebInspector.SplitWidget(true, true, "splitWidgetStateSettingName.splitWidget", 250, 250); + var splitWidget = new UI.SplitWidget(true, true, "splitWidgetStateSettingName.splitWidget", 250, 250); showRootSplitWidget(splitWidget); - var mainWidget = new WebInspector.Widget(); + var mainWidget = new UI.Widget(); mainWidget.setMinimumSize(100, 80); splitWidget.setMainWidget(mainWidget); - var firstSidebarWidget = new WebInspector.Widget(); + var firstSidebarWidget = new UI.Widget(); firstSidebarWidget.setMinimumSize(40, 70); splitWidget.setSidebarWidget(firstSidebarWidget); @@ -62,7 +62,7 @@ dumpBoundingBoxes(widgets); InspectorTest.addResult("Wrapping main widget to a split widget"); - var childsplitWidget = new WebInspector.SplitWidget(false, true, "splitWidgetStateSettingName.childsplitWidget", 100, 100); + var childsplitWidget = new UI.SplitWidget(false, true, "splitWidgetStateSettingName.childsplitWidget", 100, 100); childsplitWidget.hideSidebar(); childsplitWidget.setMainWidget(mainWidget); splitWidget.setMainWidget(childsplitWidget); @@ -70,7 +70,7 @@ dumpBoundingBoxes(widgets); InspectorTest.addResult("Adding invisble sidebar"); - var secondSidebarWidget = new WebInspector.Widget(); + var secondSidebarWidget = new UI.Widget(); secondSidebarWidget.setMinimumSize(60, 60); childsplitWidget.setSidebarWidget(secondSidebarWidget); widgets["secondSidebarWidget"] = secondSidebarWidget; @@ -86,7 +86,7 @@ dumpBoundingBoxes(widgets); InspectorTest.addResult("Attaching another sidebar"); - var thirdSidebarWidget = new WebInspector.Widget(); + var thirdSidebarWidget = new UI.Widget(); thirdSidebarWidget.setMinimumSize(80, 80); childsplitWidget.setSidebarWidget(thirdSidebarWidget); widgets["thirdSidebarWidget"] = thirdSidebarWidget;
diff --git a/third_party/WebKit/LayoutTests/inspector/components/parsed-url.html b/third_party/WebKit/LayoutTests/inspector/components/parsed-url.html index 15edb62..57098bd 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/parsed-url.html +++ b/third_party/WebKit/LayoutTests/inspector/components/parsed-url.html
@@ -7,7 +7,7 @@ { function parseAndDumpURL(url) { - var parsedURL = new WebInspector.ParsedURL(url); + var parsedURL = new Common.ParsedURL(url); InspectorTest.addResult("Parsing url: " + url); InspectorTest.addResult(" isValid: " + parsedURL.isValid);
diff --git a/third_party/WebKit/LayoutTests/inspector/components/progress-bar.html b/third_party/WebKit/LayoutTests/inspector/components/progress-bar.html index d1675f2d2..b7c3dce 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/progress-bar.html +++ b/third_party/WebKit/LayoutTests/inspector/components/progress-bar.html
@@ -11,7 +11,7 @@ } InspectorTest.MockProgressIndicator.prototype = { - // Implementation of WebInspector.Progress interface. + // Implementation of Common.Progress interface. isCanceled: function() { return this._isCanceled; @@ -69,7 +69,7 @@ function testOneSubProgress(next) { var indicator = new InspectorTest.MockProgressIndicator(); - var composite = new WebInspector.CompositeProgress(indicator); + var composite = new Common.CompositeProgress(indicator); var subProgress = composite.createSubProgress(); InspectorTest.addResult("Testing CompositeProgress with a single subprogress:"); @@ -89,7 +89,7 @@ function testMultipleSubProgresses(next) { var indicator = new InspectorTest.MockProgressIndicator(); - var composite = new WebInspector.CompositeProgress(indicator); + var composite = new Common.CompositeProgress(indicator); var subProgress1 = composite.createSubProgress(); var subProgress2 = composite.createSubProgress(3); @@ -123,7 +123,7 @@ function testCancel(next) { var indicator = new InspectorTest.MockProgressIndicator(); - var composite = new WebInspector.CompositeProgress(indicator); + var composite = new Common.CompositeProgress(indicator); var subProgress = composite.createSubProgress(); InspectorTest.addResult("Testing isCanceled:"); @@ -136,9 +136,9 @@ function testNested(next) { var indicator = new InspectorTest.MockProgressIndicator(); - var composite0 = new WebInspector.CompositeProgress(indicator); + var composite0 = new Common.CompositeProgress(indicator); var subProgress01 = composite0.createSubProgress(); - var composite1 = new WebInspector.CompositeProgress(subProgress01); + var composite1 = new Common.CompositeProgress(subProgress01); var subProgress11 = composite1.createSubProgress(10); // Weight should have no effect. InspectorTest.addResult("Testing nested subprogresses:");
diff --git a/third_party/WebKit/LayoutTests/inspector/components/segmented-range.html b/third_party/WebKit/LayoutTests/inspector/components/segmented-range.html index 8d5dc80..6441f0cc 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/segmented-range.html +++ b/third_party/WebKit/LayoutTests/inspector/components/segmented-range.html
@@ -10,12 +10,12 @@ InspectorTest.addResult("Test case: " + testName); InspectorTest.addResult("Input Segments: " + JSON.stringify(data)); - var forwardRange = new WebInspector.SegmentedRange(merge); - data.map(entry => new WebInspector.Segment(entry[0], entry[1], entry[2])).forEach(forwardRange.append, forwardRange); + var forwardRange = new Common.SegmentedRange(merge); + data.map(entry => new Common.Segment(entry[0], entry[1], entry[2])).forEach(forwardRange.append, forwardRange); var forward = forwardRange.segments(); - var backwardRange = new WebInspector.SegmentedRange(merge); - data.reverse().map(entry => new WebInspector.Segment(entry[0], entry[1], entry[2])).forEach(backwardRange.append, backwardRange); + var backwardRange = new Common.SegmentedRange(merge); + data.reverse().map(entry => new Common.Segment(entry[0], entry[1], entry[2])).forEach(backwardRange.append, backwardRange); var backward = backwardRange.segments(); // Only do reverse if we merge, otherwise result is order-dependent.
diff --git a/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes-expected.txt b/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes-expected.txt index 59a1f26..1dcaa3f 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes-expected.txt
@@ -1,4 +1,4 @@ -Tests WebInspector.TextUtils.splitStringByRegexes. +Tests Common.TextUtils.splitStringByRegexes. Running: testSimple
diff --git a/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes.html b/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes.html index 2ab726d..10e8a14 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes.html +++ b/third_party/WebKit/LayoutTests/inspector/components/split-string-by-regexes.html
@@ -9,7 +9,7 @@ function testSimple(next) { var regexes = [/hello/g, /[0-9]+/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("hello123hello123", regexes); + var results = Common.TextUtils.splitStringByRegexes("hello123hello123", regexes); dumpResults(results); next(); }, @@ -17,7 +17,7 @@ function testMatchAtStart(next) { var regexes = [/yes/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("yes thank you", regexes); + var results = Common.TextUtils.splitStringByRegexes("yes thank you", regexes); dumpResults(results); next(); }, @@ -25,7 +25,7 @@ function testMatchAtEnd(next) { var regexes = [/you/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("yes thank you", regexes); + var results = Common.TextUtils.splitStringByRegexes("yes thank you", regexes); dumpResults(results); next(); }, @@ -33,7 +33,7 @@ function testAvoidInnerMatch(next) { var regexes = [/url\("red\.com"\)/g, /red/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("image: url(\"red.com\")", regexes); + var results = Common.TextUtils.splitStringByRegexes("image: url(\"red.com\")", regexes); dumpResults(results); next(); }, @@ -41,7 +41,7 @@ function testNoMatch(next) { var regexes = [/something/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("nothing", regexes); + var results = Common.TextUtils.splitStringByRegexes("nothing", regexes); dumpResults(results); next(); }, @@ -49,7 +49,7 @@ function testNoMatches(next) { var regexes = [/something/g, /123/g, /abc/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("nothing", regexes); + var results = Common.TextUtils.splitStringByRegexes("nothing", regexes); dumpResults(results); next(); }, @@ -57,7 +57,7 @@ function testComplex(next) { var regexes = [/\(([^)]+)\)/g, /okay/g, /ka/g]; - var results = WebInspector.TextUtils.splitStringByRegexes("Start. (okay) kit-kat okay (kale) ka( ) okay. End", regexes); + var results = Common.TextUtils.splitStringByRegexes("Start. (okay) kit-kat okay (kale) ka( ) okay. End", regexes); dumpResults(results); next(); } @@ -76,7 +76,7 @@ <body onload="runTest()"> <p> -Tests WebInspector.TextUtils.splitStringByRegexes. +Tests Common.TextUtils.splitStringByRegexes. </p> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/components/split-widget.html b/third_party/WebKit/LayoutTests/inspector/components/split-widget.html index 963fc28..27a5067 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/split-widget.html +++ b/third_party/WebKit/LayoutTests/inspector/components/split-widget.html
@@ -8,9 +8,9 @@ var settingIndex = 0; function createAndShowSplitWidget(isVertical, secondIsSidebar, settingName, defaultSidebarWidth, defaultSidebarHeight, shouldSaveShowMode) { - var splitWidget = new WebInspector.SplitWidget(isVertical, secondIsSidebar, settingName, defaultSidebarWidth, defaultSidebarHeight); - splitWidget.setMainWidget(new WebInspector.Widget()); - splitWidget.setSidebarWidget(new WebInspector.Widget()); + var splitWidget = new UI.SplitWidget(isVertical, secondIsSidebar, settingName, defaultSidebarWidth, defaultSidebarHeight); + splitWidget.setMainWidget(new UI.Widget()); + splitWidget.setSidebarWidget(new UI.Widget()); if (shouldSaveShowMode) splitWidget.enableShowModeSaving(); splitWidget.element.style.position = "absolute"; @@ -28,7 +28,7 @@ var sidebarSize = splitWidget.isVertical() ? splitWidget.sidebarWidget().element.offsetWidth : splitWidget.sidebarWidget().element.offsetHeight; var orientation = splitWidget.isVertical() ? "vertical" : "horizontal"; InspectorTest.addResult(" Sidebar size = " + sidebarSize + ", showMode = " + splitWidget.showMode() + ", " + orientation); - InspectorTest.addResult(" Setting value: " + JSON.stringify(WebInspector.settings.settingForTest(splitWidget._setting._name).get())); + InspectorTest.addResult(" Setting value: " + JSON.stringify(Common.settings.settingForTest(splitWidget._setting._name).get())); } function testSplitWidgetSizes(useFraction, shouldSaveShowMode)
diff --git a/third_party/WebKit/LayoutTests/inspector/components/throttler.html b/third_party/WebKit/LayoutTests/inspector/components/throttler.html index 1b2e752e..5c7baf5 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/throttler.html +++ b/third_party/WebKit/LayoutTests/inspector/components/throttler.html
@@ -53,7 +53,7 @@ }, } - var throttler = new WebInspector.Throttler(1989); + var throttler = new Common.Throttler(1989); var timeoutMock = new InspectorTest.TimeoutMock(); throttler._setTimeout = timeoutMock.setTimeout; throttler._clearTimeout = timeoutMock.clearTimeout; @@ -197,7 +197,7 @@ { var promiseResolve; var hasFinished; - InspectorTest.addSniffer(WebInspector.Throttler.prototype, "_processCompletedForTests", onFinished); + InspectorTest.addSniffer(Common.Throttler.prototype, "_processCompletedForTests", onFinished); function onFinished() { hasFinished = true;
diff --git a/third_party/WebKit/LayoutTests/inspector/components/utilities-highlight-results.html b/third_party/WebKit/LayoutTests/inspector/components/utilities-highlight-results.html index ff309e1..1439910 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/utilities-highlight-results.html +++ b/third_party/WebKit/LayoutTests/inspector/components/utilities-highlight-results.html
@@ -40,11 +40,11 @@ { var changes = []; InspectorTest.addResult("--------- Running test: ----------"); - WebInspector.highlightRangesWithStyleClass(element, ranges, "highlighted", changes); + UI.highlightRangesWithStyleClass(element, ranges, "highlighted", changes); InspectorTest.addResult("After highlight: " + dumpTextNodesAsString(element)); - WebInspector.revertDomChanges(changes); + UI.revertDomChanges(changes); InspectorTest.addResult("After revert: " + dumpTextNodesAsString(element)); - WebInspector.applyDomChanges(changes); + UI.applyDomChanges(changes); InspectorTest.addResult("After apply: " + dumpTextNodesAsString(element)); } @@ -61,7 +61,7 @@ function range(offset, length) { - return new WebInspector.SourceRange(offset, length); + return new Common.SourceRange(offset, length); } performTestForElement(textElement(["function"]), [range(0, 8)]); // Highlight whole text node.
diff --git a/third_party/WebKit/LayoutTests/inspector/components/viewport-datagrid.html b/third_party/WebKit/LayoutTests/inspector/components/viewport-datagrid.html index 73fa59bcd..d31110b 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/viewport-datagrid.html +++ b/third_party/WebKit/LayoutTests/inspector/components/viewport-datagrid.html
@@ -43,17 +43,17 @@ } var columns = [{id: "id", title: "ID column", width: "250px"}]; - var dataGrid = new WebInspector.ViewportDataGrid(columns); - var a = new WebInspector.ViewportDataGridNode({id: "a"}); - var aa = new WebInspector.ViewportDataGridNode({id: "aa"}); - var aaa = new WebInspector.ViewportDataGridNode({id: "aaa"}); - var aab = new WebInspector.ViewportDataGridNode({id: "aab"}); - var ab = new WebInspector.ViewportDataGridNode({id: "ab"}); - var b = new WebInspector.ViewportDataGridNode({id: "b"}); + var dataGrid = new UI.ViewportDataGrid(columns); + var a = new UI.ViewportDataGridNode({id: "a"}); + var aa = new UI.ViewportDataGridNode({id: "aa"}); + var aaa = new UI.ViewportDataGridNode({id: "aaa"}); + var aab = new UI.ViewportDataGridNode({id: "aab"}); + var ab = new UI.ViewportDataGridNode({id: "ab"}); + var b = new UI.ViewportDataGridNode({id: "b"}); var root = dataGrid.rootNode(); - var dialog = new WebInspector.Dialog(); + var dialog = new UI.Dialog(); dialog.show(); var containerElement = dialog.element; containerElement.style.position = "absolute"; @@ -94,7 +94,7 @@ dumpNodes(); attach(aa, aaa); attach(aa, aab); - var aac = new WebInspector.ViewportDataGridNode({id: "aac"}); + var aac = new UI.ViewportDataGridNode({id: "aac"}); attach(aa, aac); dumpNodes(); attach(aa, aac, 0); @@ -121,7 +121,7 @@ // crbug.com/542553 -- the below should not produce exceptions. dataGrid.setStickToBottom(true); for (var i = 0; i < 500; ++i) { - var xn = new WebInspector.ViewportDataGridNode({id: "x" + i}); + var xn = new UI.ViewportDataGridNode({id: "x" + i}); root.appendChild(xn); if (i + 1 === 500) { dataGrid.updateInstantlyForTests(); @@ -134,7 +134,7 @@ // The below should not crash either. for (var i = 0; i < 40; ++i) { - var xn = new WebInspector.ViewportDataGridNode({id: "x" + i}); + var xn = new UI.ViewportDataGridNode({id: "x" + i}); root.appendChild(xn); } dataGrid.updateInstantlyForTests();
diff --git a/third_party/WebKit/LayoutTests/inspector/components/widget-events.html b/third_party/WebKit/LayoutTests/inspector/components/widget-events.html index 874e364..4cf01ce3 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/widget-events.html +++ b/third_party/WebKit/LayoutTests/inspector/components/widget-events.html
@@ -5,7 +5,7 @@ function test() { - var TestWidget = class extends WebInspector.Widget { + var TestWidget = class extends UI.Widget { constructor(widgetName) { super(); @@ -77,7 +77,7 @@ function testShowWidget(next) { var widget = new TestWidget("Widget"); - widget.show(WebInspector.inspectorView.element); + widget.show(UI.inspectorView.element); widget.detach(); next(); }, @@ -165,13 +165,13 @@ var parentWidget = new TestWidget("Parent"); var childWidget = new TestWidget("Child"); childWidget.setHideOnDetach(); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); parentWidget.doResize(); childWidget.show(parentWidget.element); parentWidget.doResize(); parentWidget.detach(); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); childWidget.detach(); parentWidget.detach(); next(); @@ -180,7 +180,7 @@ function testWidgetCounter(next) { var parentWidget = new TestWidget("Parent"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); var childWidget = new TestWidget("Child"); childWidget.show(parentWidget.element); @@ -202,7 +202,7 @@ function testRemoveChild(next) { var parentWidget = new TestWidget("Parent"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); var childWidget = new TestWidget("Child"); childWidget.show(parentWidget.element); @@ -266,7 +266,7 @@ { var parentWidget = new TestWidget("Parent"); parentWidget.showOnWasShown = new TestWidget("Child"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); parentWidget.detach(); next(); }, @@ -279,7 +279,7 @@ middleWidget.show(topWidget.element); topWidget.showOnWasShown = bottomWidget; topWidget.showRoot = middleWidget.element; - topWidget.show(WebInspector.inspectorView.element); + topWidget.show(UI.inspectorView.element); topWidget.detach(); next(); }, @@ -290,7 +290,7 @@ var childWidget = new TestWidget("Child"); childWidget.show(parentWidget.element); parentWidget.detachOnWasShown = childWidget; - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); parentWidget.detach(); next(); }, @@ -299,7 +299,7 @@ { var parentWidget = new TestWidget("Parent"); var childWidget = new TestWidget("Child"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); childWidget.show(parentWidget.element); parentWidget.showOnWillHide = childWidget; parentWidget.detach(); @@ -310,7 +310,7 @@ { var parentWidget = new TestWidget("Parent"); var childWidget = new TestWidget("Child"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); childWidget.show(parentWidget.element); parentWidget.detachOnWillHide = childWidget; parentWidget.detach(); @@ -322,8 +322,8 @@ var parentWidget1 = new TestWidget("Parent1"); var parentWidget2 = new TestWidget("Parent2"); var childWidget = new TestWidget("Child"); - parentWidget1.show(WebInspector.inspectorView.element); - parentWidget2.show(WebInspector.inspectorView.element); + parentWidget1.show(UI.inspectorView.element); + parentWidget2.show(UI.inspectorView.element); childWidget.show(parentWidget1.element); childWidget.show(parentWidget2.element); next(); @@ -335,7 +335,7 @@ var childWidget = new TestWidget("Child"); childWidget.show(parentWidget.element); parentWidget.resizeOnWasShown = childWidget; - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); parentWidget.detach(); next(); }, @@ -357,7 +357,7 @@ function testReparentWithinWidget(next) { var parentWidget = new TestWidget("Parent"); - parentWidget.show(WebInspector.inspectorView.element); + parentWidget.show(UI.inspectorView.element); var childWidget = new TestWidget("Child"); var container1 = parentWidget.element.createChild("div"); var container2 = parentWidget.element.createChild("div");
diff --git a/third_party/WebKit/LayoutTests/inspector/components/widget-focus.html b/third_party/WebKit/LayoutTests/inspector/components/widget-focus.html index d957095b..d334901 100644 --- a/third_party/WebKit/LayoutTests/inspector/components/widget-focus.html +++ b/third_party/WebKit/LayoutTests/inspector/components/widget-focus.html
@@ -6,19 +6,19 @@ function test() { var outerInput = document.createElement("input"); - WebInspector.inspectorView.element.appendChild(outerInput); + UI.inspectorView.element.appendChild(outerInput); - var mainWidget = new WebInspector.Widget(); - mainWidget.show(WebInspector.inspectorView.element); + var mainWidget = new UI.Widget(); + mainWidget.show(UI.inspectorView.element); - var widget1 = new WebInspector.Widget(); + var widget1 = new UI.Widget(); widget1.show(mainWidget.element); var input1 = document.createElement("input"); input1.id = "input1"; widget1.element.appendChild(input1); widget1.setDefaultFocusedElement(input1); - var widget2 = new WebInspector.Widget(); + var widget2 = new UI.Widget(); widget2.show(mainWidget.element); var input2 = document.createElement("input"); input2.id = "input2"; @@ -47,15 +47,15 @@ mainWidget.focus(); dumpFocus(); - var splitWidget = new WebInspector.SplitWidget(); + var splitWidget = new UI.SplitWidget(); splitWidget.show(mainWidget.element); - var widget3 = new WebInspector.Widget(); + var widget3 = new UI.Widget(); var input3 = document.createElement("input"); input1.id = "input3"; widget3.element.appendChild(input3); widget3.setDefaultFocusedElement(input3); splitWidget.setSidebarWidget(widget3); - var widget4 = new WebInspector.Widget(); + var widget4 = new UI.Widget(); var input4 = document.createElement("input"); input4.id = "input4"; widget4.element.appendChild(input4);
diff --git a/third_party/WebKit/LayoutTests/inspector/console/command-line-api.html b/third_party/WebKit/LayoutTests/inspector/console/command-line-api.html index 99d5f3b5..132908ff 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/command-line-api.html +++ b/third_party/WebKit/LayoutTests/inspector/console/command-line-api.html
@@ -38,7 +38,7 @@ step2(); return; } - WebInspector.console.log(""); + Common.console.log(""); InspectorTest.evaluateInConsole(expression, step1); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-big-array.html b/third_party/WebKit/LayoutTests/inspector/console/console-big-array.html index 2537f5a3..bb5660ab 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-big-array.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-big-array.html
@@ -59,9 +59,9 @@ function test() { - WebInspector.ArrayGroupingTreeElement._bucketThreshold = 20; + Components.ArrayGroupingTreeElement._bucketThreshold = 20; - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; var sections = []; for (var i = 0; i < messages.length; ++i) { var consoleMessage = messages[i].consoleMessage(); @@ -76,7 +76,7 @@ } } - InspectorTest.addSniffer(WebInspector.ArrayGroupingTreeElement.prototype, "onpopulate", populateCalled, true); + InspectorTest.addSniffer(Components.ArrayGroupingTreeElement.prototype, "onpopulate", populateCalled, true); var populated = false; function populateCalled() {
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-clear.html b/third_party/WebKit/LayoutTests/inspector/console/console-clear.html index 5afb5ae..138259e 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-clear.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-clear.html
@@ -19,7 +19,7 @@ InspectorTest.addResult("=== Before clear ==="); InspectorTest.dumpConsoleMessages(); - WebInspector.ConsoleView.clearConsole(); + Console.ConsoleView.clearConsole(); function callback() {
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-copy-treeoutline.html b/third_party/WebKit/LayoutTests/inspector/console/console-copy-treeoutline.html index 9b57c164..4931076 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-copy-treeoutline.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-copy-treeoutline.html
@@ -19,7 +19,7 @@ function test() { InspectorTest.fixConsoleViewportDimensions(600, 200); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewport = consoleView._viewport; InspectorTest.runTestSuite([
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html index 4d826eb..b9ceea6 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
@@ -17,7 +17,7 @@ function testCompletions(text, expected, force) { consoleEditor.setText(text); - consoleEditor.setSelection(WebInspector.TextRange.createFromLocation(Infinity, Infinity)); + consoleEditor.setSelection(Common.TextRange.createFromLocation(Infinity, Infinity)); consoleEditor._autocompleteController.autocomplete(force); return InspectorTest.addSnifferPromise(consoleEditor._autocompleteController, "_onSuggestionsShownForTest").then(checkExpected);
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-custom-formatters.html b/third_party/WebKit/LayoutTests/inspector/console/console-custom-formatters.html index 867ed99e..19e2adc 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-custom-formatters.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-custom-formatters.html
@@ -136,7 +136,7 @@ function expandVariablesInConsole() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); if (consoleView._needsFullUpdate) consoleView._updateMessageList(); var viewMessages = consoleView._visibleViewMessages;
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html b/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html index 718f57c..bfb2840 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html
@@ -28,7 +28,7 @@ function getPropertiesCallback(properties) { - properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); + properties.sort(Components.ObjectPropertiesSection.CompareProperties); var golden = { "window": 1, "document": 1, "eval": 1, "console": 1, "frames": 1, "Array": 1, "doit": 1 }; var result = {}; for (var i = 0; i < properties.length; ++i) {
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-edit-expanded-tree.html b/third_party/WebKit/LayoutTests/inspector/console/console-edit-expanded-tree.html index 4566896..4e85c61 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-edit-expanded-tree.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-edit-expanded-tree.html
@@ -20,7 +20,7 @@ function onConsoleMessageExpanded() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; ++i) { var message = messages[i]; var node = message.contentElement(); @@ -36,7 +36,7 @@ function onTreeElement(treeElement) { treeElement._startEditing(); - WebInspector.ConsoleView.instance()._viewport.refresh(); + Console.ConsoleView.instance()._viewport.refresh(); InspectorTest.addResult("After viewport refresh tree element remains in editing mode: " + !!treeElement._prompt); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html b/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html index d096dc5..b668804 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html
@@ -48,7 +48,7 @@ function getValueElements() { - var messageElement = WebInspector.ConsoleView.instance()._visibleViewMessages[1].element(); + var messageElement = Console.ConsoleView.instance()._visibleViewMessages[1].element(); return messageElement.querySelectorAll("::shadow .value"); } @@ -60,7 +60,7 @@ InspectorTest.addResult("Node was hidden after dblclick: " + node.classList.contains("hidden")); - var messageElement = WebInspector.ConsoleView.instance()._visibleViewMessages[1].element(); + var messageElement = Console.ConsoleView.instance()._visibleViewMessages[1].element(); var editPrompt = messageElement.querySelector("::shadow .text-prompt"); editPrompt.textContent = text; editPrompt.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-eval-exception-report.html b/third_party/WebKit/LayoutTests/inspector/console/console-eval-exception-report.html index d1c7b24..783ae6e 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-eval-exception-report.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-eval-exception-report.html
@@ -20,7 +20,7 @@ { InspectorTest.dumpConsoleMessages(); - var viewMessages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var viewMessages = Console.ConsoleView.instance()._visibleViewMessages; var uiMessage = viewMessages[viewMessages.length - 1]; var message = uiMessage.consoleMessage(); var stackTrace = message.stackTrace;
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-eval-scoped.html b/third_party/WebKit/LayoutTests/inspector/console/console-eval-scoped.html index 2596f1a..81b83a4 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-eval-scoped.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-eval-scoped.html
@@ -49,7 +49,7 @@ { InspectorTest.deprecatedRunAfterPendingDispatches(function() { InspectorTest.dumpConsoleMessages(); - WebInspector.ConsoleView.clearConsole(); + Console.ConsoleView.clearConsole(); InspectorTest.deprecatedRunAfterPendingDispatches(next); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-eval-throw.html b/third_party/WebKit/LayoutTests/inspector/console/console-eval-throw.html index cec6ce35..fa8af2be 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-eval-throw.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-eval-throw.html
@@ -9,12 +9,12 @@ { InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(); - InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared); - WebInspector.ConsoleView.clearConsole(); + InspectorTest.consoleModel.addEventListener(SDK.ConsoleModel.Events.ConsoleCleared, afterCleared); + Console.ConsoleView.clearConsole(); function afterCleared() { - InspectorTest.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared); + InspectorTest.consoleModel.removeEventListener(SDK.ConsoleModel.Events.ConsoleCleared, afterCleared); next(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html b/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html index e21cdd8..ba8661ce 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-filter-level-test.html
@@ -29,7 +29,7 @@ { function dumpVisibleMessages() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; i++) InspectorTest.addResult(">" + messages[i].toMessageElement().deepTextContent()); @@ -45,45 +45,45 @@ function onlyWarning(next) { - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("warning"); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("warning"); dumpVisibleMessages(); next(); }, function onlyLog(next) { - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("log"); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("log"); dumpVisibleMessages(); next(); }, function onlyErrorDebug(next) { - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("error"); - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("debug", true); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("error"); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("debug", true); dumpVisibleMessages(); next(); }, function onlyAbcMessagePlain(next) { - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter(WebInspector.NamedBitSetFilterUI.ALL_TYPES); - WebInspector.ConsoleView.instance()._filter._textFilterUI.setValue("abc"); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter(UI.NamedBitSetFilterUI.ALL_TYPES); + Console.ConsoleView.instance()._filter._textFilterUI.setValue("abc"); dumpVisibleMessages(); next(); }, function onlyAbcMessageRegex(next) { - WebInspector.ConsoleView.instance()._filter._textFilterUI._regexCheckBox.checked = "checked"; - WebInspector.ConsoleView.instance()._filter._textFilterUI.setValue("ab[a-z]"); + Console.ConsoleView.instance()._filter._textFilterUI._regexCheckBox.checked = "checked"; + Console.ConsoleView.instance()._filter._textFilterUI.setValue("ab[a-z]"); dumpVisibleMessages(); next(); }, function onlyAbcMessageRegexWarning(next) { - WebInspector.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("warning", false); + Console.ConsoleView.instance()._filter._levelFilterUI._toggleTypeFilter("warning", false); dumpVisibleMessages(); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html b/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html index 041ded66..f47c9a0f 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-filter-test.html
@@ -43,11 +43,11 @@ function test() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; function dumpVisibleMessages() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; ++i) { var viewMessage = messages[i]; var delimeter = viewMessage.consoleMessage().isGroupStartMessage() ? ">" : ""; @@ -70,43 +70,43 @@ }, function addURL1Filter(next) { - WebInspector.ConsoleView.instance()._filter.addMessageURLFilter(url1); + Console.ConsoleView.instance()._filter.addMessageURLFilter(url1); dumpVisibleMessages(); next(); }, function addURL2Filter(next) { - WebInspector.ConsoleView.instance()._filter.addMessageURLFilter(url2); + Console.ConsoleView.instance()._filter.addMessageURLFilter(url2); dumpVisibleMessages(); next(); }, function removeURL1Filter(next) { - WebInspector.ConsoleView.instance()._filter.removeMessageURLFilter(url1); + Console.ConsoleView.instance()._filter.removeMessageURLFilter(url1); dumpVisibleMessages(); next(); }, function restoreURL1Filter(next) { - WebInspector.ConsoleView.instance()._filter.addMessageURLFilter(url1); + Console.ConsoleView.instance()._filter.addMessageURLFilter(url1); dumpVisibleMessages(); next(); }, function removeAllFilters(next) { - WebInspector.ConsoleView.instance()._filter.removeMessageURLFilter(); + Console.ConsoleView.instance()._filter.removeMessageURLFilter(); dumpVisibleMessages(); next(); }, function checkTextFilter(next) { - WebInspector.ConsoleView.instance()._filter._textFilterUI.setValue("outer"); + Console.ConsoleView.instance()._filter._textFilterUI.setValue("outer"); dumpVisibleMessages(); next(); }, function checkResetFilter(next) { - WebInspector.ConsoleView.instance()._filter.reset(); + Console.ConsoleView.instance()._filter.reset(); dumpVisibleMessages(); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-format-broken-unicode.html b/third_party/WebKit/LayoutTests/inspector/console/console-format-broken-unicode.html index 1aed4e4..8345395 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-format-broken-unicode.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-format-broken-unicode.html
@@ -57,7 +57,7 @@ InspectorTest.disableConsoleViewport(); var count = 0; - var viewMessages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var viewMessages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var node = viewMessages[i].contentElement(); var currentNode = node;
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-history-contains-requested-text.html b/third_party/WebKit/LayoutTests/inspector/console/console-history-contains-requested-text.html index dbbbb07..827cb3b 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-history-contains-requested-text.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-history-contains-requested-text.html
@@ -9,7 +9,7 @@ InspectorTest.evaluateInConsole("{a:1, b:2}", step2); function step2() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); InspectorTest.addResult(consoleView._prompt.history().previous()); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-last-result.html b/third_party/WebKit/LayoutTests/inspector/console/console-last-result.html index 0f9047f..e203d86 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-last-result.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-last-result.html
@@ -23,7 +23,7 @@ function step1() { - WebInspector.ConsoleView.clearConsole(); + Console.ConsoleView.clearConsole(); InspectorTest.deprecatedRunAfterPendingDispatches(step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-link-to-snippet.html b/third_party/WebKit/LayoutTests/inspector/console/console-link-to-snippet.html index 247ef9a3..c84e352 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-link-to-snippet.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-link-to-snippet.html
@@ -7,14 +7,14 @@ function test() { - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addLineMessage", dumpLineMessage, true); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addLineMessage", dumpLineMessage, true); InspectorTest.runTestSuite([ function testConsoleLogAndReturnMessageLocation(next) { InspectorTest.waitUntilNthMessageReceivedPromise(2) .then(() => InspectorTest.dumpConsoleMessages()) - .then(() => WebInspector.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise("console.log(239);42") @@ -27,7 +27,7 @@ { InspectorTest.waitUntilNthMessageReceivedPromise(1) .then(() => InspectorTest.dumpConsoleMessages()) - .then(() => WebInspector.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise("\n }") @@ -40,7 +40,7 @@ { InspectorTest.waitUntilNthMessageReceivedPromise(1) .then(() => InspectorTest.dumpConsoleMessages()) - .then(() => WebInspector.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise("\n console.error(42);") @@ -54,7 +54,7 @@ { var callback; var promise = new Promise(fullfill => callback = fullfill); - WebInspector.scriptSnippetModel._project.createFile("", null, content, callback); + Snippets.scriptSnippetModel._project.createFile("", null, content, callback); return promise; } @@ -68,7 +68,7 @@ function selectSourceCode(uiSourceCode) { - return WebInspector.Revealer.revealPromise(uiSourceCode).then(() => uiSourceCode); + return Common.Revealer.revealPromise(uiSourceCode).then(() => uiSourceCode); } function dumpLineMessage(level, text, lineNumber, columnNumber) @@ -78,7 +78,7 @@ function runSelectedSnippet() { - WebInspector.SourcesPanel.instance()._runSnippet(); + Sources.SourcesPanel.instance()._runSnippet(); } } </script>
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-linkify-message-location.html b/third_party/WebKit/LayoutTests/inspector/console/console-linkify-message-location.html index 2aa0268..525502fb 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-linkify-message-location.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-linkify-message-location.html
@@ -26,25 +26,25 @@ { dumpConsoleMessageURLs(); - InspectorTest.addSniffer(WebInspector.BlackboxManager.prototype, "_patternChangeFinishedForTests", step2); + InspectorTest.addSniffer(Bindings.BlackboxManager.prototype, "_patternChangeFinishedForTests", step2); var frameworkRegexString = "foo\\.js"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); } function step2() { dumpConsoleMessageURLs(); - InspectorTest.addSniffer(WebInspector.BlackboxManager.prototype, "_patternChangeFinishedForTests", step3); + InspectorTest.addSniffer(Bindings.BlackboxManager.prototype, "_patternChangeFinishedForTests", step3); var frameworkRegexString = "foo\\.js|boo\\.js"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); } function step3() { dumpConsoleMessageURLs(); - InspectorTest.addSniffer(WebInspector.BlackboxManager.prototype, "_patternChangeFinishedForTests", step4); + InspectorTest.addSniffer(Bindings.BlackboxManager.prototype, "_patternChangeFinishedForTests", step4); var frameworkRegexString = ""; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); } function step4() @@ -55,7 +55,7 @@ function dumpConsoleMessageURLs() { - var messages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var messages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < messages.length; ++i) { var element = messages[i].toMessageElement(); var anchor = element.querySelector(".console-message-url");
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-links.html b/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-links.html index 4cce568..ecd620f 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-links.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-links.html
@@ -15,7 +15,7 @@ InspectorTest.dumpConsoleMessages(false, true); InspectorTest.addResult("Dump urls in messages"); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewMessages = consoleView._visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var uiMessage = viewMessages[i];
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-log-wrapped-in-framework.html b/third_party/WebKit/LayoutTests/inspector/console/console-log-wrapped-in-framework.html index 2c5517c..ede36a7 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-log-wrapped-in-framework.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-log-wrapped-in-framework.html
@@ -14,7 +14,7 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.evaluateInPage("runLogs()"); InspectorTest.deprecatedRunAfterPendingDispatches(callback);
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-preserve-log.html b/third_party/WebKit/LayoutTests/inspector/console/console-preserve-log.html index bb98fbe..9e34fe5e 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-preserve-log.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-preserve-log.html
@@ -5,11 +5,11 @@ <script> function test() { - InspectorTest.consoleModel.addMessage(new WebInspector.ConsoleMessage(InspectorTest.consoleModel.target(), WebInspector.ConsoleMessage.MessageSource.Other, WebInspector.ConsoleMessage.MessageLevel.Log, "PASS")); - WebInspector.settingForTest("preserveConsoleLog").set(true); + InspectorTest.consoleModel.addMessage(new SDK.ConsoleMessage(InspectorTest.consoleModel.target(), SDK.ConsoleMessage.MessageSource.Other, SDK.ConsoleMessage.MessageLevel.Log, "PASS")); + Common.settingForTest("preserveConsoleLog").set(true); InspectorTest.reloadPage(function() { InspectorTest.dumpConsoleMessages(); - WebInspector.settingForTest("preserveConsoleLog").set(false); + Common.settingForTest("preserveConsoleLog").set(false); InspectorTest.completeTest(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-proxy.html b/third_party/WebKit/LayoutTests/inspector/console/console-proxy.html index 9352c97..dd79707c 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-proxy.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-proxy.html
@@ -30,7 +30,7 @@ function dumpMessages() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); consoleView._viewport.invalidate() var element = consoleView._visibleViewMessages[0].contentElement(); @@ -46,7 +46,7 @@ function dumpExpandedConsoleMessages() { - var element = WebInspector.ConsoleView.instance()._visibleViewMessages[0].contentElement(); + var element = Console.ConsoleView.instance()._visibleViewMessages[0].contentElement(); dumpNoteVisible(element, "info-note"); InspectorTest.dumpConsoleMessages(false, true);
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing.html b/third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing.html index 20dcada..02cad42 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-retain-autocomplete-on-typing.html
@@ -21,7 +21,7 @@ var testSuite = [ function testSummonSuggestBox(next) { - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); InspectorTest.typeIn(consoleEditor, "f"); function onSuggestionsShown() @@ -33,8 +33,8 @@ function testTypeText(next) { - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onCursorActivityHandledForTest", onCursorActivityHandled); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onCursorActivityHandledForTest", onCursorActivityHandled); InspectorTest.typeIn(consoleEditor, "o"); function onSuggestionsHidden()
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error-in-worker.html b/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error-in-worker.html index 2266f5f6..50fcf62 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error-in-worker.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error-in-worker.html
@@ -18,8 +18,8 @@ function test() { - WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, InspectorTest.wrapListener(messageAdded)); - WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated, InspectorTest.wrapListener(messageUpdated)); + SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, InspectorTest.wrapListener(messageAdded)); + SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.MessageUpdated, InspectorTest.wrapListener(messageUpdated)); InspectorTest.addResult("Creating worker with promise"); InspectorTest.evaluateInPageWithTimeout("createPromise()"); @@ -29,7 +29,7 @@ InspectorTest.addResult(""); InspectorTest.addResult("Message added: " + event.data.level + " " + event.data.type); - if (event.data.level === WebInspector.ConsoleMessage.MessageLevel.Error) { + if (event.data.level === SDK.ConsoleMessage.MessageLevel.Error) { InspectorTest.dumpConsoleCounters(); InspectorTest.addResult(""); InspectorTest.addResult("Handling promise");
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error.html b/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error.html index 430ec13..a212edd 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-revoke-error.html
@@ -21,7 +21,7 @@ function test() { var messageAddedListener = InspectorTest.wrapListener(messageAdded); - InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAddedListener); + InspectorTest.consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, messageAddedListener); InspectorTest.addResult("Creating promise"); InspectorTest.evaluateInPageWithTimeout("createPromises()"); @@ -34,11 +34,11 @@ return; messageNumber = 0; - InspectorTest.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAddedListener); + InspectorTest.consoleModel.removeEventListener(SDK.ConsoleModel.Events.MessageAdded, messageAddedListener); InspectorTest.addResult(""); // Process array as a batch. - InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated, InspectorTest.wrapListener(messageUpdated)); + InspectorTest.consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageUpdated, InspectorTest.wrapListener(messageUpdated)); InspectorTest.dumpConsoleCounters(); InspectorTest.addResult(""); InspectorTest.addResult("Handling promise");
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var.html b/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var.html index 8a49a21..e057e8c 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var.html
@@ -43,11 +43,11 @@ function didEvaluate(result, exceptionDetails) { InspectorTest.assertTrue(!exceptionDetails, "FAIL: was thrown. Expression: " + expression); - WebInspector.panels.sources._saveToTempVariable(result); + UI.panels.sources._saveToTempVariable(result); InspectorTest.waitUntilNthMessageReceived(2, evaluateNext); } - WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, undefined, didEvaluate); + UI.context.flavor(SDK.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, undefined, didEvaluate); } function dumpConsoleMessages()
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-search-reveals-messages.html b/third_party/WebKit/LayoutTests/inspector/console/console-search-reveals-messages.html index 8c1579f..e2afcd34 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-search-reveals-messages.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-search-reveals-messages.html
@@ -13,7 +13,7 @@ function test() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewport = consoleView._viewport; const maximumViewportMessagesCount = 150; InspectorTest.runTestSuite([
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-search.html b/third_party/WebKit/LayoutTests/inspector/console/console-search.html index afbd673..125cc27 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-search.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-search.html
@@ -50,7 +50,7 @@ addResult(""); } - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewport = consoleView._viewport; const maximumViewportMessagesCount = 150; InspectorTest.runTestSuite([
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-smart-enter.html b/third_party/WebKit/LayoutTests/inspector/console/console-smart-enter.html index 294767e10..aa9b843b 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-smart-enter.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-smart-enter.html
@@ -5,7 +5,7 @@ <script> function test() { - var prompt = WebInspector.ConsoleView.instance()._prompt; + var prompt = Console.ConsoleView.instance()._prompt; InspectorTest.waitUntilConsoleEditorLoaded().then(step1); function step1() @@ -58,7 +58,7 @@ { var fulfill; var promise = new Promise(x => fulfill = x); - InspectorTest.addSniffer(WebInspector.ConsolePrompt.prototype, "_enterProcessedForTest", enterProcessed); + InspectorTest.addSniffer(Console.ConsolePrompt.prototype, "_enterProcessedForTest", enterProcessed); prompt.setText(text); prompt.moveCaretToEndOfPrompt();
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-stack-overflow.html b/third_party/WebKit/LayoutTests/inspector/console/console-stack-overflow.html index 987fbf9..ea6903e 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-stack-overflow.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-stack-overflow.html
@@ -19,7 +19,7 @@ function step2() { - if (WebInspector.ConsoleView.instance()._visibleViewMessages.length < 1) + if (Console.ConsoleView.instance()._visibleViewMessages.length < 1) InspectorTest.addConsoleSniffer(step2); else step3();
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-timestamp.html b/third_party/WebKit/LayoutTests/inspector/console/console-timestamp.html index 5c8dbfc2..5575307 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-timestamp.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-timestamp.html
@@ -13,10 +13,10 @@ function addMessageWithFixedTimestamp(messageText, timestamp) { - var message = new WebInspector.ConsoleMessage( + var message = new SDK.ConsoleMessage( InspectorTest.consoleModel.target(), - WebInspector.ConsoleMessage.MessageSource.Other, // source - WebInspector.ConsoleMessage.MessageLevel.Log, // level + SDK.ConsoleMessage.MessageSource.Other, // source + SDK.ConsoleMessage.MessageLevel.Log, // level messageText, undefined, // type undefined, // url @@ -37,14 +37,14 @@ InspectorTest.dumpConsoleMessages(); InspectorTest.addResult("Console messages with timestamps enabled:"); - WebInspector.settingForTest("consoleTimestampsEnabled").set(true); + Common.settingForTest("consoleTimestampsEnabled").set(true); addMessageWithFixedTimestamp("<After>", baseTimestamp + 1000); addMessageWithFixedTimestamp("<After>", baseTimestamp + 1000); addMessageWithFixedTimestamp("<After>", baseTimestamp + 1456); - WebInspector.settingForTest("consoleTimestampsEnabled").set(false); - WebInspector.settingForTest("consoleTimestampsEnabled").set(true); + Common.settingForTest("consoleTimestampsEnabled").set(false); + Common.settingForTest("consoleTimestampsEnabled").set(true); InspectorTest.dumpConsoleMessages(); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-in-eval.html b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-in-eval.html index 6f45632..a32b670 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-in-eval.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-in-eval.html
@@ -42,7 +42,7 @@ function step3() { - if (WebInspector.ConsoleView.instance()._visibleViewMessages.length < 2) + if (Console.ConsoleView.instance()._visibleViewMessages.length < 2) InspectorTest.addConsoleSniffer(step3); else step4();
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-in-worker.html b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-in-worker.html index 7c6ff69..1ffcac98 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-in-worker.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-in-worker.html
@@ -20,7 +20,7 @@ { var count = InspectorTest.consoleMessagesCount(); if (count === 2) - WebInspector.console.showPromise().then(expand); + Common.console.showPromise().then(expand); } function expand()
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise.html b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise.html index 36104495..794a4ad 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise.html
@@ -96,7 +96,7 @@ function test() { InspectorTest.addConsoleViewSniffer(checkConsoleMessages, true); - WebInspector.console.showPromise(); + Common.console.showPromise(); checkConsoleMessages();
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html index c991d79..0671137 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-selection.html
@@ -16,7 +16,7 @@ function test() { InspectorTest.fixConsoleViewportDimensions(600, 200); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewport = consoleView._viewport; const minimumViewportMessagesCount = 10; const messagesCount = 150;
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-stick-to-bottom.html b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-stick-to-bottom.html index abf1167e4..d183a277f 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-viewport-stick-to-bottom.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-viewport-stick-to-bottom.html
@@ -19,7 +19,7 @@ { var viewportHeight = 200; InspectorTest.fixConsoleViewportDimensions(600, viewportHeight); - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var viewport = consoleView._viewport; const minimumViewportMessagesCount = 10; const messagesCount = 150; @@ -61,7 +61,7 @@ function testSmoothScrollDoesNotStickToBottom(next) { - InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_updateViewportStickinessForTest", onUpdateTimeout); + InspectorTest.addSniffer(Console.ConsoleView.prototype, "_updateViewportStickinessForTest", onUpdateTimeout); sendPageUp(); function onUpdateTimeout() @@ -104,7 +104,7 @@ consoleView._updateStickToBottomOnMouseDown(); viewport.element.scrollTop -= 10; - InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_scheduleViewportRefreshForTest", onMessageAdded); + InspectorTest.addSniffer(Console.ConsoleView.prototype, "_scheduleViewportRefreshForTest", onMessageAdded); InspectorTest.evaluateInConsole("1 + 1"); /** @@ -113,8 +113,8 @@ function onMessageAdded(muted) { InspectorTest.addResult("New messages were muted: " + muted); - InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_scheduleViewportRefreshForTest", onMouseUpScheduledRefresh); - InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_updateViewportStickinessForTest", onUpdateStickiness); + InspectorTest.addSniffer(Console.ConsoleView.prototype, "_scheduleViewportRefreshForTest", onMouseUpScheduledRefresh); + InspectorTest.addSniffer(Console.ConsoleView.prototype, "_updateViewportStickinessForTest", onUpdateStickiness); consoleView._updateStickToBottomOnMouseUp(); } @@ -137,7 +137,7 @@ var text = "Foo"; for (var i = 0; i < viewportHeight; i++) text += "\n"; - WebInspector.ConsoleView.clearConsole(); + Console.ConsoleView.clearConsole(); consoleView._prompt.setText(text); viewport.element.scrollTop -= 10;
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-xpath.html b/third_party/WebKit/LayoutTests/inspector/console/console-xpath.html index 405ee5e56..03756b0 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/console-xpath.html +++ b/third_party/WebKit/LayoutTests/inspector/console/console-xpath.html
@@ -6,7 +6,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.ConsoleViewMessage.prototype, "_formattedParameterAsNodeForTest", formattedParameter, true); + InspectorTest.addSniffer(Console.ConsoleViewMessage.prototype, "_formattedParameterAsNodeForTest", formattedParameter, true); InspectorTest.addConsoleViewSniffer(messageSniffer, true); InspectorTest.evaluateInConsole("$x('42')"); // number
diff --git a/third_party/WebKit/LayoutTests/inspector/console/shadow-element.html b/third_party/WebKit/LayoutTests/inspector/console/shadow-element.html index 9fd255b..05bb118 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/shadow-element.html +++ b/third_party/WebKit/LayoutTests/inspector/console/shadow-element.html
@@ -7,7 +7,7 @@ function test() { - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.selectNodeWithId("shadow", step1); function step1() @@ -22,7 +22,7 @@ function step4(node) { - WebInspector.panels.elements.revealAndSelectNode(node.shadowRoots()[0]); + UI.panels.elements.revealAndSelectNode(node.shadowRoots()[0]); InspectorTest.evaluateInConsoleAndDump("'User agent shadow host: ' + $0.id", step5); }
diff --git a/third_party/WebKit/LayoutTests/inspector/console/worker-eval-contains-stack.html b/third_party/WebKit/LayoutTests/inspector/console/worker-eval-contains-stack.html index a751418c..a53eaf07 100644 --- a/third_party/WebKit/LayoutTests/inspector/console/worker-eval-contains-stack.html +++ b/third_party/WebKit/LayoutTests/inspector/console/worker-eval-contains-stack.html
@@ -10,7 +10,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executionContextCreated", contextCreated); + InspectorTest.addSniffer(SDK.RuntimeModel.prototype, "_executionContextCreated", contextCreated); InspectorTest.evaluateInPage("startWorker()"); function contextCreated()
diff --git a/third_party/WebKit/LayoutTests/inspector/cookie-resource-match.html b/third_party/WebKit/LayoutTests/inspector/cookie-resource-match.html index cd2f5f1..1a99947 100644 --- a/third_party/WebKit/LayoutTests/inspector/cookie-resource-match.html +++ b/third_party/WebKit/LayoutTests/inspector/cookie-resource-match.html
@@ -54,7 +54,7 @@ for (var i = 0; i < cookies.length; ++i) { var cookieResult = []; for (var j = 0; j < resourceURLs.length; ++j) { - if (WebInspector.Cookies.cookieMatchesResourceURL(cookies[i], resourceURLs[j])) + if (SDK.Cookies.cookieMatchesResourceURL(cookies[i], resourceURLs[j])) cookieResult.push(j); } InspectorTest.addResult("[" + cookieResult + "]"); @@ -75,7 +75,7 @@ secure: secure, session: true }; - return WebInspector.Cookies._parseProtocolCookie(WebInspector.targetManager.mainTarget(), protocolCookie); + return SDK.Cookies._parseProtocolCookie(SDK.targetManager.mainTarget(), protocolCookie); } } </script>
diff --git a/third_party/WebKit/LayoutTests/inspector/curl-command.html b/third_party/WebKit/LayoutTests/inspector/curl-command.html index 0e9a423..4be83f1 100644 --- a/third_party/WebKit/LayoutTests/inspector/curl-command.html +++ b/third_party/WebKit/LayoutTests/inspector/curl-command.html
@@ -6,11 +6,11 @@ var test = function() { - var logView = WebInspector.panels.network._networkLogView; + var logView = UI.panels.network._networkLogView; function newRequest(headers, data, opt_url) { - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), 0, opt_url || 'http://example.org/path', 0, 0, 0); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), 0, opt_url || 'http://example.org/path', 0, 0, 0); request.requestMethod = data ? "POST" : "GET"; var headerList = []; if (headers) {
diff --git a/third_party/WebKit/LayoutTests/inspector/database-table-name-excaping.html b/third_party/WebKit/LayoutTests/inspector/database-table-name-excaping.html index 4aa9ec7..7824e00 100644 --- a/third_party/WebKit/LayoutTests/inspector/database-table-name-excaping.html +++ b/third_party/WebKit/LayoutTests/inspector/database-table-name-excaping.html
@@ -7,7 +7,7 @@ function test() { var tableName = "table-name-with-dashes-and-\"quotes\""; - var escapedTableName = WebInspector.DatabaseTableView.prototype._escapeTableName(tableName, "", true); + var escapedTableName = Resources.DatabaseTableView.prototype._escapeTableName(tableName, "", true); InspectorTest.addResult("Original value: " + tableName); InspectorTest.addResult("Escaped value: " + escapedTableName); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html index d6b3848..ab950bd 100644 --- a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html +++ b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-responsive.html
@@ -8,7 +8,7 @@ var phone0 = InspectorTest.buildFakePhone(); var phone1 = InspectorTest.buildFakePhone(); - var view = new WebInspector.DeviceModeView(); + var view = new Emulation.DeviceModeView(); var toolbar = view._toolbar; var model = view._model; var viewportSize = new Size(320, 480);
diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html index f024481..caad2e0 100644 --- a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html +++ b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-switching-devices.html
@@ -8,7 +8,7 @@ var phone0 = InspectorTest.buildFakePhone(); var phone1 = InspectorTest.buildFakePhone(); - var view = new WebInspector.DeviceModeView(); + var view = new Emulation.DeviceModeView(); var toolbar = view._toolbar; var model = view._model; var viewportSize = new Size(800, 600);
diff --git a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-test.js b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-test.js index e7e41238..e41ea9e 100644 --- a/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-test.js +++ b/third_party/WebKit/LayoutTests/inspector/device-mode/device-mode-test.js
@@ -27,6 +27,6 @@ ] }; var json = Object.assign(StandardPhoneJSON, overrides || {}); - return WebInspector.EmulatedDevice.fromJSONV1(json); + return Emulation.EmulatedDevice.fromJSONV1(json); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/diff-module.html b/third_party/WebKit/LayoutTests/inspector/diff-module.html index 72d8bee..52d8701 100644 --- a/third_party/WebKit/LayoutTests/inspector/diff-module.html +++ b/third_party/WebKit/LayoutTests/inspector/diff-module.html
@@ -10,12 +10,12 @@ function test() { - print(WebInspector.Diff.charDiff("test this sentence.", "test that sentence")); - print(WebInspector.Diff.lineDiff(["test this sentence."], ["test that sentence"])); - print(WebInspector.Diff.lineDiff(["a", "b", "c"], ["a", "c"])); - print(WebInspector.Diff.lineDiff(["a", "b", "c"], ["b", "a", "c"])); - print(WebInspector.Diff.lineDiff(["a", "c"], ["a", "b", "c"])); - print(WebInspector.Diff.lineDiff( + print(Diff.Diff.charDiff("test this sentence.", "test that sentence")); + print(Diff.Diff.lineDiff(["test this sentence."], ["test that sentence"])); + print(Diff.Diff.lineDiff(["a", "b", "c"], ["a", "c"])); + print(Diff.Diff.lineDiff(["a", "b", "c"], ["b", "a", "c"])); + print(Diff.Diff.lineDiff(["a", "c"], ["a", "b", "c"])); + print(Diff.Diff.lineDiff( [ "for (var i = 0; i < 100; i++) {", " willBeLeftAlone()", @@ -42,13 +42,13 @@ for (var i = 0; i < results.length; i++) { var result = results[i]; var type = "Unknown"; - if (result[0] === WebInspector.Diff.Operation.Equal) + if (result[0] === Diff.Diff.Operation.Equal) type = "="; - else if (result[0] === WebInspector.Diff.Operation.Insert) + else if (result[0] === Diff.Diff.Operation.Insert) type = "+"; - else if (result[0] === WebInspector.Diff.Operation.Delete) + else if (result[0] === Diff.Diff.Operation.Delete) type = "-"; - else if (result[0] === WebInspector.Diff.Operation.Edit) + else if (result[0] === Diff.Diff.Operation.Edit) type = "E"; InspectorTest.addResult(type + ": " + JSON.stringify(result[1], null, 4)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/editor-test.js b/third_party/WebKit/LayoutTests/inspector/editor/editor-test.js index 4fe9ae1e4..7fc0d21 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/editor-test.js +++ b/third_party/WebKit/LayoutTests/inspector/editor/editor-test.js
@@ -3,11 +3,11 @@ InspectorTest.createTestEditor = function(clientHeight, textEditorDelegate) { - var textEditor = new WebInspector.SourcesTextEditor(textEditorDelegate || new WebInspector.SourcesTextEditorDelegate()); + var textEditor = new SourceFrame.SourcesTextEditor(textEditorDelegate || new SourceFrame.SourcesTextEditorDelegate()); clientHeight = clientHeight || 100; textEditor.element.style.height = clientHeight + "px"; textEditor.element.style.flex = "none"; - textEditor.show(WebInspector.inspectorView.element); + textEditor.show(UI.inspectorView.element); return textEditor; }; @@ -22,7 +22,7 @@ } var lines = text.split("\n"); - selections.sort(WebInspector.TextRange.comparator); + selections.sort(Common.TextRange.comparator); for (var i = selections.length - 1; i >= 0; --i) { var selection = selections[i]; selection = selection.normalize(); @@ -52,7 +52,7 @@ selection.from = selection.column; selection.to = selection.column; } - coords.push(new WebInspector.TextRange(selection.line, selection.from, selection.line, selection.to)); + coords.push(new Common.TextRange(selection.line, selection.from, selection.line, selection.to)); } editor.setSelections(coords); }
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-enter-behaviour.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-enter-behaviour.html index 972245fa..49903b5 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-enter-behaviour.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-enter-behaviour.html
@@ -32,7 +32,7 @@ { textEditor.setText(testFunction.toString()); var line = textEditor.line(2); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, line.length)); + textEditor.setSelection(Common.TextRange.createFromLocation(2, line.length)); hitEnterDumpTextAndNext(next); }, @@ -40,7 +40,7 @@ { textEditor.setText(testFunction.toString()); var line = textEditor.line(1); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(1, line.length)); + textEditor.setSelection(Common.TextRange.createFromLocation(1, line.length)); hitEnterDumpTextAndNext(next); }, @@ -48,49 +48,49 @@ { textEditor.setText(testFunction.toString()); var line = textEditor.line(2); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, line.length / 2)); + textEditor.setSelection(Common.TextRange.createFromLocation(2, line.length / 2)); hitEnterDumpTextAndNext(next); }, function testEnterInTheBeginningOfTheLine(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, 0)); + textEditor.setSelection(Common.TextRange.createFromLocation(2, 0)); hitEnterDumpTextAndNext(next); }, function testEnterWithTheSelection(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(new WebInspector.TextRange(2, 2, 2, 4)); + textEditor.setSelection(new Common.TextRange(2, 2, 2, 4)); hitEnterDumpTextAndNext(next); }, function testEnterWithReversedSelection(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(new WebInspector.TextRange(2, 4, 2, 2)); + textEditor.setSelection(new Common.TextRange(2, 4, 2, 2)); hitEnterDumpTextAndNext(next); }, function testEnterWithTheMultiLineSelection(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(new WebInspector.TextRange(2, 0, 8, 4)); + textEditor.setSelection(new Common.TextRange(2, 0, 8, 4)); hitEnterDumpTextAndNext(next); }, function testEnterWithFullLineSelection(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(new WebInspector.TextRange(2, 0, 3, 0)); + textEditor.setSelection(new Common.TextRange(2, 0, 3, 0)); hitEnterDumpTextAndNext(next); }, function testEnterBeforeOpenBrace(next) { textEditor.setText(testFunction.toString()); - textEditor.setSelection(new WebInspector.TextRange(8, 0, 8, 0)); + textEditor.setSelection(new Common.TextRange(8, 0, 8, 0)); hitEnterDumpTextAndNext(next); },
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-home-button.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-home-button.html index fb20a64..d4c7fd7 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-home-button.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-home-button.html
@@ -21,8 +21,8 @@ function homeButton(shift, callback) { - var key = WebInspector.isMac() ? "ArrowLeft" : "Home"; - var modifiers = WebInspector.isMac() ? ["metaKey"] : []; + var key = Host.isMac() ? "ArrowLeft" : "Home"; + var modifiers = Host.isMac() ? ["metaKey"] : []; if (shift) modifiers.push("shiftKey"); InspectorTest.fakeKeyEvent(textEditor, key, modifiers, callback); @@ -46,7 +46,7 @@ InspectorTest.runTestSuite([ function testFirstNonBlankCharacter(next) { - var selection = WebInspector.TextRange.createFromLocation(2, 8); + var selection = Common.TextRange.createFromLocation(2, 8); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(false, 1, next); @@ -54,7 +54,7 @@ function testFirstNonBlankCharacterFromWhitespace(next) { - var selection = WebInspector.TextRange.createFromLocation(2, 2); + var selection = Common.TextRange.createFromLocation(2, 2); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(false, 1, next); @@ -62,7 +62,7 @@ function testHomeButtonToggling(next) { - var selection = WebInspector.TextRange.createFromLocation(2, 2); + var selection = Common.TextRange.createFromLocation(2, 2); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(false, 3, next); @@ -70,7 +70,7 @@ function testHomeButtonDoesNotChangeCursor(next) { - var selection = WebInspector.TextRange.createFromLocation(0, 2); + var selection = Common.TextRange.createFromLocation(0, 2); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(false, 2, next); @@ -78,7 +78,7 @@ function testHomeButtonWithShift(next) { - var selection = new WebInspector.TextRange(0, 0, 2, 8); + var selection = new Common.TextRange(0, 0, 2, 8); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(true, 3, next); @@ -86,7 +86,7 @@ function testHomeButtonWithShiftInversed(next) { - var selection = new WebInspector.TextRange(3, 1, 2, 8); + var selection = new Common.TextRange(3, 1, 2, 8); textEditor.setSelection(selection); InspectorTest.dumpTextWithSelection(textEditor); hitHomeButton(true, 3, next);
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-indent-autodetection.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-indent-autodetection.html index 2f58bb4f..d65050fba 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-indent-autodetection.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-indent-autodetection.html
@@ -17,7 +17,7 @@ textEditor.setMimeType("text/javascript"); textEditor.setReadOnly(false); textEditor.element.focus(); - WebInspector.settingForTest("textEditorAutoDetectIndent").set(true); + Common.settingForTest("textEditorAutoDetectIndent").set(true); function genericTest(snippetName, next) { var command = "codeSnippet('" + snippetName + "');"; @@ -26,7 +26,7 @@ { textEditor.setText(result.value); var indent = textEditor.indent(); - var description = indent === WebInspector.TextUtils.Indent.TabCharacter ? "Tab" : indent.length + " spaces"; + var description = indent === Common.TextUtils.Indent.TabCharacter ? "Tab" : indent.length + " spaces"; InspectorTest.addResult("Autodetected indentation for " + snippetName + ": " + description); next();
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-line-breaks.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-line-breaks.html index f271f44..5652195 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-line-breaks.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-line-breaks.html
@@ -27,7 +27,7 @@ { var textEditor = InspectorTest.createTestEditor(); textEditor.setText("1\n2\n3\n"); - textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar"); + textEditor.editRange(new Common.TextRange(1, 0, 1, 0), "foo\r\nbar"); InspectorTest.addResult(encodeURI(textEditor.text())); next(); }, @@ -36,7 +36,7 @@ { var textEditor = InspectorTest.createTestEditor(); textEditor.setText("1\r\n2\r\n3\r\n"); - textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar"); + textEditor.editRange(new Common.TextRange(1, 0, 1, 0), "foo\r\nbar"); InspectorTest.addResult(encodeURI(textEditor.text())); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-mark-clean.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-mark-clean.html index f004937..3d65c3c7 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-mark-clean.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-mark-clean.html
@@ -15,7 +15,7 @@ InspectorTest.addResult("Initial state: clean=" + textEditor.isClean()); textEditor.markClean(); InspectorTest.addResult("After marking clean: clean=" + textEditor.isClean()); - textEditor.editRange(WebInspector.TextRange.createFromLocation(0, 0), "newText"); + textEditor.editRange(Common.TextRange.createFromLocation(0, 0), "newText"); InspectorTest.addResult("EDIT; clean=" + textEditor.isClean()); textEditor.undo(); InspectorTest.addResult("UNDO; clean=" + textEditor.isClean()); @@ -23,7 +23,7 @@ InspectorTest.addResult("REDO; clean=" + textEditor.isClean()); textEditor.undo(); InspectorTest.addResult("UNDO; clean=" + textEditor.isClean()); - textEditor.editRange(WebInspector.TextRange.createFromLocation(1, 0), "newText2"); + textEditor.editRange(Common.TextRange.createFromLocation(1, 0), "newText2"); InspectorTest.addResult("EDIT; clean=" + textEditor.isClean()); textEditor.undo(); InspectorTest.addResult("UNDO; clean=" + textEditor.isClean()); @@ -34,12 +34,12 @@ { InspectorTest.addResult("Initial state: clean=" + textEditor.isClean()); for(var i = 0; i < 3; ++i) { - textEditor.editRange(WebInspector.TextRange.createFromLocation(i, 0), "newText" + i); + textEditor.editRange(Common.TextRange.createFromLocation(i, 0), "newText" + i); InspectorTest.addResult("EDIT; clean=" + textEditor.isClean()); } textEditor.markClean(); InspectorTest.addResult("After marking clean: clean=" + textEditor.isClean()); - textEditor.editRange(WebInspector.TextRange.createFromLocation(3, 0), "newText" + 3); + textEditor.editRange(Common.TextRange.createFromLocation(3, 0), "newText" + 3); InspectorTest.addResult("EDIT; clean=" + textEditor.isClean()); for(var i = 0; i < 4; ++i) { textEditor.undo(); @@ -53,7 +53,7 @@ textEditor.undo(); InspectorTest.addResult("UNDO; clean=" + textEditor.isClean()); } - textEditor.editRange(WebInspector.TextRange.createFromLocation(1, 0), "foo"); + textEditor.editRange(Common.TextRange.createFromLocation(1, 0), "foo"); InspectorTest.addResult("EDIT; clean=" + textEditor.isClean()); textEditor.undo(); InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-replace.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-replace.html index 5f12a93..9ef7408d 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-replace.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-replace.html
@@ -9,12 +9,12 @@ function test() { var textEditor; - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); function showReplaceField() { - var searchableView = WebInspector.panels.sources.searchableView(); + var searchableView = UI.panels.sources.searchableView(); searchableView.showSearchField(); searchableView._replaceCheckboxElement.click(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-switch-editor.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-switch-editor.html index 40a15ed8..a15eca7 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-switch-editor.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-search-switch-editor.html
@@ -10,7 +10,7 @@ { var textEditor; var searchString = "FINDME"; - var searchableView = WebInspector.panels.sources.searchableView(); + var searchableView = UI.panels.sources.searchableView(); var sourceFrame; InspectorTest.showScriptSource("search-me.js", didShowScriptSource);
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-selection-to-search.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-selection-to-search.html index c86746e..f7caa95a 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-selection-to-search.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-selection-to-search.html
@@ -8,7 +8,7 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.showScriptSource("edit-me.js", step1); @@ -22,9 +22,9 @@ { panel.searchableView().showSearchField(); InspectorTest.addResult("Search controller: '" + panel.searchableView()._searchInputElement.value + "'"); - var action = new WebInspector.AdvancedSearchView.ActionDelegate(); + var action = new Sources.AdvancedSearchView.ActionDelegate(); action._showSearch(); - var searchView = /** @type {!WebInspector.AdvancedSearchView} */ (self.runtime.sharedInstance(WebInspector.AdvancedSearchView)); + var searchView = /** @type {!Sources.AdvancedSearchView} */ (self.runtime.sharedInstance(Sources.AdvancedSearchView)); InspectorTest.addResult("Advanced search controller: '" + searchView._search.value + "'"); InspectorTest.completeTest(); } @@ -36,7 +36,7 @@ var column = line.indexOf(string); if (column === -1) continue; - return new WebInspector.TextRange(i, column, i, column + string.length); + return new Common.TextRange(i, column, i, column + string.length); } } }
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-smart-braces.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-smart-braces.html index b1addf1..1347534 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-smart-braces.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-smart-braces.html
@@ -13,7 +13,7 @@ function clearEditor() { textEditor.setText(""); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 0)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 0)); } InspectorTest.runTestSuite([ @@ -42,7 +42,7 @@ function testQuotesToCloseStringLiterals(next) { textEditor.setText("'Hello"); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 6)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 6)); InspectorTest.typeIn(textEditor, "\"'", onTypedIn); function onTypedIn() { @@ -54,7 +54,7 @@ function testQuotesToCloseStringLiteralInsideLine(next) { textEditor.setText("console.log(\"information\");"); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 24)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 24)); InspectorTest.typeIn(textEditor, "\"", onTypedIn); function onTypedIn() {
diff --git a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-word-jumps.html b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-word-jumps.html index dfa6e0c..42ae8f32ce 100644 --- a/third_party/WebKit/LayoutTests/inspector/editor/text-editor-word-jumps.html +++ b/third_party/WebKit/LayoutTests/inspector/editor/text-editor-word-jumps.html
@@ -27,8 +27,8 @@ textEditor.element.focus(); InspectorTest.addResult(textEditor.text()); - const wordJumpModifier = WebInspector.isMac() ? "altKey" : "ctrlKey"; - const camelJumpModifier = WebInspector.isMac() ? "ctrlKey" : "altKey"; + const wordJumpModifier = Host.isMac() ? "altKey" : "ctrlKey"; + const camelJumpModifier = Host.isMac() ? "ctrlKey" : "altKey"; function dumpEditorSelection() { @@ -44,14 +44,14 @@ function setCursorAtBeginning() { - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 0)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 0)); } function setCursorAtEnd() { var lastLine = textEditor.linesCount - 1; var lastColumn = textEditor.line(lastLine).length; - textEditor.setSelection(WebInspector.TextRange.createFromLocation(lastLine, lastColumn)); + textEditor.setSelection(Common.TextRange.createFromLocation(lastLine, lastColumn)); } function fireEventWhileSelectionChanges(eventType, modifiers, callback)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/accessibility-pane-test.js b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/accessibility-pane-test.js index 4c7df55..8df61f3b 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/accessibility-pane-test.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/accessibility-pane-test.js
@@ -2,7 +2,7 @@ InspectorTest.accessibilitySidebarPane = function() { - return self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView); + return self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView); } /** @@ -13,7 +13,7 @@ { return new Promise((resolve) => { InspectorTest.selectNodeWithId(idValue, function() { - self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView).doUpdate().then(resolve); + self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView).doUpdate().then(resolve); }); }); } @@ -31,7 +31,7 @@ } /** - * @param {!WebInspector.AccessibilityNode} accessibilityNode + * @param {!Accessibility.AccessibilityNode} accessibilityNode */ InspectorTest.dumpAccessibilityNode = function(accessibilityNode) { @@ -56,7 +56,7 @@ /** * @param {string} attribute - * @return {?WebInspector.ARIAAttributesTreeElement} + * @return {?Accessibility.ARIAAttributesTreeElement} */ InspectorTest.findARIAAttributeTreeElement = function(attribute) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/autocomplete-attribute.html b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/autocomplete-attribute.html index 5fae382..2ad776f 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/autocomplete-attribute.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/autocomplete-attribute.html
@@ -7,7 +7,7 @@ function test() { - WebInspector.viewManager.showView("accessibility.view") + UI.viewManager.showView("accessibility.view") .then(() => InspectorTest.selectNodeAndWaitForAccessibility("inspected")) .then(runTests);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/edit-aria-attributes.html b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/edit-aria-attributes.html index 9853651..077ee82 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/accessibility/edit-aria-attributes.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/accessibility/edit-aria-attributes.html
@@ -7,7 +7,7 @@ function test() { - WebInspector.viewManager.showView("accessibility.view") + UI.viewManager.showView("accessibility.view") .then(() => InspectorTest.selectNodeAndWaitForAccessibility("inspected")) .then(editAriaChecked); @@ -19,7 +19,7 @@ treeElement._startEditing(); treeElement._prompt._element.textContent = "false"; treeElement._prompt._element.dispatchEvent(InspectorTest.createKeyEvent("Enter")); - self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView).doUpdate().then(() => { editRole(); }); + self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView).doUpdate().then(() => { editRole(); }); } function editRole() @@ -30,7 +30,7 @@ treeElement._startEditing(); treeElement._prompt._element.textContent = "radio"; treeElement._prompt._element.dispatchEvent(InspectorTest.createKeyEvent("Enter")); - self.runtime.sharedInstance(WebInspector.AccessibilitySidebarView).doUpdate().then(() => { postRoleChange(); }); + self.runtime.sharedInstance(Accessibility.AccessibilitySidebarView).doUpdate().then(() => { postRoleChange(); }); } function postRoleChange()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/attribute-modified-ns.html b/third_party/WebKit/LayoutTests/inspector/elements/attribute-modified-ns.html index 8f8f322..8b6a2182 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/attribute-modified-ns.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/attribute-modified-ns.html
@@ -37,12 +37,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.addResult("===== On attribute set ====="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.evaluateInPage("setAttribute('http://www.w3.org/1999/xlink', 'xlink:href', 'changed-url')"); }, @@ -50,12 +50,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.addResult("=== On attribute removed ==="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.evaluateInPage("removeAttribute('xlink:href')"); }, ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/breadcrumb-updates.html b/third_party/WebKit/LayoutTests/inspector/elements/breadcrumb-updates.html index 9ff3145..c13deac 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/breadcrumb-updates.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/breadcrumb-updates.html
@@ -27,14 +27,14 @@ function step1() { InspectorTest.dumpBreadcrumb("Original breadcrumb"); - InspectorTest.addSniffer(WebInspector.ElementsBreadcrumbs.prototype, "update", step2); + InspectorTest.addSniffer(Elements.ElementsBreadcrumbs.prototype, "update", step2); InspectorTest.evaluateInPage("changeClass()"); } function step2() { InspectorTest.dumpBreadcrumb("After class change"); - InspectorTest.addSniffer(WebInspector.ElementsBreadcrumbs.prototype, "update", step3); + InspectorTest.addSniffer(Elements.ElementsBreadcrumbs.prototype, "update", step3); InspectorTest.evaluateInPage("deleteClass()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-1.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-1.html index b926927f..e2b5b8f 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-1.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-1.html
@@ -8,8 +8,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html index 921fcdc7..288a247 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-2.html
@@ -8,8 +8,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-3.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-3.html index e3effe0..7cff048 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-3.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-3.html
@@ -8,8 +8,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next) @@ -24,7 +24,7 @@ var childNodes = testNode.children(); for (var i = 0; i < childNodes.length; ++i) { if (childNodes[i].nodeType() === 8) { - WebInspector.Revealer.reveal(childNodes[i]); + Common.Revealer.reveal(childNodes[i]); callback(childNodes[i]); return; }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html index d699a1b51..84b93b4 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-4.html
@@ -8,8 +8,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-1.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-1.html index f53a48f..d72426a 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-1.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-1.html
@@ -8,10 +8,10 @@ function test() { // Save time on style updates. - WebInspector.viewManager.showView("elements"); + UI.viewManager.showView("elements"); - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-2.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-2.html index 1d5c5de..d61afcc 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-2.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-actions-shadow-2.html
@@ -8,10 +8,10 @@ function test() { // Save time on style updates. - WebInspector.viewManager.showView("elements"); + UI.viewManager.showView("elements"); - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-test.js b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-test.js index df41f061..a9874147 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-test.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-dom-test.js
@@ -17,10 +17,10 @@ function testContinuation() { - var editorElement = WebInspector.panels.elements._treeOutlines[0]._shadowRoot.getSelection().anchorNode.parentElement; + var editorElement = UI.panels.elements._treeOutlines[0]._shadowRoot.getSelection().anchorNode.parentElement; editorElement.textContent = attributeText; editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", done); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", done); } } } @@ -76,7 +76,7 @@ editorElement.textContent = newValue; editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); if (useSniffer) - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", step2); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", step2); else InspectorTest.deprecatedRunAfterPendingDispatches(step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute-expected.txt b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute-expected.txt index 4d7f7d46..0dc12b1 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute-expected.txt
@@ -4,7 +4,7 @@ Running: testSetUp Running: testSetNewValue -WebInspector.DOMModel.Events.AttrModified should be issued +SDK.DOMModel.Events.AttrModified should be issued Running: testSetSameValue
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute.html index 591977b..9d6c6ea 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/edit-style-attribute.html
@@ -17,8 +17,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.runTestSuite([ function testSetUp(next) @@ -30,11 +30,11 @@ { InspectorTest.evaluateInPage("testSetNewValue()"); - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, listener); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, listener); function listener(event) { - InspectorTest.addResult("WebInspector.DOMModel.Events.AttrModified should be issued"); - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, listener); + InspectorTest.addResult("SDK.DOMModel.Events.AttrModified should be issued"); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, listener); next(); } }, @@ -43,11 +43,11 @@ { InspectorTest.evaluateInPage("testSetSameValue()", next); - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, listener); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, listener); function listener(event) { - InspectorTest.addResult("WebInspector.DOMModel.Events.AttrModified should not be issued"); - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, listener); + InspectorTest.addResult("SDK.DOMModel.Events.AttrModified should not be issued"); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, listener); } } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/set-attribute.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/set-attribute.html index a687335..178fbc85 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/set-attribute.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/set-attribute.html
@@ -37,12 +37,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.addResult("===== On attribute set ====="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.evaluateInPage("setAttribute('name', 'value')"); }, @@ -52,10 +52,10 @@ { InspectorTest.addResult("===== On attribute modified (should be 'newValue') ====="); InspectorTest.dumpElementsTree(targetNode); - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, callback); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, callback); // Setting the same property value should not result in the AttrModified event. InspectorTest.evaluateInPage("setAttribute('name', 'value')"); InspectorTest.evaluateInPage("setAttribute('name', 'value')"); @@ -66,12 +66,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.addResult("=== On attribute removed ==="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.evaluateInPage("removeAttribute('name')"); }, @@ -79,12 +79,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.addResult("=== Set attribute value ==="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, callback); targetNode.setAttributeValue("foo", "bar"); }, @@ -92,12 +92,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.addResult("=== Set attribute as text ==="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, callback); targetNode.setAttribute("foo", "foo2='baz2' foo3='baz3'"); }, @@ -105,12 +105,12 @@ { function callback() { - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, callback); InspectorTest.addResult("=== Remove attribute as text ==="); InspectorTest.dumpElementsTree(targetNode); next(); } - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, callback); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, callback); targetNode.setAttribute("foo3", ""); }, @@ -119,7 +119,7 @@ function callback(error) { InspectorTest.addResult("Error: " + error); - InspectorTest.domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, callback); + InspectorTest.domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, callback); InspectorTest.addResult("=== Set malformed attribute as text ==="); InspectorTest.dumpElementsTree(targetNode); next();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/set-outer-html-test.js b/third_party/WebKit/LayoutTests/inspector/elements/edit/set-outer-html-test.js index 6cabf36..4c98f10 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/set-outer-html-test.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/set-outer-html-test.js
@@ -22,8 +22,8 @@ { InspectorTest.containerText = text; - for (var key in WebInspector.DOMModel.Events) { - var eventName = WebInspector.DOMModel.Events[key]; + for (var key in SDK.DOMModel.Events) { + var eventName = SDK.DOMModel.Events[key]; InspectorTest.domModel.addEventListener(eventName, InspectorTest.recordEvent.bind(InspectorTest, eventName)); } @@ -33,7 +33,7 @@ InspectorTest.recordEvent = function(eventName, event) { - if (!event.data || event.type === WebInspector.DOMModel.Events.MarkersChanged || event.type === WebInspector.DOMModel.Events.DOMMutated) + if (!event.data || event.type === SDK.DOMModel.Events.MarkersChanged || event.type === SDK.DOMModel.Events.DOMMutated) return; var node = event.data.node || event.data; var parent = event.data.parent;
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/shadow-dom-modify-chardata.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/shadow-dom-modify-chardata.html index 1172642..44e3cc9 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/shadow-dom-modify-chardata.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/shadow-dom-modify-chardata.html
@@ -16,7 +16,7 @@ function test() { var containerNode; - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.runTestSuite([ function testDumpInitial(next) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/edit/switch-panels-while-editing-as-html.html b/third_party/WebKit/LayoutTests/inspector/elements/edit/switch-panels-while-editing-as-html.html index 7b4fc51..ca7cd4c2c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/edit/switch-panels-while-editing-as-html.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/edit/switch-panels-while-editing-as-html.html
@@ -22,13 +22,13 @@ var treeOutline = InspectorTest.firstElementsTreeOutline(); var treeElement = treeOutline.findTreeElement(node); treeElement.toggleEditAsHTML(); - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "setMultilineEditing", next); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "setMultilineEditing", next); } }, function switchPanels(next) { - WebInspector.inspectorView.showPanel("sources") + UI.inspectorView.showPanel("sources") .then(next) .catch(onError);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-css-path.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-css-path.html index 4ae9c64..ed646f8 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-css-path.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-css-path.html
@@ -28,7 +28,7 @@ InspectorTest.completeTest(); return; } - var cssPath = WebInspector.DOMPresentationUtils.cssPath(entry.node, true); + var cssPath = Components.DOMPresentationUtils.cssPath(entry.node, true); var result = entry.prefix + cssPath; InspectorTest.addResult(result.replace(/\n/g, "\\n")); var escapedPath = cssPath.replace(/\\/g, "\\\\");
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments.html index ca3c803..00a3123 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-hide-html-comments.html
@@ -20,7 +20,7 @@ { InspectorTest.addResult("HTML comments shown:"); InspectorTest.dumpElementsTree(); - WebInspector.settingForTest("showHTMLComments").set(false); + Common.settingForTest("showHTMLComments").set(false); InspectorTest.addResult("\nHTML comments hidden:"); InspectorTest.dumpElementsTree(); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-limited-children.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-limited-children.html index 1f26c85..5ba6b593 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-limited-children.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-limited-children.html
@@ -33,7 +33,7 @@ { InspectorTest.addResult("=========== Loaded 5 children ==========="); dumpElementsTree(); - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", step3); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", step3); InspectorTest.evaluateInPage("insertNode()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-restore-selection-when-node-comes-later.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-restore-selection-when-node-comes-later.html index 3a77fb0..e0624cb 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-restore-selection-when-node-comes-later.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-restore-selection-when-node-comes-later.html
@@ -7,7 +7,7 @@ function test() { - var domModel = WebInspector.DOMModel.fromTarget(WebInspector.targetManager.mainTarget()); + var domModel = SDK.DOMModel.fromTarget(SDK.targetManager.mainTarget()); var node; InspectorTest.runTestSuite([ @@ -30,7 +30,7 @@ function firstReloadWithoutNodeInDOM(next) { - InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onNodeRestored); + InspectorTest.addSniffer(Elements.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onNodeRestored); // Do a reload and pretend page's DOM doesn't have a node to restore. overridePushNodeForPath(node.path()); InspectorTest.reloadPage(function() { }); @@ -46,7 +46,7 @@ { var pageReloaded = false; var nodeRestored = false; - InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onNodeRestored); + InspectorTest.addSniffer(Elements.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onNodeRestored); InspectorTest.reloadPage(onPageReloaded); function onPageReloaded() @@ -84,7 +84,7 @@ */ function overridePushNodeForPath(pathToIgnore) { - var original = InspectorTest.override(WebInspector.DOMModel.prototype, "pushNodeByPathToFrontend", override); + var original = InspectorTest.override(SDK.DOMModel.prototype, "pushNodeByPathToFrontend", override); function override(nodePath, callback) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html index c08e972..768bdb8 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-search.html
@@ -20,7 +20,7 @@ { if (resultCount == 0) { InspectorTest.addResult("Nothing found"); - WebInspector.DOMModel.cancelSearch(); + SDK.DOMModel.cancelSearch(); next(); } @@ -38,7 +38,7 @@ markupVa_lue = markupVa_lue.substr(0, markupVa_lue.indexOf(">") + 1); InspectorTest.addResult(markupVa_lue.split("").join(" ")); if (isLastItem) { - WebInspector.DOMModel.cancelSearch(); + SDK.DOMModel.cancelSearch(); next(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-selection-after-delete.html b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-selection-after-delete.html index 63c041e6..9d4a736 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-selection-after-delete.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-selection-after-delete.html
@@ -47,14 +47,14 @@ function removeElementAsUser(element, callback) { - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", callback); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", callback); element.remove(); } function removeElementExternally(element, callback) { var node = element.node(); - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateChildren", callback); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateChildren", callback); node.removeNode(); } @@ -113,7 +113,7 @@ function testExternalDelete(next) { // We should wait for container node to be updated since it is already populated. - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", step2); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", step2); prepareTestTree(); function step2()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-custom-framework.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-custom-framework.html index 831d78c..e49d8cff 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-custom-framework.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-custom-framework.html
@@ -92,7 +92,7 @@ function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(false); + Common.settingForTest("showEventListenersForAncestors").set(false); InspectorTest.selectNodeWithId("inspectedNode", step1); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery1.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery1.html index 67dafa9..3d9a4bd 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery1.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery1.html
@@ -14,7 +14,7 @@ function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(true); + Common.settingForTest("showEventListenersForAncestors").set(true); InspectorTest.selectNodeWithId("node", step1); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery2.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery2.html index b0e4ebe..a2c3f131 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery2.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-jquery2.html
@@ -15,7 +15,7 @@ function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(true); + Common.settingForTest("showEventListenersForAncestors").set(true); InspectorTest.selectNodeWithId("node", step1); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar.html index 4b90125..d00291ea 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar.html
@@ -37,7 +37,7 @@ function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(true); + Common.settingForTest("showEventListenersForAncestors").set(true); InspectorTest.selectNodeWithId("node", step1); function step1() @@ -52,7 +52,7 @@ function step3() { - WebInspector.settingForTest("showEventListenersForAncestors").set(false); + Common.settingForTest("showEventListenersForAncestors").set(false); InspectorTest.addResult("Listeners for selected node only(should be no listeners):"); InspectorTest.expandAndDumpSelectedElementEventListeners(step4); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listeners-about-blank.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listeners-about-blank.html index 9ab97f0d..57773ba 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/event-listeners-about-blank.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listeners-about-blank.html
@@ -19,7 +19,7 @@ function test() { - WebInspector.settingForTest("showEventListenersForAncestors").set(true); + Common.settingForTest("showEventListenersForAncestors").set(true); InspectorTest.evaluateInPage("setupEventListeners()", step1); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/highlight/highlight-dom-updates.html b/third_party/WebKit/LayoutTests/inspector/elements/highlight/highlight-dom-updates.html index d44f5ba3..2b5f916 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/highlight/highlight-dom-updates.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/highlight/highlight-dom-updates.html
@@ -134,7 +134,7 @@ function testAppendChildWhenHidden(next) { - WebInspector.viewManager.showView("console"); + UI.viewManager.showView("console"); runAndDumpHighlights("appendChild('childTest', 'child1')", childTestNode, next); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inline-style-title.html b/third_party/WebKit/LayoutTests/inspector/elements/inline-style-title.html index 5272e61..266143c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/inline-style-title.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/inline-style-title.html
@@ -15,8 +15,8 @@ function test() { // Save time on style updates. - WebInspector.StylesSidebarPane.prototype.update = function() {}; - WebInspector.MetricsSidebarPane.prototype.update = function() {}; + Elements.StylesSidebarPane.prototype.update = function() {}; + Elements.MetricsSidebarPane.prototype.update = function() {}; InspectorTest.nodeWithId("inline-style", onInlineStyleQueried);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html index 103b1a3..8d40576 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html
@@ -22,13 +22,13 @@ function clickAtInspected() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); InspectorTest.evaluateInPage("click()"); } function dumpAndFinish() { - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); + InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); var selectedElement = InspectorTest.firstElementsTreeOutline().selectedTreeElement; InspectorTest.addResult("Node selected: " + selectedElement.node().getAttribute("id")); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html index a55e233..694383e 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html
@@ -23,13 +23,13 @@ function step2() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step3); InspectorTest.evaluateInPage("click()"); } function step3() { - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); + InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step3); var selectedElement = InspectorTest.firstElementsTreeOutline().selectedTreeElement; InspectorTest.addResult("Node selected: " + selectedElement.node().getAttribute("id")); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inspect-pointer-events-none.html b/third_party/WebKit/LayoutTests/inspector/elements/inspect-pointer-events-none.html index acb07c50..71505d93f 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/inspect-pointer-events-none.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/inspect-pointer-events-none.html
@@ -64,26 +64,26 @@ function step2() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step3); InspectorTest.evaluateInPage("clickInner(true)"); } function step3() { - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); + InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step3); expectSelectedNode("inner"); InspectorTest.domModel.setInspectMode(Protocol.DOM.InspectMode.SearchForNode, step4); } function step4() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step5); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step5); InspectorTest.evaluateInPage("clickInner(false)"); } function step5() { - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step5); + InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, step5); expectSelectedNode("outer"); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inspect-pseudo-element.html b/third_party/WebKit/LayoutTests/inspector/elements/inspect-pseudo-element.html index 2d842c8..5f34553 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/inspect-pseudo-element.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/inspect-pseudo-element.html
@@ -20,7 +20,7 @@ function inspectModeEnabled() { - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, selectedNodeChanged); + UI.context.addFlavorChangeListener(SDK.DOMNode, selectedNodeChanged); InspectorTest.evaluateInPage("clickPseudo()"); } @@ -31,7 +31,7 @@ InspectorTest.addResult("<no selected node>"); else InspectorTest.addResult("Selected node pseudo type: " + selectedNode.pseudoType()); - WebInspector.context.removeFlavorChangeListener(WebInspector.DOMNode, selectedNodeChanged); + UI.context.removeFlavorChangeListener(SDK.DOMNode, selectedNodeChanged); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/move-node.html b/third_party/WebKit/LayoutTests/inspector/elements/move-node.html index b0da541..1044be3 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/move-node.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/move-node.html
@@ -25,13 +25,13 @@ function testDragAndDrop(next) { var treeOutline = InspectorTest.firstElementsTreeOutline(); - treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectionChanged); + treeOutline.addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, selectionChanged); function selectionChanged() { InspectorTest.addResult("===== Moved child2 ====="); InspectorTest.dumpElementsTree(containerNode); - InspectorTest.addResult("Selection: " + WebInspector.DOMPresentationUtils.fullQualifiedSelector(treeOutline.selectedDOMNode())); + InspectorTest.addResult("Selection: " + Components.DOMPresentationUtils.fullQualifiedSelector(treeOutline.selectedDOMNode())); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/node-reselect-on-append-child.html b/third_party/WebKit/LayoutTests/inspector/elements/node-reselect-on-append-child.html index 53cd81d..aec5e95 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/node-reselect-on-append-child.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/node-reselect-on-append-child.html
@@ -18,8 +18,8 @@ function onNodeSelected() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, onSelectionChangedEvent); - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateChildren", onNodeAppended); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, onSelectionChangedEvent); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateChildren", onNodeAppended); InspectorTest.evaluateInPage("appendNewNode()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/node-xpath.xhtml b/third_party/WebKit/LayoutTests/inspector/elements/node-xpath.xhtml index d08c3af..950eeadf 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/node-xpath.xhtml +++ b/third_party/WebKit/LayoutTests/inspector/elements/node-xpath.xhtml
@@ -39,7 +39,7 @@ function dumpNodeData(node, prefix) { - var result = prefix + "'" + node.nodeName() + "':'" + node.nodeValue() + "' - '" + WebInspector.DOMPresentationUtils.xPath(node, true) + "'"; + var result = prefix + "'" + node.nodeName() + "':'" + node.nodeValue() + "' - '" + Components.DOMPresentationUtils.xPath(node, true) + "'"; InspectorTest.addResult(result.replace(/\r?\n/g, "\\n")); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/reveal-whitespace-text-node.html b/third_party/WebKit/LayoutTests/inspector/elements/reveal-whitespace-text-node.html index eee340e..e00a090 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/reveal-whitespace-text-node.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/reveal-whitespace-text-node.html
@@ -15,8 +15,8 @@ function childCallback(childObject) { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); - WebInspector.Revealer.reveal(childObject); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); + Common.Revealer.reveal(childObject); } function selectedNodeChanged(event) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html b/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html index 2b4ccdc..48d84b8 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context.html
@@ -14,7 +14,7 @@ function onExpanded() { - mainContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + mainContext = UI.context.flavor(SDK.ExecutionContext); dumpContextAndNext(next); } }, @@ -36,7 +36,7 @@ function selectIframeImmediateChild(next) { - var iframe = WebInspector.context.flavor(WebInspector.DOMNode); + var iframe = UI.context.flavor(SDK.DOMNode); var child = iframe.firstChild; InspectorTest.selectNode(child).then(dumpContextAndNext.bind(null, next)); }, @@ -44,8 +44,8 @@ function dumpContextAndNext(next) { - var context = WebInspector.context.flavor(WebInspector.ExecutionContext); - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var context = UI.context.flavor(SDK.ExecutionContext); + var node = UI.context.flavor(SDK.DOMNode); var contextName = context === mainContext ? "main" : "iframe"; var matchesNode = context.frameId === node.frameId(); InspectorTest.addResult("Execution Context: " + contextName);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/breadcrumb-shadow-roots.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/breadcrumb-shadow-roots.html index d4c90113..ba26921 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/breadcrumb-shadow-roots.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/breadcrumb-shadow-roots.html
@@ -17,7 +17,7 @@ function test() { - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.expandElementsTree(step0); function step0() @@ -48,23 +48,23 @@ InspectorTest.findNode(matchFunction, callback); function callback(node) { - WebInspector.Revealer.revealPromise(node).then(next); + Common.Revealer.revealPromise(node).then(next); } } function matchUserAgentShadowRoot(node) { - return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent; + return node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.UserAgent; } function matchOpenShadowRoot(node) { - return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Open; + return node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Open; } function matchClosedShadowRoot(node) { - return node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Closed; + return node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Closed; } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html index fe17e36..6153db2 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-1.html
@@ -10,7 +10,7 @@ InspectorTest.runTestSuite([ function setup(next) { - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.expandElementsTree(next); }, @@ -27,12 +27,12 @@ function isOpenShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Open; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Open; } function isClosedShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Closed; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Closed; } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-2.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-2.html index f8d093da..a0d9a04 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-2.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-2.html
@@ -10,7 +10,7 @@ InspectorTest.runTestSuite([ function setup(next) { - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.expandElementsTree(next); }, @@ -27,12 +27,12 @@ function isOpenShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Open; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Open; } function isUserAgentShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.UserAgent; } function isOpenShadowRootChild(node)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-3.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-3.html index ac22d08..2b4ccdec2 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-3.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh-3.html
@@ -10,7 +10,7 @@ InspectorTest.runTestSuite([ function setup(next) { - WebInspector.settingForTest("showUAShadowDOM").set(true); + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.expandElementsTree(next); }, @@ -27,12 +27,12 @@ function isClosedShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.Closed; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Closed; } function isUserAgentShadowRoot(node) { - return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent; + return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.UserAgent; } function isClosedShadowRootChild(node)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh.js b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh.js index c5731d21..991d2d9 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/elements-panel-shadow-selection-on-refresh.js
@@ -9,7 +9,7 @@ function onSelected() { InspectorTest.reloadPage(onReloaded); - InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onReSelected); + InspectorTest.addSniffer(Elements.ElementsPanel.prototype, "_lastSelectedNodeSelectedForTest", onReSelected); } function onReloaded()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/inspect-deep-shadow-element.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/inspect-deep-shadow-element.html index 07ebf60..eba34e7 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/inspect-deep-shadow-element.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/inspect-deep-shadow-element.html
@@ -7,7 +7,7 @@ function test() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); var tests = [ ["shadow", "inspect(host.shadowRoot.firstChild.firstChild.firstChild)"], @@ -20,7 +20,7 @@ if (!node) return; if (node.getAttribute("id") == tests[0][0]) { - InspectorTest.addResult(WebInspector.DOMPresentationUtils.xPath(node, false)); + InspectorTest.addResult(Components.DOMPresentationUtils.xPath(node, false)); tests.shift(); nextTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/reveal-shadow-dom-node.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/reveal-shadow-dom-node.html index 71961c69..47d39a5 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/reveal-shadow-dom-node.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/reveal-shadow-dom-node.html
@@ -6,7 +6,7 @@ function test() { - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged); var nodeChangesRemaining = 2; function selectedNodeChanged(event) @@ -33,10 +33,10 @@ { var shadowDiv = children[0]; InspectorTest.addResult("User-agent shadow DOM hidden:"); - WebInspector.panels.elements.revealAndSelectNode(shadowDiv).then(() => { - WebInspector.settingForTest("showUAShadowDOM").set(true); + UI.panels.elements.revealAndSelectNode(shadowDiv).then(() => { + Common.settingForTest("showUAShadowDOM").set(true); InspectorTest.addResult("User-agent shadow DOM shown:"); - WebInspector.panels.elements.revealAndSelectNode(shadowDiv); + UI.panels.elements.revealAndSelectNode(shadowDiv); }); } });
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/shadow/shadow-host-display-modes.html b/third_party/WebKit/LayoutTests/inspector/elements/shadow/shadow-host-display-modes.html index f961201..895411e 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/shadow/shadow-host-display-modes.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/shadow/shadow-host-display-modes.html
@@ -105,7 +105,7 @@ function waitForModifiedNodesUpdate(title, next) { - InspectorTest.addSniffer(WebInspector.ElementsTreeOutline.prototype, "_updateModifiedNodes", callback); + InspectorTest.addSniffer(Elements.ElementsTreeOutline.prototype, "_updateModifiedNodes", callback); function callback() {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-inline-style-csp.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-inline-style-csp.html index 651b388b..8a5ccaf 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-inline-style-csp.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-inline-style-csp.html
@@ -79,7 +79,7 @@ { var inlineStyle; InspectorTest.cssModel.inlineStylesPromise(nodeId).then(stylesCallback); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged); function onStyleSheetChanged(event) { if (event.data && event.data.edit)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-with-style-after-body.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-with-style-after-body.html index dcb6816..545f0cd 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-with-style-after-body.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/add-new-rule-with-style-after-body.html
@@ -12,12 +12,12 @@ function test() { - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, stylesheetAdded); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, stylesheetAdded); InspectorTest.evaluateInPage("addStyle()"); function stylesheetAdded() { - InspectorTest.cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, stylesheetAdded); + InspectorTest.cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, stylesheetAdded); InspectorTest.selectNodeAndWaitForStyles("inspected", step1); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/case-sensitive-suggestions.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/case-sensitive-suggestions.html index 202584f..c1de93c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/case-sensitive-suggestions.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/case-sensitive-suggestions.html
@@ -6,7 +6,7 @@ function test() { - var prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(WebInspector.cssMetadata().allProperties(), null, true); + var prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(SDK.cssMetadata().allProperties(), null, true); InspectorTest.runTestSuite([ function testForUpperCase(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-aware-property-value-edit.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-aware-property-value-edit.html index 1aa4127..3aa8412 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-aware-property-value-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-aware-property-value-edit.html
@@ -14,22 +14,22 @@ function editKeywordAsOriginal(next) { - startEditingAndDumpValue(WebInspector.Color.Format.Original, "border", next); + startEditingAndDumpValue(Common.Color.Format.Original, "border", next); }, function editKeywordAsHex(next) { - startEditingAndDumpValue(WebInspector.Color.Format.HEX, "border", next); + startEditingAndDumpValue(Common.Color.Format.HEX, "border", next); }, function editKeywordAsHSL(next) { - startEditingAndDumpValue(WebInspector.Color.Format.HSL, "border", next); + startEditingAndDumpValue(Common.Color.Format.HSL, "border", next); }, function editKeywordAsRGB(next) { - startEditingAndDumpValue(WebInspector.Color.Format.RGB, "border", onValueDumped); + startEditingAndDumpValue(Common.Color.Format.RGB, "border", onValueDumped); function onValueDumped() { InspectorTest.selectNodeAndWaitForStyles("inspected2", next); @@ -38,22 +38,22 @@ function editHexAsOriginal(next) { - startEditingAndDumpValue(WebInspector.Color.Format.Original, "color", next); + startEditingAndDumpValue(Common.Color.Format.Original, "color", next); }, function editHexAsHex(next) { - startEditingAndDumpValue(WebInspector.Color.Format.HEX, "color", next); + startEditingAndDumpValue(Common.Color.Format.HEX, "color", next); }, function editHexAsHSL(next) { - startEditingAndDumpValue(WebInspector.Color.Format.HSL, "color", next); + startEditingAndDumpValue(Common.Color.Format.HSL, "color", next); }, function editHexAsRGB(next) { - startEditingAndDumpValue(WebInspector.Color.Format.RGB, "color", next); + startEditingAndDumpValue(Common.Color.Format.RGB, "color", next); }, function editNewProperty(next) @@ -80,8 +80,8 @@ function setFormat(newFormat, callback) { - WebInspector.settingForTest("colorFormat").set(newFormat); - WebInspector.panels.elements._stylesWidget.doUpdate().then(callback); + Common.settingForTest("colorFormat").set(newFormat); + UI.panels.elements._stylesWidget.doUpdate().then(callback); } function startEditingAndDumpValue(format, propertyName, next)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-nicknames-lowercase.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-nicknames-lowercase.html index 778fca8..913a132 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-nicknames-lowercase.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/color-nicknames-lowercase.html
@@ -6,7 +6,7 @@ function test() { var badNames = []; - for (var nickname in WebInspector.Color.Nicknames) { + for (var nickname in Common.Color.Nicknames) { if (nickname.toLowerCase() !== nickname) badNames.push(nickname); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/commit-selector-mark-matching.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/commit-selector-mark-matching.html index 2c68fcb..37e17e18 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/commit-selector-mark-matching.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/commit-selector-mark-matching.html
@@ -21,7 +21,7 @@ function nodeCallback(node) { nodeId = node.id; - stylesPane = WebInspector.panels.elements._stylesWidget; + stylesPane = UI.panels.elements._stylesWidget; InspectorTest.addNewRule("foo, #inspected, .bar, #inspected", callback); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-live-edit.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-live-edit.html index 831cf9e..0dd259c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-live-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-live-edit.html
@@ -17,7 +17,7 @@ function didShowResource(sourceFrame) { - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_fireStyleSheetChanged", didEditResource); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_fireStyleSheetChanged", didEditResource); InspectorTest.replaceInSource(sourceFrame, "font-size: 12px;", "font-size: 20px;"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-outline.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-outline.html index 92281df..1590dd8 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-outline.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/css-outline.html
@@ -69,7 +69,7 @@ function onStyleFetched(result) { - var parser = new WebInspector.CSSParser(); + var parser = new SDK.CSSParser(); parser.parse(result.value, onStyleSheetParsed); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/disable-property-workingcopy-update.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/disable-property-workingcopy-update.html index 609c650d0..6d6e1312d 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/disable-property-workingcopy-update.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/disable-property-workingcopy-update.html
@@ -9,7 +9,7 @@ function test() { var cssSourceFrame; - WebInspector.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 10; + Bindings.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 10; InspectorTest.runTestSuite([ function selectContainer(next) @@ -22,8 +22,8 @@ var headers = InspectorTest.cssModel.styleSheetHeaders(); for (var i = 0; i < headers.length; ++i) { if (headers[i].sourceURL.endsWith(".css")) { - var cssLocation = new WebInspector.CSSLocation(headers[i], 0); - InspectorTest.showUISourceCode(WebInspector.cssWorkspaceBinding.rawLocationToUILocation(cssLocation).uiSourceCode, callback); + var cssLocation = new SDK.CSSLocation(headers[i], 0); + InspectorTest.showUISourceCode(Bindings.cssWorkspaceBinding.rawLocationToUILocation(cssLocation).uiSourceCode, callback); break; } } @@ -63,7 +63,7 @@ function toggleProperty(value, next) { - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", callback); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addRevision", callback); InspectorTest.waitForStyles("inspected", callback); InspectorTest.toggleMatchedStyleProperty("font-weight", value);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html index c62d1ee..e2ca767 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html
@@ -11,13 +11,13 @@ function onStylesSelected(node) { - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommitted, onWorkingCopyCommitted); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyCommitted, onWorkingCopyCommitted); InspectorTest.addNewRule("#inspected", new Function()); } function onWorkingCopyCommitted(event) { - WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.WorkingCopyCommitted, onWorkingCopyCommitted); + Workspace.workspace.removeEventListener(Workspace.Workspace.Events.WorkingCopyCommitted, onWorkingCopyCommitted); var uiSourceCode = event.data.uiSourceCode; InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.displayName()); uiSourceCode.requestContent().then(printContent(onContent))
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags.html index a794b6ae..884db48 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-resource-referred-by-multiple-styletags.html
@@ -23,7 +23,7 @@ function onEditorOpened(sourceFrame) { - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_fireStyleSheetChanged", didEditStyleSheet); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_fireStyleSheetChanged", didEditStyleSheet); InspectorTest.replaceInSource(sourceFrame, "100px", "2em"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-value-url-with-color.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-value-url-with-color.html index 83edf69e..6097bcf 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-value-url-with-color.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-value-url-with-color.html
@@ -9,8 +9,8 @@ var maxIndex = 11; var idIndex = 1; - WebInspector.Color.detectColorFormat = function() { - return WebInspector.Color.Format.RGB; + Common.Color.detectColorFormat = function() { + return Common.Color.Format.RGB; }; selectDivAndEditValue();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/filter-matched-styles-hides-separators.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/filter-matched-styles-hides-separators.html index 0b43e89..534e556c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/filter-matched-styles-hides-separators.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/filter-matched-styles-hides-separators.html
@@ -66,7 +66,7 @@ function dumpSidebarSeparators() { - var separators = WebInspector.panels.elements._stylesWidget.element.querySelectorAll(".sidebar-separator"); + var separators = UI.panels.elements._stylesWidget.element.querySelectorAll(".sidebar-separator"); for (var i = 0; i < separators.length; ++i) { var separator = separators[i]; var hidden = separator.classList.contains("hidden");
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/get-set-stylesheet-text.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/get-set-stylesheet-text.html index 68d6ee05..cfb8df4 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/get-set-stylesheet-text.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/get-set-stylesheet-text.html
@@ -32,7 +32,7 @@ foundStyleSheetHeader.requestContent().then(callback); } if (!foundStyleSheetHeader) - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetAdded); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, styleSheetAdded); } function callback(content) @@ -43,7 +43,7 @@ function styleSheetAdded() { - InspectorTest.cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetAdded); + InspectorTest.cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, styleSheetAdded); findStyleSheet(); } } @@ -60,7 +60,7 @@ InspectorTest.addResult("=== Original stylesheet text: ==="); InspectorTest.addResult(foundStyleSheetText); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, next, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, next, this); InspectorTest.cssModel.setStyleSheetText(foundStyleSheetHeader.id, "h1 { COLOR: Red; }", true).then(callback); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/metrics-box-sizing.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/metrics-box-sizing.html index fa5c5d7..c8825be 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/metrics-box-sizing.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/metrics-box-sizing.html
@@ -81,7 +81,7 @@ function testBorderBoxInit2(next) { - section = WebInspector.panels.elements._metricsWidget; + section = UI.panels.elements._metricsWidget; section.expand(); InspectorTest.addSniffer(section._updateController._updateThrottler, "_processCompletedForTests", next); }, @@ -113,7 +113,7 @@ function testContentBoxInit2(next) { - section = WebInspector.panels.elements._metricsWidget; + section = UI.panels.elements._metricsWidget; section.expand(); InspectorTest.addSniffer(section._updateController._updateThrottler, "_processCompletedForTests", next); },
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/mixed-case-color-aware-properties.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/mixed-case-color-aware-properties.html index 8771460..6afb773 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/mixed-case-color-aware-properties.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/mixed-case-color-aware-properties.html
@@ -8,7 +8,7 @@ { var colorAwareProperties = ["bAckground-ColoR", "COloR", "Border-coLoR", "border-right-color", "BOX-SHADOW"]; for (var i = 0; i < colorAwareProperties.length; ++i) { - var isColorAware = WebInspector.cssMetadata().isColorAwareProperty(colorAwareProperties[i]); + var isColorAware = SDK.cssMetadata().isColorAwareProperty(colorAwareProperties[i]); InspectorTest.addResult(colorAwareProperties[i] + (isColorAware ? " is" : " is NOT") + " color aware"); } InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/multiple-imports-edit-crash.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/multiple-imports-edit-crash.html index 3e8e11d..8a8079bb 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/multiple-imports-edit-crash.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/multiple-imports-edit-crash.html
@@ -14,8 +14,8 @@ function test() { - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetAdded, this); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, styleSheetRemoved, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, styleSheetAdded, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, styleSheetRemoved, this); InspectorTest.nodeWithId("inspected", nodeFound); function nodeFound(node)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/page-reload-update-sidebar.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/page-reload-update-sidebar.html index f185d82..6444a28 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/page-reload-update-sidebar.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/page-reload-update-sidebar.html
@@ -11,7 +11,7 @@ function test() { - var stylesSidebarPane = WebInspector.panels.elements._stylesWidget; + var stylesSidebarPane = UI.panels.elements._stylesWidget; InspectorTest.runTestSuite([ function selectInspectedNode(next) { @@ -25,7 +25,7 @@ treeElement.startEditing(treeElement.valueElement); var nodeRebuiltHappened = false; var pageReloadHappened = false; - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_nodeStylesUpdatedForTest", onNodeRebuilt); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_nodeStylesUpdatedForTest", onNodeRebuilt); InspectorTest.reloadPage(reloadedCallback); function onNodeRebuilt(node, rebuild)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location-expected.txt b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location-expected.txt index 6e8b979..9c042ea 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location-expected.txt
@@ -1,4 +1,4 @@ -Verifies WebInspector.cssWorkspaceBinding.propertyUILocation functionality +Verifies Bindings.cssWorkspaceBinding.propertyUILocation functionality font-family -> source-url.css:2:4 arial -> source-url.css:2:17
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location.html index 8526571..1ae75e2 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/property-ui-location.html
@@ -35,15 +35,15 @@ { var styles = matchedResult.nodeStyles(); for (var style of styles) { - if (style.type !== WebInspector.CSSStyleDeclaration.Type.Regular) + if (style.type !== SDK.CSSStyleDeclaration.Type.Regular) continue; var properties = style.allProperties; for (var property of properties) { if (!property.range) continue; - var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(property, true); + var uiLocation = Bindings.cssWorkspaceBinding.propertyUILocation(property, true); InspectorTest.addResult(String.sprintf("%s -> %s:%d:%d", property.name, uiLocation.uiSourceCode.name(), uiLocation.lineNumber, uiLocation.columnNumber)); - var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(property, false); + var uiLocation = Bindings.cssWorkspaceBinding.propertyUILocation(property, false); InspectorTest.addResult(String.sprintf("%s -> %s:%d:%d", property.value, uiLocation.uiSourceCode.name(), uiLocation.lineNumber, uiLocation.columnNumber)); } } @@ -53,7 +53,7 @@ </script> </head> <body onload="runTest()"> -<p>Verifies WebInspector.cssWorkspaceBinding.propertyUILocation functionality</p> +<p>Verifies Bindings.cssWorkspaceBinding.propertyUILocation functionality</p> <div id="inspected"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/pseudo-elements.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/pseudo-elements.html index 3d0e3da..de73d0e 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-2/pseudo-elements.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-2/pseudo-elements.html
@@ -88,32 +88,32 @@ function removeAfter(next) { - executeAndDumpTree("removeLastRule()", WebInspector.DOMModel.Events.NodeRemoved, next); + executeAndDumpTree("removeLastRule()", SDK.DOMModel.Events.NodeRemoved, next); }, function removeBefore(next) { - executeAndDumpTree("removeLastRule()", WebInspector.DOMModel.Events.NodeRemoved, next); + executeAndDumpTree("removeLastRule()", SDK.DOMModel.Events.NodeRemoved, next); }, function addAfter(next) { - executeAndDumpTree("addAfterRule()", WebInspector.DOMModel.Events.NodeInserted, expandAndDumpTree.bind(this, next)); + executeAndDumpTree("addAfterRule()", SDK.DOMModel.Events.NodeInserted, expandAndDumpTree.bind(this, next)); }, function addBefore(next) { - executeAndDumpTree("addBeforeRule()", WebInspector.DOMModel.Events.NodeInserted, next); + executeAndDumpTree("addBeforeRule()", SDK.DOMModel.Events.NodeInserted, next); }, function modifyTextContent(next) { - executeAndDumpTree("modifyTextContent()", WebInspector.DOMModel.Events.NodeInserted, next); + executeAndDumpTree("modifyTextContent()", SDK.DOMModel.Events.NodeInserted, next); }, function clearTextContent(next) { - executeAndDumpTree("clearTextContent()", WebInspector.DOMModel.Events.NodeRemoved, next); + executeAndDumpTree("clearTextContent()", SDK.DOMModel.Events.NodeRemoved, next); }, function removeNodeAndCheckPseudoElementsUnbound(next) @@ -121,7 +121,7 @@ var inspectedBefore = inspectedNode.beforePseudoElement(); var inspectedAfter = inspectedNode.afterPseudoElement(); - executeAndDumpTree("removeNode()", WebInspector.DOMModel.Events.NodeRemoved, callback); + executeAndDumpTree("removeNode()", SDK.DOMModel.Events.NodeRemoved, callback); function callback() { InspectorTest.addResult("inspected:before DOMNode in DOMAgent: " + !!(InspectorTest.domModel.nodeForId(inspectedBefore.id))); @@ -139,12 +139,12 @@ function domCallback() { InspectorTest.domModel.removeEventListener(eventName, domCallback, this); - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); + InspectorTest.firstElementsTreeOutline().addEventListener(Elements.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); } function treeCallback() { - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); + InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.ElementsTreeOutline.Events.ElementsTreeUpdated, treeCallback, this); InspectorTest.dumpElementsTree(containerNode); next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/simple-selector.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/simple-selector.html index 59665eb..5687219 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/simple-selector.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/simple-selector.html
@@ -13,7 +13,7 @@ var container = InspectorTest.expandedNodeWithId("container"); var children = container.children(); for (var i = 0; i < children.length; ++i) - InspectorTest.addResult(WebInspector.DOMPresentationUtils.simpleSelector(children[i])); + InspectorTest.addResult(Components.DOMPresentationUtils.simpleSelector(children[i])); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum-expected.txt b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum-expected.txt index 8e2f7f1..128b121 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum-expected.txt
@@ -1,4 +1,4 @@ -Tests WebInspector.Spectrum +Tests Components.Spectrum --- Testing colorString() Testing: red
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum.html index 81e0a9ef..1a059e27 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/spectrum.html
@@ -9,7 +9,7 @@ function setColor(inputColor, format) { InspectorTest.addResult("Testing: " + inputColor); - var color = WebInspector.Color.parse(inputColor); + var color = Common.Color.parse(inputColor); spectrum.setColor(color, format); } @@ -23,7 +23,7 @@ { setColor(inputColor, format) spectrum._hsv[3] = 0; - spectrum._innerSetColor(spectrum._hsv, undefined, undefined, WebInspector.Spectrum._ChangeSource.Other); + spectrum._innerSetColor(spectrum._hsv, undefined, undefined, Components.Spectrum._ChangeSource.Other); InspectorTest.addResult(spectrum.colorString()); } @@ -36,8 +36,8 @@ InspectorTest.addResult(spectrum._colorFormat); } - var spectrum = new WebInspector.Spectrum(); - var cf = WebInspector.Color.Format; + var spectrum = new Components.Spectrum(); + var cf = Common.Color.Format; var inputColors = [ { string: "red", format: cf.Nickname }, { string: "#ABC", format: cf.ShortHEX }, @@ -65,6 +65,6 @@ </script> </head> <body onload="runTest()"> -<p>Tests WebInspector.Spectrum</p> +<p>Tests Components.Spectrum</p> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/style-autocomplete.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/style-autocomplete.html index d4111d85..ce58842 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/style-autocomplete.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/style-autocomplete.html
@@ -6,12 +6,12 @@ function test() { - var namePrompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(WebInspector.cssMetadata().allProperties(), null, true); + var namePrompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(SDK.cssMetadata().allProperties(), null, true); var valuePrompt = valuePromptFor("color"); function valuePromptFor(name) { - return new WebInspector.StylesSidebarPane.CSSPropertyPrompt(WebInspector.cssMetadata().propertyValues(name), null, false); + return new Elements.StylesSidebarPane.CSSPropertyPrompt(SDK.cssMetadata().propertyValues(name), null, false); } InspectorTest.runTestSuite([
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-colon.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-colon.html index abec1074..277a7fd 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-colon.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-colon.html
@@ -7,7 +7,7 @@ function test() { InspectorTest.selectNodeAndWaitForStyles("inspected", step1); - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", onRevisionAdded); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addRevision", onRevisionAdded); var treeElement; var hasResourceChanged;
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-tab.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-tab.html index 490af5d..dd840309 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-tab.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule-tab.html
@@ -11,7 +11,7 @@ function test() { InspectorTest.selectNodeAndWaitForStyles("inspected", step1); - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", onRevisionAdded); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addRevision", onRevisionAdded); var treeElement; var hasResourceChanged;
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule.html index 56bf8a3..afa4a84a 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-add-new-rule.html
@@ -19,7 +19,7 @@ var testFinished = false; var displayName = null; - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", onRevisionAdded); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addRevision", onRevisionAdded); function step1() { @@ -66,7 +66,7 @@ InspectorTest.nodeWithClass("my-class", onNodeFound); function onNodeFound(node) { - WebInspector.Revealer.reveal(node); + Common.Revealer.reveal(node); } function onStylesReceived() @@ -83,7 +83,7 @@ InspectorTest.nodeWithClass("class-1", onNodeFound); function onNodeFound(node) { - WebInspector.Revealer.reveal(node); + Common.Revealer.reveal(node); } function onStylesReceived()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-commit-editing.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-commit-editing.html index bb4275b..ad0adb4 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-commit-editing.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-commit-editing.html
@@ -38,27 +38,27 @@ // Commit editing. treeElement.valueElement.textContent = "green"; treeElement.valueElement.firstChild.select(); - InspectorTest.addSniffer(WebInspector.StylePropertiesSection.prototype, "_afterUpdateFinishedForTest", next); + InspectorTest.addSniffer(Elements.StylePropertiesSection.prototype, "_afterUpdateFinishedForTest", next); treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); }, function testNewPropertyEditorIsCreated(next) { var blankTreeElement = treeOutline.rootElement().childAt(1); - if (!WebInspector.isBeingEdited(blankTreeElement.nameElement)) { + if (!UI.isBeingEdited(blankTreeElement.nameElement)) { InspectorTest.addResult("No new property editor active!"); InspectorTest.completeTest(); return; } // Test Styles pane editor looping. - InspectorTest.addSniffer(WebInspector.StylePropertiesSection.prototype, "_afterUpdateFinishedForTest", next); + InspectorTest.addSniffer(Elements.StylePropertiesSection.prototype, "_afterUpdateFinishedForTest", next); blankTreeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); }, function testCycleThroughPropertyEditing(next) { - if (!WebInspector.isBeingEdited(treeOutline.firstChild().nameElement)) { + if (!UI.isBeingEdited(treeOutline.firstChild().nameElement)) { InspectorTest.addResult("Original property name editor not active!"); InspectorTest.completeTest(); return;
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/disable-last-property-without-semicolon.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/disable-last-property-without-semicolon.html index c5e4739..913b79cee 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/disable-last-property-without-semicolon.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/disable-last-property-without-semicolon.html
@@ -9,7 +9,7 @@ { var formattedStyle; - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); function onStyleSheetChanged(event) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/do-not-rebuild-styles-on-every-change.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/do-not-rebuild-styles-on-every-change.html index 6ecaf2a..23c586c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/do-not-rebuild-styles-on-every-change.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/do-not-rebuild-styles-on-every-change.html
@@ -22,7 +22,7 @@ function didSelectElement() { - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "update", InspectorTest.addResult.bind(InspectorTest, "Requested StyleSidebarPane update"), true); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "update", InspectorTest.addResult.bind(InspectorTest, "Requested StyleSidebarPane update"), true); next(); } },
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/inline-style-sourcemap.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/inline-style-sourcemap.html index e88ae135..cf5470d 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/inline-style-sourcemap.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/inline-style-sourcemap.html
@@ -14,7 +14,7 @@ function test() { - WebInspector.targetManager.addModelListener(WebInspector.CSSModel, WebInspector.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded); + SDK.targetManager.addModelListener(SDK.CSSModel, SDK.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded); InspectorTest.evaluateInPage("embedInlineStyleSheet()", function() { }); function onStyleSheetAdded(event)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/keyframes-source-offsets.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/keyframes-source-offsets.html index 5afb518..94e6c68 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/keyframes-source-offsets.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/keyframes-source-offsets.html
@@ -49,7 +49,7 @@ dumpRule(animationsPayload[i]); InspectorTest.addResult("\n>> Modifying keyframe rule"); - var style = new WebInspector.CSSStyleDeclaration(InspectorTest.cssModel, null, animationsPayload[1].keyframes[0].style, WebInspector.CSSStyleDeclaration.Type.Regular); + var style = new SDK.CSSStyleDeclaration(InspectorTest.cssModel, null, animationsPayload[1].keyframes[0].style, SDK.CSSStyleDeclaration.Type.Regular); style.setText("width: 123px").then(onStyleEdited); function onStyleEdited()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/style-update-during-selector-edit.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/style-update-during-selector-edit.html index 3d10e47..897a5d1 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/style-update-during-selector-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/style-update-during-selector-edit.html
@@ -25,14 +25,14 @@ function rebuildUpdate() { - if (WebInspector.panels.elements._stylesWidget.node === treeOutline.selectedDOMNode()) + if (UI.panels.elements._stylesWidget.node === treeOutline.selectedDOMNode()) seenRebuildUpdate = true; } function step1() { - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "doUpdate", rebuildUpdate); - InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, attributeChanged, this); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "doUpdate", rebuildUpdate); + InspectorTest.domModel.addEventListener(SDK.DOMModel.Events.AttrModified, attributeChanged, this); // Click "Add new rule". document.querySelector(".styles-pane-toolbar").shadowRoot.querySelector(".largeicon-add").click(); InspectorTest.evaluateInPage("addStyleClass()", step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-formatting.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-formatting.html index 7e1f7b7..66d0009 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-formatting.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-formatting.html
@@ -11,7 +11,7 @@ var unformattedStyle; - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, onStyleSheetChanged, this); function onStyleSheetChanged(event) {
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-history.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-history.html index f7f4e1c..fb4432c 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-history.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-history.html
@@ -27,12 +27,12 @@ uiSourceCode = currentUISourceCode; next(); } - WebInspector.workspace.uiSourceCodes().forEach(visitUISourceCodes); + Workspace.workspace.uiSourceCodes().forEach(visitUISourceCodes); }, function testSetResourceContentMinor(next) { - InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor); + InspectorTest.addSniffer(Bindings.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor); uiSourceCode.setWorkingCopy("body {\n margin: 15px;\n padding: 10px;\n}"); function styleUpdatedMinor() @@ -43,12 +43,12 @@ function testSetResourceContentMajor(next) { - InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor); + InspectorTest.addSniffer(Bindings.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor); uiSourceCode.setWorkingCopy("body {\n margin: 20px;\n padding: 10px;\n}"); function styleUpdatedMinor() { - InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMajor); + InspectorTest.addSniffer(Bindings.StyleFile.prototype, "_styleContentSet", styleUpdatedMajor); uiSourceCode.commitWorkingCopy(function() { }); function styleUpdatedMajor() @@ -76,7 +76,7 @@ function step1(style) { var property = getLiveProperty(style, "margin"); - InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", dumpHistory(next)); + InspectorTest.addSniffer(Workspace.UISourceCode.prototype, "addRevision", dumpHistory(next)); property.setText("margin:30px;", true, true); } } @@ -103,7 +103,7 @@ var rule = matchedStyles[i].rule; if (rule.origin !== "regular") continue; - callback(new WebInspector.CSSStyleDeclaration(InspectorTest.cssModel, null, rule.style)); + callback(new SDK.CSSStyleDeclaration(InspectorTest.cssModel, null, rule.style)); return; } InspectorTest.addResult("error: did not find any regular rule");
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-inline-element-style-changes-should-not-force-style-recalc.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-inline-element-style-changes-should-not-force-style-recalc.html index 5cea375..b13e5e1 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-inline-element-style-changes-should-not-force-style-recalc.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-inline-element-style-changes-should-not-force-style-recalc.html
@@ -14,7 +14,7 @@ function test() { - WebInspector.context.setFlavor(WebInspector.TimelinePanel, WebInspector.panels.timeline); + UI.context.setFlavor(Timeline.TimelinePanel, UI.panels.timeline); InspectorTest.performActionsAndPrint("performActions()", "RecalculateStyles"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-invalid-color-values.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-invalid-color-values.html index 6ad4d689..f3a4be1 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-invalid-color-values.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-invalid-color-values.html
@@ -69,7 +69,7 @@ function dumpErrorsForInvalidColor(colorString) { - var color = WebInspector.Color.parse(colorString); + var color = Common.Color.parse(colorString); if (!color) { InspectorTest.addResult(""); InspectorTest.addResult("SUCCESS: parsed invalid color " + colorString + " to null"); @@ -81,14 +81,14 @@ function dumpColorRepresentationsForColor(colorString) { - var color = WebInspector.Color.parse(colorString); + var color = Common.Color.parse(colorString); if (!color) return; InspectorTest.addResult(""); InspectorTest.addResult("color: " + colorString); InspectorTest.addResult(" simple: " + !color.hasAlpha()); - var cf = WebInspector.Color.Format; + var cf = Common.Color.Format; for (var colorFormatKey in cf) { var colorFormat = cf[colorFormatKey]; // Simple colors do not have RGBA and HSLA representations.
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-keyframes.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-keyframes.html index eb799ef3d5..57891d9a 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-keyframes.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-keyframes.html
@@ -25,7 +25,7 @@ { InspectorTest.addResult("=== Before key modification ==="); InspectorTest.dumpSelectedElementStyles(true); - var section = WebInspector.panels.elements._stylesWidget._sectionBlocks[1].sections[1]; + var section = UI.panels.elements._stylesWidget._sectionBlocks[1].sections[1]; section.startEditingSelector(); section._selectorElement.textContent = "1%"; section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-live-locations-leak.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-live-locations-leak.html index fb37fc5..55602e52 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-live-locations-leak.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-live-locations-leak.html
@@ -64,7 +64,7 @@ function countLiveLocations() { var locationsCount = 0; - var targetInfos = WebInspector.cssWorkspaceBinding._modelToTargetInfo.valuesArray(); + var targetInfos = Bindings.cssWorkspaceBinding._modelToTargetInfo.valuesArray(); for (var targetInfo of targetInfos) locationsCount += targetInfo._locations.valuesArray().length; return locationsCount;
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-rerequest-sourcemap-on-watchdog.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-rerequest-sourcemap-on-watchdog.html index 7b53be1..38f73e5f 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-rerequest-sourcemap-on-watchdog.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-rerequest-sourcemap-on-watchdog.html
@@ -13,19 +13,19 @@ function test() { - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapAttached, onInitialSourceMap); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, onInitialSourceMap); InspectorTest.evaluateInPagePromise("addStyleSheet()"); function onInitialSourceMap() { - InspectorTest.cssModel.removeEventListener(WebInspector.CSSModel.Events.SourceMapAttached, onInitialSourceMap); + InspectorTest.cssModel.removeEventListener(SDK.CSSModel.Events.SourceMapAttached, onInitialSourceMap); InspectorTest.waitForScriptSource("styles-rerequest-sourcemap-on-watchdog.css", onCSSFile); } function onCSSFile(uiSourceCode) { - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_sourceMapLoadedForTest", onSourceMapRerequested); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_sourceMapLoadedForTest", onSourceMapRerequested); uiSourceCode.addRevision("div { color: blue; } /*# sourceMappingURL=styles-rerequest-sourcemap-on-watchdog.css.map */"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-should-not-force-sync-style-recalc.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-should-not-force-sync-style-recalc.html index 68c7eb78..60767b72 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-should-not-force-sync-style-recalc.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-should-not-force-sync-style-recalc.html
@@ -27,7 +27,7 @@ function test() { - WebInspector.context.setFlavor(WebInspector.TimelinePanel, WebInspector.panels.timeline); + UI.context.setFlavor(Timeline.TimelinePanel, UI.panels.timeline); InspectorTest.evaluateWithTimeline("performActions()", callback); function callback()
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links-2.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links-2.html index c6a984e5..0509db5 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links-2.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links-2.html
@@ -29,7 +29,7 @@ function testEditSelector(next) { - var section = WebInspector.panels.elements._stylesWidget._sectionBlocks[0].sections[3]; + var section = UI.panels.elements._stylesWidget._sectionBlocks[0].sections[3]; section.startEditingSelector(); section._selectorElement.textContent = ".should-change, .INSERTED-OTHER-SELECTOR"; InspectorTest.waitForSelectorCommitted(onSelectorEdited);
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links.js b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links.js index 2ae14f9..735e64a 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-update-links.js
@@ -98,7 +98,7 @@ InspectorTest.getMatchedRules = function() { var rules = []; - for (var block of WebInspector.panels.elements._stylesWidget._sectionBlocks) { + for (var block of UI.panels.elements._stylesWidget._sectionBlocks) { for (var section of block.sections) { var rule = section.style().parentRule; if (rule)
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-url-linkify.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-url-linkify.html index 76b48bd..66dc4a3 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-url-linkify.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/styles-url-linkify.html
@@ -10,7 +10,7 @@ { function completeURL(baseURL, href) { - InspectorTest.addResult(WebInspector.ParsedURL.completeURL(baseURL, href)); + InspectorTest.addResult(Common.ParsedURL.completeURL(baseURL, href)); } InspectorTest.addResult("URLs completed:");
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/supported-css-properties.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/supported-css-properties.html index 247de93..d1a1530 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles-4/supported-css-properties.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-4/supported-css-properties.html
@@ -4,7 +4,7 @@ <script> function test() { - var marginLonghands = WebInspector.cssMetadata().longhands("margin"); + var marginLonghands = SDK.cssMetadata().longhands("margin"); marginLonghands.sort(); InspectorTest.addResult("Margin longhands: " + marginLonghands.join(", ")); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles/original-content-provider.html b/third_party/WebKit/LayoutTests/inspector/elements/styles/original-content-provider.html index 36867078..8a1d180 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles/original-content-provider.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles/original-content-provider.html
@@ -36,7 +36,7 @@ function test() { - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_originalContentRequestedForTest", onOriginalContentRequested, true); + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_originalContentRequestedForTest", onOriginalContentRequested, true); function onOriginalContentRequested(header) { InspectorTest.addResult("original content loaded for header: " + header.sourceURL); @@ -47,7 +47,7 @@ function testSetStyle(next) { var header = headers.find(header => header.sourceURL.endsWith("set-style.css")); - InspectorTest.cssModel.setStyleText(header.id, new WebInspector.TextRange(1, 5, 1, 18), "EDITED: EDITED", true) + InspectorTest.cssModel.setStyleText(header.id, new Common.TextRange(1, 5, 1, 18), "EDITED: EDITED", true) .then(success => onEdit(header, success)) .then(next); }, @@ -55,7 +55,7 @@ function testSetSelector(next) { var header = headers.find(header => header.sourceURL.endsWith("set-selector.css")); - InspectorTest.cssModel.setSelectorText(header.id, new WebInspector.TextRange(1, 0, 1, 3), "EDITED") + InspectorTest.cssModel.setSelectorText(header.id, new Common.TextRange(1, 0, 1, 3), "EDITED") .then(success => onEdit(header, success)) .then(next); }, @@ -63,7 +63,7 @@ function testSetMedia(next) { var header = headers.find(header => header.sourceURL.endsWith("set-media.css")); - InspectorTest.cssModel.setMediaText(header.id, new WebInspector.TextRange(1, 7, 1, 12), "EDITED") + InspectorTest.cssModel.setMediaText(header.id, new Common.TextRange(1, 7, 1, 12), "EDITED") .then(success => onEdit(header, success)) .then(next); }, @@ -71,7 +71,7 @@ function testSetKeyframeKey(next) { var header = headers.find(header => header.sourceURL.endsWith("set-keyframe-key.css")); - InspectorTest.cssModel.setKeyframeKey(header.id, new WebInspector.TextRange(1, 23, 1, 27), "from") + InspectorTest.cssModel.setKeyframeKey(header.id, new Common.TextRange(1, 23, 1, 27), "from") .then(success => onEdit(header, success)) .then(next); }, @@ -79,7 +79,7 @@ function testAddRule(next) { var header = headers.find(header => header.sourceURL.endsWith("add-rule.css")); - InspectorTest.cssModel.addRule(header.id, "EDITED {}\n", new WebInspector.TextRange(1, 0, 1, 0)) + InspectorTest.cssModel.addRule(header.id, "EDITED {}\n", new Common.TextRange(1, 0, 1, 0)) .then(success => onEdit(header, success)) .then(next); },
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles/styles-test.js b/third_party/WebKit/LayoutTests/inspector/elements/styles/styles-test.js index 674573ad..d4ad43e 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles/styles-test.js +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles/styles-test.js
@@ -15,12 +15,12 @@ if (styleSheets.length < styleSheetsCount) return; - InspectorTest.cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded, this); + InspectorTest.cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded, this); styleSheets.sort(styleSheetComparator); callback(null, styleSheets); } - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded, this); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, onStyleSheetAdded, this); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles/up-down-numerics-and-colors.html b/third_party/WebKit/LayoutTests/inspector/elements/styles/up-down-numerics-and-colors.html index e4fe3e58..e9c6375 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles/up-down-numerics-and-colors.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles/up-down-numerics-and-colors.html
@@ -29,7 +29,7 @@ // PageUp should change to 'FF3' colorTreeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("PageUp")); // Ctrl/Meta + Shift Down should change to 'EE3' - if (WebInspector.isMac()) + if (Host.isMac()) colorTreeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("ArrowDown", /*Ctrl*/ false, /*Alt*/ false, /*Shift*/ true, /*Meta*/ true)); else colorTreeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("ArrowDown", /*Ctrl*/ true, /*Alt*/ false, /*Shift*/ true, /*Meta*/ false));
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-during-dom-traversal.html b/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-during-dom-traversal.html index 16c3a37..4f33e5d 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-during-dom-traversal.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-during-dom-traversal.html
@@ -12,7 +12,7 @@ InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback); function selectCallback() { - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_innerRebuildUpdate", sniffUpdate, true); + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_innerRebuildUpdate", sniffUpdate, true); var element = InspectorTest.firstElementsTreeOutline().element; for (var i = 0; i < keydownCount; ++i) element.dispatchEvent(InspectorTest.createKeyEvent("ArrowUp"));
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-throttled.html b/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-throttled.html index de31570e..c42cb4a 100644 --- a/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-throttled.html +++ b/third_party/WebKit/LayoutTests/inspector/elements/styles/updates-throttled.html
@@ -12,10 +12,10 @@ InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback); function selectCallback() { - InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_innerRebuildUpdate", sniffRebuild, true); - var stylesPane = WebInspector.panels.elements._stylesWidget; + InspectorTest.addSniffer(Elements.StylesSidebarPane.prototype, "_innerRebuildUpdate", sniffRebuild, true); + var stylesPane = UI.panels.elements._stylesWidget; for (var i = 0; i < UPDATE_COUNT; ++i) - WebInspector.context.setFlavor(WebInspector.DOMNode, stylesPane.node()); + UI.context.setFlavor(SDK.DOMNode, stylesPane.node()); InspectorTest.deprecatedRunAfterPendingDispatches(completeCallback); }
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-audits-tests.js b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-audits-tests.js index f05e10d9..1651bdf7 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-audits-tests.js +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-audits-tests.js
@@ -8,7 +8,7 @@ { InspectorTest.startExtensionAudits = function(callback) { - const launcherView = WebInspector.panels.audits._launcherView; + const launcherView = UI.panels.audits._launcherView; launcherView._selectAllClicked(false); launcherView._auditPresentStateElement.checked = true; @@ -23,7 +23,7 @@ { InspectorTest.collectAuditResults(callback); } - InspectorTest.addSniffer(WebInspector.panels.audits, "auditFinishedCallback", onAuditsDone, true); + InspectorTest.addSniffer(UI.panels.audits, "auditFinishedCallback", onAuditsDone, true); launcherView._launchButtonClicked(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-events.html b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-events.html index 75aaef0a..8a09ce0 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-events.html +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-events.html
@@ -19,7 +19,7 @@ InspectorTest._extensionSidebar = function() { - return WebInspector.extensionServer.sidebarPanes()[0]; + return Extensions.extensionServer.sidebarPanes()[0]; } }
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html index f9b8e01b..67bd97d 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-panel.html
@@ -16,7 +16,7 @@ { InspectorTest.getPanelSize = function() { - var boundingRect = WebInspector.inspectorView._tabbedPane._contentElement.getBoundingClientRect(); + var boundingRect = UI.inspectorView._tabbedPane._contentElement.getBoundingClientRect(); return { width: boundingRect.width, height: boundingRect.height @@ -25,7 +25,7 @@ InspectorTest.dumpStatusBarButtons = function() { - var panel = WebInspector.inspectorView.currentPanelDeprecated(); + var panel = UI.inspectorView.currentPanelDeprecated(); var items = panel._panelToolbar._contentElement.children; InspectorTest.addResult("Status bar buttons state:"); for (var i = 0; i < items.length; ++i) { @@ -38,13 +38,13 @@ } // Strip url(...) and prefix of the URL within, leave just last 3 components. var url = item.style.backgroundImage.replace(/^url\(.*(([/][^/]*){3}[^/)]*)\)$/, "...$1"); - InspectorTest.addResult("status bar item " + i + ", icon: \"" + url + ", tooltip: '" + item[WebInspector.Tooltip._symbol].content + "', disabled: " + item.disabled); + InspectorTest.addResult("status bar item " + i + ", icon: \"" + url + ", tooltip: '" + item[UI.Tooltip._symbol].content + "', disabled: " + item.disabled); } } InspectorTest.clickButton = function(index) { - var panel = WebInspector.inspectorView.currentPanelDeprecated(); + var panel = UI.inspectorView.currentPanelDeprecated(); var items = panel._panelToolbar._contentElement.children; for (var i = 0, buttonIndex = 0; i < items.length; ++i) { if (items[i] instanceof HTMLButtonElement) { @@ -64,18 +64,18 @@ InspectorTest.disableConsoleViewport(); InspectorTest.evaluateInPage("logMessage()"); var wrappedConsoleMessageAdded = InspectorTest.safeWrap(consoleMessageAdded); - WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, wrappedConsoleMessageAdded); + SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, wrappedConsoleMessageAdded); function consoleMessageAdded() { - WebInspector.multitargetConsoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, wrappedConsoleMessageAdded); - WebInspector.ConsoleView.instance()._viewportThrottler.flush(); + SDK.multitargetConsoleModel.removeEventListener(SDK.ConsoleModel.Events.MessageAdded, wrappedConsoleMessageAdded); + Console.ConsoleView.instance()._viewportThrottler.flush(); InspectorTest.deprecatedRunAfterPendingDispatches(clickOnMessage) } function clickOnMessage() { - var xpathResult = document.evaluate("//a[starts-with(., 'extensions-panel.html')]", WebInspector.ConsoleView.instance()._viewport.element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); + var xpathResult = document.evaluate("//a[starts-with(., 'extensions-panel.html')]", Console.ConsoleView.instance()._viewport.element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); var click = document.createEvent("MouseEvent"); click.initMouseEvent("click", true, true); @@ -91,9 +91,9 @@ InspectorTest.addResult("Showing resource " + url + " in panel " + panelName + "), line: " + lineNumber); } InspectorTest.recordNetwork(); - InspectorTest.addSniffer(WebInspector.panels.sources, "showUILocation", showUILocationHook, true); - InspectorTest.addSniffer(WebInspector.panels.resources, "showResource", showResourceHook, true); - InspectorTest.addSniffer(WebInspector.panels.network, "revealAndHighlightRequest", showRequestHook, true); + InspectorTest.addSniffer(UI.panels.sources, "showUILocation", showUILocationHook, true); + InspectorTest.addSniffer(UI.panels.resources, "showResource", showResourceHook, true); + InspectorTest.addSniffer(UI.panels.network, "revealAndHighlightRequest", showRequestHook, true); function showUILocationHook(uiLocation) { @@ -113,8 +113,8 @@ InspectorTest.switchToLastPanel = function() { - var lastPanelName = WebInspector.inspectorView._tabbedPane._tabs.peekLast().id; - return WebInspector.inspectorView.showPanel(lastPanelName); + var lastPanelName = UI.inspectorView._tabbedPane._tabs.peekLast().id; + return UI.inspectorView.showPanel(lastPanelName); } } @@ -192,7 +192,7 @@ panel.show(); } webInspector.panels.setOpenResourceHandler(handleOpenResource); - evaluateOnFrontend("WebInspector.openAnchorLocationRegistry._activeHandler = 'test extension'"); + evaluateOnFrontend("Components.openAnchorLocationRegistry._activeHandler = 'test extension'"); evaluateOnFrontend("InspectorTest.logMessageAndClickOnURL();"); expectOnShown = true; } @@ -222,7 +222,7 @@ function performSearch(query) { - WebInspector.inspectorView.panel("file://TestPanelforsearch").then(panel => { + UI.inspectorView.panel("file://TestPanelforsearch").then(panel => { panel.searchableView().showSearchField(); panel.searchableView()._searchInputElement.value = query; panel.searchableView()._performSearch(true, true); @@ -297,7 +297,7 @@ { var platform; var testPanel; - evaluateOnFrontend("reply(WebInspector.platform())", function(result) { + evaluateOnFrontend("reply(Host.platform())", function(result) { platform = result; var basePath = location.pathname.replace(/\/[^/]*$/, "/"); webInspector.panels.create("Shortcuts Test Panel", basePath + "extension-panel.png", basePath + "extension-panel.html", onPanelCreated); @@ -326,7 +326,7 @@ { panelWindow.removeEventListener("resize", onPanelResized); output("Panel resized, test passed."); - evaluateOnFrontend("reply(WebInspector.inspectorView._closeDrawer())", nextTest); + evaluateOnFrontend("reply(UI.inspectorView._closeDrawer())", nextTest); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-reload.html b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-reload.html index d2679a5..aa7717d 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-reload.html +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-reload.html
@@ -38,7 +38,7 @@ { InspectorTest.lastMessageScriptId = function(callback) { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); if (consoleView._needsFullUpdate) consoleView._updateMessageList(); var viewMessages = consoleView._visibleViewMessages;
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-resources.html b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-resources.html index 1617d240..5aab7bd 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-resources.html +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-resources.html
@@ -26,10 +26,10 @@ InspectorTest.clickOnURL = function() { - WebInspector.viewManager.showView("console").then(() => { - WebInspector.ConsoleView.instance()._updateMessageList(); + UI.viewManager.showView("console").then(() => { + Console.ConsoleView.instance()._updateMessageList(); var xpathResult = document.evaluate("//a[starts-with(., 'test-script.js')]", - WebInspector.ConsoleView.instance().element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); + Console.ConsoleView.instance().element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); var click = document.createEvent("MouseEvent"); click.initMouseEvent("click", true, true); @@ -39,13 +39,13 @@ InspectorTest.waitForStyleSheetChangedEvent = function(reply) { - var originalSetTimeout = WebInspector.Throttler.prototype._setTimeout; - WebInspector.Throttler.prototype._setTimeout = innerSetTimeout; - InspectorTest.addSniffer(WebInspector.CSSModel.prototype, "_fireStyleSheetChanged", onStyleSheetChanged); + var originalSetTimeout = Common.Throttler.prototype._setTimeout; + Common.Throttler.prototype._setTimeout = innerSetTimeout; + InspectorTest.addSniffer(SDK.CSSModel.prototype, "_fireStyleSheetChanged", onStyleSheetChanged); function onStyleSheetChanged() { - WebInspector.Throttler.prototype._setTimeout = originalSetTimeout; + Common.Throttler.prototype._setTimeout = originalSetTimeout; reply(); } @@ -196,7 +196,7 @@ webInspector.panels.setOpenResourceHandler(handleOpenResource); webInspector.inspectedWindow.eval("logMessage()", function() { evaluateOnFrontend("InspectorTest.clickOnURL();"); - evaluateOnFrontend("WebInspector.openAnchorLocationRegistry.activeHandler = 'test extension'; InspectorTest.clickOnURL();"); + evaluateOnFrontend("Components.openAnchorLocationRegistry.activeHandler = 'test extension'; InspectorTest.clickOnURL();"); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-sidebar.html b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-sidebar.html index 058e8c0..425c7b9 100644 --- a/third_party/WebKit/LayoutTests/inspector/extensions/extensions-sidebar.html +++ b/third_party/WebKit/LayoutTests/inspector/extensions/extensions-sidebar.html
@@ -26,7 +26,7 @@ InspectorTest._extensionSidebar = function(panelName) { - var sidebarPanes = WebInspector.extensionServer.sidebarPanes(); + var sidebarPanes = Extensions.extensionServer.sidebarPanes(); var result; for (var i = 0; i < sidebarPanes.length; ++i) { if (sidebarPanes[i].panelName() === panelName)
diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html index dc5208b..772b5cc 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html
@@ -7,7 +7,7 @@ InspectorTest.runTestSuite([ function testFileSystemClashDirectOrder(next) { - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); fileSystemMapping.addFileSystem("file:///Source/devtools"); fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "chrome-devtools://devtools/bundled/wrong_url", "/"); @@ -19,7 +19,7 @@ function testFileSystemClashReversedOrder(next) { - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); fileSystemMapping.addFileSystem("file:///Source/devtools"); fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/right_url", "/"); @@ -31,7 +31,7 @@ function testNetworkClashDirectOrder(next) { - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); fileSystemMapping.addFileSystem("file:///Source/devtools"); fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/wrong"); @@ -43,7 +43,7 @@ function testNetworkClashReversedOrder(next) { - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); fileSystemMapping.addFileSystem("file:///Source/devtools"); fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/right");
diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html b/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html index 78f73e7..869624d 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html
@@ -87,7 +87,7 @@ } // At first create file system mapping and clear it. - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); var fileSystemPaths = Object.keys(fileSystemMapping._fileSystemMappings); for (var i = 0; i < fileSystemPaths.length; ++i) fileSystemMapping.removeFileSystem(fileSystemPaths[i]); @@ -130,7 +130,7 @@ // Then create another file mapping to make sure it is correctly restored from the settings. InspectorTest.addResult("Creating another file system mapping."); - var fileSystemMapping = new WebInspector.FileSystemMapping(); + var fileSystemMapping = new Workspace.FileSystemMapping(); checkAndDumpFileSystemMapping(fileSystemMapping); // Now remove file mappings.
diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-project.html b/third_party/WebKit/LayoutTests/inspector/file-system-project.html index 6f4dc62..6915342 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-project.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-project.html
@@ -71,14 +71,14 @@ fs1.reportCreated(function() {}); fs2.reportCreated(function() {}); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, onUISourceCode); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, onUISourceCode); var count = 3; function onUISourceCode() { if (--count) return; - WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, onUISourceCode); + Workspace.workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, onUISourceCode); onUISourceCodesLoaded(); } @@ -93,7 +93,7 @@ function uiSourceCodesDumped() { dumpUISourceCodeLocations(uiSourceCodes, 5); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommitted, contentCommitted, this); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyCommitted, contentCommitted, this); uiSourceCodes[0].addRevision("<Modified UISourceCode content>"); } @@ -127,7 +127,7 @@ function testExcludesSettings(next) { - WebInspector.settings.createLocalSetting("workspaceExcludedFolders", {}).set({"file:///var/www2":["/html/"]}); + Common.settings.createLocalSetting("workspaceExcludedFolders", {}).set({"file:///var/www2":["/html/"]}); createFileSystem("file:///var/www2", dumpExcludes); function dumpExcludes(fs) @@ -212,7 +212,7 @@ function dumpGitFolders() { - var isolatedFileSystem = WebInspector.isolatedFileSystemManager.fileSystem("file:///var/www3"); + var isolatedFileSystem = Workspace.isolatedFileSystemManager.fileSystem("file:///var/www3"); var folders = isolatedFileSystem.gitFolders(); folders.sort(); for (var gitFolder of folders)
diff --git a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering.html b/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering.html index 37b12f19..fe82b19 100644 --- a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering.html +++ b/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-rendering.html
@@ -11,7 +11,7 @@ <script> function test() { - var delegate = new WebInspector.FilteredUISourceCodeListDelegate(); + var delegate = new Sources.FilteredUISourceCodeListDelegate(); delegate.populate(); InspectorTest.runTestSuite([
diff --git a/third_party/WebKit/LayoutTests/inspector/initial-modules-load.html b/third_party/WebKit/LayoutTests/inspector/initial-modules-load.html index d34a983..e173a8b 100644 --- a/third_party/WebKit/LayoutTests/inspector/initial-modules-load.html +++ b/third_party/WebKit/LayoutTests/inspector/initial-modules-load.html
@@ -13,17 +13,17 @@ function testCreateElementsPanel(next) { - WebInspector.inspectorView.panel("elements").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, self.runtime.loadModulePromise("animation").then(next))); + UI.inspectorView.panel("elements").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, self.runtime.loadModulePromise("animation").then(next))); }, function testCreateNetworkPanel(next) { - WebInspector.inspectorView.panel("network").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next)); + UI.inspectorView.panel("network").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next)); }, function testShowSourcesPanel(next) { - WebInspector.inspectorView.panel("sources").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next)); + UI.inspectorView.panel("sources").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next)); }, function testOpenUISourceCode(next) @@ -35,8 +35,8 @@ return true; } }); - var uiLocation = WebInspector.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1); - WebInspector.Revealer.reveal(uiLocation); + var uiLocation = Workspace.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1); + Common.Revealer.reveal(uiLocation); InspectorTest.dumpLoadedModules(next); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/input-event-warning.html b/third_party/WebKit/LayoutTests/inspector/input-event-warning.html index 2b1c62b..75df9f9 100644 --- a/third_party/WebKit/LayoutTests/inspector/input-event-warning.html +++ b/third_party/WebKit/LayoutTests/inspector/input-event-warning.html
@@ -62,7 +62,7 @@ function test() { - WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, InspectorTest.safeWrap(onConsoleMessage)); + SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, InspectorTest.safeWrap(onConsoleMessage)); step1(); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-generation.html b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-generation.html index fe2d565..1c5529c 100644 --- a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-generation.html +++ b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-generation.html
@@ -28,7 +28,7 @@ ] }] }]}; - var commands = WebInspector.InspectorBackendHostedMode.generateCommands(inspectorJson); + var commands = SDK.InspectorBackendHostedMode.generateCommands(inspectorJson); InspectorTest.addResult(commands); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands.html b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands.html index 54eccef2..5f8f31ea 100644 --- a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands.html +++ b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands.html
@@ -65,7 +65,7 @@ ] }] }]}; - var commands = WebInspector.InspectorBackendHostedMode.generateCommands(inspectorJson); + var commands = SDK.InspectorBackendHostedMode.generateCommands(inspectorJson); eval(commands); var sendMessageToBackendOriginal = InspectorFrontendHost.sendMessageToBackend; @@ -75,7 +75,7 @@ return Array.prototype.slice.call(arguments); } - var agent = WebInspector.targetManager.mainTarget().profilerAgent(); + var agent = SDK.targetManager.mainTarget().profilerAgent(); Promise.resolve() .then(function() { return processResult("commandError", agent.commandError({"message": "this is the error message"}, defaultHandler)); }) // Error: error in the protocol response .then(function() { return processResult("commandArgs0", agent.commandArgs0(defaultHandler)); })
diff --git a/third_party/WebKit/LayoutTests/inspector/jump-to-previous-editing-location.html b/third_party/WebKit/LayoutTests/inspector/jump-to-previous-editing-location.html index ca7057e1..8e363bc 100644 --- a/third_party/WebKit/LayoutTests/inspector/jump-to-previous-editing-location.html +++ b/third_party/WebKit/LayoutTests/inspector/jump-to-previous-editing-location.html
@@ -9,7 +9,7 @@ <script> function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var sourcesView = panel._sourcesView; var historyManager = sourcesView._historyManager; var editorContainer = sourcesView._editorContainer; @@ -53,7 +53,7 @@ var lineNumber = lines[i]; var columnNumber = columns[i]; var originSelection = editor.selection(); - editor.setSelection(WebInspector.TextRange.createFromLocation(lineNumber, columnNumber)); + editor.setSelection(Common.TextRange.createFromLocation(lineNumber, columnNumber)); editor._reportJump(originSelection, editor.selection()); dumpSelection("Mouse click (" + lineNumber + ", " + columnNumber + ")"); } @@ -114,7 +114,7 @@ function testDeletePreviousJumpLocations(next) { var editor = panel.visibleView.textEditor; - editor.editRange(new WebInspector.TextRange(9, 0, 15, 0), ""); + editor.editRange(new Common.TextRange(9, 0, 15, 0), ""); dumpSelection("Removed lines from 9 to 15"); rollback(); dumpSelection("Rolled back"); @@ -132,7 +132,7 @@ for (var i = 0; i < jumpsToDo; ++i) rollback(); dumpSelection("Rolled back 4 times"); - editor.editRange(new WebInspector.TextRange(9, 0, 11, 0), ""); + editor.editRange(new Common.TextRange(9, 0, 11, 0), ""); dumpSelection("Removed lines from 9 to 11"); rollover(); dumpSelection("Rolled over"); @@ -179,7 +179,7 @@ { var lines = []; var columns = []; - const jumpsAmount = WebInspector.EditingLocationHistoryManager.HistoryDepth; + const jumpsAmount = Sources.EditingLocationHistoryManager.HistoryDepth; for(var i = 0; i < jumpsAmount; ++i) { lines.push(i + 10); columns.push(7); @@ -220,10 +220,10 @@ InspectorTest.waitForScriptSource("workspace-test.js", onScriptSource); function onScriptSource(uiSourceCode) { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var anchorURI = uiSourceCode.url(); - var anchor = linkifier.linkifyScriptLocation(WebInspector.targetManager.mainTarget(), null, anchorURI, 10, 1); - WebInspector.Revealer.revealPromise(anchor[WebInspector.Linkifier._uiLocationSymbol]).then(function() { + var anchor = linkifier.linkifyScriptLocation(SDK.targetManager.mainTarget(), null, anchorURI, 10, 1); + Common.Revealer.revealPromise(anchor[Components.Linkifier._uiLocationSymbol]).then(function() { InspectorTest.addResult("Selection: " + panel.visibleView.textEditor.selection().toString()); dumpSelection("Showed anchor in " + anchorURI.split("/").pop() + " with line 333 column 3"); rollback();
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html b/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html index 20e7cc4..e5c43c5 100644 --- a/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html +++ b/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html
@@ -27,7 +27,7 @@ layer.requestCompositingReasons(function(reasons) { var node = layer.nodeForSelfOrAncestor(); - var label = WebInspector.DOMPresentationUtils.fullQualifiedSelector(node, false); + var label = Components.DOMPresentationUtils.fullQualifiedSelector(node, false); InspectorTest.addResult("Compositing reasons for " + label + ": " + reasons.sort().join(",")); if (callback) callback();
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html b/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html index 0e7fec1c..72dfba1 100644 --- a/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html +++ b/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html
@@ -21,7 +21,7 @@ function initSizes() { - canvas = WebInspector.panels.layers._layers3DView._canvasElement; + canvas = UI.panels.layers._layers3DView._canvasElement; var canvasWidth = canvas.offsetWidth; var canvasHeight = canvas.offsetHeight; var rootWidth = contentRoot.width(); @@ -49,11 +49,11 @@ function dumpStateForOutlineType(type) { var outlined = "none"; - WebInspector.panels.layers._update(); + UI.panels.layers._update(); function checkLayer(layerInfo) { - var l3dview = WebInspector.panels.layers._layers3DView; + var l3dview = UI.panels.layers._layers3DView; if (l3dview._lastSelection[type] && layerInfo.layer.id() === l3dview._lastSelection[type].layer().id()) outlined = layerInfo.name; } @@ -65,8 +65,8 @@ function dumpOutlinedStateForLayers() { InspectorTest.addResult("State of layers:"); - dumpStateForOutlineType(WebInspector.Layers3DView.OutlineType.Hovered); - dumpStateForOutlineType(WebInspector.Layers3DView.OutlineType.Selected); + dumpStateForOutlineType(LayerViewer.Layers3DView.OutlineType.Hovered); + dumpStateForOutlineType(LayerViewer.Layers3DView.OutlineType.Selected); } function onGotLayers()
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layers-panel-mouse-events.html b/third_party/WebKit/LayoutTests/inspector/layers/layers-panel-mouse-events.html index 7ee4ddc..69c31c7 100644 --- a/third_party/WebKit/LayoutTests/inspector/layers/layers-panel-mouse-events.html +++ b/third_party/WebKit/LayoutTests/inspector/layers/layers-panel-mouse-events.html
@@ -19,8 +19,8 @@ InspectorTest.findLayerTreeElement = function(layer) { - var layerTree = WebInspector.panels.layers._layerTreeOutline._treeOutline; - var element = layer[WebInspector.LayerTreeElement._symbol]; + var layerTree = UI.panels.layers._layerTreeOutline._treeOutline; + var element = layer[LayerViewer.LayerTreeElement._symbol]; element.reveal(); return element.listItemElement; } @@ -49,7 +49,7 @@ { function step1() { - WebInspector.panels.layers._update(); + UI.panels.layers._update(); var layerB1 = InspectorTest.findLayerByNodeIdAttribute("b1"); var treeElementB1 = InspectorTest.findLayerTreeElement(layerB1); @@ -58,7 +58,7 @@ function dumpElementSelectionState() { - WebInspector.panels.layers._update(); + UI.panels.layers._update(); InspectorTest.dumpSelectedStyles("Layer b1 in tree", treeElementB1); InspectorTest.dumpSelectedStyles("Layer b3 in tree", treeElementB3); }
diff --git a/third_party/WebKit/LayoutTests/inspector/load-file-resource-for-frontend.html b/third_party/WebKit/LayoutTests/inspector/load-file-resource-for-frontend.html index 36e3c2ce..9ee07f2 100644 --- a/third_party/WebKit/LayoutTests/inspector/load-file-resource-for-frontend.html +++ b/third_party/WebKit/LayoutTests/inspector/load-file-resource-for-frontend.html
@@ -12,7 +12,7 @@ var fullURL = urlPrefix + url; InspectorTest.addResult("Loading resource from " + url); - WebInspector.ResourceLoader.load(fullURL, null, callback); + Host.ResourceLoader.load(fullURL, null, callback); function callback(statusCode, headers, content) {
diff --git a/third_party/WebKit/LayoutTests/inspector/local-object-properties-section.html b/third_party/WebKit/LayoutTests/inspector/local-object-properties-section.html index d2d9d4a2..2db54ad6 100644 --- a/third_party/WebKit/LayoutTests/inspector/local-object-properties-section.html +++ b/third_party/WebKit/LayoutTests/inspector/local-object-properties-section.html
@@ -9,9 +9,9 @@ for (var i = 1000; i < 1256; ++i) d.push(i); var object = {a: "b", c: d}; - var localObject = WebInspector.RemoteObject.fromLocalObject(object); + var localObject = SDK.RemoteObject.fromLocalObject(object); - var propertiesSection = new WebInspector.ObjectPropertiesSection(localObject, "local object"); + var propertiesSection = new Components.ObjectPropertiesSection(localObject, "local object"); propertiesSection.expand(); propertiesSection.objectTreeElement().childAt(1).expand();
diff --git a/third_party/WebKit/LayoutTests/inspector/local-object.html b/third_party/WebKit/LayoutTests/inspector/local-object.html index 265f628..403d813 100644 --- a/third_party/WebKit/LayoutTests/inspector/local-object.html +++ b/third_party/WebKit/LayoutTests/inspector/local-object.html
@@ -6,7 +6,7 @@ function test() { var object = [6, 28, 496]; - var localObject = WebInspector.RemoteObject.fromLocalObject(object); + var localObject = SDK.RemoteObject.fromLocalObject(object); function getItem(index) {
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-domain-filter.html b/third_party/WebKit/LayoutTests/inspector/network/network-domain-filter.html index c962c8d0..337d0758 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-domain-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-domain-filter.html
@@ -8,12 +8,12 @@ { InspectorTest.addResult(""); InspectorTest.addResult("Domain: " + domain); - InspectorTest.addResult("Subdomains: " + JSON.stringify(WebInspector.NetworkLogView._subdomains(domain))); + InspectorTest.addResult("Subdomains: " + JSON.stringify(Network.NetworkLogView._subdomains(domain))); } function checkFilter(value, domains) { - var filter = WebInspector.NetworkLogView._createRequestDomainFilter(value); + var filter = Network.NetworkLogView._createRequestDomainFilter(value); InspectorTest.addResult(""); InspectorTest.addResult("Filter: " + value); for (var i = 0; i < domains.length; ++i)
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-filter-http-requests.html b/third_party/WebKit/LayoutTests/inspector/network/network-filter-http-requests.html index 830b1793..8caa48a 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-filter-http-requests.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-filter-http-requests.html
@@ -6,8 +6,8 @@ function test() { function checkURL(url) { - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), url, url, "", "", ""); - var result = WebInspector.NetworkLogView.HTTPRequestsFilter(request); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), url, url, "", "", ""); + var result = Network.NetworkLogView.HTTPRequestsFilter(request); InspectorTest.addResult((result ? "" : "Non-") + "HTTP request URL: " + url); }
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-filter-parser.html b/third_party/WebKit/LayoutTests/inspector/network/network-filter-parser.html index 9a302dbb..023f124 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-filter-parser.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-filter-parser.html
@@ -6,7 +6,7 @@ function test() { function checkQuery(keys, query) { - var suggestionBuilder = new WebInspector.FilterSuggestionBuilder(keys); + var suggestionBuilder = new Network.FilterSuggestionBuilder(keys); var result = suggestionBuilder.parseQuery(query); InspectorTest.addResult(""); InspectorTest.addResult("Keys: " + JSON.stringify(keys));
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-filter-updated-requests.html b/third_party/WebKit/LayoutTests/inspector/network/network-filter-updated-requests.html index 9265fc6..ec1d320 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-filter-updated-requests.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-filter-updated-requests.html
@@ -4,25 +4,25 @@ <script src="../../http/tests/inspector/network-test.js"></script> <script> function test() { - var target = WebInspector.panels.network._networkLogView; - var types = WebInspector.resourceTypes; + var target = UI.panels.network._networkLogView; + var types = Common.resourceTypes; var categoryName = types.XHR.category().title; target._resourceCategoryFilterUI._toggleTypeFilter(categoryName, false); InspectorTest.addResult("Clicked '" + categoryName + "' button."); - var requestFoo = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), "", "", "", "", ""); + var requestFoo = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), "", "", "", "", ""); requestFoo.setResourceType(types.Script); requestFoo.requestId = "foo"; target._appendRequest(requestFoo); - var requestBar = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), "", "", "", "", ""); + var requestBar = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), "", "", "", "", ""); requestBar.setResourceType(types.Script); requestBar.requestId = "bar"; target._appendRequest(requestBar); target._refresh(); function isFilteredOut(request) { - return !!target._nodesByRequestId.get(request.requestId)[WebInspector.NetworkLogView._isFilteredOutSymbol]; + return !!target._nodesByRequestId.get(request.requestId)[Network.NetworkLogView._isFilteredOutSymbol]; } InspectorTest.addResult("");
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html b/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html index ba8d87f..269274f 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html
@@ -4,10 +4,10 @@ <script src="../../http/tests/inspector/network-test.js"></script> <script> function test() { - var worker = new WebInspector.Worker("formatter_worker"); + var worker = new Common.Worker("formatter_worker"); function check(jsonText) { - var resultData = WebInspector.JSONView._extractJSON(jsonText); + var resultData = Network.JSONView._extractJSON(jsonText); if (!resultData) { failure(); return;
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-request-parse-query-params.html b/third_party/WebKit/LayoutTests/inspector/network/network-request-parse-query-params.html index e180ea4..eaee76b 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-request-parse-query-params.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-request-parse-query-params.html
@@ -7,7 +7,7 @@ function checkQuery(query) { var url = "http://webkit.org?" + query; - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), url, url, "", "", ""); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), url, url, "", "", ""); InspectorTest.addResult("Query: " + request.queryString()); var params = request.queryParameters; InspectorTest.addResult("Parameters: ");
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-request-query-string.html b/third_party/WebKit/LayoutTests/inspector/network/network-request-query-string.html index f0af0e72..fccf180a 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-request-query-string.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-request-query-string.html
@@ -6,7 +6,7 @@ function test() { function checkURL(url) { - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), url, url, "", "", ""); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), url, url, "", "", ""); InspectorTest.addResult("URL: " + url); InspectorTest.addResult("Query: " + request.queryString()); InspectorTest.addResult("");
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-status-non-http.html b/third_party/WebKit/LayoutTests/inspector/network/network-status-non-http.html index e25d5201..6dd373b76 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-status-non-http.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-status-non-http.html
@@ -10,13 +10,13 @@ function dumpRequests() { - var logView = WebInspector.panels.network._networkLogView; + var logView = UI.panels.network._networkLogView; logView._refresh(); var dataGrid = logView.element.querySelector("table.data"); var urls = document.evaluate("//tbody/tr/td[position()=1]/@title", dataGrid, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var outputStrings = []; - for (var request of WebInspector.NetworkLog.fromTarget(WebInspector.targetManager.mainTarget())._requests) { + for (var request of SDK.NetworkLog.fromTarget(SDK.targetManager.mainTarget())._requests) { var line = request.displayName + ":" + request.statusCode + " " + request.statusText if (request.failed) line += "(failed)"; @@ -35,7 +35,7 @@ setTimeout(dumpRequests); } - InspectorTest.networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestFinished, onRequestFinished); + InspectorTest.networkManager.addEventListener(SDK.NetworkManager.Events.RequestFinished, onRequestFinished); InspectorTest.recordNetwork(); InspectorTest.evaluateInPage("loadResources()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-toggle-type-filter.html b/third_party/WebKit/LayoutTests/inspector/network/network-toggle-type-filter.html index 1393f2b..927aaa34 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-toggle-type-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-toggle-type-filter.html
@@ -5,8 +5,8 @@ <script> function test() { InspectorTest.recordNetwork(); - var target = WebInspector.panels.network._networkLogView; - var types = WebInspector.resourceTypes; + var target = UI.panels.network._networkLogView; + var types = Common.resourceTypes; function toggleAndDump(buttonName, toggle) { @@ -14,9 +14,9 @@ InspectorTest.addResult((toggle ? "Toggled '" : "Clicked '") + buttonName + "' button."); target._resourceCategoryFilterUI._toggleTypeFilter(buttonName, toggle); var results = []; - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), "", "", "", "", ""); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), "", "", "", "", ""); for (var typeId in types) { - var type = WebInspector.resourceTypes[typeId]; + var type = Common.resourceTypes[typeId]; results.push(type.name() + ": " + target._resourceCategoryFilterUI.accept(type.category().title)); } InspectorTest.addResult("Filter: " + results.join(", "));
diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-update-calculator-for-all-requests.html b/third_party/WebKit/LayoutTests/inspector/network/network-update-calculator-for-all-requests.html index 329e1568..4e5b296 100644 --- a/third_party/WebKit/LayoutTests/inspector/network/network-update-calculator-for-all-requests.html +++ b/third_party/WebKit/LayoutTests/inspector/network/network-update-calculator-for-all-requests.html
@@ -4,14 +4,14 @@ <script src="../../http/tests/inspector/network-test.js"></script> <script> function test() { - var target = WebInspector.panels.network._networkLogView; - target._resourceCategoryFilterUI._toggleTypeFilter(WebInspector.resourceTypes.XHR.category().title, false); - InspectorTest.addResult("Clicked '" + WebInspector.resourceTypes.XHR.name() + "' button."); + var target = UI.panels.network._networkLogView; + target._resourceCategoryFilterUI._toggleTypeFilter(Common.resourceTypes.XHR.category().title, false); + InspectorTest.addResult("Clicked '" + Common.resourceTypes.XHR.name() + "' button."); target.reset(); function appendRequest(id, type, startTime, endTime) { - var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), "", "", "", "", ""); + var request = new SDK.NetworkRequest(SDK.targetManager.mainTarget(), "", "", "", "", ""); request.setResourceType(type); request.requestId = id; request.setIssueTime(startTime); @@ -19,15 +19,15 @@ target._appendRequest(request); target._refresh(); - var isFilteredOut = !!target._nodesByRequestId.get(request.requestId)[WebInspector.NetworkLogView._isFilteredOutSymbol]; + var isFilteredOut = !!target._nodesByRequestId.get(request.requestId)[Network.NetworkLogView._isFilteredOutSymbol]; InspectorTest.addResult(""); InspectorTest.addResult("Appended request [" + request.requestId + "] of type '" + request.resourceType().name() + "' is hidden: " + isFilteredOut + " from [" + request.startTime + "] to [" + request.endTime + "]"); InspectorTest.addResult("Timeline: from [" + target._calculator.minimumBoundary() + "] to [" + target._calculator.maximumBoundary() + "]"); } - appendRequest("a", WebInspector.resourceTypes.Script, 1, 2); - appendRequest("b", WebInspector.resourceTypes.XHR, 3, 4); - appendRequest("c", WebInspector.resourceTypes.Script, 5, 6); + appendRequest("a", Common.resourceTypes.Script, 1, 2); + appendRequest("b", Common.resourceTypes.XHR, 3, 4); + appendRequest("c", Common.resourceTypes.Script, 5, 6); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check-expected.txt b/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check-expected.txt index f763d3d..bdb496b 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check-expected.txt
@@ -1,6 +1,6 @@ Test that if a profiler is working all the agents are disabled. ---> WebInspector.targetManager.suspendAllTargets(); +--> SDK.targetManager.suspendAllTargets(); frontend: {"id":<number>,"method":"Page.configureOverlay","params":{"suspended":true}} frontend: {"id":<number>,"method":"Debugger.disable"} frontend: {"id":<number>,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":0}} @@ -9,7 +9,7 @@ frontend: {"id":<number>,"method":"CSS.disable"} frontend: {"id":<number>,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":false}} ---> WebInspector.targetManager.resumeAllTargets(); +--> SDK.targetManager.resumeAllTargets(); frontend: {"id":<number>,"method":"Page.configureOverlay","params":{"suspended":false}} frontend: {"id":<number>,"method":"Debugger.enable"} frontend: {"id":<number>,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check.html b/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check.html index a9c4dcbdb..37c528a 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/agents-disabled-check.html
@@ -5,7 +5,7 @@ function test() { - WebInspector.settingForTest("enableAsyncStackTraces").set(true); + Common.settingForTest("enableAsyncStackTraces").set(true); var messages = []; function collectMessages(message) { @@ -13,11 +13,11 @@ } Protocol.TargetBase.prototype._dumpProtocolMessage = collectMessages; InspectorBackendClass.Options.dumpInspectorProtocolMessages = 1; - messages.push("--> WebInspector.targetManager.suspendAllTargets();"); - WebInspector.targetManager.suspendAllTargets(); + messages.push("--> SDK.targetManager.suspendAllTargets();"); + SDK.targetManager.suspendAllTargets(); messages.push(""); - messages.push("--> WebInspector.targetManager.resumeAllTargets();"); - WebInspector.targetManager.resumeAllTargets(); + messages.push("--> SDK.targetManager.resumeAllTargets();"); + SDK.targetManager.resumeAllTargets(); messages.push(""); messages.push("--> done"); InspectorBackendClass.Options.dumpInspectorProtocolMessages = 0; @@ -26,7 +26,7 @@ message = message.replace(/"id":\d+,/, '"id":<number>,'); InspectorTest.addResult(message); } - WebInspector.settingForTest("enableAsyncStackTraces").set(false); + Common.settingForTest("enableAsyncStackTraces").set(false); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-large-tree-search.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-large-tree-search.html index 14a779b07..bf0e2a9 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-large-tree-search.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-large-tree-search.html
@@ -31,7 +31,7 @@ var profileAndExpectations = { "title": "profile1", "target": function() { - return WebInspector.targetManager.targets()[0]; + return SDK.targetManager.targets()[0]; }, "_profile": { "nodes": [ @@ -64,13 +64,13 @@ "endTime": nodesCount * 10e3 + 3e3 } }; - var view = new WebInspector.CPUProfileView(profileAndExpectations); + var view = new Profiler.CPUProfileView(profileAndExpectations); view.viewSelectComboBox.setSelectedIndex(1); view._changeView(); var tree = view.profileDataGridTree; if (!tree) InspectorTest.addResult("no tree"); - tree.performSearch(new WebInspector.SearchableView.SearchConfig("foo12", true, false), false); + tree.performSearch(new UI.SearchableView.SearchConfig("foo12", true, false), false); for (var item of tree._searchResults) { var node = item.profileNode; InspectorTest.addResult(`${node.callUID}: ${node.functionName} ${node.self} ${node.total}`);
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html index 478da076..621d81b 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html
@@ -9,7 +9,7 @@ var profileAndExpectations = { "title": "profile1", "target": function() { - return WebInspector.targetManager.targets()[0]; + return SDK.targetManager.targets()[0]; }, "_profile": { "nodes": [ @@ -113,7 +113,7 @@ "endTime": 1e6 } }; - var view = new WebInspector.CPUProfileView(profileAndExpectations); + var view = new Profiler.CPUProfileView(profileAndExpectations); view.viewSelectComboBox.setSelectedIndex(1); view._changeView(); var tree = view.profileDataGridTree;
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html index d65adbb..82fdd03 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html
@@ -94,8 +94,8 @@ "samples": [ 1, 2 ] }; profileAndExpectations.root = profileAndExpectations.head; - WebInspector.ProfileTreeModel.prototype._assignDepthsAndParents.call(profileAndExpectations); - WebInspector.ProfileTreeModel.prototype._calculateTotals(profileAndExpectations.head); + SDK.ProfileTreeModel.prototype._assignDepthsAndParents.call(profileAndExpectations); + SDK.ProfileTreeModel.prototype._calculateTotals(profileAndExpectations.head); function checkExpectations(node) { if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) {
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html index be6c365..9ce3b5f 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
@@ -935,7 +935,7 @@ profile.timeDeltas = [0, ...new Array(profile.samples.length - 1).fill(samplingInterval)]; profileAndExpectations.target = () => {}; profileAndExpectations.weakTarget = () => new WeakReference(null); - var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations); + var cpuProfileView = new Profiler.CPUProfileView(profileAndExpectations); cpuProfileView.viewSelectComboBox.setSelectedIndex(0); cpuProfileView._changeView(); var overviewPane = cpuProfileView._flameChart._overviewPane;
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html index 0d963fb..302513f 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html
@@ -128,7 +128,7 @@ "endTime": 100000 + 111.110 + 22.220 + 1.000, "samples": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] }; - var model = new WebInspector.CPUProfileDataModel(profile); + var model = new SDK.CPUProfileDataModel(profile); printTree("", model.profileHead); function printTree(padding, node) {
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-profile-removal.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-profile-removal.html index 9c89719..3a696a3 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-profile-removal.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-profile-removal.html
@@ -17,8 +17,8 @@ { InspectorTest.startProfilerTest(function() { function viewLoaded() { - var profiles = WebInspector.panels.profiles; - var type = WebInspector.ProfileTypeRegistry.instance.cpuProfileType; + var profiles = UI.panels.profiles; + var type = Profiler.ProfileTypeRegistry.instance.cpuProfileType; while (type.getProfiles().length !== 0) type.removeProfile(type.getProfiles()[0]); InspectorTest.addResult("Profile groups after removal:");
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-save-load.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-save-load.html index 7ca207b6..91907fde 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-save-load.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-save-load.html
@@ -48,8 +48,8 @@ } function saveProfileToFile(profile) { - WebInspector.FileOutputStream = function() { } - WebInspector.FileOutputStream.prototype = { + Bindings.FileOutputStream = function() { } + Bindings.FileOutputStream.prototype = { open: function(fileName, callback) { file.name = fileName; @@ -102,16 +102,16 @@ } next(); } - var profilesPanel = WebInspector.panels.profiles; + var profilesPanel = UI.panels.profiles; var profileName = file.name.substr(0, file.name.length - ".cpuprofile".length); InspectorTest.waitUntilProfileViewIsShown(profileName, checkLoadedContent); profilesPanel._loadFromFile(file); - var onTransferFinished = WebInspector.CPUProfileHeader.prototype.onTransferFinished; - WebInspector.CPUProfileHeader.prototype.onTransferFinished = function() + var onTransferFinished = Profiler.CPUProfileHeader.prototype.onTransferFinished; + Profiler.CPUProfileHeader.prototype.onTransferFinished = function() { loadedProfileData = this._jsonifiedProfile; onTransferFinished.call(this); - WebInspector.panels.profiles.showProfile(this); + UI.panels.profiles.showProfile(this); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-stopped-removed-race.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-stopped-removed-race.html index 6c53be7..90321f1 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-stopped-removed-race.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-stopped-removed-race.html
@@ -9,10 +9,10 @@ InspectorTest.runProfilerTestSuite([ function testProfiling(next) { - var cpuProfiler = WebInspector.targetManager.mainTarget().cpuProfilerModel; - var targetManager = WebInspector.targetManager; - targetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged, onSuspendStateChanged); - var profilesPanel = WebInspector.panels.profiles; + var cpuProfiler = SDK.targetManager.mainTarget().cpuProfilerModel; + var targetManager = SDK.targetManager; + targetManager.addEventListener(SDK.TargetManager.Events.SuspendStateChanged, onSuspendStateChanged); + var profilesPanel = UI.panels.profiles; InspectorTest.addSniffer(cpuProfiler, "stopRecording", stopRecording); InspectorTest.addSniffer(profilesPanel, "_addProfileHeader", onAddProfileHeader); profilesPanel.toggleRecord(); // Start profiling. @@ -25,7 +25,7 @@ function onSuspendStateChanged() { - if (WebInspector.targetManager.allTargetsSuspended()) { + if (SDK.targetManager.allTargetsSuspended()) { InspectorTest.addResult("Suspending targets"); return; }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-comparison-dom-groups-change.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-comparison-dom-groups-change.html index 6b7c5a5e..e32e1b8 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-comparison-dom-groups-change.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-comparison-dom-groups-change.html
@@ -81,7 +81,7 @@ function testShowAll(next) { // Make sure all nodes are visible. - WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount = function() { return 100; }; + Profiler.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount = function() { return 100; }; InspectorTest.takeAndOpenSnapshot(createHeapSnapshotA, createSnapshotB); function createSnapshotB() {
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html index 30ce0076..576bcbf 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html
@@ -13,8 +13,8 @@ function test() { - var heapProfileType = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType; - heapProfileType.addEventListener(WebInspector.HeapSnapshotProfileType.SnapshotReceived, finishHeapSnapshot); + var heapProfileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType; + heapProfileType.addEventListener(Profiler.HeapSnapshotProfileType.SnapshotReceived, finishHeapSnapshot); InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotReceived); heapProfileType._takeHeapSnapshot(function() {}); @@ -30,7 +30,7 @@ return clear("FAILED: wrong number of recorded profiles was found. profiles.length = " + profiles.length); var profile = profiles[profiles.length - 1]; - WebInspector.panels.profiles.showProfile(profile); + UI.panels.profiles.showProfile(profile); } function snapshotReceived(profile) @@ -88,7 +88,7 @@ if (errorMessage) InspectorTest.addResult(errorMessage); setTimeout(done, 0); - WebInspector.panels.profiles._reset(); + UI.panels.profiles._reset(); return !errorMessage; }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-loader.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-loader.html index 1dd618e0..d4ba530 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-loader.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-loader.html
@@ -12,10 +12,10 @@ function injectMockProfile(callback) { var dispatcher = InspectorTest.mainTarget._dispatchers["HeapProfiler"]._dispatcher; - var panel = WebInspector.panels.profiles; + var panel = UI.panels.profiles; panel._reset(); - var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType; + var profileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType; InspectorTest.override(InspectorTest.HeapProfilerAgent, "takeHeapSnapshot", takeHeapSnapshotMock); function takeHeapSnapshotMock(reportProgress, callback) { @@ -32,11 +32,11 @@ { callback(this); } - InspectorTest.addSniffer(WebInspector.HeapProfileHeader.prototype, "_didWriteToTempFile", tempFileReady); + InspectorTest.addSniffer(Profiler.HeapProfileHeader.prototype, "_didWriteToTempFile", tempFileReady); profileType._takeHeapSnapshot(function() {}); } - WebInspector.console.log = function(message) { + Common.console.log = function(message) { InspectorTest.addResult("InspectorTest.consoleModel.log: " + message); } @@ -49,7 +49,7 @@ function saveMock(url, data) { savedSnapshotData = data; - WebInspector.fileManager._savedURL({data: url}); + Workspace.fileManager._savedURL({data: url}); } InspectorTest.override(InspectorFrontendHost, "save", saveMock); @@ -57,7 +57,7 @@ InspectorFrontendHost.append = function appendMock(url, data) { savedSnapshotData += data; - WebInspector.fileManager._appendedToURL({data: url}); + Workspace.fileManager._appendedToURL({data: url}); } function closeMock(url) { @@ -65,7 +65,7 @@ InspectorFrontendHost.append = oldAppend; next(); } - InspectorTest.override(WebInspector.FileManager.prototype, "close", closeMock); + InspectorTest.override(Workspace.FileManager.prototype, "close", closeMock); profileHeader.saveToFile(); } @@ -74,14 +74,14 @@ function heapSnapshotLoadFromFileTest(next) { - var panel = WebInspector.panels.profiles; + var panel = UI.panels.profiles; var fileMock = { name: "mock.heapsnapshot", size: sourceStringified.length }; - InspectorTest.override(WebInspector.HeapProfileHeader.prototype, '_createFileReader', function(fileMock, delegate) { + InspectorTest.override(Profiler.HeapProfileHeader.prototype, '_createFileReader', function(fileMock, delegate) { return { start: function(receiver) { delegate.onTransferStarted(this); @@ -107,7 +107,7 @@ } }; }); - InspectorTest.addSniffer(WebInspector.HeapProfileHeader.prototype, "_snapshotReceived", function() { next(); }); + InspectorTest.addSniffer(Profiler.HeapProfileHeader.prototype, "_snapshotReceived", function() { next(); }); panel._loadFromFile(fileMock); }, @@ -118,7 +118,7 @@ if (profileHeader.canSaveToFile()) next(); else - profileHeader.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceived, onCanSaveProfile, this); + profileHeader.addEventListener(Profiler.ProfileHeader.Events.ProfileReceived, onCanSaveProfile, this); function onCanSaveProfile() { InspectorTest.assertTrue(profileHeader.canSaveToFile());
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-orphan-nodes.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-orphan-nodes.html index a1c37a37..c329b58 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-orphan-nodes.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-orphan-nodes.html
@@ -44,7 +44,7 @@ return builder.generateSnapshot(); } - InspectorTest.addSniffer(WebInspector.HeapSnapshotView.prototype, "_gotStatistics", checkStatistics, true); + InspectorTest.addSniffer(Profiler.HeapSnapshotView.prototype, "_gotStatistics", checkStatistics, true); InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); function checkStatistics(statistics)
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-statistics.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-statistics.html index 6838a31..427fe76 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-statistics.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-statistics.html
@@ -36,7 +36,7 @@ InspectorTest.runHeapSnapshotTestSuite([ function testStatistics(next) { - InspectorTest.addSniffer(WebInspector.HeapSnapshotView.prototype, "_gotStatistics", step1, true); + InspectorTest.addSniffer(Profiler.HeapSnapshotView.prototype, "_gotStatistics", step1, true); InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, function() {}); function step1(statistics)
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-summary-retainers.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-summary-retainers.html index f443c13..1d6aa700 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-summary-retainers.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-summary-retainers.html
@@ -104,7 +104,7 @@ function step4(retainersRoot) { retainersRoot.dataGrid.addEventListener( - WebInspector.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete, + Profiler.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete, step5.bind(this, retainersRoot)); } @@ -183,7 +183,7 @@ function step4(retainersRoot) { retainersRoot.dataGrid.addEventListener( - WebInspector.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete, + Profiler.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete, step5.bind(this, retainersRoot)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-test.js b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-test.js index 3efb678..e6c8e4f 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-test.js +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-test.js
@@ -48,9 +48,9 @@ 1, 11, 15]),// 18: property 'ce' to node 'E' strings: ["", "A", "B", "C", "D", "E", "a", "b", "ac", "bc", "bd", "ce"], _firstEdgeIndexes: new Uint32Array([0, 6, 12, 18, 21, 21, 21]), - createNode: WebInspector.JSHeapSnapshot.prototype.createNode, - createEdge: WebInspector.JSHeapSnapshot.prototype.createEdge, - createRetainingEdge: WebInspector.JSHeapSnapshot.prototype.createRetainingEdge + createNode: HeapSnapshotWorker.JSHeapSnapshot.prototype.createNode, + createEdge: HeapSnapshotWorker.JSHeapSnapshot.prototype.createEdge, + createRetainingEdge: HeapSnapshotWorker.JSHeapSnapshot.prototype.createRetainingEdge }; }; @@ -334,7 +334,7 @@ createJSHeapSnapshot: function() { var parsedSnapshot = InspectorTest._postprocessHeapSnapshotMock(this.generateSnapshot()); - return new WebInspector.JSHeapSnapshot(parsedSnapshot, new WebInspector.HeapSnapshotProgress()); + return new HeapSnapshotWorker.JSHeapSnapshot(parsedSnapshot, new HeapSnapshotWorker.HeapSnapshotProgress()); }, _registerNode: function(node) @@ -418,13 +418,13 @@ // We mock out HeapProfilerAgent -- as DRT runs in single-process mode, Inspector // and test share the same heap. Taking a snapshot takes too long for a test, // so we provide synthetic snapshots. - InspectorTest._panelReset = InspectorTest.override(WebInspector.panels.profiles, "_reset", function(){}, true); - InspectorTest.addSniffer(WebInspector.HeapSnapshotView.prototype, "show", InspectorTest._snapshotViewShown, true); + InspectorTest._panelReset = InspectorTest.override(UI.panels.profiles, "_reset", function(){}, true); + InspectorTest.addSniffer(Profiler.HeapSnapshotView.prototype, "show", InspectorTest._snapshotViewShown, true); // Reduce the number of populated nodes to speed up testing. - WebInspector.HeapSnapshotContainmentDataGrid.prototype.defaultPopulateCount = function() { return 10; }; - WebInspector.HeapSnapshotConstructorsDataGrid.prototype.defaultPopulateCount = function() { return 10; }; - WebInspector.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount = function() { return 5; }; + Profiler.HeapSnapshotContainmentDataGrid.prototype.defaultPopulateCount = function() { return 10; }; + Profiler.HeapSnapshotConstructorsDataGrid.prototype.defaultPopulateCount = function() { return 10; }; + Profiler.HeapSnapshotDiffDataGrid.prototype.defaultPopulateCount = function() { return 5; }; InspectorTest.addResult("Detailed heap profiles were enabled."); InspectorTest.safeWrap(callback)(); }; @@ -455,7 +455,7 @@ var nextTest = testSuiteTests.shift(); InspectorTest.addResult(""); InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)[1]); - InspectorTest._panelReset.call(WebInspector.panels.profiles); + InspectorTest._panelReset.call(UI.panels.profiles); InspectorTest.safeWrap(nextTest)(runner, runner); } @@ -498,9 +498,9 @@ } var acceptableComparisonResult; - if (sortOrder === WebInspector.DataGrid.Order.Ascending) { + if (sortOrder === UI.DataGrid.Order.Ascending) { acceptableComparisonResult = -1; - } else if (sortOrder === WebInspector.DataGrid.Order.Descending) { + } else if (sortOrder === UI.DataGrid.Order.Descending) { acceptableComparisonResult = 1; } else { InspectorTest.addResult("Invalid sort order: " + sortOrder); @@ -525,7 +525,7 @@ function sortingComplete() { - InspectorTest._currentGrid().removeEventListener(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, this); + InspectorTest._currentGrid().removeEventListener(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, this); InspectorTest.assertEquals(column.id, this._currentGrid().sortColumnId(), "unexpected sorting"); column.sort = this._currentGrid().sortOrder(); function callCallback() @@ -534,7 +534,7 @@ } setTimeout(callCallback, 0); } - InspectorTest._currentGrid().addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, this); + InspectorTest._currentGrid().addEventListener(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, this); this._currentGrid()._clickInHeaderCell(event); }; @@ -551,10 +551,10 @@ var rootNode = InspectorTest.currentProfileView()._retainmentDataGrid.rootNode(); function populateComplete() { - rootNode.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + rootNode.removeEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); callback(rootNode); } - rootNode.addEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + rootNode.addEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); }; InspectorTest.clickShowMoreButton = function(buttonName, row, callback) @@ -563,14 +563,14 @@ var parent = row.parent; function populateComplete() { - parent.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + parent.removeEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); function callCallback() { callback(parent); } setTimeout(callCallback, 0); } - parent.addEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + parent.addEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); row[buttonName].click(); }; @@ -609,14 +609,14 @@ callback = InspectorTest.safeWrap(callback); function populateComplete() { - row.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + row.removeEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); function callCallback() { callback(row); } setTimeout(callCallback, 0); } - row.addEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + row.addEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); (function expand() { if (row.hasChildren) @@ -676,7 +676,7 @@ InspectorTest.switchToView = function(title, callback) { callback = InspectorTest.safeWrap(callback); - var view = WebInspector.panels.profiles.visibleView; + var view = UI.panels.profiles.visibleView; view._changePerspectiveAndWait(title, callback); // Increase the grid container height so the viewport don't limit the number of nodes. InspectorTest._currentGrid().scrollContainer.style.height = "10000px"; @@ -686,7 +686,7 @@ { callback = InspectorTest.safeWrap(callback); var snapshot = generator(); - var profileType = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType; + var profileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType; function pushGeneratedSnapshot(reportProgress, callback2) { var profile = profileType.profileBeingRecorded(); @@ -710,7 +710,7 @@ InspectorTest.currentProfileView = function() { - return WebInspector.panels.profiles.visibleView; + return UI.panels.profiles.visibleView; }; InspectorTest._currentGrid = function() @@ -726,10 +726,10 @@ var dataGrid = this._dataGrid; function sortingComplete() { - dataGrid.removeEventListener(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, null); + dataGrid.removeEventListener(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, null); callback(); } - dataGrid.addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, null); + dataGrid.addEventListener(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, sortingComplete, null); } };
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot.html index 4148550..fe5d230 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot.html
@@ -61,7 +61,7 @@ { var snapshot = InspectorTest.createJSHeapSnapshotMockObject(); var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); - var iterator = new WebInspector.HeapSnapshotNodeIterator(nodeRoot); + var iterator = new HeapSnapshotWorker.HeapSnapshotNodeIterator(nodeRoot); var names = []; for (; iterator.hasNext(); iterator.next()) names.push(iterator.item().name()); @@ -72,7 +72,7 @@ { var snapshot = InspectorTest.createJSHeapSnapshotMockObject(); var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); - var edgeIterator = new WebInspector.HeapSnapshotEdgeIterator(nodeRoot); + var edgeIterator = new HeapSnapshotWorker.HeapSnapshotEdgeIterator(nodeRoot); InspectorTest.assertEquals(true, edgeIterator.hasNext(), "has edges"); var edge = edgeIterator.item(); InspectorTest.assertEquals("shortcut", edge.type(), "edge type"); @@ -118,21 +118,21 @@ // Now check against a real HeapSnapshot instance. names = []; - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); depthFirstTraversal(snapshot.rootNode()); InspectorTest.assertEquals(reference, names.join(","), "snapshot traversal"); }, function heapSnapshotSimpleTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); InspectorTest.assertEquals(6, snapshot.nodeCount, "node count"); InspectorTest.assertEquals(20, snapshot.totalSize, "total size"); }, function heapSnapshotContainmentEdgeIndexesTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var actual = snapshot._firstEdgeIndexes; var expected = [0, 6, 12, 18, 21, 21, 21]; InspectorTest.assertEquals(expected.length, actual.length, "Edge indexes size"); @@ -142,7 +142,7 @@ function heapSnapshotPostOrderIndexTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var postOrderIndex2NodeOrdinal = snapshot._buildPostOrderIndex().postOrderIndex2NodeOrdinal; var expected = [5,3,4,2,1,0]; for (var i = 0; i < expected.length; ++i) @@ -151,7 +151,7 @@ function heapSnapshotDominatorsTreeTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var result = snapshot._buildPostOrderIndex(); var dominatorsTree = snapshot._buildDominatorTree(result.postOrderIndex2NodeOrdinal, result.nodeOrdinal2PostOrderIndex); var expected = [0, 0, 0, 0, 2, 3]; @@ -161,7 +161,7 @@ function heapSnapshotRetainedSizeTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var actualRetainedSizes = new Array(snapshot.nodeCount); for (var nodeOrdinal = 0; nodeOrdinal < snapshot.nodeCount; ++nodeOrdinal) actualRetainedSizes[nodeOrdinal] = snapshot._retainedSizes[nodeOrdinal]; @@ -190,7 +190,7 @@ function heapSnapshotDominatedNodesTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var expectedDominatedNodes = [21, 14, 7, 28, 35]; var actualDominatedNodes = snapshot._dominatedNodes; @@ -238,7 +238,7 @@ function heapSnapshotRetainersTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var expectedRetainers = { "": [], "A": [""], @@ -257,7 +257,7 @@ function heapSnapshotAggregatesTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); var expectedAggregates = { "A": { count: 1, self: 2, maxRet: 2, type: "object", name: "A" }, "B": { count: 1, self: 3, maxRet: 8, type: "object", name: "B" }, @@ -290,7 +290,7 @@ function heapSnapshotFlagsTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMockWithDOM(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMockWithDOM(), new HeapSnapshotWorker.HeapSnapshotProgress()); var expectedCanBeQueried = { "": false, "A": true, @@ -313,7 +313,7 @@ function heapSnapshotNodesProviderTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); function nodeFilter(node) { @@ -323,7 +323,7 @@ var allNodeIndexes = []; for (var i = 0; i < snapshot.nodes.length; i += snapshot._nodeFieldCount) allNodeIndexes.push(i); - var provider = new WebInspector.HeapSnapshotNodesProvider(snapshot, nodeFilter, allNodeIndexes); + var provider = new HeapSnapshotWorker.HeapSnapshotNodesProvider(snapshot, nodeFilter, allNodeIndexes); // Sort by names in reverse order. provider.sortAndRewind({fieldName1: "name", ascending1: false, fieldName2: "id", ascending2: false}); var range = provider.serializeItemsRange(0, 3); @@ -339,7 +339,7 @@ function heapSnapshotEdgesProviderTest() { - var snapshot = new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()); + var snapshot = new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress()); function edgeFilter(edge) { @@ -365,7 +365,7 @@ var sourceStringified = JSON.stringify(source); var partSize = sourceStringified.length >> 3; - var loader = new WebInspector.HeapSnapshotLoader(); + var loader = new HeapSnapshotWorker.HeapSnapshotLoader(); for (var i = 0, l = sourceStringified.length; i < l; i += partSize) loader.write(sourceStringified.slice(i, i + partSize)); loader.close(); @@ -376,7 +376,7 @@ { InspectorTest.assertEquals(JSON.stringify(reference), JSON.stringify(actual)); } - assertSnapshotEquals(new WebInspector.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress(), false), result); + assertSnapshotEquals(new HeapSnapshotWorker.JSHeapSnapshot(InspectorTest.createHeapSnapshotMock(), new HeapSnapshotWorker.HeapSnapshotProgress(), false), result); }, ]; @@ -394,7 +394,7 @@ return result.join("\n"); } - var proxy = new WebInspector.HeapSnapshotWorkerProxy(function(eventName, arg) + var proxy = new Profiler.HeapSnapshotWorkerProxy(function(eventName, arg) { InspectorTest.addResult("Unexpected event from worker: " + eventName); });
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/profiler-test.js b/third_party/WebKit/LayoutTests/inspector/profiler/profiler-test.js index 70f8a61..8c97ef2 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/profiler-test.js +++ b/third_party/WebKit/LayoutTests/inspector/profiler/profiler-test.js
@@ -1,13 +1,13 @@ var initialize_ProfilerTest = function() { InspectorTest.preloadPanel("profiles"); -WebInspector.TempFile = InspectorTest.TempFileMock; +Bindings.TempFile = InspectorTest.TempFileMock; InspectorTest.startProfilerTest = function(callback) { InspectorTest.addResult("Profiler was enabled."); - InspectorTest.addSniffer(WebInspector.panels.profiles, "_addProfileHeader", InspectorTest._profileHeaderAdded, true); - InspectorTest.addSniffer(WebInspector.ProfileView.prototype, "refresh", InspectorTest._profileViewRefresh, true); + InspectorTest.addSniffer(UI.panels.profiles, "_addProfileHeader", InspectorTest._profileHeaderAdded, true); + InspectorTest.addSniffer(Profiler.ProfileView.prototype, "refresh", InspectorTest._profileViewRefresh, true); InspectorTest.safeWrap(callback)(); }; @@ -46,14 +46,14 @@ InspectorTest._profileHeaderAdded = function(profile) { if (InspectorTest._showProfileWhenAdded === profile.title) - WebInspector.panels.profiles.showProfile(profile); + UI.panels.profiles.showProfile(profile); }; InspectorTest.waitUntilProfileViewIsShown = function(title, callback) { callback = InspectorTest.safeWrap(callback); - var profilesPanel = WebInspector.panels.profiles; + var profilesPanel = UI.panels.profiles; if (profilesPanel.visibleView && profilesPanel.visibleView.profile && profilesPanel.visibleView._profileHeader.title === title) callback(profilesPanel.visibleView); else @@ -72,12 +72,12 @@ InspectorTest.startSamplingHeapProfiler = function() { - WebInspector.SamplingHeapProfileType.instance.startRecordingProfile(); + Profiler.SamplingHeapProfileType.instance.startRecordingProfile(); } InspectorTest.stopSamplingHeapProfiler = function() { - WebInspector.SamplingHeapProfileType.instance.stopRecordingProfile(); + Profiler.SamplingHeapProfileType.instance.stopRecordingProfile(); } };
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/temp-storage-cleaner.html b/third_party/WebKit/LayoutTests/inspector/profiler/temp-storage-cleaner.html index 1b989965..5ca5996 100644 --- a/third_party/WebKit/LayoutTests/inspector/profiler/temp-storage-cleaner.html +++ b/third_party/WebKit/LayoutTests/inspector/profiler/temp-storage-cleaner.html
@@ -5,7 +5,7 @@ function test() { - WebInspector.TempFile.ensureTempStorageCleared() + Bindings.TempFile.ensureTempStorageCleared() .then(function finish() { InspectorTest.addResult("PASSED: we got a call from TempStorageCleaner that it had done the job."); }, function(e) {
diff --git a/third_party/WebKit/LayoutTests/inspector/reveal-objects.html b/third_party/WebKit/LayoutTests/inspector/reveal-objects.html index f8e4c98..02ddde2 100644 --- a/third_party/WebKit/LayoutTests/inspector/reveal-objects.html +++ b/third_party/WebKit/LayoutTests/inspector/reveal-objects.html
@@ -39,7 +39,7 @@ return true; } }); - uiLocation = WebInspector.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1); + uiLocation = Workspace.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1); InspectorTest.nodeWithId("div", nodeCallback); @@ -71,36 +71,36 @@ function revealNode(next) { - WebInspector.Revealer.revealPromise(node).then(next); + Common.Revealer.revealPromise(node).then(next); }, function revealUILocation(next) { - WebInspector.Revealer.revealPromise(uiLocation).then(next); + Common.Revealer.revealPromise(uiLocation).then(next); }, function revealResource(next) { - WebInspector.Revealer.revealPromise(resource).then(next); + Common.Revealer.revealPromise(resource).then(next); }, function revealRequestWithResource(next) { - WebInspector.Revealer.revealPromise(requestWithResource).then(next); + Common.Revealer.revealPromise(requestWithResource).then(next); }, function revealRequestWithoutResource(next) { - WebInspector.Revealer.revealPromise(requestWithoutResource).then(next); + Common.Revealer.revealPromise(requestWithoutResource).then(next); } ]); function installHooks() { - InspectorTest.addSniffer(WebInspector.ElementsPanel.prototype, "revealAndSelectNode", nodeRevealed, true); - InspectorTest.addSniffer(WebInspector.SourcesPanel.prototype, "showUILocation", uiLocationRevealed, true); - InspectorTest.addSniffer(WebInspector.ResourcesPanel.prototype, "showResource", resourceRevealed, true); - InspectorTest.addSniffer(WebInspector.NetworkPanel.prototype, "revealAndHighlightRequest", revealed, true); + InspectorTest.addSniffer(Elements.ElementsPanel.prototype, "revealAndSelectNode", nodeRevealed, true); + InspectorTest.addSniffer(Sources.SourcesPanel.prototype, "showUILocation", uiLocationRevealed, true); + InspectorTest.addSniffer(Resources.ResourcesPanel.prototype, "showResource", resourceRevealed, true); + InspectorTest.addSniffer(Network.NetworkPanel.prototype, "revealAndHighlightRequest", revealed, true); } function nodeRevealed(node) @@ -120,7 +120,7 @@ function revealed(request) { - InspectorTest.addResult("Request " + new WebInspector.ParsedURL(request.url).lastPathComponent + " revealed in the Network panel"); + InspectorTest.addResult("Request " + new Common.ParsedURL(request.url).lastPathComponent + " revealed in the Network panel"); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-es6-setSymbolPropertyValue.html b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-es6-setSymbolPropertyValue.html index 7298b64..0f1971d 100644 --- a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-es6-setSymbolPropertyValue.html +++ b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-es6-setSymbolPropertyValue.html
@@ -36,7 +36,7 @@ function step2(error, result, exceptionDetails) { - name = WebInspector.RemoteObject.toCallArgument(InspectorTest.runtimeModel.createRemoteObject(result)); + name = SDK.RemoteObject.toCallArgument(InspectorTest.runtimeModel.createRemoteObject(result)); next(); } },
diff --git a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-setPropertyValue.html b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-setPropertyValue.html index 1ea7fdb..0e4433b 100644 --- a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-setPropertyValue.html +++ b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-setPropertyValue.html
@@ -29,7 +29,7 @@ function test() { var obj1, obj2; - var nameFoo = WebInspector.RemoteObject.toCallArgument("foo"); + var nameFoo = SDK.RemoteObject.toCallArgument("foo"); InspectorTest.runTestSuite([ function testSetUp(next) @@ -131,12 +131,12 @@ function step1(error) { - obj1.setPropertyValue(WebInspector.RemoteObject.toCallArgument("foo1"), "Infinity", step2); + obj1.setPropertyValue(SDK.RemoteObject.toCallArgument("foo1"), "Infinity", step2); } function step2(error) { - obj1.setPropertyValue(WebInspector.RemoteObject.toCallArgument("foo2"), "-Infinity", step3); + obj1.setPropertyValue(SDK.RemoteObject.toCallArgument("foo2"), "-Infinity", step3); } function step3(error)
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js b/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js index a76b61af2..bcb06b833 100644 --- a/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js +++ b/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js
@@ -6,20 +6,20 @@ InspectorTest.sassSourceMapFactory = function() { if (!sassSourceMapFactory) - sassSourceMapFactory = new WebInspector.SASSSourceMapFactory(); + sassSourceMapFactory = new Sass.SASSSourceMapFactory(); return sassSourceMapFactory; } InspectorTest.parseSCSS = function(url, text) { - return WebInspector.SASSSupport.parseSCSS(url, text); + return Sass.SASSSupport.parseSCSS(url, text); } InspectorTest.parseCSS = InspectorTest.parseSCSS; InspectorTest.loadASTMapping = function(header, callback) { - var completeSourceMapURL = WebInspector.ParsedURL.completeURL(header.sourceURL, header.sourceMapURL); - WebInspector.TextSourceMap.load(completeSourceMapURL, header.sourceURL).then(onSourceMapLoaded); + var completeSourceMapURL = Common.ParsedURL.completeURL(header.sourceURL, header.sourceMapURL); + SDK.TextSourceMap.load(completeSourceMapURL, header.sourceURL).then(onSourceMapLoaded); function onSourceMapLoaded(sourceMap) { @@ -96,7 +96,7 @@ } ruleChanges.push(change); } - var T = WebInspector.SASSSupport.PropertyChangeType; + var T = Sass.SASSSupport.PropertyChangeType; for (var rule of changesPerRule.keys()) { var changes = changesPerRule.get(rule); var names = []; @@ -199,7 +199,7 @@ InspectorTest.updateSASSText = function(url, newText) { - var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); + var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url); uiSourceCode.addRevision(newText); } @@ -279,7 +279,7 @@ var edit = edits[i]; var range = edit.oldRange; var line = String.sprintf("{%d, %d, %d, %d}", range.startLine, range.startColumn, range.endLine, range.endColumn); - line += String.sprintf(" '%s' => '%s'", (new WebInspector.Text(text)).extract(range), edit.newText); + line += String.sprintf(" '%s' => '%s'", (new Common.Text(text)).extract(range), edit.newText); lines.push(line); } lines = indent(lines); @@ -298,9 +298,9 @@ } if (!match) return null; - var sourceRange = new WebInspector.SourceRange(match.index, match[0].length); - var textRange = new WebInspector.Text(source).toTextRange(sourceRange); - return new WebInspector.SourceEdit("", textRange, newText); + var sourceRange = new Common.SourceRange(match.index, match[0].length); + var textRange = new Common.Text(source).toTextRange(sourceRange); + return new Common.SourceEdit("", textRange, newText); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-ast-diff-1.html b/third_party/WebKit/LayoutTests/inspector/sass/test-ast-diff-1.html index c549033..748e298 100644 --- a/third_party/WebKit/LayoutTests/inspector/sass/test-ast-diff-1.html +++ b/third_party/WebKit/LayoutTests/inspector/sass/test-ast-diff-1.html
@@ -28,7 +28,7 @@ function onParsed() { - var diff = WebInspector.SASSSupport.diffModels(ast1, ast2); + var diff = Sass.SASSSupport.diffModels(ast1, ast2); InspectorTest.dumpASTDiff(diff); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html index 33642a9a..a358df5 100644 --- a/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html +++ b/third_party/WebKit/LayoutTests/inspector/sass/test-find-node-for-position.html
@@ -25,7 +25,7 @@ function onNode(node) { - if (!(node instanceof WebInspector.SASSSupport.TextNode)) + if (!(node instanceof Sass.SASSSupport.TextNode)) return; var startOffset = text.offsetFromPosition(node.range.startLine, node.range.startColumn); var endOffset = text.offsetFromPosition(node.range.endLine, node.range.endColumn); @@ -33,7 +33,7 @@ offsetToNode.set(i, node); } - var cursor = new WebInspector.TextCursor(text.lineEndings()); + var cursor = new Common.TextCursor(text.lineEndings()); for (var i = 0; i < text.value().length; ++i) { var canonical = offsetToNode.get(i) || null; cursor.advance(i);
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-with-cache-busting-url.html b/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-with-cache-busting-url.html index b971122..44dc83a 100644 --- a/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-with-cache-busting-url.html +++ b/third_party/WebKit/LayoutTests/inspector/sass/test-mapping-with-cache-busting-url.html
@@ -21,7 +21,7 @@ { Runtime.experiments.enableForTest("liveSASS"); InspectorTest.evaluateInPage("simulateBrowserSync()", function() { }); - InspectorTest.cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapAttached, onSourceMapAttached); + InspectorTest.cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, onSourceMapAttached); function onSourceMapAttached(event) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-css.html b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-css.html index 850bfe8..89c9d699 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-css.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-css.html
@@ -87,9 +87,9 @@ ".green {", " display" ].join("\n")); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(1, 10)); + textEditor.setSelection(Common.TextRange.createFromLocation(1, 10)); InspectorTest.dumpTextWithSelection(textEditor); - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", suggestionsShown); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", suggestionsShown); InspectorTest.typeIn(textEditor, ":"); function suggestionsShown(words)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-general.html b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-general.html index 31ec729..66df0a2 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-general.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-general.html
@@ -23,8 +23,8 @@ function testCompletionsShowUpOnKeyPress(next) { textEditor.setText("name1 name2 name3 name4\nna"); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(1, 2)); - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onAutocompletionSuggestBox); + textEditor.setSelection(Common.TextRange.createFromLocation(1, 2)); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onAutocompletionSuggestBox); InspectorTest.typeIn(textEditor, "m"); function onAutocompletionSuggestBox() { @@ -48,7 +48,7 @@ function testRemoveDuplicate(next) { textEditor.setText("one\none"); - textEditor.setSelection(new WebInspector.TextRange(0, 0, 0, 3)); + textEditor.setSelection(new Common.TextRange(0, 0, 0, 3)); InspectorTest.typeIn(textEditor, "\b", dumpDictionary.bind(null, next)); }, @@ -60,13 +60,13 @@ function testSimpleEdit(next) { - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 3)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 3)); InspectorTest.typeIn(textEditor, "\b", dumpDictionary.bind(null, next)); }, function testDeleteOneDogAndOneCat(next) { - textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 6)); + textEditor.setSelection(Common.TextRange.createFromLocation(0, 6)); InspectorTest.typeIn(textEditor, "\b\b\b\b\b\b", dumpDictionary.bind(null, next)); } ];
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-hide-on-smart-brace.html b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-hide-on-smart-brace.html index 99069a7..e038fe3 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-hide-on-smart-brace.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-hide-on-smart-brace.html
@@ -21,10 +21,10 @@ var testSuite = [ function testSummonSuggestBox(next) { - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", onSuggestionsShown); textEditor.setText("one\n()"); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(1,1)); + textEditor.setSelection(Common.TextRange.createFromLocation(1,1)); InspectorTest.typeIn(textEditor, "o", function() { }); function onSuggestionsShown() @@ -36,7 +36,7 @@ function testTypeSmartBrace(next) { - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsHiddenForTest", onSuggestionsHidden); InspectorTest.typeIn(textEditor, ")", function() { }); function onSuggestionsHidden()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-test.js b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-test.js index 4ebe5bc..375c0eb9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-test.js +++ b/third_party/WebKit/LayoutTests/inspector/sources/autocomplete-test.js
@@ -16,8 +16,8 @@ if (lineNumber === -1) throw new Error("Test case is invalid: cursor position is not marked with '|' symbol."); textEditor.setText(lines.join("\n").replace("|", "")); - textEditor.setSelection(WebInspector.TextRange.createFromLocation(lineNumber, columnNumber)); - InspectorTest.addSniffer(WebInspector.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", suggestionsShown); + textEditor.setSelection(Common.TextRange.createFromLocation(lineNumber, columnNumber)); + InspectorTest.addSniffer(TextEditor.TextEditorAutocompleteController.prototype, "_onSuggestionsShownForTest", suggestionsShown); textEditor._autocompleteController.autocomplete(); function suggestionsShown(words) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html b/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html index e5598d9..5c7a097 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html
@@ -14,33 +14,33 @@ function onSourceFrame(sourceFrame) { InspectorTest.addResult("Initial swatch positions:"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); InspectorTest.runTestSuite([ function testEditBezier(next) { var swatch = sourceFrame.textEditor._codeMirrorElement.querySelector("span[is=bezier-swatch]"); swatch.shadowRoot.querySelector(".bezier-swatch-icon").click(); - sourceFrame._bezierEditor.setBezier(WebInspector.Geometry.CubicBezier.parse("linear")); + sourceFrame._bezierEditor.setBezier(Common.Geometry.CubicBezier.parse("linear")); sourceFrame._bezierEditor._onchange(); sourceFrame._swatchPopoverHelper.hide(true) - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testAddBezier(next) { - var bodyLineEnd = new WebInspector.TextRange(1, 37, 1, 37); + var bodyLineEnd = new Common.TextRange(1, 37, 1, 37); sourceFrame.textEditor.editRange(bodyLineEnd, " transition: height 1s cubic-bezier(0, 0.5, 1, 1);"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testInvalidateBezier(next) { - var startParenthesis = new WebInspector.TextRange(1, 67, 1, 68); + var startParenthesis = new Common.TextRange(1, 67, 1, 68); sourceFrame.textEditor.editRange(startParenthesis, "["); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/color-swatch-position.html b/third_party/WebKit/LayoutTests/inspector/sources/color-swatch-position.html index a44334c2..31a1658 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/color-swatch-position.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/color-swatch-position.html
@@ -14,56 +14,56 @@ function onSourceFrame(sourceFrame) { InspectorTest.addResult("Initial swatch positions:"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); InspectorTest.runTestSuite([ function testEditSpectrum(next) { var swatch = sourceFrame.textEditor._codeMirrorElement.querySelector("span[is=color-swatch]"); swatch.shadowRoot.querySelector(".color-swatch-inner").click(); - sourceFrame._spectrum._innerSetColor(WebInspector.Color.parse("#008000").hsva(), "", WebInspector.Color.Format.HEX, WebInspector.Spectrum._ChangeSource.Other); + sourceFrame._spectrum._innerSetColor(Common.Color.parse("#008000").hsva(), "", Common.Color.Format.HEX, Components.Spectrum._ChangeSource.Other); sourceFrame._swatchPopoverHelper.hide(true) - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testAddLine(next) { - var start = WebInspector.TextRange.createFromLocation(0, 0); + var start = Common.TextRange.createFromLocation(0, 0); sourceFrame.textEditor.editRange(start, "/* New line */\n"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testDeleteLine(next) { - var bodyLine = new WebInspector.TextRange(2, 0, 3, 0); + var bodyLine = new Common.TextRange(2, 0, 3, 0); sourceFrame.textEditor.editRange(bodyLine, ""); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testAddColor(next) { - var emptyBodyLine = new WebInspector.TextRange(2, 0, 2, 0); + var emptyBodyLine = new Common.TextRange(2, 0, 2, 0); sourceFrame.textEditor.editRange(emptyBodyLine, "color: hsl(300, 100%, 35%);"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testInvalidateColor(next) { - var endParenthesis = new WebInspector.TextRange(2, 25, 2, 26); + var endParenthesis = new Common.TextRange(2, 25, 2, 26); sourceFrame.textEditor.editRange(endParenthesis, "]"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); }, function testBookmarksAtLineStart(next) { - var lineStart = new WebInspector.TextRange(5, 0, 5, 0); + var lineStart = new Common.TextRange(5, 0, 5, 0); sourceFrame.textEditor.editRange(lineStart, "background color:\n#ff0;\n"); - InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark); + InspectorTest.dumpSwatchPositions(sourceFrame, Sources.CSSSourceFrame.SwatchBookmark); next(); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/compile-javascript.html b/third_party/WebKit/LayoutTests/inspector/sources/compile-javascript.html index 87bc249..18a8d6e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/compile-javascript.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/compile-javascript.html
@@ -12,8 +12,8 @@ function onSourceFrame(sourceFrame) { - InspectorTest.addSniffer(WebInspector.JavaScriptCompiler.prototype, "_compilationFinishedForTest", onCompilationFinished.bind(null, sourceFrame)); - sourceFrame.textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 0)); + InspectorTest.addSniffer(Sources.JavaScriptCompiler.prototype, "_compilationFinishedForTest", onCompilationFinished.bind(null, sourceFrame)); + sourceFrame.textEditor.setSelection(Common.TextRange.createFromLocation(0, 0)); InspectorTest.typeIn(sourceFrame.textEditor, "test!"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/css-outline-dialog.html b/third_party/WebKit/LayoutTests/inspector/sources/css-outline-dialog.html index e7e40ebf..6d4057b 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/css-outline-dialog.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/css-outline-dialog.html
@@ -14,13 +14,13 @@ function onSourceShown(sourceFrame) { textEditor = sourceFrame.textEditor; - InspectorTest.addSniffer(WebInspector.StyleSheetOutlineDialog.prototype, "refresh", onDialogFulfilled); - WebInspector.panels.sources._sourcesView._showOutlineDialog(); + InspectorTest.addSniffer(Sources.StyleSheetOutlineDialog.prototype, "refresh", onDialogFulfilled); + UI.panels.sources._sourcesView._showOutlineDialog(); } function onDialogFulfilled() { - WebInspector.StyleSheetOutlineDialog._instanceForTests.selectItem(1, ""); + Sources.StyleSheetOutlineDialog._instanceForTests.selectItem(1, ""); var selection = textEditor.selection(); if (!selection.isEmpty()) { InspectorTest.addResult("ERROR: selection is not empty.");
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-await/async-pause-on-exception.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-await/async-pause-on-exception.html index cc226e0..840e1e2 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-await/async-pause-on-exception.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-await/async-pause-on-exception.html
@@ -56,7 +56,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.showScriptSource("async-pause-on-exception.html", step2); } @@ -69,7 +69,7 @@ function step3() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); InspectorTest.addResult("\n=== Pausing on all exceptions ==="); InspectorTest.runTestFunction(); waitUntilPausedNTimes(2, step4); @@ -77,7 +77,7 @@ function step4() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-callstack-in-console.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-callstack-in-console.html index be8b774..70acff1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-callstack-in-console.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-callstack-in-console.html
@@ -50,7 +50,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.DebuggerAgent.setAsyncCallStackDepth(0); InspectorTest.runTestFunctionAndWaitUntilPaused(step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-listeners-count.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-listeners-count.html index 0dc8d4b..3a9efa1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-listeners-count.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-listeners-count.html
@@ -10,7 +10,7 @@ InspectorTest.runDebuggerTestSuite([ function testSourceFramesCount(next) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var sourceFrameCount = 0; InspectorTest.showScriptSource("script1.js", didShowScriptSources); @@ -27,7 +27,7 @@ function didShowScriptSourceAgain() { - var listeners = WebInspector.breakpointManager._listeners.get(WebInspector.BreakpointManager.Events.BreakpointAdded); + var listeners = Bindings.breakpointManager._listeners.get(Bindings.BreakpointManager.Events.BreakpointAdded); // There should be 3 breakpoint-added event listeners: // - BreakpointsSidebarPane // - 2 shown tabs @@ -35,7 +35,7 @@ function dumpListener(listener) { - if (!(listener.thisObject instanceof WebInspector.SourceFrame)) + if (!(listener.thisObject instanceof SourceFrame.SourceFrame)) return; var sourceFrame = listener.thisObject; InspectorTest.addResult(" " + sourceFrame._uiSourceCode.name());
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html index 29ae6721..39065d03 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html
@@ -168,7 +168,7 @@ resetWorkspace(breakpointManager); InspectorTest.addResult(" Resolving provisional breakpoint."); InspectorTest.addScript(mockTarget, breakpointManager, "a.js"); - mockTarget.debuggerModel._breakpointResolved("a.js:10", new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); + mockTarget.debuggerModel._breakpointResolved("a.js:10", new SDK.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); addUISourceCode(breakpointManager, "a.js", false, true); InspectorTest.finishBreakpointTest(breakpointManager, next); } @@ -186,7 +186,7 @@ uiLocationToRawLocation: function(uiSourceCode, lineNumber) { - return new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCode.url(), lineNumber - 10, 0); + return new SDK.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCode.url(), lineNumber - 10, 0); }, isIdentity: function() @@ -237,7 +237,7 @@ resetWorkspace(breakpointManager); InspectorTest.addResult(" Resolving provisional breakpoint."); InspectorTest.addScript(mockTarget, breakpointManager, "a.js"); - mockTarget.debuggerModel._breakpointResolved("a.js:10", new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 11, 0)); + mockTarget.debuggerModel._breakpointResolved("a.js:10", new SDK.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 11, 0)); var breakpoints = breakpointManager.allBreakpoints(); InspectorTest.assertEquals(1, breakpoints.length, "Exactly one provisional breakpoint should be registered in breakpoint manager."); InspectorTest.finishBreakpointTest(breakpointManager, next); @@ -258,7 +258,7 @@ uiLocationToRawLocation: function(uiSourceCode, lineNumber) { - return new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCodeA.url(), lineNumber - 10, 0); + return new SDK.DebuggerModel.Location(mockTarget.debuggerModel, uiSourceCodeA.url(), lineNumber - 10, 0); }, isIdentity: function() @@ -290,7 +290,7 @@ InspectorTest.addResult("\n Adding files:"); InspectorTest.addScript(mockTarget, breakpointManager, "a.js"); - mockTarget.debuggerModel._breakpointResolved("a.js:10", new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); + mockTarget.debuggerModel._breakpointResolved("a.js:10", new SDK.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); uiSourceCodeA = addUISourceCode(breakpointManager, "a.js", false, true); uiSourceCodeB = addUISourceCode(breakpointManager, "b.js", true, true); @@ -326,7 +326,7 @@ var uiSourceCode = addUISourceCode(breakpointManager, "a.js"); InspectorTest.addResult("\n Emulating breakpoint resolved event:"); - mockTarget.debuggerModel._breakpointResolved("a.js:10", new WebInspector.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); + mockTarget.debuggerModel._breakpointResolved("a.js:10", new SDK.DebuggerModel.Location(mockTarget.debuggerModel, "a.js", 10, 0)); InspectorTest.addResult("\n Make sure we don't do any unnecessary breakpoint actions:"); InspectorTest.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformed.bind(this));
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js index 6469615b..0502153 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
@@ -16,7 +16,7 @@ { if (!InspectorTest.uiSourceCodes[uiSourceCode.url()]) return null; - return new WebInspector.DebuggerModel.Location(target.debuggerModel, uiSourceCode.url(), lineNumber, 0); + return new SDK.DebuggerModel.Location(target.debuggerModel, uiSourceCode.url(), lineNumber, 0); }, isIdentity: function() @@ -32,11 +32,11 @@ return InspectorTest.dumpTargetIds ? "target " + targetAware.target().id() + " " : ""; } -InspectorTest.DebuggerModelMock = class extends WebInspector.SDKModel { +InspectorTest.DebuggerModelMock = class extends SDK.SDKModel { constructor(target) { - super(WebInspector.DebuggerModel, target); - this._breakpointResolvedEventTarget = new WebInspector.Object(); + super(SDK.DebuggerModel, target); + this._breakpointResolvedEventTarget = new Common.Object(); this._scripts = {}; this._breakpoints = {}; this._debuggerWorkspaceBinding = InspectorTest.testDebuggerWorkspaceBinding; @@ -62,7 +62,7 @@ _addScript(scriptId, url) { - var script = new WebInspector.Script(this, scriptId, url); + var script = new SDK.Script(this, scriptId, url); this._scripts[scriptId] = script; this._debuggerWorkspaceBinding._targetToData.get(this._target)._parsedScriptSource({data: script}); } @@ -100,7 +100,7 @@ createRawLocation(script, line, column) { - return new WebInspector.DebuggerModel.Location(this, script.scriptId, line, column); + return new SDK.DebuggerModel.Location(this, script.scriptId, line, column); } setBreakpointByURL(url, lineNumber, columnNumber, condition, callback) @@ -119,7 +119,7 @@ return; } if (lineNumber >= 1000) { - var shiftedLocation = new WebInspector.DebuggerModel.Location(this, url, lineNumber + 10, columnNumber); + var shiftedLocation = new SDK.DebuggerModel.Location(this, url, lineNumber + 10, columnNumber); this._scheduleSetBeakpointCallback(callback, breakpointId, [shiftedLocation]); return; } @@ -127,7 +127,7 @@ var locations = []; var script = this._scriptForURL(url); if (script) { - var location = new WebInspector.DebuggerModel.Location(this, script.scriptId, lineNumber, 0); + var location = new SDK.DebuggerModel.Location(this, script.scriptId, lineNumber, 0); locations.push(location); } @@ -187,11 +187,11 @@ InspectorTest.setupLiveLocationSniffers = function() { - InspectorTest.addSniffer(WebInspector.DebuggerWorkspaceBinding.prototype, "createLiveLocation", function(rawLocation) + InspectorTest.addSniffer(Bindings.DebuggerWorkspaceBinding.prototype, "createLiveLocation", function(rawLocation) { InspectorTest.addResult(" Location created: " + InspectorTest.dumpTarget(rawLocation) + rawLocation.scriptId + ":" + rawLocation.lineNumber); }, true); - InspectorTest.addSniffer(WebInspector.DebuggerWorkspaceBinding.Location.prototype, "dispose", function() + InspectorTest.addSniffer(Bindings.DebuggerWorkspaceBinding.Location.prototype, "dispose", function() { InspectorTest.addResult(" Location disposed: " + InspectorTest.dumpTarget(this._rawLocation) + this._rawLocation.scriptId + ":" + this._rawLocation.lineNumber); }, true); @@ -201,7 +201,7 @@ { target.debuggerModel._addScript(url, url); InspectorTest.addResult(" Adding script: " + url); - var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Debugger); + var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType(Workspace.projectTypes.Debugger); for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; if (uiSourceCode.url() === url) { @@ -217,7 +217,7 @@ if (!doNotAddScript) InspectorTest.addScript(target, breakpointManager, url); InspectorTest.addResult(" Adding UISourceCode: " + url); - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); var binding = breakpointManager._debuggerWorkspaceBinding; var uiSourceCode = InspectorTest.testNetworkProject.addFile(contentProvider, null); InspectorTest.uiSourceCodes[url] = uiSourceCode; @@ -231,8 +231,8 @@ InspectorTest.createBreakpointManager = function(targetManager, debuggerWorkspaceBinding, persistentBreakpoints) { InspectorTest._pendingBreakpointUpdates = 0; - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_updateInDebugger", updateInDebugger, true); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didUpdateInDebugger", didUpdateInDebugger, true); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_updateInDebugger", updateInDebugger, true); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didUpdateInDebugger", didUpdateInDebugger, true); function updateInDebugger() { @@ -271,10 +271,10 @@ mappingForManager = targets[i].defaultMapping; } - var breakpointManager = new WebInspector.BreakpointManager(setting, debuggerWorkspaceBinding._workspace, targetManager, debuggerWorkspaceBinding); + var breakpointManager = new Bindings.BreakpointManager(setting, debuggerWorkspaceBinding._workspace, targetManager, debuggerWorkspaceBinding); breakpointManager.defaultMapping = mappingForManager; - breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, breakpointAdded); - breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, breakpointRemoved); + breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointAdded, breakpointAdded); + breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointRemoved, breakpointRemoved); InspectorTest.addResult(" Created breakpoints manager"); InspectorTest.dumpBreakpointStorage(breakpointManager); return breakpointManager;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.html index eab218a..f7ec6f33 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-breakpoints-not-activated-on-reload.html
@@ -25,14 +25,14 @@ { InspectorTest.addResult("Main resource was shown."); InspectorTest.setBreakpoint(sourceFrame, 8, "", true); - WebInspector.panels.sources._toggleBreakpointsActive(); + UI.panels.sources._toggleBreakpointsActive(); InspectorTest.reloadPage(step3); } function step3() { InspectorTest.addResult("Main resource was shown."); - if (!WebInspector.breakpointManager.breakpointsActive()) + if (!Bindings.breakpointManager.breakpointsActive()) InspectorTest.addResult("Breakpoints are deactivated."); else InspectorTest.addResult("Error: breakpoints are activated.");
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-disable-add-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-disable-add-breakpoint.html index 026e149..6843a41d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-disable-add-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-disable-add-breakpoint.html
@@ -24,23 +24,23 @@ { testSourceFrame = sourceFrame; InspectorTest.addResult("Main resource was shown."); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, step3, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasDisabled, step3, this); InspectorTest.debuggerModel.disableDebugger(); } function step3() { - InspectorTest.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, step3, this); + InspectorTest.debuggerModel.removeEventListener(SDK.DebuggerModel.Events.DebuggerWasDisabled, step3, this); InspectorTest.addResult("Debugger disabled."); InspectorTest.setBreakpoint(testSourceFrame, 8, "", true); InspectorTest.addResult("Breakpoint added"); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, step4, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasEnabled, step4, this); InspectorTest.debuggerModel.enableDebugger(); } function step4() { - InspectorTest.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, step4, this); + InspectorTest.debuggerModel.removeEventListener(SDK.DebuggerModel.Events.DebuggerWasEnabled, step4, this); InspectorTest.addResult("Debugger was enabled"); InspectorTest.runTestFunctionAndWaitUntilPaused(step5); } @@ -53,17 +53,17 @@ function step6() { InspectorTest.addResult("Disable debugger again"); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, step7, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasDisabled, step7, this); InspectorTest.debuggerModel.disableDebugger(); } function step7() { InspectorTest.addResult("Debugger disabled"); - var breakpoint = WebInspector.breakpointManager.findBreakpoints(testSourceFrame.uiSourceCode(), 8)[0]; + var breakpoint = Bindings.breakpointManager.findBreakpoints(testSourceFrame.uiSourceCode(), 8)[0]; breakpoint.remove(); InspectorTest.addResult("Breakpoint removed"); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, step8, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasEnabled, step8, this); InspectorTest.debuggerModel.enableDebugger(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.html index ca8ad0a..5d92133 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/debugger-reload-breakpoints-with-source-maps.html
@@ -16,7 +16,7 @@ function step2(sourceFrame) { - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", didSetBreakpointInDebugger, true); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", didSetBreakpointInDebugger, true); InspectorTest.setBreakpoint(sourceFrame, 14, "", true); InspectorTest.setBreakpoint(sourceFrame, 15, "", true); @@ -29,7 +29,7 @@ if (counter) return; //Both breakpoints are resolved before reload - InspectorTest.addSniffer(WebInspector.JavaScriptBreakpointsSidebarPane.prototype, "didReceiveBreakpointLineForTest", onBreakpointsReady); + InspectorTest.addSniffer(Sources.JavaScriptBreakpointsSidebarPane.prototype, "didReceiveBreakpointLineForTest", onBreakpointsReady); } function onBreakpointsReady() @@ -42,10 +42,10 @@ function waitForBreakpoints() { var expectedBreakpointLocations = [[14, 0], [16, 4]]; - var jsBreakpoints = self.runtime.sharedInstance(WebInspector.JavaScriptBreakpointsSidebarPane); + var jsBreakpoints = self.runtime.sharedInstance(Sources.JavaScriptBreakpointsSidebarPane); jsBreakpoints.didReceiveBreakpointLineForTest = function(uiSourceCode, line, column) { - if (WebInspector.CompilerScriptMapping.StubProjectID === uiSourceCode.project().id()) + if (Bindings.CompilerScriptMapping.StubProjectID === uiSourceCode.project().id()) return; if (!uiSourceCode.url().endsWith("source1.js")) return;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/disable-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/disable-breakpoints.html index bb0b5d5..c70db45 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/disable-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/disable-breakpoints.html
@@ -46,7 +46,7 @@ InspectorTest.addResult("Test function finished."); InspectorTest.addResult("Disabling breakpoints..."); - WebInspector.breakpointManager.setBreakpointsActive(false); + Bindings.breakpointManager.setBreakpointsActive(false); InspectorTest.addResult("Running test function again..."); InspectorTest.addConsoleSniffer(testFunctionFinishedForTheSecondTime); @@ -68,7 +68,7 @@ { currentSourceFrame = sourceFrame; InspectorTest.addResult("Enabling breakpoints..."); - WebInspector.breakpointManager.setBreakpointsActive(true); + Bindings.breakpointManager.setBreakpointsActive(true); InspectorTest.addResult("Running test function..."); InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints-editing-dom-from-inspector.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints-editing-dom-from-inspector.html index e5f48a3..b07fde0b 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints-editing-dom-from-inspector.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints-editing-dom-from-inspector.html
@@ -8,7 +8,7 @@ function test() { - var pane = WebInspector.domBreakpointsSidebarPane; + var pane = Components.domBreakpointsSidebarPane; InspectorTest.runDebuggerTestSuite([ function testRemoveNode(next) { @@ -17,7 +17,7 @@ function step2(node) { - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); InspectorTest.addResult("Set NodeRemoved DOM breakpoint."); node.removeNode(next); } @@ -30,7 +30,7 @@ function step2(node) { - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set AttributeModified DOM breakpoint."); node.setAttribute("title", "a title", next); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html index 4de3ffe..d814606 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dom-breakpoints.html
@@ -82,7 +82,7 @@ function test() { - var pane = WebInspector.domBreakpointsSidebarPane; + var pane = Components.domBreakpointsSidebarPane; var rootElement; var outerElement; var authorShadowRoot; @@ -95,7 +95,7 @@ function step2(node) { rootElement = node; - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')"); InspectorTest.addResult("Append childElement to rootElement."); @@ -106,9 +106,9 @@ function testBreakpointToggle(next) { InspectorTest.addResult("Test that DOM breakpoint toggles properly using checkbox."); - WebInspector.domBreakpointsSidebarPane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + Components.domBreakpointsSidebarPane._setBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set DOM breakpoint."); - var elementId = pane._createBreakpointId(rootElement.id, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); + var elementId = pane._createBreakpointId(rootElement.id, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); var element = pane._breakpointElements.get(elementId); element._checkboxElement.click(); InspectorTest.addResult("Uncheck DOM breakpoint."); @@ -158,7 +158,7 @@ function step3(frames) { InspectorTest.captureStackTrace(frames); - pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified); + pane._removeBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified); InspectorTest.resumeExecution(next); } }, @@ -166,7 +166,7 @@ function testModifyAttribute(next) { InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute."); - pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'data-test', 'foo')"); InspectorTest.addResult("Modify rootElement data-test attribute."); @@ -174,7 +174,7 @@ function step2(callFrames) { - pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); + pane._removeBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); next(); } }, @@ -182,7 +182,7 @@ function testModifyAttrNode(next) { InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying Attr node."); - pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); InspectorTest.evaluateInPageWithTimeout("modifyAttrNode('rootElement', 'data-test', 'bar')"); InspectorTest.addResult("Modify rootElement data-test attribute."); @@ -190,7 +190,7 @@ function step2(callFrames) { - pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); + pane._removeBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); next(); } }, @@ -198,7 +198,7 @@ function testSetAttrNode(next) { InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when adding a new Attr node."); - pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); InspectorTest.evaluateInPageWithTimeout("setAttrNode('rootElement', 'data-foo', 'bar')"); InspectorTest.addResult("Modify rootElement data-foo attribute."); @@ -206,7 +206,7 @@ function step2(callFrames) { - pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); + pane._removeBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); next(); } }, @@ -214,7 +214,7 @@ function testModifyStyleAttribute(next) { InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying style attribute."); - pane._setBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); InspectorTest.evaluateInPageWithTimeout("modifyStyleAttribute('rootElement', 'color', 'green')"); InspectorTest.addResult("Modify rootElement style.color attribute."); @@ -222,7 +222,7 @@ function step2(callFrames) { - pane._removeBreakpoint(rootElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); + pane._removeBreakpoint(rootElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified); next(); } }, @@ -234,7 +234,7 @@ function step2(node) { - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove."); InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')"); InspectorTest.addResult("Remove elementToRemove."); @@ -249,7 +249,7 @@ function step2(node) { - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); pane._saveBreakpoints(); InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); InspectorTest.reloadPage(step3); @@ -276,7 +276,7 @@ { authorShadowRoot = node; InspectorTest.addResult("Test that 'Subtree Modified' breakpoint on author shadow root is hit when appending a child."); - pane._setBreakpoint(authorShadowRoot, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + pane._setBreakpoint(authorShadowRoot, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on author shadow root."); InspectorTest.evaluateInPageWithTimeout("appendElementToOpenShadowRoot('childElement')"); InspectorTest.addResult("Append childElement to author shadow root."); @@ -293,7 +293,7 @@ outerElement = node; InspectorTest.addResult("Test that shadow DOM breakpoints are persisted between page reloads."); - pane._setBreakpoint(outerElement, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + pane._setBreakpoint(outerElement, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); pane._saveBreakpoints(); InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on outerElement."); InspectorTest.reloadPage(step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html index f8468e2..f8cd2e1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html
@@ -17,8 +17,8 @@ <script> function test() { - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; InspectorTest.startDebuggerTest(); @@ -31,7 +31,7 @@ function dumpBreakpointStorage() { - var breakpointManager = WebInspector.breakpointManager; + var breakpointManager = Bindings.breakpointManager; var breakpoints = breakpointManager._storage._setting.get(); InspectorTest.addResult(" Dumping breakpoint storage"); for (var i = 0; i < breakpoints.length; ++i) @@ -41,7 +41,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 11, "", true); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-after-suspension.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-after-suspension.html index f8d2ca1..36b526f 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-after-suspension.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-after-suspension.html
@@ -22,7 +22,7 @@ function start() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.waitUntilPaused(paused); InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()"); @@ -37,14 +37,14 @@ function suspendAll() { InspectorTest.addResult("Suspend all targets"); - WebInspector.targetManager.suspendAllTargets(); + SDK.targetManager.suspendAllTargets(); InspectorTest.deprecatedRunAfterPendingDispatches(resumeAll); } function resumeAll() { InspectorTest.addResult("Resume all targets"); - WebInspector.targetManager.resumeAllTargets(); + SDK.targetManager.resumeAllTargets(); InspectorTest.waitUntilPaused(finish); InspectorTest.evaluateInPageWithTimeout("addListenerAndClick()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-script-first-stmt.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-script-first-stmt.html index a4f1230..53f91eb 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-script-first-stmt.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-script-first-stmt.html
@@ -29,7 +29,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); var numberOfPauses = 2; InspectorTest.startDebuggerTest(step1, true);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-xhr.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-xhr.html index 1d40b4f2..8b4f527 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-xhr.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints-xhr.html
@@ -49,7 +49,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); var xhrTargetNames = ["XMLHttpRequest", "XMLHttpRequestUpload"]; InspectorTest.setQuiet(true);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints.html index 7e4bc61..80c5cad 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/event-listener-breakpoints.html
@@ -72,7 +72,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); var testFunctions = [ function testClickBreakpoint(next) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html index 12378b96..10d159e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html
@@ -6,7 +6,7 @@ <script> function test() { - WebInspector.targetManager.mainTarget().setIsNodeJSForTest(); + SDK.targetManager.mainTarget().setIsNodeJSForTest(); InspectorTest.startDebuggerTest(); var functionText = "function foobar() { \nconsole.log('foobar execute!');\n}"; @@ -17,7 +17,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 1, "", true); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html index 62d425b3..578df05 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html
@@ -20,19 +20,19 @@ function didShowScriptSource(sourceFrame) { var uiSourceCode = sourceFrame._uiSourceCode; - var breakpointManager = WebInspector.breakpointManager; + var breakpointManager = Bindings.breakpointManager; InspectorTest.addResult("Locations for first line"); - breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(0, 0, 1, 0)) + breakpointManager.possibleBreakpoints(uiSourceCode, new Common.TextRange(0, 0, 1, 0)) .then(dumpLocations) .then(() => InspectorTest.addResult("All locations")) - .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(0, 0, 6, 0))) + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new Common.TextRange(0, 0, 6, 0))) .then(dumpLocations) .then(() => InspectorTest.addResult("Existing location by position")) - .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(2, 31, 2, 32))) + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new Common.TextRange(2, 31, 2, 32))) .then(dumpLocations) .then(() => InspectorTest.addResult("Not existing location by position")) - .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(2, 32, 2, 33))) + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new Common.TextRange(2, 32, 2, 33))) .then(dumpLocations) .then(() => InspectorTest.completeDebuggerTest()); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html index 2a6cfbc..4adbd93 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html
@@ -119,7 +119,7 @@ function setBreakpointAndWaitUntilPaused(sourceFrame, lineNumber, pausedCallback) { var expectedBreakpointId; - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); InspectorTest.setBreakpoint(sourceFrame, lineNumber, "", true); function didSetBreakpointInDebugger(callback, breakpointId)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html index d34fa819..b310a79 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html
@@ -92,7 +92,7 @@ function setBreakpoint(sourceFrame, lineNumber, condition, callback) { var expectedBreakpointId; - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); InspectorTest.setBreakpoint(sourceFrame, lineNumber, condition, true); function didSetBreakpointInDebugger(breakpointManagerCallback, breakpointId)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/use-possible-breakpoints-to-resolve-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/use-possible-breakpoints-to-resolve-breakpoint.html index 9453fcdc..94e731b1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/use-possible-breakpoints-to-resolve-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/use-possible-breakpoints-to-resolve-breakpoint.html
@@ -31,7 +31,7 @@ function didShowScriptSource(sourceFrame) { var uiSourceCode = sourceFrame._uiSourceCode; - var breakpointManager = WebInspector.breakpointManager; + var breakpointManager = Bindings.breakpointManager; setBreakpoint(breakpointManager, sourceFrame, 3, false) .then(() => setBreakpoint(breakpointManager, sourceFrame, 4, false)) .then(() => setBreakpoint(breakpointManager, sourceFrame, 5, false))
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/xhr-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/xhr-breakpoints.html index c2c01cc..ffbac1330 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/xhr-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/xhr-breakpoints.html
@@ -13,7 +13,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane); InspectorTest.runDebuggerTestSuite([ function testXHRBreakpoint(next) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debug-console-command.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debug-console-command.html index 0140f19..c151794 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debug-console-command.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debug-console-command.html
@@ -49,7 +49,7 @@ function didPause1(callFrames, reason) { InspectorTest.addResult("Script execution paused."); - InspectorTest.addResult("Reason for pause: " + (reason == WebInspector.DebuggerModel.BreakReason.DebugCommand ? "debug command" : "debugger statement") + "."); + InspectorTest.addResult("Reason for pause: " + (reason == SDK.DebuggerModel.BreakReason.DebugCommand ? "debug command" : "debugger statement") + "."); next(); } } @@ -70,7 +70,7 @@ InspectorTest.captureStackTrace(callFrames); InspectorTest.evaluateInConsole("undebug(" + functionName + ")"); InspectorTest.addResult("Breakpoint removed."); - InspectorTest.assertEquals(reason, WebInspector.DebuggerModel.BreakReason.DebugCommand); + InspectorTest.assertEquals(reason, SDK.DebuggerModel.BreakReason.DebugCommand); InspectorTest.resumeExecution(didResume); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debugger-command-line-api.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debugger-command-line-api.html index c736202..5de8721e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debugger-command-line-api.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-console/debugger-command-line-api.html
@@ -12,19 +12,19 @@ var test = function() { - InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_inspectRequested", inspect); - InspectorTest.addSniffer(WebInspector.Revealer, "revealPromise", oneRevealPromise, true); + InspectorTest.addSniffer(SDK.RuntimeModel.prototype, "_inspectRequested", inspect); + InspectorTest.addSniffer(Common.Revealer, "revealPromise", oneRevealPromise, true); function oneRevealPromise(node, revealPromise) { - if (!(node instanceof WebInspector.RemoteObject)) + if (!(node instanceof SDK.RemoteObject)) return; revealPromise.then(updateFocusedNode); } function updateFocusedNode() { - InspectorTest.addResult("Selected node id: '" + WebInspector.panels.elements.selectedDOMNode().getAttribute("id") + "'."); + InspectorTest.addResult("Selected node id: '" + UI.panels.elements.selectedDOMNode().getAttribute("id") + "'."); InspectorTest.completeDebuggerTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html index ac19db8..3d7eeea9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-blackbox-patterns.html
@@ -22,7 +22,7 @@ for (var i = 0; i < testCases.length; i += 2) { var url = testCases[i]; InspectorTest.addResult("Testing \"" + url + "\""); - var regexValue = WebInspector.blackboxManager._urlToRegExpString(url); + var regexValue = Bindings.blackboxManager._urlToRegExpString(url); InspectorTest.assertEquals(testCases[i + 1], regexValue); if (!regexValue) continue;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.html index 5b6c4f3..706eae8f 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.html
@@ -73,7 +73,7 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.setQuiet(true); @@ -84,8 +84,8 @@ function step1(node) { - var pane = WebInspector.domBreakpointsSidebarPane; - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + var pane = Components.domBreakpointsSidebarPane; + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')"); InspectorTest.waitUntilPausedAndDumpStackAndResume(next); } @@ -93,7 +93,7 @@ function testXHRBreakpoint(next) { - var pane = self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane); pane._setBreakpoint("foo", true); InspectorTest.evaluateInPageWithTimeout("sendXHR('file:///foo?a=b')"); InspectorTest.waitUntilPausedAndDumpStackAndResume(next); @@ -101,7 +101,7 @@ function testEventListenerBreakpoint(next) { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.evaluateInPageWithTimeout("addListenerAndClick(false)"); InspectorTest.waitUntilPausedAndPerformSteppingActions([ @@ -112,7 +112,7 @@ function testSteppingThroughEventListenerBreakpoint(next) { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.evaluateInPageWithTimeout("addListenerAndClick(true)"); InspectorTest.waitUntilPausedAndPerformSteppingActions([ @@ -127,7 +127,7 @@ function testSteppingOutOnEventListenerBreakpoint(next) { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.evaluateInPageWithTimeout("addListenerAndClick(true)"); InspectorTest.waitUntilPausedAndPerformSteppingActions([ @@ -140,7 +140,7 @@ function testSteppingOutOnEventListenerBreakpointAllBlackboxed(next) { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.evaluateInPageWithTimeout("addFewBlackboxedListenersAndClick(false)"); InspectorTest.waitUntilPausedAndPerformSteppingActions([ @@ -151,7 +151,7 @@ function testSteppingOutOnEventListenerBreakpointAllBlackboxedButOne(next) { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._setBreakpoint("listener:click"); InspectorTest.evaluateInPageWithTimeout("addFewBlackboxedListenersAndClick(true)"); InspectorTest.waitUntilPausedAndPerformSteppingActions([ @@ -164,8 +164,8 @@ function tearDown(next) { - self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane)._removeBreakpoint("foo"); - self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane)._removeBreakpoint("listener:click"); + self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane)._removeBreakpoint("foo"); + self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane)._removeBreakpoint("listener:click"); next(); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-jquery.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-jquery.html index 74d6dab..56574fb 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-jquery.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-jquery.html
@@ -42,7 +42,7 @@ function test() { var frameworkRegexString = "/jquery-1\\.11\\.1\\.min\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.startDebuggerTest(step1, true);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-break-program.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-break-program.html index 94a64f5..5f1267f2 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-break-program.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-break-program.html
@@ -25,9 +25,9 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); InspectorTest.startDebuggerTest(step1, true); @@ -38,7 +38,7 @@ function step2() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); pane._setBreakpoint("instrumentation:setTimer"); InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause)); } @@ -51,7 +51,7 @@ function completeTest() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); pane._removeBreakpoint("instrumentation:setTimer"); InspectorTest.completeDebuggerTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-exceptions.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-exceptions.html index 0899fcb..0263177 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-exceptions.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-exceptions.html
@@ -17,14 +17,14 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.setQuiet(true); InspectorTest.startDebuggerTest(step1); function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); } @@ -36,7 +36,7 @@ function completeTest() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-step-in.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-step-in.html index 517293ea..4d9a96c 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-step-in.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-skip-step-in.html
@@ -57,7 +57,7 @@ var frameworkRegexString = "/framework\\.js$"; var totalDebuggerStatements = 6; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.setQuiet(true); InspectorTest.startDebuggerTest(step1);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-sourcemap.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-sourcemap.html index 5c84e75..ef417245 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-sourcemap.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-sourcemap.html
@@ -18,9 +18,9 @@ function test() { - InspectorTest.addSniffer(WebInspector.BlackboxManager.prototype, "_patternChangeFinishedForTests", step1); + InspectorTest.addSniffer(Bindings.BlackboxManager.prototype, "_patternChangeFinishedForTests", step1); var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); function step1() {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-from-framework.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-from-framework.html index 5a43b31..c3247be 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-from-framework.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-from-framework.html
@@ -16,7 +16,7 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.setQuiet(true); InspectorTest.startDebuggerTest(step1); @@ -25,7 +25,7 @@ function step1() { - xhrPane = self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); + xhrPane = self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane); xhrPane._setBreakpoint("foo", true); InspectorTest.runTestFunctionAndWaitUntilPaused(step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-into-skips-setTimeout.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-into-skips-setTimeout.html index de0edb7..e9f9a79 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-into-skips-setTimeout.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-step-into-skips-setTimeout.html
@@ -28,7 +28,7 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.startDebuggerTest(step1, true);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-steppings.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-steppings.html index 56ac8b3c..574e999 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-steppings.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-steppings.html
@@ -42,7 +42,7 @@ function test() { var frameworkRegexString = "/framework\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.startDebuggerTest(step1, true);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-async-callstack.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-async-callstack.html index fd3ae08..aca7f6bf 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-async-callstack.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-async-callstack.html
@@ -35,7 +35,7 @@ var frameworkRegexString = "/framework\\.js$"; var maxAsyncCallStackDepth = 4; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.setQuiet(true); InspectorTest.startDebuggerTest(step1);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-worker.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-worker.html index 6016661..e07ce7c4 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-worker.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-frameworks/frameworks-with-worker.html
@@ -12,7 +12,7 @@ function test() { var frameworkRegexString = "foo\\.js$"; - WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString); + Common.settingForTest("skipStackFramesPattern").set(frameworkRegexString); InspectorTest.startDebuggerTest(step1, true); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-change-variable.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-change-variable.html index 34165231..882b468d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-change-variable.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-change-variable.html
@@ -44,7 +44,7 @@ function step2(callFrames) { - var pane = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane); + var pane = self.runtime.sharedInstance(Sources.CallStackSidebarPane); pane._callFrameSelected(pane.callFrames[1]); InspectorTest.deprecatedRunAfterPendingDispatches(step3); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.html index 2648113d..0ed443f87 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.html
@@ -76,7 +76,7 @@ function step3() { - var pane = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane); + var pane = self.runtime.sharedInstance(Sources.CallStackSidebarPane); pane._callFrameSelected(pane.callFrames[1]); InspectorTest.deprecatedRunAfterPendingDispatches(step4); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused.html index cf76f74..d5785e4 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused.html
@@ -36,7 +36,7 @@ function step3(callFrames, result) { InspectorTest.addResult("Evaluated script on the top frame: " + result); - var pane = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane); + var pane = self.runtime.sharedInstance(Sources.CallStackSidebarPane); pane._callFrameSelected(pane.callFrames[1]); InspectorTest.deprecatedRunAfterPendingDispatches(step4); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-mute-exception.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-mute-exception.html index fe9e2d6..33d6379 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-mute-exception.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-mute-exception.html
@@ -31,7 +31,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); InspectorTest.showScriptSource("debugger-mute-exception.html", step2); } @@ -46,7 +46,7 @@ function step3() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-in-internal.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-in-internal.html index b570a50..bbaa7ae 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-in-internal.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-in-internal.html
@@ -20,7 +20,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.showScriptSource("debugger-pause-in-internal.html", step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-exception.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-exception.html index d5e6ddf..9cfa976 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-exception.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-exception.html
@@ -20,7 +20,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.showScriptSource("debugger-pause-on-exception.html", step2); } @@ -33,7 +33,7 @@ function step3() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-failed-assertion.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-failed-assertion.html index 5bc651c2..8f018ed 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-failed-assertion.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-failed-assertion.html
@@ -20,7 +20,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.showScriptSource("debugger-pause-on-failed-assertion.html", step2); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-promise-rejection.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-promise-rejection.html index 9727098..79baa35efe 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-promise-rejection.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-pause-on-promise-rejection.html
@@ -54,7 +54,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.showScriptSource("debugger-pause-on-promise-rejection.html", step2); } @@ -67,7 +67,7 @@ function step3() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions); InspectorTest.addResult("\n=== Pausing on all exceptions ==="); InspectorTest.runTestFunction(); waitUntilPausedNTimes(2, step4); @@ -75,7 +75,7 @@ function step4() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-in-inline-script.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-in-inline-script.html index b03d495..cc7c430 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-in-inline-script.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-in-inline-script.html
@@ -34,7 +34,7 @@ InspectorTest.addResult("Did load front-end"); InspectorTest.addResult("Paused: " + !!InspectorTest.debuggerModel.debuggerPausedDetails()); InspectorTest.reloadPage(didReload.bind(this)); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, didPauseAfterReload, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerPaused, didPauseAfterReload, this); } function didReload() @@ -59,7 +59,7 @@ return; } var frame = callFrames[callFrameIndex]; - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(frame.location()); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(frame.location()); InspectorTest.showUISourceCode(uiLocation.uiSourceCode, dumpCallFrameLine); function dumpCallFrameLine(sourceFrame)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-on-elements-panel.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-on-elements-panel.html index 85c1e6a..4d6d57c 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-on-elements-panel.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/pause-on-elements-panel.html
@@ -16,7 +16,7 @@ function step1() { - WebInspector.inspectorView.showPanel("sources").then(step2); + UI.inspectorView.showPanel("sources").then(step2); } function step2() @@ -32,7 +32,7 @@ function step4(node) { - InspectorTest.assertTrue(!WebInspector.panels.sources.paused()); + InspectorTest.assertTrue(!UI.panels.sources.paused()); InspectorTest.togglePause(); // This used to skip the pause request (the test used to timeout).
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/skip-pauses-until-reload.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/skip-pauses-until-reload.html index 974e17b..5e2bc98 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/skip-pauses-until-reload.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/skip-pauses-until-reload.html
@@ -63,7 +63,7 @@ InspectorTest.setBreakpoint(sourceFrame, 12, "", true); InspectorTest.addResult("Set up to pause on all exceptions."); // FIXME: Test is flaky with PauseOnAllExceptions due to races in debugger. - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.nodeWithId("element", didResolveNode); testRunner.logToStderr("didShowScriptSource"); } @@ -71,18 +71,18 @@ function didResolveNode(node) { testRunner.logToStderr("didResolveNode"); - var pane = WebInspector.domBreakpointsSidebarPane; + var pane = Components.domBreakpointsSidebarPane; InspectorTest.addResult("Set up DOM breakpoints."); - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); - pane._setBreakpoint(node, WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.AttributeModified, true); + pane._setBreakpoint(node, Components.DOMBreakpointsSidebarPane.BreakpointTypes.NodeRemoved, true); setUpEventBreakpoints(); } function setUpEventBreakpoints() { testRunner.logToStderr("setUpEventBreakpoints"); - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); InspectorTest.addResult("Set up Event breakpoints."); pane._setBreakpoint("listener:click"); InspectorTest.deprecatedRunAfterPendingDispatches(didSetUp); @@ -136,7 +136,7 @@ function completeTest() { testRunner.logToStderr("completeTest"); - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); pane._removeBreakpoint("listener:click"); InspectorTest.completeDebuggerTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/debugger-step-into-event-listener.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/debugger-step-into-event-listener.html index d2989827..0fe8679 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/debugger-step-into-event-listener.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/debugger-step-into-event-listener.html
@@ -40,7 +40,7 @@ InspectorTest.addResult("SUCCESS: Did step into event listener(" + expectedName + ")."); else InspectorTest.addResult("FAIL: Unexpected top function: expected " + expectedName + ", found " + topFunctionName); - InspectorTest.assertEquals(WebInspector.DebuggerModel.BreakReason.Other, reason, "FAIL: wrong pause reason: " + reason); + InspectorTest.assertEquals(SDK.DebuggerModel.BreakReason.Other, reason, "FAIL: wrong pause reason: " + reason); } var stepCount = 0;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/step-through-event-listeners.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/step-through-event-listeners.html index f3130dfc..54afaa43 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/step-through-event-listeners.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-step/step-through-event-listeners.html
@@ -28,7 +28,7 @@ function test() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); InspectorTest.runDebuggerTestSuite([ function testClickBreakpoint(next) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function.html index a5bc7ed..42904a0 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-async-function.html
@@ -35,7 +35,7 @@ function dumpCallStackSidebarPane() { - var callFrameList = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane).callFrameList; + var callFrameList = self.runtime.sharedInstance(Sources.CallStackSidebarPane).callFrameList; for (var item of callFrameList._items) InspectorTest.addResult(item.element.textContent.replace(/VM\d+/g, "VM")); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-url.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-url.html index b06073b2..86e8faa 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-url.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/async-call-stack-url.html
@@ -33,7 +33,7 @@ function step4() { - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", step5); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", step5); scriptFormatter._toggleFormatScriptSource(); } @@ -44,7 +44,7 @@ function step6() { - var callFrameList = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane).callFrameList; + var callFrameList = self.runtime.sharedInstance(Sources.CallStackSidebarPane).callFrameList; for (var item of callFrameList._items) InspectorTest.addResult(item.element.textContent.replace(/VM\d+/g, "VM")); InspectorTest.completeDebuggerTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-empty-event-listener.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-empty-event-listener.html index bf8b76da..1e425a8 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-empty-event-listener.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-empty-event-listener.html
@@ -21,7 +21,7 @@ var test = function() { - var pane = self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane); InspectorTest.startDebuggerTest(step1, true); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-set-timeout-with-syntax-error.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-set-timeout-with-syntax-error.html index 89e39915..42ed9f30 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-set-timeout-with-syntax-error.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/break-on-set-timeout-with-syntax-error.html
@@ -21,7 +21,7 @@ function step1() { - self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane)._setBreakpoint("instrumentation:timerFired"); + self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane)._setBreakpoint("instrumentation:timerFired"); InspectorTest.evaluateInPage("runSetTimeoutWithSyntaxError()", InspectorTest.waitUntilMessageReceived.bind(this, step2)); } @@ -34,7 +34,7 @@ function step3() { - self.runtime.sharedInstance(WebInspector.EventListenerBreakpointsSidebarPane)._removeBreakpoint("instrumentation:timerFired"); + self.runtime.sharedInstance(Sources.EventListenerBreakpointsSidebarPane)._removeBreakpoint("instrumentation:timerFired"); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/callstack-placards-discarded.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/callstack-placards-discarded.html index 32b298d..d716b6c 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/callstack-placards-discarded.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/callstack-placards-discarded.html
@@ -14,7 +14,7 @@ InspectorTest.runDebuggerTestSuite([ function testCallStackPlacardsDiscarded(next) { - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, didPause, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerPaused, didPause, this); var previousCount = undefined; function didPause(event) { @@ -55,7 +55,7 @@ function liveLocationsCount() { var count = 0; - var infos = WebInspector.debuggerWorkspaceBinding._targetToData.get(InspectorTest.debuggerModel.target()).scriptDataMap.valuesArray(); + var infos = Bindings.debuggerWorkspaceBinding._targetToData.get(InspectorTest.debuggerModel.target()).scriptDataMap.valuesArray(); infos.forEach(function(info) { count += info._locations.size; });
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/click-gutter-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/click-gutter-breakpoint.html index 63f7968..e2554ef 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/click-gutter-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/click-gutter-breakpoint.html
@@ -23,8 +23,8 @@ return Promise.resolve(); } - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; var scriptFormatter; var formattedSourceFrame;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/copy-stack-trace.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/copy-stack-trace.html index 3b0bcd8..d145107a 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/copy-stack-trace.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/copy-stack-trace.html
@@ -31,7 +31,7 @@ function step2() { InspectorFrontendHost.copyText = InspectorTest.addResult.bind(InspectorTest); - self.runtime.sharedInstance(WebInspector.CallStackSidebarPane)._copyStackTrace(); + self.runtime.sharedInstance(Sources.CallStackSidebarPane)._copyStackTrace(); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-expand-scope.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-expand-scope.html index e31a5e6..5937bfe8 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-expand-scope.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-expand-scope.html
@@ -34,7 +34,7 @@ function onTestStarted() { - InspectorTest.addSniffer(WebInspector.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); + InspectorTest.addSniffer(Sources.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); InspectorTest.runTestFunctionAndWaitUntilPaused(() => {}); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values.html index c0264de..99aaa58 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-inline-values.html
@@ -25,7 +25,7 @@ function runTestFunction() { - InspectorTest.addSniffer(WebInspector.JavaScriptSourceFrame.prototype, "setExecutionLocation", onSetExecutionLocation); + InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "setExecutionLocation", onSetExecutionLocation); InspectorTest.evaluateInPage("setTimeout(testFunction, 0)"); } @@ -46,7 +46,7 @@ InspectorTest.addResult(output.join(" ")); } - InspectorTest.addSniffer(WebInspector.JavaScriptSourceFrame.prototype, "setExecutionLocation", onSetExecutionLocation); + InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "setExecutionLocation", onSetExecutionLocation); if (++stepCount < 10) InspectorTest.stepOver(); else
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var.html index 199bd60..4ae99322 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var.html
@@ -84,11 +84,11 @@ function didEvaluate(result, exceptionDetails) { InspectorTest.assertTrue(!exceptionDetails, "FAIL: was thrown. Expression: " + expression); - WebInspector.panels.sources._saveToTempVariable(result); + UI.panels.sources._saveToTempVariable(result); InspectorTest.waitUntilNthMessageReceived(2, evaluateNext); } - WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, undefined, didEvaluate); + UI.context.flavor(SDK.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, undefined, didEvaluate); } function tearDown()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/error-in-watch-expressions.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/error-in-watch-expressions.html index 2c33e118..af2ae8b9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/error-in-watch-expressions.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/error-in-watch-expressions.html
@@ -7,8 +7,8 @@ var test = function() { - var watchExpressionsPane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); - WebInspector.panels.sources._sidebarPaneStack.showView(WebInspector.panels.sources._watchSidebarPane).then(() => { + var watchExpressionsPane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane); + UI.panels.sources._sidebarPaneStack.showView(UI.panels.sources._watchSidebarPane).then(() => { watchExpressionsPane.doUpdate(); watchExpressionsPane._createWatchExpression("#$%"); watchExpressionsPane._saveExpressions();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/execution-context-sorted.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/execution-context-sorted.html index 0b2baa5..6180e41 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/execution-context-sorted.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/execution-context-sorted.html
@@ -7,7 +7,7 @@ { var contexts = InspectorTest.runtimeModel.executionContexts(); for (var c of contexts) - InspectorTest.addResult(WebInspector.ResourceTreeModel.fromTarget(c.target()).frameForId(c.frameId).displayName()); + InspectorTest.addResult(SDK.ResourceTreeModel.fromTarget(c.target()).frameForId(c.frameId).displayName()); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html index 80d94c931..f433ea5 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables.html
@@ -22,13 +22,13 @@ function step1() { - InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.prototype, "_renderDecorations").then(step2); + InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype, "_renderDecorations").then(step2); InspectorTest.runTestFunctionAndWaitUntilPaused(); } function step2() { - var currentFrame = WebInspector.panels.sources.visibleView; + var currentFrame = UI.panels.sources.visibleView; var decorations = currentFrame.textEditor._decorations; for (var line of decorations.keysArray()) { var lineDecorations = Array.from(decorations.get(line)).map(decoration => decoration.element.textContent).join(", ");
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html index 655319c..ae65b4ef 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/last-execution-context.html
@@ -7,10 +7,10 @@ function test() { InspectorTest.createWorkspace(true); - var context = new WebInspector.Context(); - context.addFlavorChangeListener(WebInspector.ExecutionContext, executionContextChanged, this); - context.addFlavorChangeListener(WebInspector.Target, targetChanged, this); - new WebInspector.ExecutionContextSelector(InspectorTest.testTargetManager, context); + var context = new UI.Context(); + context.addFlavorChangeListener(SDK.ExecutionContext, executionContextChanged, this); + context.addFlavorChangeListener(SDK.Target, targetChanged, this); + new Components.ExecutionContextSelector(InspectorTest.testTargetManager, context); function executionContextChanged(event) { @@ -33,7 +33,7 @@ InspectorTest.addResult(""); InspectorTest.addResult("Adding sw target"); - var swTarget = InspectorTest.createMockTarget("sw-target", null, WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Worker); + var swTarget = InspectorTest.createMockTarget("sw-target", null, SDK.Target.Capability.Network | SDK.Target.Capability.Worker); swTarget.runtimeModel._executionContextCreated({id: "sw1", auxData: { isDefault: true, frameId: "" }, origin: "origin", name: "swContext1Name"}); InspectorTest.addResult(""); @@ -46,39 +46,39 @@ InspectorTest.addResult(""); InspectorTest.addResult("Switching to sw target"); - context.setFlavor(WebInspector.Target, swTarget); + context.setFlavor(SDK.Target, swTarget); InspectorTest.addResult(""); InspectorTest.addResult("Switching to page target"); - context.setFlavor(WebInspector.Target, pageTarget); + context.setFlavor(SDK.Target, pageTarget); InspectorTest.addResult(""); InspectorTest.addResult("User selected content script"); - context.setFlavor(WebInspector.ExecutionContext, pageTarget.runtimeModel.executionContexts()[2]); + context.setFlavor(SDK.ExecutionContext, pageTarget.runtimeModel.executionContexts()[2]); InspectorTest.addResult(""); InspectorTest.addResult("Switching to sw target"); - context.setFlavor(WebInspector.Target, swTarget); + context.setFlavor(SDK.Target, swTarget); InspectorTest.addResult(""); InspectorTest.addResult("Switching to page target"); - context.setFlavor(WebInspector.Target, pageTarget); + context.setFlavor(SDK.Target, pageTarget); InspectorTest.addResult(""); InspectorTest.addResult("User selected iframe1"); - context.setFlavor(WebInspector.ExecutionContext, pageTarget.runtimeModel.executionContexts()[0]); + context.setFlavor(SDK.ExecutionContext, pageTarget.runtimeModel.executionContexts()[0]); InspectorTest.addResult(""); InspectorTest.addResult("Switching to sw target"); - context.setFlavor(WebInspector.Target, swTarget); + context.setFlavor(SDK.Target, swTarget); InspectorTest.addResult(""); InspectorTest.addResult("Switching to page target"); - context.setFlavor(WebInspector.Target, pageTarget); + context.setFlavor(SDK.Target, pageTarget); InspectorTest.addResult(""); InspectorTest.addResult("Switching to sw target"); - context.setFlavor(WebInspector.Target, swTarget); + context.setFlavor(SDK.Target, swTarget); InspectorTest.addResult(""); InspectorTest.addResult("Removing page main frame");
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/monitor-console-command.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/monitor-console-command.html index f58e6ede..bc73877 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/monitor-console-command.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/monitor-console-command.html
@@ -68,7 +68,7 @@ function didReceive(message) { - if (message.type === WebInspector.ConsoleMessage.MessageType.Result) { + if (message.type === SDK.ConsoleMessage.MessageType.Result) { InspectorTest.waitUntilMessageReceived(didReceive); return; }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-execution-line.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-execution-line.html index f3f75d0..f31512e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-execution-line.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-execution-line.html
@@ -16,8 +16,8 @@ { var executionLineSet = false; var executionLineRevealed = false; - InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "revealPosition", didRevealLine); - InspectorTest.addSniffer(WebInspector.JavaScriptSourceFrame.prototype, "setExecutionLocation", didSetExecutionLocation); + InspectorTest.addSniffer(SourceFrame.SourceFrame.prototype, "revealPosition", didRevealLine); + InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "setExecutionLocation", didSetExecutionLocation); InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); function didPause(callFrames)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-not-skipped.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-not-skipped.html index 80b33f15..51f7096 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-not-skipped.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/reveal-not-skipped.html
@@ -13,8 +13,8 @@ var test = function() { - var panel = WebInspector.panels.sources; - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + var panel = UI.panels.sources; + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.runDebuggerTestSuite([ function testRevealAfterPausedOnException(next) @@ -27,7 +27,7 @@ InspectorTest.addResult("Script source was shown for '" + panel.visibleView._uiSourceCode.name() + "'."); InspectorTest.addResult("Throwing exception..."); InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); - InspectorTest.addSniffer(WebInspector.TabbedEditorContainer.prototype, "showFile", step3); + InspectorTest.addSniffer(Sources.TabbedEditorContainer.prototype, "showFile", step3); } function step3() @@ -48,7 +48,7 @@ InspectorTest.addResult("Script source was shown for '" + panel.visibleView._uiSourceCode.name() + "'."); InspectorTest.addResult("Throwing exception..."); InspectorTest.evaluateInPage("setTimeout(throwAnException, 0)"); - InspectorTest.addSniffer(WebInspector.TabbedEditorContainer.prototype, "showFile", step6); + InspectorTest.addSniffer(Sources.TabbedEditorContainer.prototype, "showFile", step6); } function step6() @@ -73,7 +73,7 @@ InspectorTest.addResult("Script source was shown for '" + panel.visibleView._uiSourceCode.name() + "'."); InspectorTest.addResult("Formatting..."); InspectorTest.scriptFormatter().then(function(scriptFormatter) { - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-2.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-2.html index decad53b3..2575000b 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-2.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-2.html
@@ -6,8 +6,8 @@ <script> var test = function() { - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; var scriptFormatter; var formattedSourceFrame; @@ -26,7 +26,7 @@ function didShowScriptSource(frame) { - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-3.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-3.html index cbb45ce..c501f6f 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-3.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-breakpoints-3.html
@@ -6,8 +6,8 @@ <script> var test = function() { - WebInspector.breakpointManager._storage._breakpoints = {}; - var panel = WebInspector.panels.sources; + Bindings.breakpointManager._storage._breakpoints = {}; + var panel = UI.panels.sources; var scriptFormatter; InspectorTest.runDebuggerTestSuite([ @@ -25,7 +25,7 @@ function didShowScriptSource(frame) { - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html index fce8c70..4c4c6f9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-formatter-search.html
@@ -36,7 +36,7 @@ InspectorTest.addResult("Pre-format search results:"); InspectorTest.dumpSearchMatches(matches); shouldRequestContent = true; - InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); + InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted); scriptFormatter._toggleFormatScriptSource(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-checkContent.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-checkContent.html index 10d73e65..3025548b 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-checkContent.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-checkContent.html
@@ -16,7 +16,7 @@ window.confirm = confirmOverride; - WebInspector.scriptSnippetModel.project().createFile("", null, "", onCreated.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", onCreated.bind(this)); function onCreated(usc) { uiSourceCode = usc;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html index b915940..d936f5e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
@@ -14,14 +14,14 @@ { function evaluateSnippetAndDumpEvaluationDetails(uiSourceCode, context, callback) { - InspectorTest.addSniffer(WebInspector.ScriptSnippetModel.prototype, "_printRunScriptResult", dumpResult); - WebInspector.scriptSnippetModel.evaluateScriptSnippet(context, uiSourceCode); + InspectorTest.addSniffer(Snippets.ScriptSnippetModel.prototype, "_printRunScriptResult", dumpResult); + Snippets.scriptSnippetModel.evaluateScriptSnippet(context, uiSourceCode); var target = context.target(); - var mapping = WebInspector.scriptSnippetModel._mappingForTarget.get(target); + var mapping = Snippets.scriptSnippetModel._mappingForTarget.get(target); var evaluationSourceURL = mapping._evaluationSourceURL(uiSourceCode); - var snippetId = WebInspector.scriptSnippetModel._snippetIdForUISourceCode.get(uiSourceCode); + var snippetId = Snippets.scriptSnippetModel._snippetIdForUISourceCode.get(uiSourceCode); InspectorTest.addResult("Last evaluation source url for snippet: " + evaluationSourceURL); - InspectorTest.assertEquals(snippetId, WebInspector.scriptSnippetModel._snippetIdForSourceURL(evaluationSourceURL), "Snippet can not be identified by its evaluation sourceURL."); + InspectorTest.assertEquals(snippetId, Snippets.scriptSnippetModel._snippetIdForSourceURL(evaluationSourceURL), "Snippet can not be identified by its evaluation sourceURL."); function dumpResult(target, result) @@ -33,14 +33,14 @@ function resetSnippetsSettings() { - WebInspector.scriptSnippetModel._snippetStorage._lastSnippetIdentifierSetting.set(0); - WebInspector.scriptSnippetModel._snippetStorage._snippetsSetting.set([]); - WebInspector.scriptSnippetModel._lastSnippetEvaluationIndexSetting.set(0); - WebInspector.scriptSnippetModel._project.removeProject(); - WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspector.workspace); + Snippets.scriptSnippetModel._snippetStorage._lastSnippetIdentifierSetting.set(0); + Snippets.scriptSnippetModel._snippetStorage._snippetsSetting.set([]); + Snippets.scriptSnippetModel._lastSnippetEvaluationIndexSetting.set(0); + Snippets.scriptSnippetModel._project.removeProject(); + Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspace); } - var workspace = WebInspector.workspace; + var workspace = Workspace.workspace; InspectorTest.runDebuggerTestSuite([ function testCreateEditRenameRemove(next) { @@ -48,7 +48,7 @@ function filterSnippet(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.Snippets; + return uiSourceCode.project().type() === Workspace.projectTypes.Snippets; } function uiSourceCodeAdded(event) @@ -63,8 +63,8 @@ InspectorTest.addResult("UISourceCodeRemoved: " + uiSourceCode.name()); } - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); function renameSnippetAndCheckWorkspace(uiSourceCode, snippetName) { @@ -80,7 +80,7 @@ } InspectorTest.addResult("UISourceCode name is '" + uiSourceCode.name() + "' now."); InspectorTest.addResult("Number of uiSourceCodes in workspace: " + workspace.uiSourceCodes().filter(filterSnippet).length); - var storageSnippetsCount = WebInspector.scriptSnippetModel._snippetStorage.snippets().length; + var storageSnippetsCount = Snippets.scriptSnippetModel._snippetStorage.snippets().length; InspectorTest.addResult("Number of snippets in the storage: " + storageSnippetsCount); } @@ -91,7 +91,7 @@ resetSnippetsSettings(); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); function step2(uiSourceCode) { @@ -114,7 +114,7 @@ function contentDumped2() { InspectorTest.addResult("Snippet1 created."); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); } } @@ -136,9 +136,9 @@ function onContentDumped() { - WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode1.url()); - WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode2.url()); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); + Snippets.scriptSnippetModel.project().deleteFile(uiSourceCode1.url()); + Snippets.scriptSnippetModel.project().deleteFile(uiSourceCode2.url()); + Snippets.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); } } @@ -146,15 +146,15 @@ { var uiSourceCode3 = uiSourceCode; InspectorTest.addResult("Snippet3 created."); - WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode3.url()); + Snippets.scriptSnippetModel.project().deleteFile(uiSourceCode3.url()); InspectorTest.addResult("Snippet3 deleted."); InspectorTest.addResult("Number of uiSourceCodes in workspace: " + workspace.uiSourceCodes().filter(filterSnippet).length); - var storageSnippetsCount = WebInspector.scriptSnippetModel._snippetStorage.snippets().length; + var storageSnippetsCount = Snippets.scriptSnippetModel._snippetStorage.snippets().length; InspectorTest.addResult("Number of snippets in the storage: " + storageSnippetsCount); - workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); - workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); + workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded); + workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved); next(); } @@ -165,12 +165,12 @@ var uiSourceCode1; var uiSourceCode2; var uiSourceCode3; - var context = WebInspector.context.flavor(WebInspector.ExecutionContext); + var context = UI.context.flavor(SDK.ExecutionContext); resetSnippetsSettings(); - var snippetScriptMapping = WebInspector.scriptSnippetModel.snippetScriptMapping(WebInspector.targetManager.targets()[0]); + var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.targetManager.targets()[0]); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); function step2(uiSourceCode) { @@ -180,7 +180,7 @@ content += "// This snippet does nothing.\n"; content += "var i = 2+2;\n"; uiSourceCode1.setWorkingCopy(content); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); } function step3(uiSourceCode) @@ -194,7 +194,7 @@ content += "};\n"; content += "doesNothing;\n"; uiSourceCode2.setWorkingCopy(content); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); } function step4(uiSourceCode) @@ -228,8 +228,8 @@ { function evaluateSnippetAndReloadPage(uiSourceCode, callback) { - InspectorTest.addSniffer(WebInspector.ScriptSnippetModel.prototype, "_printRunScriptResult", snippetFinished); - WebInspector.scriptSnippetModel.evaluateScriptSnippet(WebInspector.context.flavor(WebInspector.ExecutionContext), uiSourceCode); + InspectorTest.addSniffer(Snippets.ScriptSnippetModel.prototype, "_printRunScriptResult", snippetFinished); + Snippets.scriptSnippetModel.evaluateScriptSnippet(UI.context.flavor(SDK.ExecutionContext), uiSourceCode); function snippetFinished(result) { @@ -241,9 +241,9 @@ } resetSnippetsSettings(); - var snippetScriptMapping = WebInspector.scriptSnippetModel.snippetScriptMapping(WebInspector.targetManager.targets()[0]); + var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.targetManager.targets()[0]); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step3.bind(this)); function step3(uiSourceCode) { @@ -262,7 +262,7 @@ { var context; - InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executionContextCreated", contextCreated); + InspectorTest.addSniffer(SDK.RuntimeModel.prototype, "_executionContextCreated", contextCreated); InspectorTest.evaluateInPage("startWorker()"); function contextCreated() @@ -271,7 +271,7 @@ context = this.executionContexts()[0]; resetSnippetsSettings(); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); } function step2(uiSourceCode) @@ -287,7 +287,7 @@ { resetSnippetsSettings(); - WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); function step2(uiSourceCode) { @@ -297,7 +297,7 @@ function step3() { - WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); + Snippets.scriptSnippetModel.project().createFile("", null, "", step4.bind(this)); } function step4(uiSourceCode)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html index de02d96..b77f31c 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-panel.html
@@ -14,17 +14,17 @@ function createNavigatorView() { - var workspace = WebInspector.workspace; - WebInspector.workspace = InspectorTest.testWorkspace; - var navigatorView = new WebInspector.SourcesNavigatorView(); - WebInspector.workspace = workspace; - navigatorView.show(WebInspector.inspectorView.element); + var workspace = Workspace.workspace; + Workspace.workspace = InspectorTest.testWorkspace; + var navigatorView = new Sources.SourcesNavigatorView(); + Workspace.workspace = workspace; + navigatorView.show(UI.inspectorView.element); return navigatorView; } function createContentProvider(url) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); contentProvider.requestContent = function() { InspectorTest.addResult("Source requested for " + url); @@ -36,7 +36,7 @@ function createMockWorkspace() { InspectorTest.createWorkspaceWithTarget(true); - InspectorTest.testDebuggerProject = new WebInspector.ContentProviderBasedProject(InspectorTest.testWorkspace, "", WebInspector.projectTypes.Debugger, ""); + InspectorTest.testDebuggerProject = new Bindings.ContentProviderBasedProject(InspectorTest.testWorkspace, "", Workspace.projectTypes.Debugger, ""); return InspectorTest.testWorkspace; } @@ -47,7 +47,7 @@ function addDebuggerFile(workspace, url) { - var uiSourceCode = InspectorTest.testDebuggerProject.createUISourceCode(url, WebInspector.resourceTypes.Script); + var uiSourceCode = InspectorTest.testDebuggerProject.createUISourceCode(url, Common.resourceTypes.Script); InspectorTest.testDebuggerProject.addUISourceCodeWithProvider(uiSourceCode, createContentProvider(url)); return uiSourceCode; }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html index 2c9f055ef..652b158 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-sorting.html
@@ -11,18 +11,18 @@ { var navigatorView = new constructor(); navigatorView._resetWorkspace(InspectorTest.testWorkspace); - navigatorView.show(WebInspector.inspectorView.element); + navigatorView.show(UI.inspectorView.element); return navigatorView; } InspectorTest.createWorkspaceWithTarget(true); - sourcesNavigatorView = createNavigatorView(WebInspector.SourcesNavigatorView); - contentScriptsNavigatorView = createNavigatorView(WebInspector.ContentScriptsNavigatorView); + sourcesNavigatorView = createNavigatorView(Sources.SourcesNavigatorView); + contentScriptsNavigatorView = createNavigatorView(Sources.ContentScriptsNavigatorView); var uiSourceCodes = []; function addUISourceCode(url, isContentScript) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); var uiSourceCode = InspectorTest.testNetworkProject.addFile(contentProvider, InspectorTest.mainFrame(), isContentScript); uiSourceCodes.push(uiSourceCode); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html index cd073df..1547600 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html
@@ -13,8 +13,8 @@ InspectorTest.evaluateInPage("injectScript(1);"); InspectorTest.evaluateInPage("injectScript(2);"); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, reportAdded); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, reportRemoved); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, reportAdded); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, reportRemoved); var iteration = 0;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/selected-call-frame-after-formatting-source.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/selected-call-frame-after-formatting-source.html index 1f76ba0..d75ac63 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/selected-call-frame-after-formatting-source.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/selected-call-frame-after-formatting-source.html
@@ -19,7 +19,7 @@ var test = function() { InspectorTest.startDebuggerTest(step1); - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var sourceFrame; function step1() @@ -44,7 +44,7 @@ function step4() { - InspectorTest.assertEquals("testFunction", WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame).functionName); + InspectorTest.assertEquals("testFunction", UI.context.flavor(SDK.DebuggerModel.CallFrame).functionName); sourceFrame._toggleFormatSource(step5); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-function-definition.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-function-definition.html index 38fdb71..9a24ec5 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-function-definition.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-function-definition.html
@@ -12,13 +12,13 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.runTestSuite([ function testRevealFunctionDefinition(next) { InspectorTest.addSniffer(panel, "showUISourceCode", showUISourceCodeHook); - WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate("jumpToMe", "", false, true, false, false, false, didGetFunction); + UI.context.flavor(SDK.ExecutionContext).evaluate("jumpToMe", "", false, true, false, false, false, didGetFunction); function didGetFunction(funcObject, exceptionDetails) { @@ -39,15 +39,15 @@ function testDumpFunctionDefinition(next) { - InspectorTest.addSniffer(WebInspector.ObjectPropertiesSection, "formatObjectAsFunction", onConsoleMessagesReceived); - WebInspector.ConsoleModel.evaluateCommandInConsole(WebInspector.context.flavor(WebInspector.ExecutionContext), "jumpToMe"); + InspectorTest.addSniffer(Components.ObjectPropertiesSection, "formatObjectAsFunction", onConsoleMessagesReceived); + SDK.ConsoleModel.evaluateCommandInConsole(UI.context.flavor(SDK.ExecutionContext), "jumpToMe"); function onConsoleMessagesReceived() { InspectorTest.deprecatedRunAfterPendingDispatches(function() { var messages = []; InspectorTest.disableConsoleViewport(); - var viewMessages = WebInspector.ConsoleView.instance()._visibleViewMessages; + var viewMessages = Console.ConsoleView.instance()._visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var uiMessage = viewMessages[i]; var element = uiMessage.contentElement();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-generator-location.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-generator-location.html index 2a159f4..0d42235 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-generator-location.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/show-generator-location.html
@@ -26,7 +26,7 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; function performStandardTestCase(pageExpression, next) { @@ -47,7 +47,7 @@ break; } } - WebInspector.Revealer.reveal(remote.debuggerModel().createRawLocationByScriptId(loc.scriptId, loc.lineNumber, loc.columnNumber)); + Common.Revealer.reveal(remote.debuggerModel().createRawLocationByScriptId(loc.scriptId, loc.lineNumber, loc.columnNumber)); } function showUISourceCodeHook(uiSourceCode, lineNumber, columnNumber, forceShowInPanel)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame-count.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame-count.html index b98a2ae..fbe61da7 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame-count.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame-count.html
@@ -22,7 +22,7 @@ InspectorTest.runDebuggerTestSuite([ function testSourceFramesCount(next) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.showScriptSource("source-frame-count.html", function() {}); InspectorTest.showScriptSource("script1.js", function() {}); @@ -39,7 +39,7 @@ { framesOpened++; } - InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "wasShown", didCreateSourceFrame, true); + InspectorTest.addSniffer(SourceFrame.SourceFrame.prototype, "wasShown", didCreateSourceFrame, true); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame.html index e7669e03..ab4d7b3 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-frame.html
@@ -18,7 +18,7 @@ function test() { - WebInspector.viewManager.showView("resources"); + UI.viewManager.showView("resources"); InspectorTest.runDebuggerTestSuite([ function testSetBreakpoint(next) { @@ -27,7 +27,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Script source was shown."); - InspectorTest.addSniffer(WebInspector.JavaScriptSourceFrame.prototype, "_addBreakpointDecoration", didAddBreakpoint); + InspectorTest.addSniffer(Sources.JavaScriptSourceFrame.prototype, "_addBreakpointDecoration", didAddBreakpoint); InspectorTest.setBreakpoint(sourceFrame, 14, "", true); } @@ -47,8 +47,8 @@ { InspectorTest.addResult("Script source was shown."); shownSourceFrame = sourceFrame; - InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototype, "_addMessageToSource", didAddMessage); - InspectorTest.addSniffer(WebInspector.UISourceCodeFrame.prototype, "_removeMessageFromSource", didRemoveMessage); + InspectorTest.addSniffer(Sources.UISourceCodeFrame.prototype, "_addMessageToSource", didAddMessage); + InspectorTest.addSniffer(Sources.UISourceCodeFrame.prototype, "_removeMessageFromSource", didRemoveMessage); InspectorTest.evaluateInPage("addErrorToConsole()"); } @@ -57,7 +57,7 @@ if (this !== shownSourceFrame) return; InspectorTest.addResult("Message added to source frame: " + message.text()); - setImmediate(function() { WebInspector.ConsoleView.clearConsole(); }); + setImmediate(function() { Console.ConsoleView.clearConsole(); }); } function didRemoveMessage(message) @@ -71,14 +71,14 @@ function testShowResource(next) { - WebInspector.viewManager.showView("network"); - InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "show", didShowSourceFrame); + UI.viewManager.showView("network"); + InspectorTest.addSniffer(SourceFrame.SourceFrame.prototype, "show", didShowSourceFrame); InspectorTest.resourceTreeModel.forAllResources(visit); function visit(resource) { if (resource.url.indexOf("debugger-test.js") !== -1) { - WebInspector.panels.resources.showResource(resource, 1); + UI.panels.resources.showResource(resource, 1); return true; } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-url-comment.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-url-comment.html index 7421990..259533d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-url-comment.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/source-url-comment.html
@@ -68,7 +68,7 @@ function didShowScriptSource(sourceFrame) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var uiSourceCodes = panel._workspace.uiSourceCodes(); var ignored = true; for (var i = 0; i < uiSourceCodes.length && ignored; ++i) { @@ -101,7 +101,7 @@ function didShowScriptSource(sourceFrame) { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var uiSourceCodes = panel._workspace.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { if (uiSourceCodes[i].url().indexOf("scriptWithPoorSourceURL.js") !== -1)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html index 143f207..a0ee0f5 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html
@@ -9,8 +9,8 @@ var uiSourceCodes = []; function addUISourceCode(url) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); - var uiSourceCode = WebInspector.NetworkProject.forTarget(InspectorTest.mainTarget).addFile(contentProvider, InspectorTest.mainFrame(), false); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); + var uiSourceCode = Bindings.NetworkProject.forTarget(InspectorTest.mainTarget).addFile(contentProvider, InspectorTest.mainFrame(), false); uiSourceCodes.push(uiSourceCode); } @@ -46,7 +46,7 @@ InspectorTest.addResult("Dumping next file for each file:"); for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; - var nextUISourceCode = WebInspector.SourcesView.SwitchFileActionDelegate._nextFile(uiSourceCode); + var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nextFile(uiSourceCode); var nextURI = nextUISourceCode ? nextUISourceCode.url() : "<none>"; InspectorTest.addResult("Next file for " + uiSourceCode.url() + " is " + nextURI + "."); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html index 954c60f1..5fd0cbc4 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
@@ -7,7 +7,7 @@ function createContentProvider(url) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); contentProvider.requestContent = function() { InspectorTest.addResult("Source requested for " + url); @@ -16,8 +16,8 @@ return contentProvider; } - var workspace = new WebInspector.Workspace(); - workspace.networkProject = new WebInspector.NetworkProject(InspectorTest.mainTarget, workspace); + var workspace = new Workspace.Workspace(); + workspace.networkProject = new Bindings.NetworkProject(InspectorTest.mainTarget, workspace); function addNetworkFile(url) { @@ -27,7 +27,7 @@ function dumpUISourceCodeDisplayName(url) { var uiSourceCode = addNetworkFile(url); - InspectorTest.addResult("UISourceCode display name for url \"" + url + "\" is \"" + WebInspector.TabbedEditorContainer.prototype._titleForFile(uiSourceCode) + "\"."); + InspectorTest.addResult("UISourceCode display name for url \"" + url + "\" is \"" + Sources.TabbedEditorContainer.prototype._titleForFile(uiSourceCode) + "\"."); } const baseURL = "http://localhost:8080/folder/";
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html index 732d512..6f7de77 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html
@@ -13,24 +13,24 @@ setTimeout(callback.bind(null, "var x = 0;"), 0); } MockProject.prototype.isServiceProject = function() { return false; }; - MockProject.prototype.type = function() { return WebInspector.projectTypes.Debugger; } + MockProject.prototype.type = function() { return Workspace.projectTypes.Debugger; } MockProject.prototype.url = function() { return "mock://debugger-ui/"; } InspectorTest.runTestSuite([ function testUISourceCode(next) { - var uiSourceCode = new WebInspector.UISourceCode(new MockProject(), "url", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(new MockProject(), "url", Common.resourceTypes.Script); function didRequestContent(callNumber, content) { InspectorTest.addResult("Callback " + callNumber + " is invoked."); - InspectorTest.assertEquals("text/javascript", WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + InspectorTest.assertEquals("text/javascript", Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); InspectorTest.assertEquals("var x = 0;", content); if (callNumber === 3) { // Check that sourceCodeProvider.requestContent won't be called anymore. uiSourceCode.requestContent().then(function(content) { - InspectorTest.assertEquals("text/javascript", WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + InspectorTest.assertEquals("text/javascript", Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); InspectorTest.assertEquals("var x = 0;", content); next(); });
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html index 0401924..0a83f73 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-panel-switch.html
@@ -19,13 +19,13 @@ InspectorTest.startDebuggerTest(step1); var updateCount = 8; - WebInspector.settings.createLocalSetting("watchExpressions", []).set(["x", "y.foo"]); + Common.settings.createLocalSetting("watchExpressions", []).set(["x", "y.foo"]); function step1() { - watchExpressionsPane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); - WebInspector.panels.sources._sidebarPaneStack.showView(WebInspector.panels.sources._watchSidebarPane).then(() => { - InspectorTest.addSniffer(WebInspector.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true); + watchExpressionsPane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane); + UI.panels.sources._sidebarPaneStack.showView(UI.panels.sources._watchSidebarPane).then(() => { + InspectorTest.addSniffer(Sources.WatchExpression.prototype, "_createWatchExpression", watchExpressionsUpdated, true); InspectorTest.evaluateInPage("testFunction()"); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html index 424444e..0841c95 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/watch-expressions-preserve-expansion.html
@@ -26,8 +26,8 @@ var test = function() { - var watchExpressionsPane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); - WebInspector.panels.sources._sidebarPaneStack.showView(WebInspector.panels.sources._watchSidebarPane).then(() => { + var watchExpressionsPane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane); + UI.panels.sources._sidebarPaneStack.showView(UI.panels.sources._watchSidebarPane).then(() => { watchExpressionsPane.doUpdate(); watchExpressionsPane._createWatchExpression("globalObject"); watchExpressionsPane._createWatchExpression("windowAlias"); @@ -61,7 +61,7 @@ function dumpWatchExpressions() { - var pane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane); for (var i = 0; i < pane._watchExpressions.length; i++) { var watch = pane._watchExpressions[i]; @@ -108,7 +108,7 @@ function expandWatchExpression(path, callback) { - var pane = self.runtime.sharedInstance(WebInspector.WatchExpressionsSidebarPane); + var pane = self.runtime.sharedInstance(Sources.WatchExpressionsSidebarPane); var expression = path.shift(); for (var i = 0; i < pane._watchExpressions.length; i++) { var watch = pane._watchExpressions[i];
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts-expected.txt index 3da6385..0d11b1d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts-expected.txt
@@ -27,7 +27,7 @@ var test = function() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.startDebuggerTest(step1, true); function callstackStatus() @@ -128,7 +128,7 @@ var test = function() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.startDebuggerTest(step1, true); function callstackStatus()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts.html index de7d7b79..4ca7897 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debug-inlined-scripts.html
@@ -19,7 +19,7 @@ var test = function() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.startDebuggerTest(step1, true); function callstackStatus()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-autocontinue-on-syntax-error.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-autocontinue-on-syntax-error.html index f1ff50ad..8a0463f8 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-autocontinue-on-syntax-error.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-autocontinue-on-syntax-error.html
@@ -17,7 +17,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.addConsoleSniffer(step2); InspectorTest.evaluateInPage("loadIframe()"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-compile-and-run.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-compile-and-run.html index c8f56c5..dab8616 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-compile-and-run.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-compile-and-run.html
@@ -27,7 +27,7 @@ } } - var contextId = WebInspector.context.flavor(WebInspector.ExecutionContext).id; + var contextId = UI.context.flavor(SDK.ExecutionContext).id; InspectorTest.runDebuggerTestSuite([ function testSuccessfulCompileAndRun(next) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html index f9eef35..32a1571 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html
@@ -25,67 +25,67 @@ function step2(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "var").then(checkAgainstGolden.bind(this, ["var1", "var2"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "var").then(checkAgainstGolden.bind(this, ["var1", "var2"], [], next)); }, function step3(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "di").then(checkAgainstGolden.bind(this, ["dir", "dirxml"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "di").then(checkAgainstGolden.bind(this, ["dir", "dirxml"], [], next)); }, function step4(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "win").then(checkAgainstGolden.bind(this, ["window"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "win").then(checkAgainstGolden.bind(this, ["window"], [], next)); }, function step5(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "t").then(checkAgainstGolden.bind(this, ["this"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "t").then(checkAgainstGolden.bind(this, ["this"], [], next)); }, function step6(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("var1.", "toExp").then(checkAgainstGolden.bind(this, ["toExponential"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("var1.", "toExp").then(checkAgainstGolden.bind(this, ["toExponential"], [], next)); }, function step7(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("123.", "toExp").then(checkAgainstGolden.bind(this, [], ["toExponential"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("123.", "toExp").then(checkAgainstGolden.bind(this, [], ["toExponential"], next)); }, function step8(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "").then(checkAgainstGolden.bind(this, [], ["$"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "").then(checkAgainstGolden.bind(this, [], ["$"], next)); }, function step9(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("", "", true).then(checkAgainstGolden.bind(this, ["$", "window"], [], next)); + Components.JavaScriptAutocomplete.completionsForExpression("", "", true).then(checkAgainstGolden.bind(this, ["$", "window"], [], next)); }, function step10(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("console.", "log('bar');").then(checkAgainstGolden.bind(this, [], ["$"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("console.", "log('bar');").then(checkAgainstGolden.bind(this, [], ["$"], next)); }, function step11(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("arr1.", "").then(checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("arr1.", "").then(checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); }, function step12(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("arr1[", "").then(checkAgainstGolden.bind(this, ["\"length\"]"], ["3]"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("arr1[", "").then(checkAgainstGolden.bind(this, ["\"length\"]"], ["3]"], next)); }, function step13_ShouldNotCrash(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("arr2.", "").then(checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("arr2.", "").then(checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); }, function step14(next) { - WebInspector.JavaScriptAutocomplete.completionsForExpression("document\n","E").then(checkAgainstGolden.bind(this, ["Element"], ["ELEMENT_NODE"], next)); + Components.JavaScriptAutocomplete.completionsForExpression("document\n","E").then(checkAgainstGolden.bind(this, ["Element"], ["ELEMENT_NODE"], next)); } ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-disable-enable.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-disable-enable.html index afc4240..61106d6 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-disable-enable.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-disable-enable.html
@@ -24,7 +24,7 @@ { InspectorTest.addResult("Main resource was shown."); InspectorTest.setBreakpoint(sourceFrame, 8, "", true); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, step3, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasDisabled, step3, this); InspectorTest.debuggerModel.disableDebugger(); } @@ -38,7 +38,7 @@ function step4() { InspectorTest.addResult("function evaluated without a pause on the breakpoint."); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, step5, this); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.DebuggerWasEnabled, step5, this); InspectorTest.debuggerModel.enableDebugger(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html index 19ebd62..30caa01a 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html
@@ -51,7 +51,7 @@ function onTestStarted() { - InspectorTest.addSniffer(WebInspector.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); + InspectorTest.addSniffer(Sources.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); InspectorTest.runTestFunctionAndWaitUntilPaused(() => {}); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-minified-variables-evalution.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-minified-variables-evalution.html index f14ceca..4ffe8a1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-minified-variables-evalution.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-minified-variables-evalution.html
@@ -44,7 +44,7 @@ function testAtPosition(uiSourceCode, position) { - return WebInspector.SourceMapNamesResolver.resolveExpression(WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame), position.originText, uiSourceCode, position.line, position.startColumn, position.endColumn) + return Sources.SourceMapNamesResolver.resolveExpression(UI.context.flavor(SDK.DebuggerModel.CallFrame), position.originText, uiSourceCode, position.line, position.startColumn, position.endColumn) .then(InspectorTest.evaluateOnCurrentCallFrame) .then(remoteObject => InspectorTest.addResult(remoteObject.description)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-proto-property.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-proto-property.html index ef6e98b..effafeb 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-proto-property.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-proto-property.html
@@ -25,7 +25,7 @@ function step1() { - InspectorTest.addSniffer(WebInspector.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); + InspectorTest.addSniffer(Sources.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); InspectorTest.runTestFunctionAndWaitUntilPaused(() => {}); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-minified-variables.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-minified-variables.html index 17c9d35..db6d27f 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-minified-variables.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-minified-variables.html
@@ -12,7 +12,7 @@ function onSourceMapLoaded() { InspectorTest.startDebuggerTest(() => InspectorTest.runTestFunctionAndWaitUntilPaused()); - InspectorTest.addSniffer(WebInspector.SourceMapNamesResolver, "_scopeResolvedForTest", onScopeResolved, true); + InspectorTest.addSniffer(Sources.SourceMapNamesResolver, "_scopeResolvedForTest", onScopeResolved, true); } var resolvedScopes = 0;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-identifiers.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-identifiers.html index cef7edd..376f1928 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-identifiers.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-identifiers.html
@@ -12,7 +12,7 @@ function onSourceMapLoaded() { InspectorTest.startDebuggerTest(() => InspectorTest.runTestFunctionAndWaitUntilPaused()); - InspectorTest.addSniffer(WebInspector.SourceMapNamesResolver, "_scopeResolvedForTest", onAllScopesResolved, true); + InspectorTest.addSniffer(Sources.SourceMapNamesResolver, "_scopeResolvedForTest", onAllScopesResolved, true); } function onAllScopesResolved()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-this.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-this.html index 400889ef..8313d22 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-this.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scope-resolve-this.html
@@ -13,7 +13,7 @@ function onSourceMapLoaded() { InspectorTest.startDebuggerTest(() => InspectorTest.runTestFunctionAndWaitUntilPaused()); - InspectorTest.addSniffer(WebInspector.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); + InspectorTest.addSniffer(Sources.ScopeChainSidebarPane.prototype, "_sidebarPaneUpdatedForTest", onSidebarRendered, true); } function onSidebarRendered()
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts-reload.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts-reload.html index 46ea3b8..dff7884 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts-reload.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts-reload.html
@@ -17,7 +17,7 @@ function step2() { InspectorTest.queryScripts(function(script) { step3({ data: script }) }); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step3); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, step3); } function step3(event)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts.html index 8cac13a..ee8c47e6 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-scripts.html
@@ -12,7 +12,7 @@ function step1() { InspectorTest.queryScripts(function(script) { step2({ data: script }) }); - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step2); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, step2); } function step2(event)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dont-report-injected-script.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dont-report-injected-script.html index c7bf0e2c..31273a8 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dont-report-injected-script.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dont-report-injected-script.html
@@ -11,7 +11,7 @@ function test() { - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step2); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, step2); InspectorTest.evaluateInPage("newWorld()\n//# sourceURL=foo.js"); var expectedScriptParsed = 2;
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-script-tag.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-script-tag.html index 2d248ea..1171caf 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-script-tag.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-script-tag.html
@@ -52,7 +52,7 @@ function testOpenDevToolsThenReload(next) { - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, scriptParsed); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, scriptParsed); InspectorTest.addResult("Reloading page."); InspectorTest.reloadPage(onPageReloaded); @@ -71,7 +71,7 @@ // that the first one that has document url as a sourceURL is inline. InspectorTest.addResult("The first script with document url as a sourceURL to be seen is " + (script.isInlineScript() ? "" : "not ") + "inline script."); InspectorTest.assertTrue(script.isInlineScript(), "Only inline scripts should have document url as a sourceURL."); - InspectorTest.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, scriptParsed); + InspectorTest.debuggerModel.removeEventListener(SDK.DebuggerModel.Events.ParsedScriptSource, scriptParsed); if (!--eventsCountBeforeNext) next(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-scripts.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-scripts.html index 4477e9e..e171426d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-scripts.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/dynamic-scripts.html
@@ -47,8 +47,8 @@ function step3() { - var panel = WebInspector.panels.sources; - var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network); + var panel = UI.panels.sources; + var uiSourceCodes = Workspace.workspace.uiSourceCodesForProjectType(Workspace.projectTypes.Network); var urls = uiSourceCodes.map(function(uiSourceCode) { return uiSourceCode.name(); }); urls.sort();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/extract-javascript-identifiers.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/extract-javascript-identifiers.html index f5621bc..45728a7 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/extract-javascript-identifiers.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/extract-javascript-identifiers.html
@@ -56,7 +56,7 @@ { InspectorTest.addResult("Text:"); InspectorTest.addResult(" " + text + "\n"); - WebInspector.formatterWorkerPool.runTask("javaScriptIdentifiers", {content: text}) + Common.formatterWorkerPool.runTask("javaScriptIdentifiers", {content: text}) .then(onIdentifiers) .then(next); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html index 4272bc8..a1323862 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html
@@ -22,7 +22,7 @@ fs.root.mkdir("html").addFile("edit-me.js", "function f()\n{\n return 0;\n}\n"); fs.root.addFile("bar.js", "<bar content>"); InspectorTest.addResult("Adding file system."); - fs.addFileMapping(WebInspector.ParsedURL.completeURL(InspectorTest.mainTarget.inspectedURL(), "resources/"), "/html/"); + fs.addFileMapping(Common.ParsedURL.completeURL(InspectorTest.mainTarget.inspectedURL(), "resources/"), "/html/"); fs.reportCreated(fileSystemCreated); function fileSystemCreated() @@ -38,7 +38,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Editing filesystem resource: " + sourceFrame.uiSourceCode().url()); - InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_didEditScriptSource", didEditScriptSource); + InspectorTest.addSniffer(SDK.DebuggerModel.prototype, "_didEditScriptSource", didEditScriptSource); InspectorTest.replaceInSource(sourceFrame, "return 0;", "return \"live-edited string\";"); InspectorTest.commitSource(sourceFrame); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html index f4c1bf9..e5ed9dc 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
@@ -13,8 +13,8 @@ var resourceScriptMapping; var defaultScriptMapping; var persistence; - var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.projectId("file:///var/www"); - WebInspector.networkMapping.dispose(); + var fileSystemProjectId = Bindings.FileSystemWorkspaceBinding.projectId("file:///var/www"); + Bindings.networkMapping.dispose(); function createWorkspaceWithTarget() { @@ -24,7 +24,7 @@ defaultScriptMapping = entry._defaultMapping; if (persistence) persistence.dispose(); - persistence = new WebInspector.Persistence(InspectorTest.testWorkspace, WebInspector.breakpointManager, WebInspector.fileSystemMapping); + persistence = new Persistence.Persistence(InspectorTest.testWorkspace, Bindings.breakpointManager, Workspace.fileSystemMapping); } function dumpFileSystemUISourceCodesMappings() @@ -53,28 +53,28 @@ function fileSystemCreated1() { InspectorTest.addResult("Adding network resource."); - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", WebInspector.resourceTypes.Script, "<foo content>", target); - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", WebInspector.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target); dumpFileSystemUISourceCodesMappings(); var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(fileSystemProjectId, "file:///var/www/html/foo.js"); - networkUISourceCode = InspectorTest.testWorkspace.uiSourceCode(WebInspector.NetworkProject.projectId(target, target.resourceTreeModel.mainFrame, false), "http://localhost/html/foo.js"); + networkUISourceCode = InspectorTest.testWorkspace.uiSourceCode(Bindings.NetworkProject.projectId(target, target.resourceTreeModel.mainFrame, false), "http://localhost/html/foo.js"); InspectorTest.addResult("Adding mapping between network and file system resources."); InspectorTest.testNetworkMapping.addMapping(networkUISourceCode, uiSourceCode); - var setting = JSON.stringify(WebInspector.fileSystemMapping._fileSystemMappingSetting.get()); + var setting = JSON.stringify(Workspace.fileSystemMapping._fileSystemMappingSetting.get()); InspectorTest.addResult("Emulate reloading inspector."); fs.reportRemoved(); createWorkspaceWithTarget(); - WebInspector.fileSystemMapping._fileSystemMappingSetting.set(JSON.parse(setting)); - WebInspector.fileSystemMapping._loadFromSettings(); + Workspace.fileSystemMapping._fileSystemMappingSetting.set(JSON.parse(setting)); + Workspace.fileSystemMapping._loadFromSettings(); fs.reportCreated(fileSystemCreated2); } function fileSystemCreated2() { - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", WebInspector.resourceTypes.Script, "<foo content>", target); - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", WebInspector.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target); dumpFileSystemUISourceCodesMappings(); @@ -90,11 +90,11 @@ function fileSystemCreated3() { - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", WebInspector.resourceTypes.Script, "<foo content>", target); - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", WebInspector.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target); dumpFileSystemUISourceCodesMappings(); - WebInspector.fileSystemMapping.removeMappingForURL(networkUISourceCode.url()); + Workspace.fileSystemMapping.removeMappingForURL(networkUISourceCode.url()); fs.reportRemoved(); next(); } @@ -121,14 +121,14 @@ { dumpWorkspaceUISourceCodes(); InspectorTest.addResult("Removing project:"); - InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, projectRemoved); + InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, projectRemoved); InspectorTest.testTargetManager.removeTarget(target); target = null; } function projectRemoved() { - InspectorTest.testWorkspace.removeEventListener(WebInspector.Workspace.Events.ProjectRemoved, projectRemoved); + InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.ProjectRemoved, projectRemoved); InspectorTest.addResult("Received project removed event."); fs.reportRemoved(); setImmediate(next); @@ -148,8 +148,8 @@ function fileSystemCreated() { - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h1/foo.js", WebInspector.resourceTypes.Script, "<foo content>", target); - InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h2/bar.js", WebInspector.resourceTypes.Script, "<bar content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h1/foo.js", Common.resourceTypes.Script, "<foo content>", target); + InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h2/bar.js", Common.resourceTypes.Script, "<bar content>", target); dumpFileSystemUISourceCodesMappings(); fs.reportRemoved(); next();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html index b6a3301b..766e338 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html
@@ -18,7 +18,7 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; function pathToFileName(path) { @@ -27,7 +27,7 @@ function dumpBreakpointStorageAndLocations() { - var breakpointManager = WebInspector.breakpointManager; + var breakpointManager = Bindings.breakpointManager; var breakpoints = breakpointManager._storage._setting.get(); InspectorTest.addResult(" Dumping breakpoint storage"); for (var i = 0; i < breakpoints.length; ++i) @@ -68,7 +68,7 @@ InspectorTest.addResult(" " + prefix + "TextEditor.removeBreakpoint(lineNumber = " + lineNumber + ")"); } - WebInspector.breakpointManager._storage._breakpoints = {}; + Bindings.breakpointManager._storage._breakpoints = {}; InspectorTest.runDebuggerTestSuite([ function testEditUndo(next) @@ -87,7 +87,7 @@ InspectorTest.addSniffer(javaScriptSourceFrame._textEditor.__proto__, "removeBreakpoint", removeBreakpointSniffer, true); InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -100,7 +100,7 @@ InspectorTest.addResult("Editing source:"); InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//"); - originalUISourceCode = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; + originalUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; InspectorTest.showUISourceCode(originalUISourceCode, didShowOriginalUISourceCode); } @@ -112,7 +112,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Undoing source editing:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.undoSourceEditing(javaScriptSourceFrame); } @@ -139,7 +139,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -152,7 +152,7 @@ InspectorTest.addResult("Editing source:"); InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "}//"); - originalUISourceCode = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; + originalUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; InspectorTest.showUISourceCode(originalUISourceCode, didShowOriginalUISourceCode); } @@ -164,7 +164,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); } @@ -191,7 +191,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -204,7 +204,7 @@ InspectorTest.addResult("Editing source:"); InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}"); - originalUISourceCode = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; + originalUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; InspectorTest.showUISourceCode(originalUISourceCode, didShowOriginalUISourceCode); } @@ -229,7 +229,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source again:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); } @@ -256,7 +256,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -269,7 +269,7 @@ InspectorTest.addResult("Editing source:"); InspectorTest.replaceInSource(javaScriptSourceFrame, "}", "//}"); - originalUISourceCode = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; + originalUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location).uiSourceCode; InspectorTest.showUISourceCode(originalUISourceCode, didShowOriginalUISourceCode); } @@ -294,7 +294,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source again:"); - InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-no-reveal.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-no-reveal.html index 1d8256d8..6209dcf 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-no-reveal.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-no-reveal.html
@@ -9,7 +9,7 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; var sourceFrame; function didStepInto() @@ -38,7 +38,7 @@ panel._updateLastModificationTimeForTest(); InspectorTest.replaceInSource(sourceFrame, oldText, newText); InspectorTest.addResult("Moving cursor to (0, 0)."); - sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0, 0)); + sourceFrame.setSelection(Common.TextRange.createFromLocation(0, 0)); InspectorTest.addResult("Committing live edit."); InspectorTest.commitSource(sourceFrame); } @@ -77,7 +77,7 @@ panel._updateLastModificationTimeForTest(); InspectorTest.replaceInSource(sourceFrame, oldText, newText); InspectorTest.addResult("Moving cursor to (0, 0)."); - sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0, 0)); + sourceFrame.setSelection(Common.TextRange.createFromLocation(0, 0)); InspectorTest.addResult("Committing live edit."); InspectorTest.commitSource(sourceFrame); } @@ -85,7 +85,7 @@ function didEditScriptSource() { InspectorTest.addResult("Stepping into..."); - InspectorTest.addSniffer(WebInspector.SourcesView.prototype, "showSourceLocation", didRevealAfterStepInto); + InspectorTest.addSniffer(Sources.SourcesView.prototype, "showSourceLocation", didRevealAfterStepInto); panel._lastModificationTimeoutPassedForTest(); InspectorTest.stepInto(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit.html index dfca7f38..de3682e0 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit.html
@@ -16,7 +16,7 @@ function test() { - var panel = WebInspector.panels.sources; + var panel = UI.panels.sources; InspectorTest.runDebuggerTestSuite([ function testLiveEdit(next)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html index d8eaf21..2014c85 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/navigator-view.html
@@ -14,30 +14,30 @@ var networkProject1 = InspectorTest.testNetworkProject; var subframe = target.resourceTreeModel.frameForId(239); - WebInspector.targetManager = InspectorTest.testTargetManager; - WebInspector.networkMapping = InspectorTest.testNetworkMapping; + SDK.targetManager = InspectorTest.testTargetManager; + Bindings.networkMapping = InspectorTest.testNetworkMapping; target2 = InspectorTest.createMockTarget(100); var networkProject2 = InspectorTest.testNetworkProject; - var sourcesNavigatorView = new WebInspector.SourcesNavigatorView(); + var sourcesNavigatorView = new Sources.SourcesNavigatorView(); sourcesNavigatorView._resetWorkspace(InspectorTest.testWorkspace); - sourcesNavigatorView.show(WebInspector.inspectorView.element); - var contentScriptsNavigatorView = new WebInspector.ContentScriptsNavigatorView(); + sourcesNavigatorView.show(UI.inspectorView.element); + var contentScriptsNavigatorView = new Sources.ContentScriptsNavigatorView(); contentScriptsNavigatorView._resetWorkspace(InspectorTest.testWorkspace); - contentScriptsNavigatorView.show(WebInspector.inspectorView.element); + contentScriptsNavigatorView.show(UI.inspectorView.element); var uiSourceCodes = []; function addUISourceCode(url, isContentScript, frame) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); var uiSourceCode = networkProject1.addFile(contentProvider, frame || mainFrame); uiSourceCodes.push(uiSourceCode); } function addUISourceCode2(url, isContentScript) { - var contentProvider = WebInspector.StaticContentProvider.fromString(url, WebInspector.resourceTypes.Script, ""); + var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, ""); var uiSourceCode = networkProject2.addFile(contentProvider, target2.resourceTreeModel.mainFrame); uiSourceCodes.push(uiSourceCode); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html index 25ca7764..f8a549f 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/network-uisourcecode-provider.html
@@ -34,20 +34,20 @@ var loaderId = "loader-id"; var mimeType; switch (type) { - case WebInspector.resourceTypes.Document: + case Common.resourceTypes.Document: mimeType = "text/html"; break; - case WebInspector.resourceTypes.Script: + case Common.resourceTypes.Script: mimeType = "text/javascript"; break; - case WebInspector.resourceTypes.Stylesheet: + case Common.resourceTypes.Stylesheet: mimeType = "text/css"; break; } - var resource = new WebInspector.Resource(target, null, url, documentURL, frameId, loaderId, type, mimeType); + var resource = new SDK.Resource(target, null, url, documentURL, frameId, loaderId, type, mimeType); resource._content = content; - target.resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.ResourceAdded, resource); + target.resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resource); return resource; } @@ -58,13 +58,13 @@ var resourceId = ++lastResourceId + ""; var url = documentURL + "/" + resourceId; var script = InspectorTest.createScriptMock(url, 0, 0, false, content, target); - target.debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script); + target.debuggerModel.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource, script); } function finishResource(resource) { resource.request.finished = true; - resource.request.dispatchEventToListeners(WebInspector.NetworkRequest.Events.FinishedLoading, resource.request); + resource.request.dispatchEventToListeners(SDK.NetworkRequest.Events.FinishedLoading, resource.request); } function createNetworkUISourceCodeProvider() @@ -78,7 +78,7 @@ createNetworkUISourceCodeProvider(); InspectorTest.addResult("Creating resource."); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); - createResourceMock(WebInspector.resourceTypes.Document, "<document resource content>"); + createResourceMock(Common.resourceTypes.Document, "<document resource content>"); function uiSourceCodeAdded(uiSourceCode) { @@ -92,7 +92,7 @@ createNetworkUISourceCodeProvider(); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); InspectorTest.addResult("Creating script resource."); - createResourceMock(WebInspector.resourceTypes.Script, "<script resource content>"); + createResourceMock(Common.resourceTypes.Script, "<script resource content>"); InspectorTest.addResult("Creating script."); createScriptMock("<script content>"); @@ -120,15 +120,15 @@ createNetworkUISourceCodeProvider(); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); InspectorTest.addResult("Creating stylesheet resource."); - createResourceMock(WebInspector.resourceTypes.Stylesheet, "<stylesheet resource content>"); + createResourceMock(Common.resourceTypes.Stylesheet, "<stylesheet resource content>"); - WebInspector.CSSModel.fromTarget(target)._styleSheetAdded(mockStyleSheetHeader); + SDK.CSSModel.fromTarget(target)._styleSheetAdded(mockStyleSheetHeader); function uiSourceCodeAdded(uiSourceCode) { InspectorTest.addResult("Added uiSourceCode: " + InspectorTest.uiSourceCodeURL(uiSourceCode)); InspectorTest.waitForWorkspaceUISourceCodeRemovedEvent(uiSourceCodeRemoved); - WebInspector.CSSModel.fromTarget(target)._styleSheetRemoved(mockStyleSheetHeader.styleSheetId); + SDK.CSSModel.fromTarget(target)._styleSheetRemoved(mockStyleSheetHeader.styleSheetId); } function uiSourceCodeRemoved(uiSourceCode)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html index 37b7a68..9d9b181d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html
@@ -14,7 +14,7 @@ InspectorTest.createWorkspace(); InspectorTest.testTargetManager.addTarget(target); defaultScriptMapping = InspectorTest.testDebuggerWorkspaceBinding._targetToData.get(target)._defaultMapping; - var resourceScriptMapping = new WebInspector.ResourceScriptMapping(InspectorTest.debuggerModel, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping, InspectorTest.testDebuggerWorkspaceBinding); + var resourceScriptMapping = new Bindings.ResourceScriptMapping(InspectorTest.debuggerModel, InspectorTest.testWorkspace, InspectorTest.testNetworkMapping, InspectorTest.testDebuggerWorkspaceBinding); return resourceScriptMapping; } @@ -63,7 +63,7 @@ { InspectorTest.addResult("Adding uiSourceCode for finished resource."); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); - InspectorTest.addMockUISourceCodeToWorkspace(url, WebInspector.resourceTypes.Script, "<content script resource content>"); + InspectorTest.addMockUISourceCodeToWorkspace(url, Common.resourceTypes.Script, "<content script resource content>"); function uiSourceCodeAdded(uiSourceCode) { @@ -87,7 +87,7 @@ { InspectorTest.addResult("Adding uiSourceCode for finished resource."); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeForResourceAdded); - InspectorTest.addMockUISourceCodeToWorkspace(url, WebInspector.resourceTypes.Script, "<script resource content>"); + InspectorTest.addMockUISourceCodeToWorkspace(url, Common.resourceTypes.Script, "<script resource content>"); } function uiSourceCodeForResourceAdded(uiSourceCode) @@ -159,7 +159,7 @@ { InspectorTest.addResult("Adding uiSourceCode for finished resource."); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded); - InspectorTest.addMockUISourceCodeToWorkspace(url, WebInspector.resourceTypes.Document, "<resource content>"); + InspectorTest.addMockUISourceCodeToWorkspace(url, Common.resourceTypes.Document, "<resource content>"); function uiSourceCodeAdded(uiSourceCode) { @@ -184,7 +184,7 @@ { InspectorTest.addResult("Adding uiSourceCode for finished resource."); InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeForResourceAdded); - InspectorTest.addMockUISourceCodeToWorkspace(url, WebInspector.resourceTypes.Document, "<resource content>"); + InspectorTest.addMockUISourceCodeToWorkspace(url, Common.resourceTypes.Document, "<resource content>"); } function uiSourceCodeForResourceAdded(uiSourceCode)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html index a98a556..0a44cc9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
@@ -34,7 +34,7 @@ function step1() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions); InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); } @@ -57,7 +57,7 @@ function completeTest() { - InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); + InspectorTest.DebuggerAgent.setPauseOnExceptions(SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions); InspectorTest.completeDebuggerTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-extract-outline.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-extract-outline.html index da2b452f..ff65e11 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-extract-outline.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-extract-outline.html
@@ -55,7 +55,7 @@ function test() { - var worker = new WebInspector.Worker("formatter_worker"); + var worker = new Common.Worker("formatter_worker"); worker.onmessage = InspectorTest.safeWrap(function(event) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-failed-to-parse.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-failed-to-parse.html index aaa0fb3..482a1e9 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-failed-to-parse.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/script-failed-to-parse.html
@@ -16,7 +16,7 @@ InspectorTest.runDebuggerTestSuite([ function testScriptParsedEvent(next) { - InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse); + InspectorTest.debuggerModel.addEventListener(SDK.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse); InspectorTest.evaluateInPage("addScript('resources/script-failed-to-parse.js')"); function scriptFailedToParse(event) @@ -24,7 +24,7 @@ var script = event.data; if (script.sourceURL.indexOf("script-failed-to-parse.js") !== -1) { InspectorTest.addResult("Event with script-failed-to-parse.js received"); - InspectorTest.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse); + InspectorTest.debuggerModel.removeEventListener(SDK.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse); next(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html index 70b75a0..77fb2c5 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
@@ -19,14 +19,14 @@ function step2(uiSourceCode) { - InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => step3(uiSourceCode)); + InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => step3(uiSourceCode)); InspectorTest.showScriptSource("test.js"); } function step3(uiSourceCode) { - var mainTarget = WebInspector.targetManager.mainTarget(); - var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSourceCode, mainTarget); + var mainTarget = SDK.targetManager.mainTarget(); + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCode, mainTarget); if (!scriptFile) { InspectorTest.addResult("[FAIL]: no script file for test.js"); InspectorTest.completeDebuggerTest(); @@ -38,8 +38,8 @@ return; } - InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.prototype, "_didDivergeFromVM").then(dumpDivergeFromVM); - InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest()); + InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype, "_didDivergeFromVM").then(dumpDivergeFromVM); + InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest()); InspectorTest.evaluateInPage(changedScriptSource); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/inspect-function.html b/third_party/WebKit/LayoutTests/inspector/sources/inspect-function.html index 954e14f7..5254544 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/inspect-function.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/inspect-function.html
@@ -6,7 +6,7 @@ function test() { var revealed = 0; - InspectorTest.addSniffer(WebInspector.SourcesView.prototype, "showSourceLocation", didReveal, true); + InspectorTest.addSniffer(Sources.SourcesView.prototype, "showSourceLocation", didReveal, true); InspectorTest.evaluateInConsole("function foo() { }; inspect(foo.bind());inspect(foo);"); function didReveal(uiSourceCode, lineNumber, columnNumber)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/javascript-outline-dialog.html b/third_party/WebKit/LayoutTests/inspector/sources/javascript-outline-dialog.html index 34d0ee4..2da437e3 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/javascript-outline-dialog.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/javascript-outline-dialog.html
@@ -12,8 +12,8 @@ InspectorTest.showScriptSource("javascript-outline-dialog.js", onSourceShown); function onSourceShown(sourceFrame) { - InspectorTest.addSniffer(WebInspector.JavaScriptOutlineDialog.prototype, "refresh", onDialogFulfilled); - WebInspector.panels.sources._sourcesView._showOutlineDialog(); + InspectorTest.addSniffer(Sources.JavaScriptOutlineDialog.prototype, "refresh", onDialogFulfilled); + UI.panels.sources._sourcesView._showOutlineDialog(); } function onDialogFulfilled() @@ -28,7 +28,7 @@ function dumpScores(query) { InspectorTest.addResult(`Scores for query="${query}"`); - var dialog = WebInspector.JavaScriptOutlineDialog._instanceForTests; + var dialog = Sources.JavaScriptOutlineDialog._instanceForTests; var keys = []; for (var i = 0; i < dialog.itemCount(); ++i) { keys.push({
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/sass-highlighter.html b/third_party/WebKit/LayoutTests/inspector/sources/sass-highlighter.html index fee9a06a..957a82b 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/sass-highlighter.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/sass-highlighter.html
@@ -13,7 +13,7 @@ function onSourceShown(uiSourceCodeFrame) { var uiSourceCode = uiSourceCodeFrame.uiSourceCode(); - InspectorTest.addResult(WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + InspectorTest.addResult(Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/search-config.html b/third_party/WebKit/LayoutTests/inspector/sources/search-config.html index 1b93d00..3d779bb 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/search-config.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/search-config.html
@@ -6,7 +6,7 @@ { function dumpParsedSearchQuery(query, isRegex) { - var searchConfig = new WebInspector.SearchConfig(query, true, isRegex); + var searchConfig = new Workspace.SearchConfig(query, true, isRegex); InspectorTest.addResult("Dumping parsed search query [" + query + "]:"); InspectorTest.addResult(JSON.stringify(searchConfig.queries())); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/snippet-storage.html b/third_party/WebKit/LayoutTests/inspector/sources/snippet-storage.html index 38c9aad..8edbda87 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/snippet-storage.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/snippet-storage.html
@@ -6,7 +6,7 @@ { var settingPrefix = "test"; var namePrefix = "Test snippet #"; - var snippetStorage = new WebInspector.SnippetStorage(settingPrefix, namePrefix); + var snippetStorage = new Snippets.SnippetStorage(settingPrefix, namePrefix); function dumpSnippets(snippets) {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/source-code-diff.html b/third_party/WebKit/LayoutTests/inspector/sources/source-code-diff.html index 09f0662e..45267525 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/source-code-diff.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/source-code-diff.html
@@ -22,7 +22,7 @@ function onBefore(beforeFrame) { - InspectorTest.addSniffer(WebInspector.SourceCodeDiff.prototype, "_decorationsSetForTest", decorationsSet); + InspectorTest.addSniffer(Sources.SourceCodeDiff.prototype, "_decorationsSetForTest", decorationsSet); beforeFrame.setContent(textAfter); } @@ -35,11 +35,11 @@ { var type = decoration[1].type; var name = "Unknown"; - if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Insert) + if (type === Sources.SourceCodeDiff.GutterDecorationType.Insert) name = "Insert"; - else if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Delete) + else if (type === Sources.SourceCodeDiff.GutterDecorationType.Delete) name = "Delete"; - else if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Modify) + else if (type === Sources.SourceCodeDiff.GutterDecorationType.Modify) name = "Modify"; InspectorTest.addResult(decoration[0] + ":" + name)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html b/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html index 661a189..307c9c1 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-extension-names.html
@@ -6,8 +6,8 @@ <script> function test() { - var contentScriptsNavigatorView = new WebInspector.ContentScriptsNavigatorView(); - contentScriptsNavigatorView.show(WebInspector.inspectorView.element); + var contentScriptsNavigatorView = new Sources.ContentScriptsNavigatorView(); + contentScriptsNavigatorView.show(UI.inspectorView.element); var mockExecutionContext = { id: 1234567, @@ -21,8 +21,8 @@ function testAddExecutionContextBeforeFile(next) { InspectorTest.runtimeModel._executionContextCreated(mockExecutionContext); - var contentProvider = WebInspector.StaticContentProvider.fromString(mockContentScriptURL, WebInspector.resourceTypes.Script, ""); - WebInspector.NetworkProject.forTarget(InspectorTest.mainTarget).addFile(contentProvider, InspectorTest.mainFrame(), true); + var contentProvider = Common.StaticContentProvider.fromString(mockContentScriptURL, Common.resourceTypes.Script, ""); + Bindings.NetworkProject.forTarget(InspectorTest.mainTarget).addFile(contentProvider, InspectorTest.mainFrame(), true); InspectorTest.dumpNavigatorView(contentScriptsNavigatorView); next(); },
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-focus-editor-on-select.html b/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-focus-editor-on-select.html index 604bcf6..bfef8904 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-focus-editor-on-select.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/sources-panel-focus-editor-on-select.html
@@ -9,8 +9,8 @@ function onSourceFrame(sourceFrame) { InspectorTest.addResult("initial: focused = " + sourceFrame.hasFocus()); - WebInspector.inspectorView.showPanel("elements") - .then(() => WebInspector.inspectorView.showPanel("sources")) + UI.inspectorView.showPanel("elements") + .then(() => UI.inspectorView.showPanel("sources")) .then(onPanelReselected.bind(null, sourceFrame)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage-update.html b/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage-update.html index d818a53..139a597f 100644 --- a/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage-update.html +++ b/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage-update.html
@@ -66,8 +66,8 @@ InspectorTest.assertTrue(!!storage, "Local storage not found."); - WebInspector.panels.resources._showDOMStorage(storage); - view = WebInspector.panels.resources._domStorageViews.get(storage); + UI.panels.resources._showDOMStorage(storage); + view = UI.panels.resources._domStorageViews.get(storage); InspectorTest.addSniffer(view, "_dataGridForDOMStorageItems", viewUpdated); },
diff --git a/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage.html b/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage.html index 71801f9..13f7aa2 100644 --- a/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage.html +++ b/third_party/WebKit/LayoutTests/inspector/storage-panel-dom-storage.html
@@ -44,7 +44,7 @@ if (storages) { for (var i = 0; i < storages.length; i++) { var storage = storages[i]; - WebInspector.panels.resources._showDOMStorage(storage); + UI.panels.resources._showDOMStorage(storage); InspectorTest.addResult("Did show: " + name(storage)); } } else @@ -55,7 +55,7 @@ for (var i = 0; i < storages.length; i++) { var storage = storages[i]; InspectorTest.addResult(name(storage) + " content: "); - var view = WebInspector.panels.resources._domStorageViews.get(storage); + var view = UI.panels.resources._domStorageViews.get(storage); dumpDataGridContent(view._dataGrid); } InspectorTest.addResult("DONE");
diff --git a/third_party/WebKit/LayoutTests/inspector/syntax-highlight.js b/third_party/WebKit/LayoutTests/inspector/syntax-highlight.js index 1efce0f5..bcb3fb7c 100644 --- a/third_party/WebKit/LayoutTests/inspector/syntax-highlight.js +++ b/third_party/WebKit/LayoutTests/inspector/syntax-highlight.js
@@ -4,7 +4,7 @@ { var node = document.createElement("span"); node.textContent = str; - var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType); + var javascriptSyntaxHighlighter = new UI.DOMSyntaxHighlighter(mimeType); return javascriptSyntaxHighlighter.syntaxHighlightNode(node).then(dumpSyntax); function dumpSyntax()
diff --git a/third_party/WebKit/LayoutTests/inspector/tabbed-editors-history.html b/third_party/WebKit/LayoutTests/inspector/tabbed-editors-history.html index 69369141..5ae972b 100644 --- a/third_party/WebKit/LayoutTests/inspector/tabbed-editors-history.html +++ b/third_party/WebKit/LayoutTests/inspector/tabbed-editors-history.html
@@ -35,7 +35,7 @@ return "url_" + index; } - var history = new WebInspector.TabbedEditorContainer.History([]); + var history = new Sources.TabbedEditorContainer.History([]); dumpHistory(history); // Emulate opening of several tabs. @@ -52,7 +52,7 @@ // ... and switching between them. updateAndDump(history, [url(12), url(13), url(11)]); updateAndDump(history, [url(11), url(12), url(13)]); - updateScrollAndSelectionAndDump(history, url(11), 10, new WebInspector.TextRange(15, 5, 15, 10)); + updateScrollAndSelectionAndDump(history, url(11), 10, new Common.TextRange(15, 5, 15, 10)); // Now close some tabs. removeAndDump(history, url(11)); removeAndDump(history, url(13));
diff --git a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-closeable-persistence.html b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-closeable-persistence.html index 29325a07..1ff2d034 100644 --- a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-closeable-persistence.html +++ b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-closeable-persistence.html
@@ -4,11 +4,11 @@ <script type="text/javascript"> var test = function() { - var tabbedLocation = WebInspector.viewManager.createTabbedLocation(); + var tabbedLocation = UI.viewManager.createTabbedLocation(); logPersistenceSetting(); // Show a closeable tab. - var sensors = new WebInspector.SimpleView("sensors"); + var sensors = new UI.SimpleView("sensors"); sensors.isCloseable = function() { return true; } tabbedLocation.showView(sensors); logPersistenceSetting(); @@ -18,12 +18,12 @@ logPersistenceSetting(); // Show a permanent tab. - var console = new WebInspector.SimpleView("console"); + var console = new UI.SimpleView("console"); tabbedLocation.showView(console); logPersistenceSetting(); // Show transient tab. - var history = new WebInspector.SimpleView("history"); + var history = new UI.SimpleView("history"); history.isTransient = function() { return true; } tabbedLocation.showView(history); logPersistenceSetting();
diff --git a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-max-tab-width-calculation.html b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-max-tab-width-calculation.html index 24f9257..69591f2 100644 --- a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-max-tab-width-calculation.html +++ b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-max-tab-width-calculation.html
@@ -6,7 +6,7 @@ { function calculateAndDumpMaxWidth(measuredWidths, totalWidth) { - var maxWidth = WebInspector.TabbedPane.prototype._calculateMaxWidth(measuredWidths, totalWidth); + var maxWidth = UI.TabbedPane.prototype._calculateMaxWidth(measuredWidths, totalWidth); InspectorTest.addResult("measuredWidths = [" + String(measuredWidths) + "], totalWidth = " + totalWidth + ", maxWidth = " + maxWidth + "."); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-tabs-to-show.html b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-tabs-to-show.html index ec600f2..104bd09 100644 --- a/third_party/WebKit/LayoutTests/inspector/tabbed-pane-tabs-to-show.html +++ b/third_party/WebKit/LayoutTests/inspector/tabbed-pane-tabs-to-show.html
@@ -13,13 +13,13 @@ return { width: function() { return width; }, title: title, toString: toString }; } - var tabbedPane = new WebInspector.TabbedPane(); + var tabbedPane = new UI.TabbedPane(); tabbedPane.setAllowTabReorder(true, true); var dropDownButtonMeasuredWidth = 10; function getTabsToShowAndDumpResults(tabsOrdered, tabsHistory, totalWidth) { - var tabsToShowIndexes = WebInspector.TabbedPane.prototype._tabsToShowIndexes.call(tabbedPane, tabsOrdered, tabsHistory, totalWidth, dropDownButtonMeasuredWidth); + var tabsToShowIndexes = UI.TabbedPane.prototype._tabsToShowIndexes.call(tabbedPane, tabsOrdered, tabsHistory, totalWidth, dropDownButtonMeasuredWidth); InspectorTest.addResult(" tabsToShowIndexes = [" + String(tabsToShowIndexes) + "]"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html b/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html index 9827e3e..f2990a8 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing-browser-thread.html
@@ -36,7 +36,7 @@ for (var testCase of Object.keys(testCases)) { var model = InspectorTest.createTracingModel(); model.setEventsForTest(testCases[testCase]); - var browserMain = WebInspector.TracingModel.browserMainThread(model); + var browserMain = SDK.TracingModel.browserMainThread(model); if (!browserMain) { InspectorTest.addResult(`${testCase} failed, no browser main thread found`); continue;
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing-session-id.html b/third_party/WebKit/LayoutTests/inspector/tracing-session-id.html index fe5b0a8..c93e4195 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing-session-id.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing-session-id.html
@@ -21,11 +21,11 @@ function processEvent(event) { var metadataEvents = [ - WebInspector.TimelineModel.RecordType.SetLayerTreeId, - WebInspector.TimelineModel.RecordType.TracingStartedInPage + TimelineModel.TimelineModel.RecordType.SetLayerTreeId, + TimelineModel.TimelineModel.RecordType.TracingStartedInPage ]; - if (!event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory) || metadataEvents.indexOf(event.name) < 0) + if (!event.hasCategory(SDK.TracingModel.DevToolsMetadataEventCategory) || metadataEvents.indexOf(event.name) < 0) return; InspectorTest.assertEquals(InspectorTest.timelineModel().sessionId(), event.args["data"]["sessionId"]);
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing.html b/third_party/WebKit/LayoutTests/inspector/tracing.html index c0fb9114..748ed381 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing.html
@@ -85,7 +85,7 @@ for (var i = 0; i < events.length; ++i) { var event = events[i]; - if (event.phase === WebInspector.TracingModel.Phase.Complete) + if (event.phase === SDK.TracingModel.Phase.Complete) ++phaseComplete; if (event.name in knownEvents) ++knownEvents[event.name];
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/buffer-usage.html b/third_party/WebKit/LayoutTests/inspector/tracing/buffer-usage.html index b07a38b..0e2ec1a 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/buffer-usage.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/buffer-usage.html
@@ -6,12 +6,12 @@ function test() { - WebInspector.TestTimelineLifecycleDelegate = function() + TestTimelineLifecycleDelegate = function() { this._hadLoadingProgress = false; } - WebInspector.TestTimelineLifecycleDelegate.prototype = { + TestTimelineLifecycleDelegate.prototype = { recordingStarted: function() { InspectorTest.addResult("TimelineLifecycleDelegate.recordingStarted"); @@ -45,10 +45,10 @@ InspectorTest.completeTest(); }, - __proto__: WebInspector.TimelineLifecycleDelegate + __proto__: Timeline.TimelineLifecycleDelegate }; - var controller = new WebInspector.TimelineController(WebInspector.targetManager.mainTarget(), new WebInspector.TestTimelineLifecycleDelegate(), InspectorTest.createTracingModel()); + var controller = new Timeline.TimelineController(SDK.targetManager.mainTarget(), new TestTimelineLifecycleDelegate(), InspectorTest.createTracingModel()); controller.startRecording(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/category-filter.html b/third_party/WebKit/LayoutTests/inspector/tracing/category-filter.html index f0248ed0..382c07d 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/category-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/category-filter.html
@@ -36,8 +36,8 @@ ]; var model = InspectorTest.createTimelineModelWithEvents(testData); - var view = new WebInspector.EventsTimelineTreeView(model, WebInspector.panels.timeline._filters, null); - view.updateContents(WebInspector.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime())); + var view = new Timeline.EventsTimelineTreeView(model, UI.panels.timeline._filters, null); + view.updateContents(Timeline.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime())); var filtersControl = view._filtersControl; InspectorTest.addResult("Original records"); @@ -45,12 +45,12 @@ dumpVisibleRecords(); InspectorTest.addResult("Visible records when 'loading' is disabled"); - WebInspector.TimelineUIUtils.categories().loading.hidden = true; + Timeline.TimelineUIUtils.categories().loading.hidden = true; filtersControl._notifyFiltersChanged(); dumpVisibleRecords(); InspectorTest.addResult("Visible records when 'scripting' is disabled"); - WebInspector.TimelineUIUtils.categories().scripting.hidden = true; + Timeline.TimelineUIUtils.categories().scripting.hidden = true; filtersControl._notifyFiltersChanged(); dumpVisibleRecords();
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/console-timeline.html b/third_party/WebKit/LayoutTests/inspector/tracing/console-timeline.html index edaeac3..4b7f23b8 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/console-timeline.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/console-timeline.html
@@ -79,8 +79,8 @@ function test() { - var panel = WebInspector.panels.timeline; - panel._model._currentTarget = WebInspector.targetManager.mainTarget(); + var panel = UI.panels.timeline; + panel._model._currentTarget = SDK.targetManager.mainTarget(); InspectorTest.runTestSuite([ function testStartStopTimeline(next) @@ -177,9 +177,9 @@ { thread.events().forEach(function(event) { - if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console)) InspectorTest.addResult(event.name); - else if (event.name === WebInspector.TimelineModel.RecordType.TimeStamp) + else if (event.name === TimelineModel.TimelineModel.RecordType.TimeStamp) InspectorTest.addResult(event.args["data"]["message"]); }); });
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html b/third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html index eb2df38..2f33e0d 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html
@@ -82,12 +82,12 @@ { function isDecodeImageEvent(event) { - return event.name === WebInspector.TimelineModel.RecordType.DecodeImage; + return event.name === TimelineModel.TimelineModel.RecordType.DecodeImage; } function compareImageURLs(a, b) { - var urlA = WebInspector.TimelineData.forEvent(a).url; - var urlB = WebInspector.TimelineData.forEvent(b).url; + var urlA = TimelineModel.TimelineData.forEvent(a).url; + var urlB = TimelineModel.TimelineData.forEvent(b).url; urlA = InspectorTest.formatters.formatAsURL(urlA || "<missing>"); urlB = InspectorTest.formatters.formatAsURL(urlB || "<missing>"); return urlA.localeCompare(urlB); @@ -96,10 +96,10 @@ var sortedDecodeEvents = events.filter(isDecodeImageEvent).sort(compareImageURLs); for (var i = 0; i < sortedDecodeEvents.length; ++i) { var event = sortedDecodeEvents[i]; - var timlelineData = WebInspector.TimelineData.forEvent(event); + var timlelineData = TimelineModel.TimelineData.forEvent(event); var url = timlelineData.url; // Skip duplicate events, as long as they have the imageURL - if (i && url && url === WebInspector.TimelineData.forEvent(sortedDecodeEvents[i - 1]).url) + if (i && url && url === TimelineModel.TimelineData.forEvent(sortedDecodeEvents[i - 1]).url) continue; InspectorTest.addResult("event: " + event.name); InspectorTest.addResult("imageURL: " + InspectorTest.formatters.formatAsURL(url));
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/frame-model-instrumentation.html b/third_party/WebKit/LayoutTests/inspector/tracing/frame-model-instrumentation.html index 67dac3bd..7f7d641 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/frame-model-instrumentation.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/frame-model-instrumentation.html
@@ -12,7 +12,7 @@ function test() { - WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true); + UI.panels.timeline._captureLayersAndPicturesSetting.set(true); InspectorTest.invokeAsyncWithTimeline("doActions", InspectorTest.safeWrap(dumpLastFrame)); function dumpLastFrame() {
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/frame-model.html b/third_party/WebKit/LayoutTests/inspector/tracing/frame-model.html index 1a0662a..f4f013e80 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/frame-model.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/frame-model.html
@@ -276,13 +276,13 @@ ], }; - var frameModel = new WebInspector.TimelineFrameModel(event => WebInspector.TimelineUIUtils.eventStyle(event).category.name); + var frameModel = new TimelineModel.TimelineFrameModel(event => Timeline.TimelineUIUtils.eventStyle(event).category.name); function loadEvents(events) { var tracingTimelineModel = InspectorTest.createTimelineModelWithEvents(events); frameModel.reset(); - frameModel.addTraceEvents(WebInspector.targetManager.mainTarget(), tracingTimelineModel.inspectedTargetEvents(), sessionId); + frameModel.addTraceEvents(SDK.targetManager.mainTarget(), tracingTimelineModel.inspectedTargetEvents(), sessionId); } for (var testName in testData) {
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html b/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html index 57170bc..aa35b461 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html
@@ -12,7 +12,7 @@ { Runtime.experiments.enableForTest("timelineRuleUsageRecording"); - var panel = WebInspector.panels.timeline; + var panel = UI.panels.timeline; panel._markUnusedCSS.set(true); InspectorTest.runTestSuite([ @@ -27,7 +27,7 @@ function printResults() { - WebInspector.inspectorView.showPanel("sources").then(showSource); + UI.inspectorView.showPanel("sources").then(showSource); } function showSource() @@ -37,7 +37,7 @@ function waitForDecorations() { - InspectorTest.addSniffer(WebInspector.CoverageProfile.LineDecorator.prototype, "decorate", didShowDecorations); + InspectorTest.addSniffer(Components.CoverageProfile.LineDecorator.prototype, "decorate", didShowDecorations); } function didShowDecorations(sourceFrame)
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/scroll-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/scroll-invalidations.html index b3ece8d..1d7aa56 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/scroll-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/scroll-invalidations.html
@@ -20,8 +20,8 @@ function onRecordingDone() { - var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); - InspectorTest.addArray(WebInspector.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", "Scroll invalidations"); + var record = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); + InspectorTest.addArray(TimelineModel.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", "Scroll invalidations"); InspectorTest.completeTest(); }; }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/compile-script.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/compile-script.html index b8029f8..9f81da3 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/compile-script.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/compile-script.html
@@ -18,7 +18,7 @@ function test() { - InspectorTest.performActionsAndPrint("performActions()", WebInspector.TimelineModel.RecordType.CompileScript); + InspectorTest.performActionsAndPrint("performActions()", TimelineModel.TimelineModel.RecordType.CompileScript); } </script>
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-gc-event.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-gc-event.html index fb71eb6..abc7803 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-gc-event.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-gc-event.html
@@ -19,7 +19,7 @@ function validate() { - var gcRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.MinorGC) + var gcRecord = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.MajorGC) || InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.MinorGC) if (gcRecord) InspectorTest.addResult("SUCCESS: Found expected GC event record"); else
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-injected-script-eval.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-injected-script-eval.html index 6eb5192..4dc8117 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-injected-script-eval.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-injected-script-eval.html
@@ -10,7 +10,7 @@ function test() { - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.performActionsAndPrint("performActions()", "FunctionCall"); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-blackboxing.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-blackboxing.html index 6425684..cb4404a 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-blackboxing.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-blackboxing.html
@@ -284,15 +284,15 @@ Runtime.experiments.enableForTest("blackboxJSFramesOnTimeline"); var timelineModel = InspectorTest.createTimelineModelWithEvents(rawTraceEvents); - var frameModel = new WebInspector.TimelineFrameModel(event => WebInspector.TimelineUIUtils.eventStyle(event).category.name); - var dataProvider = new WebInspector.TimelineFlameChartDataProvider(timelineModel, frameModel, new WebInspector.TimelineIRModel(), WebInspector.panels.timeline._filters); + var frameModel = new TimelineModel.TimelineFrameModel(event => Timeline.TimelineUIUtils.eventStyle(event).category.name); + var dataProvider = new Timeline.TimelineFlameChartDataProvider(timelineModel, frameModel, new TimelineModel.TimelineIRModel(), UI.panels.timeline._filters); InspectorTest.addResult("\nBlackboxed url: lib_script.js"); - WebInspector.blackboxManager._blackboxURL("lib_script.js"); + Bindings.blackboxManager._blackboxURL("lib_script.js"); printTimelineData(dataProvider); InspectorTest.addResult("\nUnblackboxed url: lib_script.js"); - WebInspector.blackboxManager._unblackboxURL("lib_script.js"); + Bindings.blackboxManager._unblackboxURL("lib_script.js"); printTimelineData(dataProvider); InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-callstacks.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-callstacks.html index 30a3846d..e2957c9 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-callstacks.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-callstacks.html
@@ -551,8 +551,8 @@ ]; var tracingTimelineModel = InspectorTest.createTimelineModelWithEvents(rawTraceEvents); - var events = WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents(tracingTimelineModel.mainThreadEvents()); - events = events.mergeOrdered(tracingTimelineModel.mainThreadEvents(), WebInspector.TracingModel.Event.orderedCompareStartTime); + var events = TimelineModel.TimelineJSProfileProcessor.generateJSFrameEvents(tracingTimelineModel.mainThreadEvents()); + events = events.mergeOrdered(tracingTimelineModel.mainThreadEvents(), SDK.TracingModel.Event.orderedCompareStartTime); events.filter(function(e) { return e.duration; }).forEach(function(e) { InspectorTest.addResult(e.name + ": " + e.startTime.toFixed(3) + " / " + (e.duration.toFixed(3) || 0) + " " + (e.args.data && e.args.data.functionName || "")); });
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html index 0afc5f1..ef18a523 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html
@@ -52,7 +52,7 @@ ] }; - InspectorTest.addSniffer(WebInspector.SourcesTextEditor.prototype, "setGutterDecoration", decorationAdded, true); + InspectorTest.addSniffer(SourceFrame.SourcesTextEditor.prototype, "setGutterDecoration", decorationAdded, true); InspectorTest.showScriptSource("timeline-data.js", frameRevealed); function decorationAdded(line, type, element) @@ -65,8 +65,8 @@ var url = frame.uiSourceCode().url(); InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url)); cpuProfile.nodes.forEach(n => n.callFrame.url = url); - var lineProfile = WebInspector.LineLevelProfile.instance(); - lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuProfile)); + var lineProfile = Components.LineLevelProfile.instance(); + lineProfile.appendCPUProfile(new SDK.CPUProfileDataModel(cpuProfile)); setTimeout(() => InspectorTest.completeTest(), 0); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html index 37f2718..21dcde0 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html
@@ -24,12 +24,12 @@ function test() { - var model = WebInspector.panels.timeline._model; + var model = UI.panels.timeline._model; InspectorTest.invokeAsyncWithTimeline("performActions", finish); function finish() { - var event = model.mainThreadEvents().find(e => e.name === WebInspector.TimelineModel.RecordType.RunMicrotasks); + var event = model.mainThreadEvents().find(e => e.name === TimelineModel.TimelineModel.RecordType.RunMicrotasks); InspectorTest.printTraceEventProperties(event); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-open-function-call.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-open-function-call.html index 2a7cb1b..d034006 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-open-function-call.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-open-function-call.html
@@ -62,7 +62,7 @@ }]; var model = InspectorTest.createTimelineModelWithEvents(rawTraceEvents); - var event = model.mainThreadEvents().find(e => e.name === WebInspector.TimelineModel.RecordType.FunctionCall); + var event = model.mainThreadEvents().find(e => e.name === TimelineModel.TimelineModel.RecordType.FunctionCall); InspectorTest.addResult(`${event.startTime} ${event.endTime}`); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-runtime-stats.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-runtime-stats.html index c5eed728..c848ee6 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-runtime-stats.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-runtime-stats.html
@@ -15,14 +15,14 @@ { Runtime.experiments.enableForTest("timelineV8RuntimeCallStats"); Runtime.experiments.enableForTest("timelineShowAllEvents"); - WebInspector.settingForTest("showNativeFunctionsInJSProfile").set(true); - var model = WebInspector.panels.timeline._model; + Common.settingForTest("showNativeFunctionsInJSProfile").set(true); + var model = UI.panels.timeline._model; InspectorTest.evaluateWithTimeline("performActions()", finish); function finish() { var frame = model.mainThreadEvents() - .filter(e => e.name === WebInspector.TimelineModel.RecordType.JSFrame) + .filter(e => e.name === TimelineModel.TimelineModel.RecordType.JSFrame) .map(e => e.args["data"]["callFrame"]) .find(frame => frame.functionName === "FunctionCallback" && frame.url === "native V8Runtime"); InspectorTest.assertTrue(!!frame, "FunctionCallback frame not found");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-id.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-id.html index a2d24aa..4453be0a 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-id.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-id.html
@@ -33,7 +33,7 @@ InspectorTest.invokeAsyncWithTimeline("performActions", finish); } - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var recordTypes = new Set(["TimerInstall", "TimerRemove", "FunctionCall"]); function formatter(event) @@ -41,10 +41,10 @@ if (!recordTypes.has(event.name)) return; - var detailsText = WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(event, InspectorTest.timelineModel().targetByEvent(event)); + var detailsText = Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(event, InspectorTest.timelineModel().targetByEvent(event)); InspectorTest.addResult("detailsTextContent for " + event.name + " event: '" + detailsText + "'"); - var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, InspectorTest.timelineModel().targetByEvent(event), linkifier); + var details = Timeline.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, InspectorTest.timelineModel().targetByEvent(event), linkifier); if (!details) return; InspectorTest.addResult("details.textContent for " + event.name + " event: '" + details.textContent.replace(/VM[\d]+/, "VM") + "'");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-tag-1.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-tag-1.html index 931afd5e..5a0259f4 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-tag-1.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-script-tag-1.html
@@ -13,7 +13,7 @@ function test() { - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.startTimeline(step1); function step1() { @@ -30,7 +30,7 @@ { function format(record) { - if (record.type() === WebInspector.TimelineModel.RecordType.EvaluateScript) { + if (record.type() === TimelineModel.TimelineModel.RecordType.EvaluateScript) { InspectorTest.dumpTimelineRecord(record, undefined, undefined, [ "TimeStamp", ]);
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-reason.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-reason.html index d3ea8c7..72b66a1 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-reason.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-reason.html
@@ -32,9 +32,9 @@ { var layoutRecord = InspectorTest.findFirstTimelineRecord("Layout"); var event = layoutRecord.traceEvent(); - var initiator = WebInspector.TimelineData.forEvent(event).initiator(); - InspectorTest.addResult("layout invalidated: " + WebInspector.TimelineData.forEvent(initiator).stackTrace[0].functionName); - InspectorTest.addResult("layout forced: " + WebInspector.TimelineData.forEvent(event).stackTrace[0].functionName); + var initiator = TimelineModel.TimelineData.forEvent(event).initiator(); + InspectorTest.addResult("layout invalidated: " + TimelineModel.TimelineData.forEvent(initiator).stackTrace[0].functionName); + InspectorTest.addResult("layout forced: " + TimelineModel.TimelineData.forEvent(event).stackTrace[0].functionName); InspectorTest.completeTest(); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-with-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-with-invalidations.html index 9d8bbfa0..f4ffae3 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-with-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-layout/timeline-layout-with-invalidations.html
@@ -30,8 +30,8 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("display", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Layout, 0, "first layout invalidations"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Layout, 1, "second layout invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Layout, 0, "first layout invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Layout, 1, "second layout invalidations"); next(); }); }, @@ -39,8 +39,8 @@ function testSubframe(next) { InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Layout, 0, "first layout invalidations"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Layout, 1, "second layout invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Layout, 0, "first layout invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Layout, 1, "second layout invalidations"); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-aggregated-details.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-aggregated-details.html index 65c5f87..7325bc71 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-aggregated-details.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-aggregated-details.html
@@ -593,18 +593,18 @@ } ]; - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tracingModel(), rawTraceEvents); timeline.requestWindowTimes(0, Infinity); - var groupByEnum = WebInspector.AggregatedTimelineTreeView.GroupBy; + var groupByEnum = Timeline.AggregatedTimelineTreeView.GroupBy; for (var grouping in groupByEnum) { var groupingValue = groupByEnum[grouping]; - testEventTree(WebInspector.TimelinePanel.DetailsTab.CallTree, groupingValue); - testEventTree(WebInspector.TimelinePanel.DetailsTab.BottomUp, groupingValue); + testEventTree(Timeline.TimelinePanel.DetailsTab.CallTree, groupingValue); + testEventTree(Timeline.TimelinePanel.DetailsTab.BottomUp, groupingValue); } - testEventTree(WebInspector.TimelinePanel.DetailsTab.Events); + testEventTree(Timeline.TimelinePanel.DetailsTab.Events); InspectorTest.completeTest(); function testEventTree(type, grouping) @@ -630,9 +630,9 @@ if (node.isGroupNode()) { name = treeView._displayInfoForGroupNode(node).name; } else { - name = node.event.name === WebInspector.TimelineModel.RecordType.JSFrame - ? WebInspector.beautifyFunctionName(node.event.args["data"]["functionName"]) - : WebInspector.TimelineUIUtils.eventTitle(node.event); + name = node.event.name === TimelineModel.TimelineModel.RecordType.JSFrame + ? UI.beautifyFunctionName(node.event.args["data"]["functionName"]) + : Timeline.TimelineUIUtils.eventTitle(node.event); } InspectorTest.addResult(" ".repeat(padding) + `${name}: ${node.selfTime.toFixed(3)} ${node.totalTime.toFixed(3)}`); (node.children || new Map()).forEach(printEventTree.bind(null, padding + 1));
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-record.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-record.html index 45b1c48..8067445 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-record.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-record.html
@@ -7,13 +7,13 @@ function test() { - var panel = WebInspector.panels.timeline; + var panel = UI.panels.timeline; var callbackBarrier = new CallbackBarrier(); InspectorTest.addSniffer(panel, "recordingStarted", recordingStarted); InspectorTest.addSniffer(panel, "loadingComplete", callbackBarrier.createCallback()); - WebInspector.viewManager.showView("console"); + UI.viewManager.showView("console"); InspectorTest.runWhenPageLoads(step1); InspectorTest.addResult("Reloading page on console panel"); panel._millisecondsToRecordAfterLoadEvent = 1; @@ -21,7 +21,7 @@ function step1() { - WebInspector.viewManager.showView("timeline"); + UI.viewManager.showView("timeline"); InspectorTest.runWhenPageLoads(callbackBarrier.createCallback()); callbackBarrier.callWhenDone(recordingStopped); InspectorTest.addResult("Reloading page on timeline panel");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-zoom.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-zoom.html index 3c95eddd..dab3117 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-zoom.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-auto-zoom.html
@@ -34,7 +34,7 @@ ]; InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tracingModel(), traceEvents); - var overview = WebInspector.panels.timeline._overviewPane; + var overview = UI.panels.timeline._overviewPane; var startTime = overview._windowStartTime; var endTime = overview._windowEndTime; InspectorTest.assertGreaterOrEqual(startTime, 1010);
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-dfs.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-dfs.html index e748b6e1..4b34eac6 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-dfs.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-dfs.html
@@ -48,7 +48,7 @@ {"name": "b", "ts": 4000000, "ph": "E", "tid": mainThread, "pid": pid, "cat":"disabled-by-default.devtools.timeline", "args": {}} ]; - var model = new WebInspector.TimelineModel(new WebInspector.TimelineModel.Filter()); + var model = new TimelineModel.TimelineModel(new TimelineModel.TimelineModel.Filter()); InspectorTest.setTraceEvents(model, InspectorTest.createTracingModel(), testData); InspectorTest.addResult("DFS preorder:");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-event-causes.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-event-causes.html index f5fbedc2..b79c400 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-event-causes.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-event-causes.html
@@ -27,12 +27,12 @@ InspectorTest.invokeAsyncWithTimeline("setTimeoutFunction", finishAndRunNextTest); function finishAndRunNextTest() { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var record = InspectorTest.findFirstTimelineRecord("TimerFire"); InspectorTest.check(record, "Should receive a TimerFire record."); var event = record.traceEvent(); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); - WebInspector.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); + var contentHelper = new Timeline.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); + Timeline.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); var causes = contentHelper.element.deepTextContent(); InspectorTest.check(causes, "Should generate causes"); checkStringContains(causes, "Timer Installed\nPromise @ setTimeoutFunction.js:"); @@ -54,12 +54,12 @@ InspectorTest.invokeAsyncWithTimeline("requestAnimationFrameFunction", finishAndRunNextTest); function finishAndRunNextTest() { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var record = InspectorTest.findFirstTimelineRecord("FireAnimationFrame"); InspectorTest.check(record, "Should receive a FireAnimationFrame record."); var event = record.traceEvent(); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); - WebInspector.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); + var contentHelper = new Timeline.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); + Timeline.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); var causes = contentHelper.element.deepTextContent(); InspectorTest.check(causes, "Should generate causes"); checkStringContains(causes, "Animation Frame Requested\nPromise @ requestAnimationFrameFunction.js:"); @@ -83,12 +83,12 @@ InspectorTest.evaluateWithTimeline("styleRecalcFunction()", finishAndRunNextTest); function finishAndRunNextTest() { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var record = InspectorTest.findFirstTimelineRecord("UpdateLayoutTree"); InspectorTest.check(record, "Should receive a UpdateLayoutTree record."); var event = record.traceEvent(); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); - WebInspector.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); + var contentHelper = new Timeline.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); + Timeline.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); var causes = contentHelper.element.deepTextContent(); InspectorTest.check(causes, "Should generate causes"); checkStringContains(causes, "First Invalidated\nstyleRecalcFunction @ styleRecalcFunction.js:"); @@ -112,12 +112,12 @@ InspectorTest.evaluateWithTimeline("layoutFunction()", finishAndRunNextTest); function finishAndRunNextTest() { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var record = InspectorTest.findFirstTimelineRecord("Layout"); InspectorTest.check(record, "Should receive a Layout record."); var event = record.traceEvent(); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); - WebInspector.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); + var contentHelper = new Timeline.TimelineDetailsContentHelper(InspectorTest.timelineModel().targetByEvent(event), linkifier, true); + Timeline.TimelineUIUtils._generateCauses(event, InspectorTest.timelineModel().targetByEvent(event), null, contentHelper); var causes = contentHelper.element.deepTextContent(); InspectorTest.check(causes, "Should generate causes"); checkStringContains(causes, "Layout Forced\nlayoutFunction @ layoutFunction.js:");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-filtering.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-filtering.html index 5143296..1c4700801 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-filtering.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-filtering.html
@@ -52,8 +52,8 @@ var model = InspectorTest.createTimelineModelWithEvents(testData); - var view = new WebInspector.EventsTimelineTreeView(model, WebInspector.panels.timeline._filters, null); - view.updateContents(WebInspector.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime())); + var view = new Timeline.EventsTimelineTreeView(model, UI.panels.timeline._filters, null); + view.updateContents(Timeline.TimelineSelection.fromRange(model.minimumRecordTime(), model.maximumRecordTime())); var filtersControl = view._filtersControl; function printEventMessage(event, level) {
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-flame-chart-automatically-size-window.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-flame-chart-automatically-size-window.html index ae7bb8ff..accadea 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-flame-chart-automatically-size-window.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-flame-chart-automatically-size-window.html
@@ -8,7 +8,7 @@ function test() { - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; timeline._onModeChanged(); timeline._currentViews[0]._automaticallySizeWindow = true;
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-grouped-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-grouped-invalidations.html index d330abd..24bcaa1 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-grouped-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-grouped-invalidations.html
@@ -25,14 +25,14 @@ Runtime.experiments.enableForTest("timelineInvalidationTracking"); InspectorTest.invokeAsyncWithTimeline("display", function() { - var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); - InspectorTest.addArray(WebInspector.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", "paint invalidations"); + var record = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); + InspectorTest.addArray(TimelineModel.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", "paint invalidations"); - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); var event = record.traceEvent(); var target = InspectorTest.timelineModel().targetByEvent(event); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(target, linkifier, true); - WebInspector.TimelineUIUtils._generateCauses(event, target, null, contentHelper); + var contentHelper = new Timeline.TimelineDetailsContentHelper(target, linkifier, true); + Timeline.TimelineUIUtils._generateCauses(event, target, null, contentHelper); var invalidationsTree = contentHelper.element.getElementsByClassName("invalidations-tree")[0]; var invalidations = invalidationsTree.shadowRoot.textContent; checkStringContains(invalidations, "Inline CSS style declaration was mutated for [ DIV class='testElement' ], [ DIV class='testElement' ], and 2 others. (anonymous) @ timeline-grouped-invalidations.html:14");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-load-event.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-load-event.html index d133e07..0685843 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-load-event.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-load-event.html
@@ -19,7 +19,7 @@ function test() { - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.startTimeline(function() { InspectorTest.reloadPage(pageReloaded); }); function pageReloaded()
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-node-reference.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-node-reference.html index 86d4e38..7fea2fd 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-node-reference.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-node-reference.html
@@ -27,8 +27,8 @@ function clickValueLink(record, row) { - var panel = WebInspector.panels.timeline; - WebInspector.TimelineUIUtils.buildTraceEventDetails(record.traceEvent(), panel._model, new WebInspector.Linkifier(), true, onDetailsContentReady); + var panel = UI.panels.timeline; + Timeline.TimelineUIUtils.buildTraceEventDetails(record.traceEvent(), panel._model, new Components.Linkifier(), true, onDetailsContentReady); function onDetailsContentReady(element) { @@ -45,17 +45,17 @@ function onTimelineRecorded(records) { var layoutRecord = InspectorTest.findFirstTimelineRecord("Layout"); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onSelectedNodeChanged); + UI.context.addFlavorChangeListener(SDK.DOMNode, onSelectedNodeChanged); clickValueLink(layoutRecord, "Layout root"); } function onSelectedNodeChanged() { - var node = WebInspector.panels.elements.selectedDOMNode(); + var node = UI.panels.elements.selectedDOMNode(); // We may first get an old selected node while switching to the Elements panel. if (node.nodeName() === "BODY") return; - WebInspector.context.removeFlavorChangeListener(WebInspector.DOMNode, onSelectedNodeChanged); + UI.context.removeFlavorChangeListener(SDK.DOMNode, onSelectedNodeChanged); InspectorTest.addResult("Layout root node id: " + node.getAttribute("id")); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-receive-response-event.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-receive-response-event.html index 0f9f8b3..c9faa63c 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-receive-response-event.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-receive-response-event.html
@@ -23,20 +23,20 @@ function test() { - WebInspector.viewManager.showView("timeline"); - WebInspector.panels.timeline._model._currentTarget = WebInspector.targetManager.mainTarget(); - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.viewManager.showView("timeline"); + UI.panels.timeline._model._currentTarget = SDK.targetManager.mainTarget(); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.invokeAsyncWithTimeline("performActions", finish); function finish() { - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var typesToDump = new Set([recordTypes.ResourceSendRequest, recordTypes.ResourceReceiveResponse, recordTypes.ResourceReceivedData, recordTypes.ResourceFinish, recordTypes.EventDispatch, recordTypes.FunctionCall]); function dumpEvent(traceEvent, level) { // Ignore stray paint & rendering events for better stability. - var categoryName = WebInspector.TimelineUIUtils.eventStyle(traceEvent).category.name; + var categoryName = Timeline.TimelineUIUtils.eventStyle(traceEvent).category.name; if (categoryName !== "loading" && categoryName !== "scripting") return; // Here and below: pretend coalesced record are just not there, as coalescation is time dependent and, hence, not stable.
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-window-filter.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-window-filter.html index 67b0780..2f2e05a 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-window-filter.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-window-filter.html
@@ -7,7 +7,7 @@ function test() { - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; var overviewPane = timeline._overviewPane; InspectorTest.loadTimeline(InspectorTest.timelineData()); @@ -33,7 +33,7 @@ function dumpDividers(calculator) { - var dividers = WebInspector.TimelineGrid.calculateDividerOffsets(calculator).offsets; + var dividers = UI.TimelineGrid.calculateDividerOffsets(calculator).offsets; for (var i = 0; i < dividers.length; ++i) dividers[i] -= calculator.zeroTime(); InspectorTest.addResult("divider offsets: [" + dividers.join(", ") + "]. We are expecting round numbers.");
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource-details.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource-details.html index 9f075cf1..60e80b5 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource-details.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource-details.html
@@ -20,16 +20,16 @@ function test() { - var model = WebInspector.panels.timeline._model; + var model = UI.panels.timeline._model; InspectorTest.invokeAsyncWithTimeline("performActions", finish); function finish() { - var linkifier = new WebInspector.Linkifier(); + var linkifier = new Components.Linkifier(); function printRequestDetails(request) { - return WebInspector.TimelineUIUtils.buildNetworkRequestDetails(request, model, linkifier).then(printElement); + return Timeline.TimelineUIUtils.buildNetworkRequestDetails(request, model, linkifier).then(printElement); } function printElement(element) {
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource.html index 545d0d4..db76d71 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-network/timeline-network-resource.html
@@ -20,7 +20,7 @@ var requestId; var scriptUrl = "timeline-network-resource.js"; - var model = WebInspector.panels.timeline._model; + var model = UI.panels.timeline._model; InspectorTest.invokeAsyncWithTimeline("performActions", finish); @@ -29,11 +29,11 @@ var lastRecordStartTime; function format(record) { - if (record.type() === WebInspector.TimelineModel.RecordType.ResourceSendRequest) + if (record.type() === TimelineModel.TimelineModel.RecordType.ResourceSendRequest) printSend(record); - else if (record.type() === WebInspector.TimelineModel.RecordType.ResourceReceiveResponse) + else if (record.type() === TimelineModel.TimelineModel.RecordType.ResourceReceiveResponse) printReceive(record); - else if (record.type() === WebInspector.TimelineModel.RecordType.ResourceFinish) + else if (record.type() === TimelineModel.TimelineModel.RecordType.ResourceFinish) printFinish(record); } model.forAllRecords(format); @@ -44,7 +44,7 @@ { InspectorTest.addResult(""); InspectorTest.printTimelineRecordProperties(record); - InspectorTest.addResult("Text details for " + record.type() + ": " + WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(record.traceEvent())); + InspectorTest.addResult("Text details for " + record.type() + ": " + Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(record.traceEvent())); } function printSend(record)
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/layer-tree.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/layer-tree.html index cf6a5284..094de66 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/layer-tree.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/layer-tree.html
@@ -21,7 +21,7 @@ function test() { - WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true); + UI.panels.timeline._captureLayersAndPicturesSetting.set(true); InspectorTest.invokeAsyncWithTimeline("doActions", step1); function step1()
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/paint-profiler-update.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/paint-profiler-update.html index 34142ec..c35ae02d 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/paint-profiler-update.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/paint-profiler-update.html
@@ -26,7 +26,7 @@ function test() { - var panel = WebInspector.panels.timeline; + var panel = UI.panels.timeline; panel._captureLayersAndPicturesSetting.set(true); panel._onModeChanged(); @@ -37,9 +37,9 @@ { var events = InspectorTest.timelineModel()._mainThreadEvents; for (var event of events) { - if (event.name === WebInspector.TimelineModel.RecordType.Paint) { + if (event.name === TimelineModel.TimelineModel.RecordType.Paint) { paintEvents.push(event); - if (!WebInspector.TimelineData.forEvent(event).picture) + if (!TimelineModel.TimelineData.forEvent(event).picture) InspectorTest.addResult("Event without picture at " + paintEvents.length); } } @@ -48,7 +48,7 @@ throw new Error("FAIL: Expect at least two paint events"); InspectorTest.addSniffer(panel, "_appendDetailsTabsForTraceEventAndShowDetails", onRecordDetailsReady, false); - panel.select(WebInspector.TimelineSelection.fromTraceEvent(paintEvents[0]), WebInspector.TimelinePanel.DetailsTab.PaintProfiler); + panel.select(Timeline.TimelineSelection.fromTraceEvent(paintEvents[0]), Timeline.TimelinePanel.DetailsTab.PaintProfiler); } function onRecordDetailsReady() @@ -67,7 +67,7 @@ if (updateCount++) InspectorTest.completeTest(); else - panel.select(WebInspector.TimelineSelection.fromTraceEvent(paintEvents[1]), WebInspector.TimelinePanel.DetailsTab.PaintProfiler); + panel.select(Timeline.TimelineSelection.fromTraceEvent(paintEvents[1]), Timeline.TimelinePanel.DetailsTab.PaintProfiler); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.html index 9b89b1b0..18e8a34 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.html
@@ -21,13 +21,13 @@ function testMultipleStyleRecalcs() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first style recalc"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 1, "second style recalc"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 0, "first paint"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first style recalc"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 1, "second style recalc"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 0, "first paint"); - var thirdRecalc = InspectorTest.findTimelineRecord(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 2); + var thirdRecalc = InspectorTest.findTimelineRecord(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 2); InspectorTest.assertTrue(thirdRecalc === undefined, "There should be no additional style recalc records."); - var secondPaint = InspectorTest.findTimelineRecord(WebInspector.TimelineModel.RecordType.Paint, 1); + var secondPaint = InspectorTest.findTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint, 1); InspectorTest.assertTrue(secondPaint === undefined, "There should be no additional paint records."); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.html index 463ffad..9d8ee00 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.html
@@ -31,7 +31,7 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("display", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 0, "paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 0, "paint invalidations"); next(); }); }, @@ -40,12 +40,12 @@ { InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", function() { // The first paint corresponds to the local frame and should have no invalidations. - var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); - var firstInvalidations = WebInspector.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); + var firstPaintRecord = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); + var firstInvalidations = TimelineModel.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); InspectorTest.assertEquals(firstInvalidations, null); // The second paint corresponds to the subframe and should have our layout/style invalidations. - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); next(); });
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations.html index f2109c3..88e3d37 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-layout-invalidations.html
@@ -27,7 +27,7 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("display", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 0, "paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 0, "paint invalidations"); next(); }); }, @@ -36,12 +36,12 @@ { InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", function() { // The first paint corresponds to the local frame and should have no invalidations. - var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); - var firstInvalidations = WebInspector.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); + var firstPaintRecord = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); + var firstInvalidations = TimelineModel.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); InspectorTest.assertEquals(firstInvalidations, null); // The second paint corresponds to the subframe and should have our layout/style invalidations. - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-style-recalc-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-style-recalc-invalidations.html index 5b37aad..b0f124e 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-style-recalc-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint-with-style-recalc-invalidations.html
@@ -25,7 +25,7 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("display", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 0, "first paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 0, "first paint invalidations"); next(); }); }, @@ -34,12 +34,12 @@ { InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", function() { // The first paint corresponds to the local frame and should have no invalidations. - var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); - var firstInvalidations = WebInspector.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); + var firstPaintRecord = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); + var firstInvalidations = TimelineModel.InvalidationTracker.invalidationEventsFor(firstPaintRecord._event); InspectorTest.assertEquals(firstInvalidations, null); // The second paint corresponds to the subframe and should have our style invalidations. - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.Paint, 1, "second paint invalidations"); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint.html index 855d02e..0c8cfe154 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/timeline-paint.html
@@ -22,7 +22,7 @@ function step1(records) { - var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); + var record = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); if (record) InspectorTest.printTimelineRecordProperties(record); else @@ -32,7 +32,7 @@ function step3(records) { - var paintRecord = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.Paint); + var paintRecord = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.Paint); InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found"); var topQuad = paintRecord.traceEvent().args["data"].clip; var subframePaint = paintRecord.children()[0];
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/update-layer-tree.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/update-layer-tree.html index 32e686c..a3e88285 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/update-layer-tree.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-paint/update-layer-tree.html
@@ -28,7 +28,7 @@ var events = InspectorTest.timelineModel().inspectedTargetEvents(); for (var i = 0; i < events.length; ++i) { var event = events[i]; - if (events[i].name === WebInspector.TimelineModel.RecordType.UpdateLayerTree) { + if (events[i].name === TimelineModel.TimelineModel.RecordType.UpdateLayerTree) { InspectorTest.addResult("Got UpdateLayerTree event, phase: " + events[i].phase); break; }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/parse-author-style-sheet.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/parse-author-style-sheet.html index 59ffabfa..3c3421d 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/parse-author-style-sheet.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/parse-author-style-sheet.html
@@ -21,7 +21,7 @@ function processTracingEvents() { - var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.ParseAuthorStyleSheet); + var record = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.ParseAuthorStyleSheet); if (record) InspectorTest.addResult("SUCCESS: found ParseAuthorStyleSheet record"); else
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.html index d61ef7f2..61d38c1 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.html
@@ -63,7 +63,7 @@ function testClassName(next) { InspectorTest.invokeAsyncWithTimeline("changeClassNameAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0); next(); }); }, @@ -71,7 +71,7 @@ function testIdWithoutStyleChange(next) { InspectorTest.invokeAsyncWithTimeline("changeIdWithoutStyleChangeAndDisplay", function() { - var record = InspectorTest.findFirstTimelineRecord(WebInspector.TimelineModel.RecordType.UpdateLayoutTree); + var record = InspectorTest.findFirstTimelineRecord(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree); InspectorTest.assertTrue(record === undefined, "There should be no style recalculation for an id change without style changes."); next(); }); @@ -80,7 +80,7 @@ function testId(next) { InspectorTest.invokeAsyncWithTimeline("changeIdAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0); next(); }); }, @@ -88,7 +88,7 @@ function testStyleAttributeChange(next) { InspectorTest.invokeAsyncWithTimeline("changeStyleAttributeAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0); next(); }); }, @@ -96,7 +96,7 @@ function testAttributeChange(next) { InspectorTest.invokeAsyncWithTimeline("changeAttributeAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0); next(); }); }, @@ -104,7 +104,7 @@ function testPseudoChange(next) { InspectorTest.invokeAsyncWithTimeline("changePseudoAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidations.html index 3e758db..9a1c7bb5 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidations.html
@@ -46,7 +46,7 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("changeStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); next(); }); }, @@ -54,9 +54,9 @@ function multipleStyleRecalcs(next) { InspectorTest.invokeAsyncWithTimeline("changeMultipleStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalc style invalidations"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalc style invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalc style invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalc style invalidations"); next(); }); }, @@ -64,7 +64,7 @@ function testSubframe(next) { InspectorTest.invokeAsyncWithTimeline("changeSubframeStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalc style invalidations"); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidator-invalidations.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidator-invalidations.html index 3201c97..3ab23e0 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidator-invalidations.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-style/timeline-style-recalc-with-invalidator-invalidations.html
@@ -55,7 +55,7 @@ function testLocalFrame(next) { InspectorTest.invokeAsyncWithTimeline("changeStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); next(); }); }, @@ -63,9 +63,9 @@ function multipleStyleRecalcs(next) { InspectorTest.invokeAsyncWithTimeline("changeMultipleStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalculate styles"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalculate styles"); next(); }); }, @@ -73,9 +73,9 @@ function testSubframe(next) { InspectorTest.invokeAsyncWithTimeline("changeMultipleSubframeStylesAndDisplay", function() { - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalculate styles"); - InspectorTest.dumpInvalidations(WebInspector.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 0, "first recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 1, "second recalculate styles"); + InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.RecordType.UpdateLayoutTree, 2, "third recalculate styles"); next(); }); }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-time.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-time.html index 0f7a473..9a16df9b 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-time.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-time.html
@@ -81,14 +81,14 @@ function dumpName(event, level) { if (namesToDump.has(event.name)) - InspectorTest.addResult("----".repeat(level) + "> " + WebInspector.TimelineUIUtils.eventTitle(event)); + InspectorTest.addResult("----".repeat(level) + "> " + Timeline.TimelineUIUtils.eventTitle(event)); } function callback() { InspectorTest.walkTimelineEventTree(dumpName); next(); } - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.evaluateWithTimeline(actions, InspectorTest.safeWrap(callback), true); } }
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-timer.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-timer.html index 4b6370c5..77e0c54 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-timer.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-timer.html
@@ -24,7 +24,7 @@ function test() { - WebInspector.panels.timeline._captureJSProfileSetting.set(false); + UI.panels.timeline._captureJSProfileSetting.set(false); InspectorTest.invokeAsyncWithTimeline("performActions", finish); function finish()
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-usertiming.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-usertiming.html index 8339ecc3..500ec12 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-usertiming.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-time/timeline-usertiming.html
@@ -91,7 +91,7 @@ asyncEvents.forEach(function(eventGroup) { eventGroup.forEach(function(event) { - if (event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) + if (event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) InspectorTest.addResult(event.name); }); })
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/trace-event-self-time.html b/third_party/WebKit/LayoutTests/inspector/tracing/trace-event-self-time.html index d5b13d79..50e39ed 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/trace-event-self-time.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/trace-event-self-time.html
@@ -287,7 +287,7 @@ }; var timelineController = InspectorTest.timelineController(); - timelineController._addCpuProfile(WebInspector.targetManager.mainTarget().id(), null, cpuProfile); + timelineController._addCpuProfile(SDK.targetManager.mainTarget().id(), null, cpuProfile); timelineController.traceEventsCollected(rawTraceEvents); timelineController._allSourcesFinished(); var events = InspectorTest.timelineModel().inspectedTargetEvents();
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html b/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html index d739cfc..40df4ae 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/tracing-timeline-load.html
@@ -29,7 +29,7 @@ { var model = InspectorTest.tracingModel(); model.reset(); - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; function createFileReader(file, delegate) { @@ -43,10 +43,10 @@ callback(); } - InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", createFileReader); - WebInspector.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate()); + InspectorTest.override(Timeline.TimelineLoader, "_createFileReader", createFileReader); + Timeline.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate()); - var saver = new WebInspector.TracingTimelineSaver(); + var saver = new Timeline.TracingTimelineSaver(); var stream = new InspectorTest.StringOutputStream(InspectorTest.safeWrap(checkSaveData)); var storage = timeline._tracingModelBackingStorage; stream.open("", storage.writeToStream.bind(storage, stream, saver)); @@ -55,7 +55,7 @@ function runTestOnMalformedInput(input, callback) { var model = InspectorTest.tracingModel(); - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; model.reset(); @@ -70,8 +70,8 @@ callback(); } - InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", createFileReader); - WebInspector.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate()); + InspectorTest.override(Timeline.TimelineLoader, "_createFileReader", createFileReader); + Timeline.TimelineLoader.loadFromFile(model, {}, new InspectorTest.TestTimelineLifecycleDelegate()); } var data = [{"args":{"number":32},"cat":"__metadata","name":"num_cpus","ph":"M","pid":32127,"tid":0,"ts":0},
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/worker-events.html b/third_party/WebKit/LayoutTests/inspector/tracing/worker-events.html index 52544d0a..cd11bea 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/worker-events.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/worker-events.html
@@ -50,7 +50,7 @@ function processEvent(event) { - if (!event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory) || event.name !== WebInspector.TimelineModel.DevToolsMetadataEvent.TracingSessionIdForWorker) + if (!event.hasCategory(SDK.TracingModel.DevToolsMetadataEventCategory) || event.name !== TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingSessionIdForWorker) return; ++workerMetadataEventCount;
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/worker-js-frames.html b/third_party/WebKit/LayoutTests/inspector/tracing/worker-js-frames.html index d80c305..871225a7 100644 --- a/third_party/WebKit/LayoutTests/inspector/tracing/worker-js-frames.html +++ b/third_party/WebKit/LayoutTests/inspector/tracing/worker-js-frames.html
@@ -88,9 +88,9 @@ function processEvent(expectedFunctions, event) { - if (event.name === WebInspector.TimelineModel.RecordType.EvaluateScript) + if (event.name === TimelineModel.TimelineModel.RecordType.EvaluateScript) InspectorTest.printTraceEventProperties(event); - if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) + if (event.name === TimelineModel.TimelineModel.RecordType.JSFrame) expectedFunctions.delete(event.args.data.functionName); return expectedFunctions; }
diff --git a/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html b/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html index 1ada6c82f..4f09e84 100644 --- a/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html +++ b/third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html
@@ -8,8 +8,8 @@ var mockProjectId = 0; function createMockProject() { - var workspace = new WebInspector.Workspace(); - var project = new WebInspector.ContentProviderBasedProject(workspace, "mockProject:" + (++mockProjectId)); + var workspace = new Workspace.Workspace(); + var project = new Bindings.ContentProviderBasedProject(workspace, "mockProject:" + (++mockProjectId)); project.requestFileContent = function(uri, callback) { callback("<script content>"); @@ -37,7 +37,7 @@ InspectorTest.runTestSuite([ function testAddRevisionsRevertToOriginal(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url", Common.resourceTypes.Script); uiSourceCode.setWorkingCopy("content1"); uiSourceCode.setWorkingCopy("content2"); uiSourceCode.commitWorkingCopy(function() { }); @@ -62,7 +62,7 @@ function testAddRevisionsRevertAndClearHistory(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url2", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url2", Common.resourceTypes.Script); uiSourceCode.setWorkingCopy("content1"); uiSourceCode.setWorkingCopy("content2"); @@ -88,7 +88,7 @@ function testAddRevisionsRevertToPrevious(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url3", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url3", Common.resourceTypes.Script); uiSourceCode.setWorkingCopy("content1"); uiSourceCode.setWorkingCopy("content2"); @@ -114,7 +114,7 @@ function testRequestContentAddRevisionsRevertToOriginal(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url4", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url4", Common.resourceTypes.Script); uiSourceCode.requestContent().then(contentReceived); function contentReceived() @@ -146,7 +146,7 @@ function testRequestContentAddRevisionsRevertAndClearHistory(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url5", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url5", Common.resourceTypes.Script); uiSourceCode.requestContent().then(contentReceived); function contentReceived() @@ -178,7 +178,7 @@ function testRequestContentAddRevisionsRevertToPrevious(next) { - var uiSourceCode = new WebInspector.UISourceCode(createMockProject(), "url6", WebInspector.resourceTypes.Script); + var uiSourceCode = new Workspace.UISourceCode(createMockProject(), "url6", Common.resourceTypes.Script); uiSourceCode.requestContent().then(contentReceived); function contentReceived()
diff --git a/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html b/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html index fea5b80a..386bd9e 100644 --- a/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html +++ b/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html
@@ -14,12 +14,12 @@ ]; for (var i = 0; i < cases.length; i++) { - var result = WebInspector.MultitargetNetworkManager.patchUserAgentWithChromeVersion(cases[i]); + var result = SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion(cases[i]); InspectorTest.addResult(result); } InspectorTest.addResult("\nManually setting custom user agent"); - WebInspector.multitargetNetworkManager.setCustomUserAgentOverride("foobar with %s inside"); + SDK.multitargetNetworkManager.setCustomUserAgentOverride("foobar with %s inside"); InspectorTest.evaluateInPage("navigator.userAgent", step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/user-metrics.html b/third_party/WebKit/LayoutTests/inspector/user-metrics.html index 55caa0c..95ec93b1 100644 --- a/third_party/WebKit/LayoutTests/inspector/user-metrics.html +++ b/third_party/WebKit/LayoutTests/inspector/user-metrics.html
@@ -11,9 +11,9 @@ InspectorFrontendHost.recordEnumeratedHistogram = function(name, code) { if (name === "DevTools.ActionTaken") - InspectorTest.addResult("Action taken: " + nameOf(WebInspector.UserMetrics.Action, code)); + InspectorTest.addResult("Action taken: " + nameOf(Host.UserMetrics.Action, code)); else if (name === "DevTools.PanelShown") - InspectorTest.addResult("Panel shown: " + nameOf(WebInspector.UserMetrics._PanelCodes, code)); + InspectorTest.addResult("Panel shown: " + nameOf(Host.UserMetrics._PanelCodes, code)); } function nameOf(object, code) @@ -26,15 +26,15 @@ } InspectorTest.addResult("recordActionTaken:"); - InspectorTest.dump(WebInspector.UserMetrics.Action); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowDocked); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.WindowUndocked); + InspectorTest.dump(Host.UserMetrics.Action); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.WindowDocked); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.WindowUndocked); InspectorTest.addResult("\nrecordPanelShown:"); - InspectorTest.dump(WebInspector.UserMetrics._PanelCodes); - WebInspector.viewManager.showView("profiles"); - WebInspector.viewManager.showView("timeline"); - WebInspector.viewManager.showView("audits"); + InspectorTest.dump(Host.UserMetrics._PanelCodes); + UI.viewManager.showView("profiles"); + UI.viewManager.showView("timeline"); + UI.viewManager.showView("audits"); InspectorTest.completeTest(); }
diff --git a/third_party/WebKit/LayoutTests/inspector/version-controller.html b/third_party/WebKit/LayoutTests/inspector/version-controller.html index 7289f1f..850a648 100644 --- a/third_party/WebKit/LayoutTests/inspector/version-controller.html +++ b/third_party/WebKit/LayoutTests/inspector/version-controller.html
@@ -15,7 +15,7 @@ function runVersionControllerTest(oldVersion, currentVersion) { InspectorTest.addResult("Testing methods to run to upgrade from " + oldVersion + " to " + currentVersion + "."); - var versionController = new WebInspector.VersionController(); + var versionController = new Common.VersionController(); var methodsToRun = versionController._methodsToRunToUpdateVersion(oldVersion, currentVersion); InspectorTest.addResult("Methods to run: " + JSON.stringify(methodsToRun)); InspectorTest.addResult(""); @@ -38,7 +38,7 @@ function runClearBreakpointsTest(breakpointsCount, maxBreakpointsCount) { InspectorTest.addResult("Starting test with " + breakpointsCount + " breakpoints and " + maxBreakpointsCount + " allowed at max."); - var versionController = new WebInspector.VersionController(); + var versionController = new Common.VersionController(); var serializedBreakpoints = []; for (var i = 0; i < breakpointsCount; ++i) serializedBreakpoints.push(createBreakpoint("file" + i + ".js", i % 10, "", true));
diff --git a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html index a4ced0c..332902d 100644 --- a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html
@@ -6,18 +6,18 @@ function test() { var projects = {}; - var workspace = new WebInspector.Workspace(); + var workspace = new Workspace.Workspace(); function createUISourceCode(projectId, relativePath) { var project = projects[projectId]; if (!projects[projectId]) { - var projectType = projectId.startsWith("file") ? WebInspector.projectTypes.FileSystem : WebInspector.projectTypes.Network; - project = new WebInspector.ProjectStore(workspace, projectId, projectType, ""); + var projectType = projectId.startsWith("file") ? Workspace.projectTypes.FileSystem : Workspace.projectTypes.Network; + project = new Workspace.ProjectStore(workspace, projectId, projectType, ""); workspace.addProject(project); projects[projectId] = project; } - var uiSourceCode = project.createUISourceCode(projectId +"/" + relativePath, WebInspector.resourceTypes.Script); + var uiSourceCode = project.createUISourceCode(projectId +"/" + relativePath, Common.resourceTypes.Script); project.addUISourceCode(uiSourceCode); }
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn index 639080f..0cba489 100644 --- a/third_party/WebKit/Source/devtools/BUILD.gn +++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -49,7 +49,6 @@ "front_end/common/Throttler.js", "front_end/common/Trie.js", "front_end/common/UIString.js", - "front_end/common/WebInspector.js", "front_end/common/Worker.js", ] devtools_components_js_files = [
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js index c318596..aa3a298 100644 --- a/third_party/WebKit/Source/devtools/front_end/Runtime.js +++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
@@ -764,6 +764,14 @@ _loadScripts() { if (!this._descriptor.scripts || !this._descriptor.scripts.length) return Promise.resolve(); + + // Module namespaces. + var namespace = this._name.replace('_lazy', ''); + if (namespace === 'sdk' || namespace === 'ui') + namespace = namespace.toUpperCase(); + namespace = namespace.split('_').map(a => a.substring(0, 1).toUpperCase() + a.substring(1)).join(''); + self[namespace] = self[namespace] || {}; + return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modularizeURL, this), this._remoteBase()); } @@ -882,7 +890,7 @@ * @return {string} */ title() { - // FIXME: should be WebInspector.UIString() but runtime is not l10n aware yet. + // FIXME: should be Common.UIString() but runtime is not l10n aware yet. return this._descriptor['title-' + Runtime._platform] || this._descriptor['title']; }
diff --git a/third_party/WebKit/Source/devtools/front_end/Tests.js b/third_party/WebKit/Source/devtools/front_end/Tests.js index b97f02a..98820a2 100644 --- a/third_party/WebKit/Source/devtools/front_end/Tests.js +++ b/third_party/WebKit/Source/devtools/front_end/Tests.js
@@ -199,7 +199,7 @@ /** * Waits for current throttler invocations, if any. - * @param {!WebInspector.Throttler} throttler + * @param {!Common.Throttler} throttler * @param {function()} callback */ TestSuite.prototype.waitForThrottler = function(throttler, callback) { @@ -233,7 +233,7 @@ * @param {string} panelName Name of the panel to show. */ TestSuite.prototype.showPanel = function(panelName) { - return WebInspector.inspectorView.showPanel(panelName); + return UI.inspectorView.showPanel(panelName); }; // UI Tests @@ -260,8 +260,8 @@ */ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function() { var test = this; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget()); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); + var debuggerModel = SDK.DebuggerModel.fromTarget(SDK.targetManager.mainTarget()); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); this.showPanel('elements').then(function() { // Reload inspected page. It will reset the debugger agent. @@ -269,7 +269,7 @@ }); function waitUntilScriptIsParsed() { - debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); + debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); test.showPanel('sources').then(function() { test._waitUntilScriptsAreParsed(['debugger_test_page.html'], function() { test.releaseControl(); @@ -350,7 +350,7 @@ // Tests that debugger works correctly if pause event occurs when DevTools // frontend is being loaded. TestSuite.prototype.testPauseWhenLoadingDevTools = function() { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget()); + var debuggerModel = SDK.DebuggerModel.fromTarget(SDK.targetManager.mainTarget()); if (debuggerModel.debuggerPausedDetails) return; @@ -380,7 +380,7 @@ function testScriptPause() { // The script should be in infinite loop. Click "Pause" button to // pause it and wait for the result. - WebInspector.panels.sources._togglePause(); + UI.panels.sources._togglePause(); this._waitForScriptPause(this.releaseControl.bind(this)); } @@ -399,7 +399,7 @@ test.releaseControl(); } - this.addSniffer(WebInspector.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); + this.addSniffer(SDK.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); // Reload inspected page to sniff network events test.evaluateInConsole_('window.location.reload(true);', function(resultText) {}); @@ -418,7 +418,7 @@ test.releaseControl(); } - this.addSniffer(WebInspector.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); + this.addSniffer(SDK.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); // Send synchronous XHR to sniff network events test.evaluateInConsole_( @@ -442,7 +442,7 @@ test.releaseControl(); } - this.addSniffer(WebInspector.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); + this.addSniffer(SDK.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); // Reload inspected page to sniff network events test.evaluateInConsole_('window.location.reload(true);', function(resultText) {}); @@ -477,7 +477,7 @@ test.releaseControl(); } - this.addSniffer(WebInspector.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); + this.addSniffer(SDK.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource); // Reload inspected page to sniff network events test.evaluateInConsole_('window.location.reload(true);', function(resultText) {}); @@ -509,7 +509,7 @@ test.releaseControl(); } - this.addSniffer(WebInspector.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource, true); + this.addSniffer(SDK.NetworkDispatcher.prototype, '_finishNetworkRequest', finishResource, true); test.evaluateInConsole_('addImage(\'' + url + '\')', function(resultText) {}); test.evaluateInConsole_('addImage(\'' + url + '?pushUseNullEndTime\')', function(resultText) {}); @@ -519,21 +519,21 @@ TestSuite.prototype.testConsoleOnNavigateBack = function() { function filteredMessages() { - return WebInspector.multitargetConsoleModel.messages().filter( - a => a.source !== WebInspector.ConsoleMessage.MessageSource.Violation); + return SDK.multitargetConsoleModel.messages().filter( + a => a.source !== SDK.ConsoleMessage.MessageSource.Violation); } if (filteredMessages().length === 1) firstConsoleMessageReceived.call(this, null); else - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this); function firstConsoleMessageReceived(event) { - if (event && event.data.source === WebInspector.ConsoleMessage.MessageSource.Violation) + if (event && event.data.source === SDK.ConsoleMessage.MessageSource.Violation) return; - WebInspector.multitargetConsoleModel.removeEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this); + SDK.multitargetConsoleModel.removeEventListener( + SDK.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this); this.evaluateInConsole_('clickLink();', didClickLink.bind(this)); } @@ -571,7 +571,7 @@ this._waitForTargets(2, callback.bind(this)); function callback() { - var target = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS)[0]; + var target = SDK.targetManager.targets(SDK.Target.Capability.JS)[0]; InspectorBackendClass.deprecatedRunAfterPendingDispatches(this.releaseControl.bind(this)); } }; @@ -581,8 +581,8 @@ this._waitForTargets(2, callback.bind(this)); function callback() { - var target = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS)[0]; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var target = SDK.targetManager.targets(SDK.Target.Capability.JS)[0]; + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel.isPaused()) { this.releaseControl(); return; @@ -592,17 +592,17 @@ }; TestSuite.prototype.enableTouchEmulation = function() { - var deviceModeModel = new WebInspector.DeviceModeModel(function() {}); - deviceModeModel._target = WebInspector.targetManager.mainTarget(); + var deviceModeModel = new Emulation.DeviceModeModel(function() {}); + deviceModeModel._target = SDK.targetManager.mainTarget(); deviceModeModel._applyTouch(true, true); }; TestSuite.prototype.enableAutoAttachToCreatedPages = function() { - WebInspector.settingForTest('autoAttachToCreatedPages').set(true); + Common.settingForTest('autoAttachToCreatedPages').set(true); }; TestSuite.prototype.waitForDebuggerPaused = function() { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget()); + var debuggerModel = SDK.DebuggerModel.fromTarget(SDK.targetManager.mainTarget()); if (debuggerModel.debuggerPausedDetails) return; @@ -625,7 +625,7 @@ var test = this; function testOverrides(params, metrics, callback) { - WebInspector.targetManager.mainTarget().emulationAgent().invoke_setDeviceMetricsOverride(params, getMetrics); + SDK.targetManager.mainTarget().emulationAgent().invoke_setDeviceMetricsOverride(params, getMetrics); function getMetrics() { test.evaluateInConsole_('(' + dumpPageMetrics.toString() + ')()', checkMetrics); @@ -671,9 +671,9 @@ }; TestSuite.prototype.testDispatchKeyEventDoesNotCrash = function() { - WebInspector.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( + SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( {type: 'rawKeyDown', windowsVirtualKeyCode: 0x23, key: 'End'}); - WebInspector.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( + SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( {type: 'keyUp', windowsVirtualKeyCode: 0x23, key: 'End'}); }; @@ -690,15 +690,15 @@ messages.splice(index, 1); if (!messages.length) { - WebInspector.multitargetConsoleModel.removeEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); + SDK.multitargetConsoleModel.removeEventListener( + SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); next(); } } - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); - WebInspector.multitargetNetworkManager.setNetworkConditions(preset); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); + SDK.multitargetNetworkManager.setNetworkConditions(preset); } test.takeControl(); @@ -706,20 +706,20 @@ function step1() { testPreset( - WebInspector.NetworkConditionsSelector._presets[0], + Components.NetworkConditionsSelector._presets[0], ['offline event: online = false', 'connection change event: type = none; downlinkMax = 0'], step2); } function step2() { testPreset( - WebInspector.NetworkConditionsSelector._presets[2], + Components.NetworkConditionsSelector._presets[2], ['online event: online = true', 'connection change event: type = cellular; downlinkMax = 0.244140625'], step3); } function step3() { testPreset( - WebInspector.NetworkConditionsSelector._presets[8], + Components.NetworkConditionsSelector._presets[8], ['connection change event: type = wifi; downlinkMax = 30'], test.releaseControl.bind(test)); } }; @@ -744,14 +744,14 @@ } } - var captureFilmStripSetting = WebInspector.settings.createSetting('timelineCaptureFilmStrip', false); + var captureFilmStripSetting = Common.settings.createSetting('timelineCaptureFilmStrip', false); captureFilmStripSetting.set(true); test.evaluateInConsole_(performActionsInPage.toString(), function() {}); test.invokeAsyncWithTimeline_('performActionsInPage', onTimelineDone); function onTimelineDone() { captureFilmStripSetting.set(false); - var filmStripModel = new WebInspector.FilmStripModel(WebInspector.panels.timeline._tracingModel); + var filmStripModel = new Components.FilmStripModel(UI.panels.timeline._tracingModel); var frames = filmStripModel.frames(); test.assertTrue(frames.length > 4 && typeof frames.length === 'number'); loadFrameImages(frames); @@ -815,9 +815,9 @@ setTimeout(reset, 0); function createSettings() { - var localSetting = WebInspector.settings.createSetting('local', undefined, true); + var localSetting = Common.settings.createSetting('local', undefined, true); localSetting.set({s: 'local', n: 1}); - var globalSetting = WebInspector.settings.createSetting('global', undefined, false); + var globalSetting = Common.settings.createSetting('global', undefined, false); globalSetting.set({s: 'global', n: 2}); } @@ -827,13 +827,13 @@ } function gotPreferences(prefs) { - WebInspector.Main._instanceForTest._createSettings(prefs); + Main.Main._instanceForTest._createSettings(prefs); - var localSetting = WebInspector.settings.createSetting('local', undefined, true); + var localSetting = Common.settings.createSetting('local', undefined, true); test.assertEquals('object', typeof localSetting.get()); test.assertEquals('local', localSetting.get().s); test.assertEquals(1, localSetting.get().n); - var globalSetting = WebInspector.settings.createSetting('global', undefined, false); + var globalSetting = Common.settings.createSetting('global', undefined, false); test.assertEquals('object', typeof globalSetting.get()); test.assertEquals('global', globalSetting.get().s); test.assertEquals(2, globalSetting.get().n); @@ -842,7 +842,7 @@ }; TestSuite.prototype.testWindowInitializedOnNavigateBack = function() { - var messages = WebInspector.multitargetConsoleModel.messages(); + var messages = SDK.multitargetConsoleModel.messages(); this.assertEquals(1, messages.length); var text = messages[0].messageText; if (text.indexOf('Uncaught') !== -1) @@ -855,7 +855,7 @@ this.showPanel('console').then(() => this._waitForExecutionContexts(2, onExecutionContexts.bind(this))); function onExecutionContexts() { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); var options = consoleView._consoleContextSelector._selectElement.options; var values = []; for (var i = 0; i < options.length; ++i) @@ -868,11 +868,11 @@ TestSuite.prototype.testDevToolsSharedWorker = function() { this.takeControl(); - WebInspector.TempFile.ensureTempStorageCleared().then(() => this.releaseControl()); + Bindings.TempFile.ensureTempStorageCleared().then(() => this.releaseControl()); }; TestSuite.prototype.waitForTestResultsInConsole = function() { - var messages = WebInspector.multitargetConsoleModel.messages(); + var messages = SDK.multitargetConsoleModel.messages(); for (var i = 0; i < messages.length; ++i) { var text = messages[i].messageText; if (text === 'PASS') @@ -889,8 +889,8 @@ this.fail(text); } - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage, this); this.takeControl(); }; @@ -914,14 +914,14 @@ TestSuite.prototype.startTimeline = function(callback) { var test = this; this.showPanel('timeline').then(function() { - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; test._overrideMethod(timeline, 'recordingStarted', callback); timeline._toggleRecording(); }); }; TestSuite.prototype.stopTimeline = function(callback) { - var timeline = WebInspector.panels.timeline; + var timeline = UI.panels.timeline; this._overrideMethod(timeline, 'loadingComplete', callback); timeline._toggleRecording(); }; @@ -934,14 +934,14 @@ Array.prototype.slice.call(arguments, 1, -1).map(arg => JSON.stringify(arg)).join(',') + ','; this.evaluateInConsole_( `${functionName}(${argsString} function() { console.log('${doneMessage}'); });`, function() {}); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage); function onConsoleMessage(event) { var text = event.data.messageText; if (text === doneMessage) { - WebInspector.multitargetConsoleModel.removeEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage); + SDK.multitargetConsoleModel.removeEventListener( + SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage); callback(); } } @@ -967,16 +967,16 @@ TestSuite.prototype.checkInputEventsPresent = function() { var expectedEvents = new Set(arguments); - var model = WebInspector.panels.timeline._model; + var model = UI.panels.timeline._model; var asyncEvents = model.mainThreadAsyncEvents(); - var input = asyncEvents.get(WebInspector.TimelineModel.AsyncEventGroup.input) || []; + var input = asyncEvents.get(TimelineModel.TimelineModel.AsyncEventGroup.input) || []; var prefix = 'InputLatency::'; for (var e of input) { if (!e.name.startsWith(prefix)) continue; if (e.steps.length < 2) continue; - if (e.name.startsWith(prefix + 'Mouse') && typeof WebInspector.TimelineData.forEvent(e.steps[0]).timeWaitingForMainThread !== 'number') + if (e.name.startsWith(prefix + 'Mouse') && typeof TimelineModel.TimelineData.forEvent(e.steps[0]).timeWaitingForMainThread !== 'number') throw `Missing timeWaitingForMainThread on ${e.name}`; expectedEvents.delete(e.name.substr(prefix.length)); } @@ -986,7 +986,7 @@ /** * Serializes array of uiSourceCodes to string. - * @param {!Array.<!WebInspectorUISourceCode>} uiSourceCodes + * @param {!Array.<!Workspace.UISourceCode>} uiSourceCodes * @return {string} */ TestSuite.prototype.uiSourceCodesToString_ = function(uiSourceCodes) { @@ -998,17 +998,17 @@ /** * Returns all loaded non anonymous uiSourceCodes. - * @return {!Array.<!WebInspectorUISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ TestSuite.prototype.nonAnonymousUISourceCodes_ = function() { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ function filterOutService(uiSourceCode) { return !uiSourceCode.isFromServiceProject(); } - var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); + var uiSourceCodes = Workspace.workspace.uiSourceCodes(); return uiSourceCodes.filter(filterOutService); }; @@ -1020,21 +1020,21 @@ */ TestSuite.prototype.evaluateInConsole_ = function(code, callback) { function innerEvaluate() { - WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionContext, showConsoleAndEvaluate, this); - var consoleView = WebInspector.ConsoleView.instance(); + UI.context.removeFlavorChangeListener(SDK.ExecutionContext, showConsoleAndEvaluate, this); + var consoleView = Console.ConsoleView.instance(); consoleView._prompt._appendCommand(code); - this.addSniffer(WebInspector.ConsoleView.prototype, '_consoleMessageAddedForTest', function(viewMessage) { + this.addSniffer(Console.ConsoleView.prototype, '_consoleMessageAddedForTest', function(viewMessage) { callback(viewMessage.toMessageElement().deepTextContent()); }.bind(this)); } function showConsoleAndEvaluate() { - WebInspector.console.showPromise().then(innerEvaluate.bind(this)); + Common.console.showPromise().then(innerEvaluate.bind(this)); } - if (!WebInspector.context.flavor(WebInspector.ExecutionContext)) { - WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, showConsoleAndEvaluate, this); + if (!UI.context.flavor(SDK.ExecutionContext)) { + UI.context.addFlavorChangeListener(SDK.ExecutionContext, showConsoleAndEvaluate, this); return; } showConsoleAndEvaluate.call(this); @@ -1068,7 +1068,7 @@ * @param {function():void} callback */ TestSuite.prototype._waitForScriptPause = function(callback) { - this.addSniffer(WebInspector.DebuggerModel.prototype, '_pausedScript', callback); + this.addSniffer(SDK.DebuggerModel.prototype, '_pausedScript', callback); }; /** @@ -1081,7 +1081,7 @@ if (test._scriptsAreParsed(expectedScripts)) callback(); else - test.addSniffer(WebInspector.panels.sources.sourcesView(), '_addUISourceCode', waitForAllScripts); + test.addSniffer(UI.panels.sources.sourcesView(), '_addUISourceCode', waitForAllScripts); } waitForAllScripts(); @@ -1091,15 +1091,15 @@ checkTargets.call(this); function checkTargets() { - if (WebInspector.targetManager.targets().length >= n) + if (SDK.targetManager.targets().length >= n) callback.call(null); else - this.addSniffer(WebInspector.TargetManager.prototype, 'addTarget', checkTargets.bind(this)); + this.addSniffer(SDK.TargetManager.prototype, 'addTarget', checkTargets.bind(this)); } }; TestSuite.prototype._waitForExecutionContexts = function(n, callback) { - var runtimeModel = WebInspector.targetManager.mainTarget().runtimeModel; + var runtimeModel = SDK.targetManager.mainTarget().runtimeModel; checkForExecutionContexts.call(this); function checkForExecutionContexts() { @@ -1107,7 +1107,7 @@ callback.call(null); else this.addSniffer( - WebInspector.RuntimeModel.prototype, '_executionContextCreated', checkForExecutionContexts.bind(this)); + SDK.RuntimeModel.prototype, '_executionContextCreated', checkForExecutionContexts.bind(this)); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAAttributesView.js b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAAttributesView.js index 6d975ec..1a84262 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAAttributesView.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAAttributesView.js
@@ -4,17 +4,17 @@ /** * @unrestricted */ -WebInspector.ARIAAttributesPane = class extends WebInspector.AccessibilitySubPane { +Accessibility.ARIAAttributesPane = class extends Accessibility.AccessibilitySubPane { constructor() { - super(WebInspector.UIString('ARIA Attributes')); + super(Common.UIString('ARIA Attributes')); - this._noPropertiesInfo = this.createInfo(WebInspector.UIString('No ARIA attributes')); + this._noPropertiesInfo = this.createInfo(Common.UIString('No ARIA attributes')); this._treeOutline = this.createTreeOutline(); } /** * @override - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ setNode(node) { super.setNode(node); @@ -25,9 +25,9 @@ var attributes = node.attributes(); for (var i = 0; i < attributes.length; ++i) { var attribute = attributes[i]; - if (WebInspector.ARIAAttributesPane._attributes.indexOf(attribute.name) < 0) + if (Accessibility.ARIAAttributesPane._attributes.indexOf(attribute.name) < 0) continue; - this._treeOutline.appendChild(new WebInspector.ARIAAttributesTreeElement(this, attribute, target)); + this._treeOutline.appendChild(new Accessibility.ARIAAttributesTreeElement(this, attribute, target)); } var foundAttributes = (this._treeOutline.rootElement().childCount() !== 0); @@ -39,11 +39,11 @@ /** * @unrestricted */ -WebInspector.ARIAAttributesTreeElement = class extends TreeElement { +Accessibility.ARIAAttributesTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ARIAAttributesPane} parentPane - * @param {!WebInspector.DOMNode.Attribute} attribute - * @param {!WebInspector.Target} target + * @param {!Accessibility.ARIAAttributesPane} parentPane + * @param {!SDK.DOMNode.Attribute} attribute + * @param {!SDK.Target} target */ constructor(parentPane, attribute, target) { super(''); @@ -95,7 +95,7 @@ * @param {string} value */ appendAttributeValueElement(value) { - this._valueElement = WebInspector.ARIAAttributesTreeElement.createARIAValueElement(value); + this._valueElement = Accessibility.ARIAAttributesTreeElement.createARIAValueElement(value); this.listItemElement.appendChild(this._valueElement); } @@ -114,7 +114,7 @@ _startEditing() { var valueElement = this._valueElement; - if (WebInspector.isBeingEdited(valueElement)) + if (UI.isBeingEdited(valueElement)) return; var previousContent = valueElement.textContent; @@ -122,15 +122,15 @@ /** * @param {string} previousContent * @param {!Event} event - * @this {WebInspector.ARIAAttributesTreeElement} + * @this {Accessibility.ARIAAttributesTreeElement} */ function blurListener(previousContent, event) { var text = event.target.textContent; this._editingCommitted(text, previousContent); } - this._prompt = new WebInspector.ARIAAttributesPane.ARIAAttributePrompt( - WebInspector.ariaMetadata().valuesForProperty(this._nameElement.textContent), this); + this._prompt = new Accessibility.ARIAAttributesPane.ARIAAttributePrompt( + Accessibility.ariaMetadata().valuesForProperty(this._nameElement.textContent), this); this._prompt.setAutocompletionTimeout(0); var proxyElement = this._prompt.attachAndStartEditing(valueElement, blurListener.bind(this, previousContent)); @@ -177,7 +177,7 @@ return; } - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === 'U+001B') { + if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === 'U+001B') { this._editingCancelled(); event.consume(); return; @@ -189,10 +189,10 @@ /** * @unrestricted */ -WebInspector.ARIAAttributesPane.ARIAAttributePrompt = class extends WebInspector.TextPrompt { +Accessibility.ARIAAttributesPane.ARIAAttributePrompt = class extends UI.TextPrompt { /** * @param {!Array<string>} ariaCompletions - * @param {!WebInspector.ARIAAttributesTreeElement} treeElement + * @param {!Accessibility.ARIAAttributesTreeElement} treeElement */ constructor(ariaCompletions, treeElement) { super(); @@ -223,7 +223,7 @@ } }; -WebInspector.ARIAAttributesPane._attributes = [ +Accessibility.ARIAAttributesPane._attributes = [ 'role', 'aria-busy', 'aria-checked',
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAConfig.js b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAConfig.js index c023ccd..217f6e7 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAConfig.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAConfig.js
@@ -1,4 +1,4 @@ -WebInspector.ARIAMetadata._config = { +Accessibility.ARIAMetadata._config = { 'attributes': { 'aria-activedescendant': {'type': 'IDREF'}, 'aria-atomic': {'default': 'false', 'type': 'boolean'},
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAMetadata.js b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAMetadata.js index 222223d..5ffcc10 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAMetadata.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/ARIAMetadata.js
@@ -4,12 +4,12 @@ /** * @unrestricted */ -WebInspector.ARIAMetadata = class { +Accessibility.ARIAMetadata = class { /** * @param {?Object} config */ constructor(config) { - /** @type {!Map<string, !WebInspector.ARIAMetadata.Attribute>} */ + /** @type {!Map<string, !Accessibility.ARIAMetadata.Attribute>} */ this._attributes = new Map(); if (config) @@ -27,7 +27,7 @@ var attributeConfig = attributes[name]; if (attributeConfig.type === 'boolean') attributeConfig.enum = booleanEnum; - this._attributes.set(name, new WebInspector.ARIAMetadata.Attribute(attributeConfig)); + this._attributes.set(name, new Accessibility.ARIAMetadata.Attribute(attributeConfig)); } /** @type {!Array<string>} */ @@ -50,18 +50,18 @@ }; /** - * @return {!WebInspector.ARIAMetadata} + * @return {!Accessibility.ARIAMetadata} */ -WebInspector.ariaMetadata = function() { - if (!WebInspector.ARIAMetadata._instance) - WebInspector.ARIAMetadata._instance = new WebInspector.ARIAMetadata(WebInspector.ARIAMetadata._config || null); - return WebInspector.ARIAMetadata._instance; +Accessibility.ariaMetadata = function() { + if (!Accessibility.ARIAMetadata._instance) + Accessibility.ARIAMetadata._instance = new Accessibility.ARIAMetadata(Accessibility.ARIAMetadata._config || null); + return Accessibility.ARIAMetadata._instance; }; /** * @unrestricted */ -WebInspector.ARIAMetadata.Attribute = class { +Accessibility.ARIAMetadata.Attribute = class { /** * @param {!Object} config */
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js index 3e3e482..d1301d7 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.AXTreePane = class extends WebInspector.AccessibilitySubPane { +Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane { constructor() { - super(WebInspector.UIString('Accessibility Tree')); + super(Common.UIString('Accessibility Tree')); this._treeOutline = this.createTreeOutline(); @@ -16,7 +16,7 @@ } /** - * @param {?WebInspector.AccessibilityNode} axNode + * @param {?Accessibility.AccessibilityNode} axNode * @override */ setAXNode(axNode) { @@ -31,7 +31,7 @@ treeOutline.element.classList.remove('hidden'); var previousTreeElement = treeOutline.rootElement(); - var inspectedNodeTreeElement = new WebInspector.AXNodeTreeElement(axNode, this); + var inspectedNodeTreeElement = new Accessibility.AXNodeTreeElement(axNode, this); inspectedNodeTreeElement.setInspected(true); var parent = axNode.parentNode(); @@ -45,12 +45,12 @@ ancestor = ancestor.parentNode(); } for (var ancestorNode of chain) { - var ancestorTreeElement = new WebInspector.AXNodeTreeElement(ancestorNode, this); + var ancestorTreeElement = new Accessibility.AXNodeTreeElement(ancestorNode, this); previousTreeElement.appendChild(ancestorTreeElement); previousTreeElement.expand(); previousTreeElement = ancestorTreeElement; } - var parentTreeElement = new WebInspector.AXNodeTreeParentElement(parent, inspectedNodeTreeElement, this); + var parentTreeElement = new Accessibility.AXNodeTreeParentElement(parent, inspectedNodeTreeElement, this); previousTreeElement.appendChild(parentTreeElement); if (this.isExpanded(parent.backendDOMNodeId())) parentTreeElement.appendSiblings(); @@ -65,7 +65,7 @@ previousTreeElement.expand(); for (var child of axNode.children()) { - var childTreeElement = new WebInspector.AXNodeTreeElement(child, this); + var childTreeElement = new Accessibility.AXNodeTreeElement(child, this); inspectedNodeTreeElement.appendChild(childTreeElement); } @@ -88,7 +88,7 @@ } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this.node().target(); @@ -119,10 +119,10 @@ } }; -WebInspector.InspectNodeButton = class { +Accessibility.InspectNodeButton = class { /** - * @param {!WebInspector.AccessibilityNode} axNode - * @param {!WebInspector.AXTreePane} treePane + * @param {!Accessibility.AccessibilityNode} axNode + * @param {!Accessibility.AXTreePane} treePane */ constructor(axNode, treePane) { this._axNode = axNode; @@ -137,36 +137,36 @@ */ _handleMouseDown(event) { this._treePane.setSelectedByUser(true); - WebInspector.Revealer.reveal(this._axNode.deferredDOMNode()); + Common.Revealer.reveal(this._axNode.deferredDOMNode()); } }; /** * @unrestricted */ -WebInspector.AXNodeTreeElement = class extends TreeElement { +Accessibility.AXNodeTreeElement = class extends TreeElement { /** - * @param {!WebInspector.AccessibilityNode} axNode - * @param {!WebInspector.AXTreePane} treePane + * @param {!Accessibility.AccessibilityNode} axNode + * @param {!Accessibility.AXTreePane} treePane */ constructor(axNode, treePane) { // Pass an empty title, the title gets made later in onattach. super(''); - /** @type {!WebInspector.AccessibilityNode} */ + /** @type {!Accessibility.AccessibilityNode} */ this._axNode = axNode; - /** @type {!WebInspector.AXTreePane} */ + /** @type {!Accessibility.AXTreePane} */ this._treePane = treePane; this.selectable = true; this._inspectNodeButton = - new WebInspector.InspectNodeButton(axNode, treePane); + new Accessibility.InspectNodeButton(axNode, treePane); } /** - * @return {!WebInspector.AccessibilityNode} + * @return {!Accessibility.AccessibilityNode} */ axNode() { return this._axNode; @@ -201,7 +201,7 @@ inspectDOMNode() { this._treePane.setSelectedByUser(true); - WebInspector.Revealer.reveal(this._axNode.deferredDOMNode()); + Common.Revealer.reveal(this._axNode.deferredDOMNode()); } /** @@ -277,7 +277,7 @@ return; var roleElement = createElementWithClass('span', 'monospace'); - roleElement.classList.add(WebInspector.AXNodeTreeElement.RoleStyles[role.type]); + roleElement.classList.add(Accessibility.AXNodeTreeElement.RoleStyles[role.type]); roleElement.setTextContentTruncatedIfNeeded(role.value || ''); this.listItemElement.appendChild(roleElement); @@ -285,7 +285,7 @@ _appendIgnoredNodeElement() { var ignoredNodeElement = createElementWithClass('span', 'monospace'); - ignoredNodeElement.textContent = WebInspector.UIString('Ignored'); + ignoredNodeElement.textContent = Common.UIString('Ignored'); ignoredNodeElement.classList.add('ax-tree-ignored-node'); this.listItemElement.appendChild(ignoredNodeElement); } @@ -304,7 +304,7 @@ }; /** @type {!Object<string, string>} */ -WebInspector.AXNodeTreeElement.RoleStyles = { +Accessibility.AXNodeTreeElement.RoleStyles = { internalRole: 'ax-internal-role', role: 'ax-role', }; @@ -312,16 +312,16 @@ /** * @unrestricted */ -WebInspector.ExpandSiblingsButton = class { +Accessibility.ExpandSiblingsButton = class { /** - * @param {!WebInspector.AXNodeTreeParentElement} treeElement + * @param {!Accessibility.AXNodeTreeParentElement} treeElement * @param {number} numSiblings */ constructor(treeElement, numSiblings) { this._treeElement = treeElement; this.element = createElementWithClass('button', 'expand-siblings'); - this.element.textContent = WebInspector.UIString( + this.element.textContent = Common.UIString( (numSiblings === 1 ? '+ %d node' : '+ %d nodes'), numSiblings); this.element.addEventListener('mousedown', this._handleMouseDown.bind(this)); } @@ -338,18 +338,18 @@ /** * @unrestricted */ -WebInspector.AXNodeTreeParentElement = class extends WebInspector.AXNodeTreeElement { +Accessibility.AXNodeTreeParentElement = class extends Accessibility.AXNodeTreeElement { /** - * @param {!WebInspector.AccessibilityNode} axNode - * @param {!WebInspector.AXNodeTreeElement} inspectedNodeTreeElement - * @param {!WebInspector.AXTreePane} treePane + * @param {!Accessibility.AccessibilityNode} axNode + * @param {!Accessibility.AXNodeTreeElement} inspectedNodeTreeElement + * @param {!Accessibility.AXTreePane} treePane */ constructor(axNode, inspectedNodeTreeElement, treePane) { super(axNode, treePane); this._inspectedNodeTreeElement = inspectedNodeTreeElement; var numSiblings = axNode.children().length - 1; - this._expandSiblingsButton = new WebInspector.ExpandSiblingsButton(this, numSiblings); + this._expandSiblingsButton = new Accessibility.ExpandSiblingsButton(this, numSiblings); this._partiallyExpanded = false; } @@ -407,7 +407,7 @@ foundInspectedNode = true; continue; } - siblingTreeElement = new WebInspector.AXNodeTreeElement(sibling, this._treePane); + siblingTreeElement = new Accessibility.AXNodeTreeElement(sibling, this._treePane); if (foundInspectedNode) this.appendChild(siblingTreeElement); else
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js index 5e9d8c5..20a5565 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityModel.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.AccessibilityNode = class extends WebInspector.SDKObject { +Accessibility.AccessibilityNode = class extends SDK.SDKObject { /** - * @param {!WebInspector.AccessibilityModel} accessibilityModel + * @param {!Accessibility.AccessibilityModel} accessibilityModel * @param {!Protocol.Accessibility.AXNode} payload */ constructor(accessibilityModel, payload) { @@ -20,7 +20,7 @@ accessibilityModel._setAXNodeForBackendDOMNodeId(payload.backendDOMNodeId, this); this._backendDOMNodeId = payload.backendDOMNodeId; this._deferredDOMNode = - new WebInspector.DeferredDOMNode(this.target(), + new SDK.DeferredDOMNode(this.target(), payload.backendDOMNodeId); } else { this._backendDOMNodeId = null; @@ -105,14 +105,14 @@ } /** - * @return {?WebInspector.AccessibilityNode} + * @return {?Accessibility.AccessibilityNode} */ parentNode() { return this._parentNode; } /** - * @param {?WebInspector.AccessibilityNode} parentNode + * @param {?Accessibility.AccessibilityNode} parentNode */ _setParentNode(parentNode) { this._parentNode = parentNode; @@ -133,14 +133,14 @@ } /** - * @return {?WebInspector.DeferredDOMNode} + * @return {?SDK.DeferredDOMNode} */ deferredDOMNode() { return this._deferredDOMNode; } /** - * @return {!Array<!WebInspector.AccessibilityNode>} + * @return {!Array<!Accessibility.AccessibilityNode>} */ children() { var children = []; @@ -177,7 +177,7 @@ /** * TODO(aboxhall): Remove once protocol is stable. - * @param {!WebInspector.AccessibilityNode} inspectedNode + * @param {!Accessibility.AccessibilityNode} inspectedNode * @param {string=} leadingSpace * @return {string} */ @@ -202,28 +202,28 @@ /** * @unrestricted */ -WebInspector.AccessibilityModel = class extends WebInspector.SDKModel { +Accessibility.AccessibilityModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.AccessibilityModel, target); + super(Accessibility.AccessibilityModel, target); this._agent = target.accessibilityAgent(); - /** @type {!Map<string, !WebInspector.AccessibilityNode>} */ + /** @type {!Map<string, !Accessibility.AccessibilityNode>} */ this._axIdToAXNode = new Map(); this._backendDOMNodeIdToAXNode = new Map(); } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.AccessibilityModel} + * @param {!SDK.Target} target + * @return {!Accessibility.AccessibilityModel} */ static fromTarget(target) { - if (!target[WebInspector.AccessibilityModel._symbol]) - target[WebInspector.AccessibilityModel._symbol] = new WebInspector.AccessibilityModel(target); + if (!target[Accessibility.AccessibilityModel._symbol]) + target[Accessibility.AccessibilityModel._symbol] = new Accessibility.AccessibilityModel(target); - return target[WebInspector.AccessibilityModel._symbol]; + return target[Accessibility.AccessibilityModel._symbol]; } clear() { @@ -231,12 +231,12 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {!Promise} */ requestPartialAXTree(node) { /** - * @this {WebInspector.AccessibilityModel} + * @this {Accessibility.AccessibilityModel} * @param {?string} error * @param {!Array<!Protocol.Accessibility.AXNode>=} payloads */ @@ -250,7 +250,7 @@ return; for (var payload of payloads) - new WebInspector.AccessibilityNode(this, payload); + new Accessibility.AccessibilityNode(this, payload); for (var axNode of this._axIdToAXNode.values()) { for (var axChild of axNode.children()) { @@ -263,7 +263,7 @@ /** * @param {string} axId - * @return {?WebInspector.AccessibilityNode} + * @return {?Accessibility.AccessibilityNode} */ axNodeForId(axId) { return this._axIdToAXNode.get(axId); @@ -271,15 +271,15 @@ /** * @param {string} axId - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ _setAXNodeForAXId(axId, axNode) { this._axIdToAXNode.set(axId, axNode); } /** - * @param {?WebInspector.DOMNode} domNode - * @return {?WebInspector.AccessibilityNode} + * @param {?SDK.DOMNode} domNode + * @return {?Accessibility.AccessibilityNode} */ axNodeForDOMNode(domNode) { if (!domNode) @@ -289,7 +289,7 @@ /** * @param {number} backendDOMNodeId - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ _setAXNodeForBackendDOMNodeId(backendDOMNodeId, axNode) { this._backendDOMNodeIdToAXNode.set(backendDOMNodeId, @@ -298,7 +298,7 @@ // TODO(aboxhall): Remove once protocol is stable. /** - * @param {!WebInspector.DOMNode} inspectedNode + * @param {!SDK.DOMNode} inspectedNode */ logTree(inspectedNode) { var rootNode = inspectedNode; @@ -308,4 +308,4 @@ } }; -WebInspector.AccessibilityModel._symbol = Symbol('AccessibilityModel'); +Accessibility.AccessibilityModel._symbol = Symbol('AccessibilityModel');
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js index fc2be11..40e5d829 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityNodeView.js
@@ -4,13 +4,13 @@ /** * @unrestricted */ -WebInspector.AXNodeSubPane = class extends WebInspector.AccessibilitySubPane { +Accessibility.AXNodeSubPane = class extends Accessibility.AccessibilitySubPane { constructor() { - super(WebInspector.UIString('Computed Properties')); + super(Common.UIString('Computed Properties')); - this._noNodeInfo = this.createInfo(WebInspector.UIString('No accessibility node')); + this._noNodeInfo = this.createInfo(Common.UIString('No accessibility node')); this._ignoredInfo = - this.createInfo(WebInspector.UIString('Accessibility node not exposed'), 'ax-ignored-info hidden'); + this.createInfo(Common.UIString('Accessibility node not exposed'), 'ax-ignored-info hidden'); this._treeOutline = this.createTreeOutline(); this._ignoredReasonsTree = this.createTreeOutline(); @@ -19,7 +19,7 @@ } /** - * @param {?WebInspector.AccessibilityNode} axNode + * @param {?Accessibility.AccessibilityNode} axNode * @override */ setAXNode(axNode) { @@ -54,8 +54,8 @@ * @param {!Protocol.Accessibility.AXProperty} property */ function addIgnoredReason(property) { - ignoredReasons.appendChild(new WebInspector.AXNodeIgnoredReasonTreeElement( - property, /** @type {!WebInspector.AccessibilityNode} */ (axNode))); + ignoredReasons.appendChild(new Accessibility.AXNodeIgnoredReasonTreeElement( + property, /** @type {!Accessibility.AccessibilityNode} */ (axNode))); } var ignoredReasonsArray = /** @type {!Array<!Protocol.Accessibility.AXProperty>} */ (axNode.ignoredReasons()); for (var reason of ignoredReasonsArray) @@ -76,8 +76,8 @@ * @param {!Protocol.Accessibility.AXProperty} property */ function addProperty(property) { - treeOutline.appendChild(new WebInspector.AXNodePropertyTreePropertyElement( - property, /** @type {!WebInspector.AccessibilityNode} */ (axNode))); + treeOutline.appendChild(new Accessibility.AXNodePropertyTreePropertyElement( + property, /** @type {!Accessibility.AccessibilityNode} */ (axNode))); } for (var property of axNode.coreProperties()) @@ -105,7 +105,7 @@ /** * @override - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ setNode(node) { super.setNode(node); @@ -116,9 +116,9 @@ /** * @unrestricted */ -WebInspector.AXNodePropertyTreeElement = class extends TreeElement { +Accessibility.AXNodePropertyTreeElement = class extends TreeElement { /** - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ constructor(axNode) { // Pass an empty title, the title gets made later in onattach. @@ -139,7 +139,7 @@ else valueElement = createElementWithClass('span', 'monospace'); var valueText; - var isStringProperty = type && WebInspector.AXNodePropertyTreeElement.StringProperties.has(type); + var isStringProperty = type && Accessibility.AXNodePropertyTreeElement.StringProperties.has(type); if (isStringProperty) { // Render \n as a nice unicode cr symbol. valueText = '"' + value.replace(/\n/g, '\u21B5') + '"'; @@ -148,8 +148,8 @@ valueText = String(value); } - if (type && type in WebInspector.AXNodePropertyTreeElement.TypeStyles) - valueElement.classList.add(WebInspector.AXNodePropertyTreeElement.TypeStyles[type]); + if (type && type in Accessibility.AXNodePropertyTreeElement.TypeStyles) + valueElement.classList.add(Accessibility.AXNodePropertyTreeElement.TypeStyles[type]); valueElement.setTextContentTruncatedIfNeeded(valueText || ''); @@ -174,9 +174,9 @@ */ appendNameElement(name) { var nameElement = createElement('span'); - var AXAttributes = WebInspector.AccessibilityStrings.AXAttributes; + var AXAttributes = Accessibility.AccessibilityStrings.AXAttributes; if (name in AXAttributes) { - nameElement.textContent = WebInspector.UIString(AXAttributes[name].name); + nameElement.textContent = Common.UIString(AXAttributes[name].name); nameElement.title = AXAttributes[name].description; nameElement.classList.add('ax-readable-name'); } else { @@ -202,12 +202,12 @@ var sources = value.sources; for (var i = 0; i < sources.length; i++) { var source = sources[i]; - var child = new WebInspector.AXValueSourceTreeElement(source, this._axNode); + var child = new Accessibility.AXValueSourceTreeElement(source, this._axNode); this.appendChild(child); } this.expand(); } - var element = WebInspector.AXNodePropertyTreeElement.createSimpleValueElement(value.type, String(value.value)); + var element = Accessibility.AXNodePropertyTreeElement.createSimpleValueElement(value.type, String(value.value)); this.listItemElement.appendChild(element); return element; } @@ -217,8 +217,8 @@ * @param {number} index */ appendRelatedNode(relatedNode, index) { - var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); - var nodeTreeElement = new WebInspector.AXRelatedNodeSourceTreeElement({deferredNode: deferredNode}, relatedNode); + var deferredNode = new SDK.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); + var nodeTreeElement = new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode: deferredNode}, relatedNode); this.appendChild(nodeTreeElement); } @@ -226,8 +226,8 @@ * @param {!Protocol.Accessibility.AXRelatedNode} relatedNode */ appendRelatedNodeInline(relatedNode) { - var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); - var linkedNode = new WebInspector.AXRelatedNodeElement({deferredNode: deferredNode}, relatedNode); + var deferredNode = new SDK.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); + var linkedNode = new Accessibility.AXRelatedNodeElement({deferredNode: deferredNode}, relatedNode); this.listItemElement.appendChild(linkedNode.render()); } @@ -250,7 +250,7 @@ /** @type {!Object<string, string>} */ -WebInspector.AXNodePropertyTreeElement.TypeStyles = { +Accessibility.AXNodePropertyTreeElement.TypeStyles = { attribute: 'ax-value-string', boolean: 'object-value-boolean', booleanOrUndefined: 'object-value-boolean', @@ -267,7 +267,7 @@ }; /** @type {!Set.<!Protocol.Accessibility.AXValueType>} */ -WebInspector.AXNodePropertyTreeElement.StringProperties = new Set([ +Accessibility.AXNodePropertyTreeElement.StringProperties = new Set([ Protocol.Accessibility.AXValueType.String, Protocol.Accessibility.AXValueType.ComputedString, Protocol.Accessibility.AXValueType.IdrefList, Protocol.Accessibility.AXValueType.Idref ]); @@ -275,10 +275,10 @@ /** * @unrestricted */ -WebInspector.AXNodePropertyTreePropertyElement = class extends WebInspector.AXNodePropertyTreeElement { +Accessibility.AXNodePropertyTreePropertyElement = class extends Accessibility.AXNodePropertyTreeElement { /** * @param {!Protocol.Accessibility.AXProperty} property - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ constructor(property, axNode) { super(axNode); @@ -313,10 +313,10 @@ /** * @unrestricted */ -WebInspector.AXValueSourceTreeElement = class extends WebInspector.AXNodePropertyTreeElement { +Accessibility.AXValueSourceTreeElement = class extends Accessibility.AXNodePropertyTreeElement { /** * @param {!Protocol.Accessibility.AXValueSource} source - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ constructor(source, axNode) { super(axNode); @@ -337,9 +337,9 @@ * @param {string} idref */ appendRelatedNodeWithIdref(relatedNode, index, idref) { - var deferredNode = new WebInspector.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); + var deferredNode = new SDK.DeferredDOMNode(this._axNode.target(), relatedNode.backendDOMNodeId); var nodeTreeElement = - new WebInspector.AXRelatedNodeSourceTreeElement({deferredNode: deferredNode, idref: idref}, relatedNode); + new Accessibility.AXRelatedNodeSourceTreeElement({deferredNode: deferredNode, idref: idref}, relatedNode); this.appendChild(nodeTreeElement); } @@ -358,7 +358,7 @@ if (matchingNode) { this.appendRelatedNodeWithIdref(matchingNode, 0, idref); } else { - this.listItemElement.appendChild(new WebInspector.AXRelatedNodeElement({idref: idref}).render()); + this.listItemElement.appendChild(new Accessibility.AXRelatedNodeElement({idref: idref}).render()); } } else { // TODO(aboxhall): exclamation mark if not idreflist type @@ -368,7 +368,7 @@ if (matchingNode) { this.appendRelatedNodeWithIdref(matchingNode, i, idref); } else { - this.appendChild(new WebInspector.AXRelatedNodeSourceTreeElement({idref: idref})); + this.appendChild(new Accessibility.AXRelatedNodeSourceTreeElement({idref: idref})); } } } @@ -408,10 +408,10 @@ case AXValueSourceType.Placeholder: case AXValueSourceType.RelatedElement: if (source.nativeSource) { - var AXNativeSourceTypes = WebInspector.AccessibilityStrings.AXNativeSourceTypes; + var AXNativeSourceTypes = Accessibility.AccessibilityStrings.AXNativeSourceTypes; var nativeSource = source.nativeSource; - nameElement.textContent = WebInspector.UIString(AXNativeSourceTypes[nativeSource].name); - nameElement.title = WebInspector.UIString(AXNativeSourceTypes[nativeSource].description); + nameElement.textContent = Common.UIString(AXNativeSourceTypes[nativeSource].name); + nameElement.title = Common.UIString(AXNativeSourceTypes[nativeSource].description); nameElement.classList.add('ax-readable-name'); break; } @@ -420,14 +420,14 @@ nameElement.classList.add('monospace'); break; default: - var AXSourceTypes = WebInspector.AccessibilityStrings.AXSourceTypes; + var AXSourceTypes = Accessibility.AccessibilityStrings.AXSourceTypes; if (type in AXSourceTypes) { - nameElement.textContent = WebInspector.UIString(AXSourceTypes[type].name); - nameElement.title = WebInspector.UIString(AXSourceTypes[type].description); + nameElement.textContent = Common.UIString(AXSourceTypes[type].name); + nameElement.title = Common.UIString(AXSourceTypes[type].description); nameElement.classList.add('ax-readable-name'); } else { console.warn(type, 'not in AXSourceTypes'); - nameElement.textContent = WebInspector.UIString(type); + nameElement.textContent = Common.UIString(type); } } this.listItemElement.appendChild(nameElement); @@ -438,7 +438,7 @@ if (this._source.invalid) { var exclamationMark = - WebInspector.AXNodePropertyTreeElement.createExclamationMark(WebInspector.UIString('Invalid source.')); + Accessibility.AXNodePropertyTreeElement.createExclamationMark(Common.UIString('Invalid source.')); this.listItemElement.appendChild(exclamationMark); this.listItemElement.classList.add('ax-value-source-invalid'); } else if (this._source.superseded) { @@ -458,8 +458,8 @@ } else if (this._source.value) { this.appendValueElement(this._source.value); } else { - var valueElement = WebInspector.AXNodePropertyTreeElement.createSimpleValueElement( - Protocol.Accessibility.AXValueType.ValueUndefined, WebInspector.UIString('Not specified')); + var valueElement = Accessibility.AXNodePropertyTreeElement.createSimpleValueElement( + Protocol.Accessibility.AXValueType.ValueUndefined, Common.UIString('Not specified')); this.listItemElement.appendChild(valueElement); this.listItemElement.classList.add('ax-value-source-unused'); } @@ -476,7 +476,7 @@ appendValueElement(value) { var element = super.appendValueElement(value); if (!element) { - element = WebInspector.AXNodePropertyTreeElement.createSimpleValueElement(value.type, String(value.value)); + element = Accessibility.AXNodePropertyTreeElement.createSimpleValueElement(value.type, String(value.value)); this.listItemElement.appendChild(element); } return element; @@ -486,16 +486,16 @@ /** * @unrestricted */ -WebInspector.AXRelatedNodeSourceTreeElement = class extends TreeElement { +Accessibility.AXRelatedNodeSourceTreeElement = class extends TreeElement { /** - * @param {{deferredNode: (!WebInspector.DeferredDOMNode|undefined), idref: (string|undefined)}} node + * @param {{deferredNode: (!SDK.DeferredDOMNode|undefined), idref: (string|undefined)}} node * @param {!Protocol.Accessibility.AXRelatedNode=} value */ constructor(node, value) { super(''); this._value = value; - this._axRelatedNodeElement = new WebInspector.AXRelatedNodeElement(node, value); + this._axRelatedNodeElement = new Accessibility.AXRelatedNodeElement(node, value); this.selectable = false; } @@ -508,7 +508,7 @@ return; if (this._value.text) - this.listItemElement.appendChild(WebInspector.AXNodePropertyTreeElement.createSimpleValueElement( + this.listItemElement.appendChild(Accessibility.AXNodePropertyTreeElement.createSimpleValueElement( Protocol.Accessibility.AXValueType.ComputedString, this._value.text)); } }; @@ -516,9 +516,9 @@ /** * @unrestricted */ -WebInspector.AXRelatedNodeElement = class { +Accessibility.AXRelatedNodeElement = class { /** - * @param {{deferredNode: (!WebInspector.DeferredDOMNode|undefined), idref: (string|undefined)}} node + * @param {{deferredNode: (!SDK.DeferredDOMNode|undefined), idref: (string|undefined)}} node * @param {!Protocol.Accessibility.AXRelatedNode=} value */ constructor(node, value) { @@ -535,11 +535,11 @@ var valueElement; /** - * @param {?WebInspector.DOMNode} node - * @this {!WebInspector.AXRelatedNodeElement} + * @param {?SDK.DOMNode} node + * @this {!Accessibility.AXRelatedNodeElement} */ function onNodeResolved(node) { - valueElement.appendChild(WebInspector.DOMPresentationUtils.linkifyNodeReference(node, this._idref)); + valueElement.appendChild(Components.DOMPresentationUtils.linkifyNodeReference(node, this._idref)); } if (this._deferredNode) { @@ -549,7 +549,7 @@ } else if (this._idref) { element.classList.add('invalid'); valueElement = - WebInspector.AXNodePropertyTreeElement.createExclamationMark(WebInspector.UIString('No node with this ID.')); + Accessibility.AXNodePropertyTreeElement.createExclamationMark(Common.UIString('No node with this ID.')); valueElement.createTextChild(this._idref); element.appendChild(valueElement); } @@ -561,10 +561,10 @@ /** * @unrestricted */ -WebInspector.AXNodeIgnoredReasonTreeElement = class extends WebInspector.AXNodePropertyTreeElement { +Accessibility.AXNodeIgnoredReasonTreeElement = class extends Accessibility.AXNodePropertyTreeElement { /** * @param {!Protocol.Accessibility.AXProperty} property - * @param {!WebInspector.AccessibilityNode} axNode + * @param {!Accessibility.AccessibilityNode} axNode */ constructor(property, axNode) { super(axNode); @@ -576,67 +576,67 @@ /** * @param {?string} reason - * @param {?WebInspector.AccessibilityNode} axNode + * @param {?Accessibility.AccessibilityNode} axNode * @return {?Element} */ static createReasonElement(reason, axNode) { var reasonElement = null; switch (reason) { case 'activeModalDialog': - reasonElement = WebInspector.formatLocalized('Element is hidden by active modal dialog:\u00a0', []); + reasonElement = UI.formatLocalized('Element is hidden by active modal dialog:\u00a0', []); break; case 'ancestorDisallowsChild': - reasonElement = WebInspector.formatLocalized('Element is not permitted as child of ', []); + reasonElement = UI.formatLocalized('Element is not permitted as child of ', []); break; // http://www.w3.org/TR/wai-aria/roles#childrenArePresentational case 'ancestorIsLeafNode': - reasonElement = WebInspector.formatLocalized('Ancestor\'s children are all presentational:\u00a0', []); + reasonElement = UI.formatLocalized('Ancestor\'s children are all presentational:\u00a0', []); break; case 'ariaHidden': var ariaHiddenSpan = createElement('span', 'source-code').textContent = 'aria-hidden'; - reasonElement = WebInspector.formatLocalized('Element is %s.', [ariaHiddenSpan]); + reasonElement = UI.formatLocalized('Element is %s.', [ariaHiddenSpan]); break; case 'ariaHiddenRoot': var ariaHiddenSpan = createElement('span', 'source-code').textContent = 'aria-hidden'; var trueSpan = createElement('span', 'source-code').textContent = 'true'; - reasonElement = WebInspector.formatLocalized('%s is %s on ancestor:\u00a0', [ariaHiddenSpan, trueSpan]); + reasonElement = UI.formatLocalized('%s is %s on ancestor:\u00a0', [ariaHiddenSpan, trueSpan]); break; case 'emptyAlt': - reasonElement = WebInspector.formatLocalized('Element has empty alt text.', []); + reasonElement = UI.formatLocalized('Element has empty alt text.', []); break; case 'emptyText': - reasonElement = WebInspector.formatLocalized('No text content.', []); + reasonElement = UI.formatLocalized('No text content.', []); break; case 'inert': - reasonElement = WebInspector.formatLocalized('Element is inert.', []); + reasonElement = UI.formatLocalized('Element is inert.', []); break; case 'inheritsPresentation': - reasonElement = WebInspector.formatLocalized('Element inherits presentational role from\u00a0', []); + reasonElement = UI.formatLocalized('Element inherits presentational role from\u00a0', []); break; case 'labelContainer': - reasonElement = WebInspector.formatLocalized('Part of label element:\u00a0', []); + reasonElement = UI.formatLocalized('Part of label element:\u00a0', []); break; case 'labelFor': - reasonElement = WebInspector.formatLocalized('Label for\u00a0', []); + reasonElement = UI.formatLocalized('Label for\u00a0', []); break; case 'notRendered': - reasonElement = WebInspector.formatLocalized('Element is not rendered.', []); + reasonElement = UI.formatLocalized('Element is not rendered.', []); break; case 'notVisible': - reasonElement = WebInspector.formatLocalized('Element is not visible.', []); + reasonElement = UI.formatLocalized('Element is not visible.', []); break; case 'presentationalRole': var rolePresentationSpan = createElement('span', 'source-code').textContent = 'role=' + axNode.role().value; - reasonElement = WebInspector.formatLocalized('Element has %s.', [rolePresentationSpan]); + reasonElement = UI.formatLocalized('Element has %s.', [rolePresentationSpan]); break; case 'probablyPresentational': - reasonElement = WebInspector.formatLocalized('Element is presentational.', []); + reasonElement = UI.formatLocalized('Element is presentational.', []); break; case 'staticTextUsedAsNameFor': - reasonElement = WebInspector.formatLocalized('Static text node is used as name for\u00a0', []); + reasonElement = UI.formatLocalized('Static text node is used as name for\u00a0', []); break; case 'uninteresting': - reasonElement = WebInspector.formatLocalized('Element not interesting for accessibility.', []); + reasonElement = UI.formatLocalized('Element not interesting for accessibility.', []); break; } if (reasonElement) @@ -651,7 +651,7 @@ this.listItemElement.removeChildren(); this._reasonElement = - WebInspector.AXNodeIgnoredReasonTreeElement.createReasonElement(this._property.name, this._axNode); + Accessibility.AXNodeIgnoredReasonTreeElement.createReasonElement(this._property.name, this._axNode); this.listItemElement.appendChild(this._reasonElement); var value = this._property.value;
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js index 974719b0..4cb9cedb 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilitySidebarView.js
@@ -4,32 +4,32 @@ /** * @unrestricted */ -WebInspector.AccessibilitySidebarView = class extends WebInspector.ThrottledWidget { +Accessibility.AccessibilitySidebarView = class extends UI.ThrottledWidget { constructor() { super(); this._node = null; this._axNode = null; - this._sidebarPaneStack = WebInspector.viewManager.createStackLocation(); - this._treeSubPane = new WebInspector.AXTreePane(); + this._sidebarPaneStack = UI.viewManager.createStackLocation(); + this._treeSubPane = new Accessibility.AXTreePane(); this._sidebarPaneStack.showView(this._treeSubPane); - this._ariaSubPane = new WebInspector.ARIAAttributesPane(); + this._ariaSubPane = new Accessibility.ARIAAttributesPane(); this._sidebarPaneStack.showView(this._ariaSubPane); - this._axNodeSubPane = new WebInspector.AXNodeSubPane(); + this._axNodeSubPane = new Accessibility.AXNodeSubPane(); this._sidebarPaneStack.showView(this._axNodeSubPane); this._sidebarPaneStack.widget().show(this.element); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._pullNode, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._pullNode, this); this._pullNode(); } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._node; } /** - * @param {?WebInspector.AccessibilityNode} axNode + * @param {?Accessibility.AccessibilityNode} axNode */ accessibilityNodeCallback(axNode) { if (!axNode) @@ -60,7 +60,7 @@ this._ariaSubPane.setNode(node); if (!node) return Promise.resolve(); - var accessibilityModel = WebInspector.AccessibilityModel.fromTarget(node.target()); + var accessibilityModel = Accessibility.AccessibilityModel.fromTarget(node.target()); accessibilityModel.clear(); return accessibilityModel.requestPartialAXTree(node) .then(() => { @@ -78,37 +78,37 @@ this._axNodeSubPane.setNode(this.node()); this._ariaSubPane.setNode(this.node()); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrModified, this._onAttrChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrModified, this._onAttrChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrRemoved, this._onAttrChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); } /** * @override */ willHide() { - WebInspector.targetManager.removeModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrModified, this._onAttrChange, this); - WebInspector.targetManager.removeModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); - WebInspector.targetManager.removeModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); - WebInspector.targetManager.removeModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); + SDK.targetManager.removeModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrModified, this._onAttrChange, this); + SDK.targetManager.removeModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrRemoved, this._onAttrChange, this); + SDK.targetManager.removeModelListener( + SDK.DOMModel, SDK.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); + SDK.targetManager.removeModelListener( + SDK.DOMModel, SDK.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); } _pullNode() { - this._node = WebInspector.context.flavor(WebInspector.DOMNode); + this._node = UI.context.flavor(SDK.DOMNode); this.update(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onAttrChange(event) { if (!this.node()) @@ -120,7 +120,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onNodeChange(event) { if (!this.node()) @@ -135,7 +135,7 @@ /** * @unrestricted */ -WebInspector.AccessibilitySubPane = class extends WebInspector.SimpleView { +Accessibility.AccessibilitySubPane = class extends UI.SimpleView { /** * @param {string} name */ @@ -147,21 +147,21 @@ } /** - * @param {?WebInspector.AccessibilityNode} axNode + * @param {?Accessibility.AccessibilityNode} axNode * @protected */ setAXNode(axNode) { } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._node; } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ setNode(node) { this._node = node;
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityStrings.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityStrings.js index 299553dd..50d31b2 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityStrings.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AccessibilityStrings.js
@@ -1,9 +1,9 @@ // Copyright 2015 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. -WebInspector.AccessibilityStrings = {}; +Accessibility.AccessibilityStrings = {}; -WebInspector.AccessibilityStrings.AXAttributes = { +Accessibility.AccessibilityStrings.AXAttributes = { 'disabled': { name: 'Disabled', description: 'If true, this element currently cannot be interacted with.', @@ -162,7 +162,7 @@ 'description': {name: 'Description', description: 'The accessible description for this element.', group: 'Default'} }; -WebInspector.AccessibilityStrings.AXSourceTypes = { +Accessibility.AccessibilityStrings.AXSourceTypes = { 'attribute': {name: 'From attribute', description: 'Value from attribute.'}, 'implicit': { name: 'Implicit', @@ -174,7 +174,7 @@ 'relatedElement': {name: 'Related element', description: 'Value from related element.'} }; -WebInspector.AccessibilityStrings.AXNativeSourceTypes = { +Accessibility.AccessibilityStrings.AXNativeSourceTypes = { 'figcaption': {name: 'From caption', description: 'Value from figcaption element.'}, 'label': {name: 'From label', description: 'Value from label element.'}, 'labelfor': {name: 'From label (for)', description: 'Value from label element with for= attribute.'},
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/module.json b/third_party/WebKit/Source/devtools/front_end/accessibility/module.json index ef0fc6e..06fe6f9 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/module.json +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/module.json
@@ -7,7 +7,7 @@ "title": "Accessibility", "order": 10, "persistence": "permanent", - "className": "WebInspector.AccessibilitySidebarView" + "className": "Accessibility.AccessibilitySidebarView" } ], "dependencies": ["elements"],
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationGroupPreviewUI.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationGroupPreviewUI.js index 424ccbe..d5c4fa8b 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationGroupPreviewUI.js +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationGroupPreviewUI.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.AnimationGroupPreviewUI = class { +Animation.AnimationGroupPreviewUI = class { /** - * @param {!WebInspector.AnimationModel.AnimationGroup} model + * @param {!Animation.AnimationModel.AnimationGroup} model */ constructor(model) { this._model = model; @@ -67,7 +67,7 @@ var y = Math.floor(this._viewBoxHeight / Math.max(6, numberOfAnimations) * i + 1); line.setAttribute('y1', y); line.setAttribute('y2', y); - line.style.stroke = WebInspector.AnimationUI.Color(this._model.animations()[i]); + line.style.stroke = Animation.AnimationUI.Color(this._model.animations()[i]); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js index 385efb1..b69a705e 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
@@ -5,45 +5,45 @@ /** * @unrestricted */ -WebInspector.AnimationModel = class extends WebInspector.SDKModel { +Animation.AnimationModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.AnimationModel, target); + super(Animation.AnimationModel, target); this._agent = target.animationAgent(); - target.registerAnimationDispatcher(new WebInspector.AnimationDispatcher(this)); - /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */ + target.registerAnimationDispatcher(new Animation.AnimationDispatcher(this)); + /** @type {!Map.<string, !Animation.AnimationModel.Animation>} */ this._animationsById = new Map(); - /** @type {!Map.<string, !WebInspector.AnimationModel.AnimationGroup>} */ + /** @type {!Map.<string, !Animation.AnimationModel.AnimationGroup>} */ this._animationGroups = new Map(); /** @type {!Array.<string>} */ this._pendingAnimations = []; this._playbackRate = 1; var resourceTreeModel = - /** @type {!WebInspector.ResourceTreeModel} */ (WebInspector.ResourceTreeModel.fromTarget(target)); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._reset, this); - this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(target, this, resourceTreeModel); + /** @type {!SDK.ResourceTreeModel} */ (SDK.ResourceTreeModel.fromTarget(target)); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.MainFrameNavigated, this._reset, this); + this._screenshotCapture = new Animation.AnimationModel.ScreenshotCapture(target, this, resourceTreeModel); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.AnimationModel} + * @param {!SDK.Target} target + * @return {?Animation.AnimationModel} */ static fromTarget(target) { if (!target.hasDOMCapability()) return null; - if (!target[WebInspector.AnimationModel._symbol]) - target[WebInspector.AnimationModel._symbol] = new WebInspector.AnimationModel(target); + if (!target[Animation.AnimationModel._symbol]) + target[Animation.AnimationModel._symbol] = new Animation.AnimationModel(target); - return target[WebInspector.AnimationModel._symbol]; + return target[Animation.AnimationModel._symbol]; } _reset() { this._animationsById.clear(); this._animationGroups.clear(); this._pendingAnimations = []; - this.dispatchEventToListeners(WebInspector.AnimationModel.Events.ModelReset); + this.dispatchEventToListeners(Animation.AnimationModel.Events.ModelReset); } /** @@ -65,7 +65,7 @@ * @param {!Protocol.Animation.Animation} payload */ animationStarted(payload) { - var animation = WebInspector.AnimationModel.Animation.parsePayload(this.target(), payload); + var animation = Animation.AnimationModel.Animation.parsePayload(this.target(), payload); // Ignore Web Animations custom effects & groups. if (animation.type() === 'WebAnimation' && animation.source().keyframesRule().keyframes().length === 0) { @@ -90,7 +90,7 @@ } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} incomingGroup + * @param {!Animation.AnimationModel.AnimationGroup} incomingGroup * @return {boolean} */ _matchExistingGroups(incomingGroup) { @@ -108,12 +108,12 @@ this._screenshotCapture.captureScreenshots(incomingGroup.finiteDuration(), incomingGroup._screenshots); } this.dispatchEventToListeners( - WebInspector.AnimationModel.Events.AnimationGroupStarted, matchedGroup || incomingGroup); + Animation.AnimationModel.Events.AnimationGroupStarted, matchedGroup || incomingGroup); return !!matchedGroup; } /** - * @return {!WebInspector.AnimationModel.AnimationGroup} + * @return {!Animation.AnimationModel.AnimationGroup} */ _createGroupFromPendingAnimations() { console.assert(this._pendingAnimations.length); @@ -127,7 +127,7 @@ remainingAnimations.push(id); } this._pendingAnimations = remainingAnimations; - return new WebInspector.AnimationModel.AnimationGroup(this, groupedAnimations[0].id(), groupedAnimations); + return new Animation.AnimationModel.AnimationGroup(this, groupedAnimations[0].id(), groupedAnimations); } /** @@ -138,7 +138,7 @@ * @param {?Protocol.Error} error * @param {number} playbackRate * @return {number} - * @this {!WebInspector.AnimationModel} + * @this {!Animation.AnimationModel} */ function callback(error, playbackRate) { if (error) @@ -193,35 +193,35 @@ }; /** @enum {symbol} */ -WebInspector.AnimationModel.Events = { +Animation.AnimationModel.Events = { AnimationGroupStarted: Symbol('AnimationGroupStarted'), ModelReset: Symbol('ModelReset') }; -WebInspector.AnimationModel._symbol = Symbol('AnimationModel'); +Animation.AnimationModel._symbol = Symbol('AnimationModel'); /** * @unrestricted */ -WebInspector.AnimationModel.Animation = class extends WebInspector.SDKObject { +Animation.AnimationModel.Animation = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Animation.Animation} payload */ constructor(target, payload) { super(target); this._payload = payload; - this._source = new WebInspector.AnimationModel.AnimationEffect(this.target(), this._payload.source); + this._source = new Animation.AnimationModel.AnimationEffect(this.target(), this._payload.source); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Animation.Animation} payload - * @return {!WebInspector.AnimationModel.Animation} + * @return {!Animation.AnimationModel.Animation} */ static parsePayload(target, payload) { - return new WebInspector.AnimationModel.Animation(target, payload); + return new Animation.AnimationModel.Animation(target, payload); } /** @@ -306,21 +306,21 @@ } /** - * @return {!WebInspector.AnimationModel.AnimationEffect} + * @return {!Animation.AnimationModel.AnimationEffect} */ source() { return this._source; } /** - * @return {!WebInspector.AnimationModel.Animation.Type} + * @return {!Animation.AnimationModel.Animation.Type} */ type() { - return /** @type {!WebInspector.AnimationModel.Animation.Type} */ (this._payload.type); + return /** @type {!Animation.AnimationModel.Animation.Type} */ (this._payload.type); } /** - * @param {!WebInspector.AnimationModel.Animation} animation + * @param {!Animation.AnimationModel.Animation} animation * @return {boolean} */ overlaps(animation) { @@ -347,18 +347,18 @@ /** * @param {number} duration * @param {number} delay - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _updateNodeStyle(duration, delay, node) { var animationPrefix; - if (this.type() === WebInspector.AnimationModel.Animation.Type.CSSTransition) + if (this.type() === Animation.AnimationModel.Animation.Type.CSSTransition) animationPrefix = 'transition-'; - else if (this.type() === WebInspector.AnimationModel.Animation.Type.CSSAnimation) + else if (this.type() === Animation.AnimationModel.Animation.Type.CSSAnimation) animationPrefix = 'animation-'; else return; - var cssModel = WebInspector.CSSModel.fromTarget(node.target()); + var cssModel = SDK.CSSModel.fromTarget(node.target()); if (!cssModel) return; cssModel.setEffectivePropertyValueForNode(node.id, animationPrefix + 'duration', duration + 'ms'); @@ -366,14 +366,14 @@ } /** - * @return {!Promise.<?WebInspector.RemoteObject>} + * @return {!Promise.<?SDK.RemoteObject>} */ remoteObjectPromise() { /** * @param {?Protocol.Error} error * @param {!Protocol.Runtime.RemoteObject} payload - * @return {?WebInspector.RemoteObject} - * @this {!WebInspector.AnimationModel.Animation} + * @return {?SDK.RemoteObject} + * @this {!Animation.AnimationModel.Animation} */ function callback(error, payload) { return !error ? this.target().runtimeModel.createRemoteObject(payload) : null; @@ -392,7 +392,7 @@ /** @enum {string} */ -WebInspector.AnimationModel.Animation.Type = { +Animation.AnimationModel.Animation.Type = { CSSTransition: 'CSSTransition', CSSAnimation: 'CSSAnimation', WebAnimation: 'WebAnimation' @@ -401,16 +401,16 @@ /** * @unrestricted */ -WebInspector.AnimationModel.AnimationEffect = class extends WebInspector.SDKObject { +Animation.AnimationModel.AnimationEffect = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Animation.AnimationEffect} payload */ constructor(target, payload) { super(target); this._payload = payload; if (payload.keyframesRule) - this._keyframesRule = new WebInspector.AnimationModel.KeyframesRule(target, payload.keyframesRule); + this._keyframesRule = new Animation.AnimationModel.KeyframesRule(target, payload.keyframesRule); this._delay = this._payload.delay; this._duration = this._payload.duration; } @@ -468,19 +468,19 @@ } /** - * @return {!Promise.<!WebInspector.DOMNode>} + * @return {!Promise.<!SDK.DOMNode>} */ node() { if (!this._deferredNode) - this._deferredNode = new WebInspector.DeferredDOMNode(this.target(), this.backendNodeId()); + this._deferredNode = new SDK.DeferredDOMNode(this.target(), this.backendNodeId()); return this._deferredNode.resolvePromise(); } /** - * @return {!WebInspector.DeferredDOMNode} + * @return {!SDK.DeferredDOMNode} */ deferredNode() { - return new WebInspector.DeferredDOMNode(this.target(), this.backendNodeId()); + return new SDK.DeferredDOMNode(this.target(), this.backendNodeId()); } /** @@ -491,7 +491,7 @@ } /** - * @return {?WebInspector.AnimationModel.KeyframesRule} + * @return {?Animation.AnimationModel.KeyframesRule} */ keyframesRule() { return this._keyframesRule; @@ -508,16 +508,16 @@ /** * @unrestricted */ -WebInspector.AnimationModel.KeyframesRule = class extends WebInspector.SDKObject { +Animation.AnimationModel.KeyframesRule = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Animation.KeyframesRule} payload */ constructor(target, payload) { super(target); this._payload = payload; this._keyframes = this._payload.keyframes.map(function(keyframeStyle) { - return new WebInspector.AnimationModel.KeyframeStyle(target, keyframeStyle); + return new Animation.AnimationModel.KeyframeStyle(target, keyframeStyle); }); } @@ -526,7 +526,7 @@ */ _setKeyframesPayload(payload) { this._keyframes = payload.map(function(keyframeStyle) { - return new WebInspector.AnimationModel.KeyframeStyle(this._target, keyframeStyle); + return new Animation.AnimationModel.KeyframeStyle(this._target, keyframeStyle); }); } @@ -538,7 +538,7 @@ } /** - * @return {!Array.<!WebInspector.AnimationModel.KeyframeStyle>} + * @return {!Array.<!Animation.AnimationModel.KeyframeStyle>} */ keyframes() { return this._keyframes; @@ -548,9 +548,9 @@ /** * @unrestricted */ -WebInspector.AnimationModel.KeyframeStyle = class extends WebInspector.SDKObject { +Animation.AnimationModel.KeyframeStyle = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Animation.KeyframeStyle} payload */ constructor(target, payload) { @@ -591,11 +591,11 @@ /** * @unrestricted */ -WebInspector.AnimationModel.AnimationGroup = class extends WebInspector.SDKObject { +Animation.AnimationModel.AnimationGroup = class extends SDK.SDKObject { /** - * @param {!WebInspector.AnimationModel} model + * @param {!Animation.AnimationModel} model * @param {string} id - * @param {!Array.<!WebInspector.AnimationModel.Animation>} animations + * @param {!Array.<!Animation.AnimationModel.Animation>} animations */ constructor(model, id, animations) { super(model.target()); @@ -615,7 +615,7 @@ } /** - * @return {!Array.<!WebInspector.AnimationModel.Animation>} + * @return {!Array.<!Animation.AnimationModel.Animation>} */ animations() { return this._animations; @@ -631,7 +631,7 @@ */ _animationIds() { /** - * @param {!WebInspector.AnimationModel.Animation} animation + * @param {!Animation.AnimationModel.Animation} animation * @return {string} */ function extractId(animation) { @@ -704,16 +704,16 @@ } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} group + * @param {!Animation.AnimationModel.AnimationGroup} group * @return {boolean} */ _matches(group) { /** - * @param {!WebInspector.AnimationModel.Animation} anim + * @param {!Animation.AnimationModel.Animation} anim * @return {string} */ function extractId(anim) { - if (anim.type() === WebInspector.AnimationModel.Animation.Type.WebAnimation) + if (anim.type() === Animation.AnimationModel.Animation.Type.WebAnimation) return anim.type() + anim.id(); else return anim._cssId(); @@ -731,7 +731,7 @@ } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} group + * @param {!Animation.AnimationModel.AnimationGroup} group */ _update(group) { this._model._releaseAnimations(this._animationIds()); @@ -756,7 +756,7 @@ * @implements {Protocol.AnimationDispatcher} * @unrestricted */ -WebInspector.AnimationDispatcher = class { +Animation.AnimationDispatcher = class { constructor(animationModel) { this._animationModel = animationModel; } @@ -789,20 +789,20 @@ /** * @unrestricted */ -WebInspector.AnimationModel.ScreenshotCapture = class { +Animation.AnimationModel.ScreenshotCapture = class { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.AnimationModel} model - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.Target} target + * @param {!Animation.AnimationModel} model + * @param {!SDK.ResourceTreeModel} resourceTreeModel */ constructor(target, model, resourceTreeModel) { this._target = target; - /** @type {!Array<!WebInspector.AnimationModel.ScreenshotCapture.Request>} */ + /** @type {!Array<!Animation.AnimationModel.ScreenshotCapture.Request>} */ this._requests = []; resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.ScreencastFrame, this._screencastFrame, this); + SDK.ResourceTreeModel.Events.ScreencastFrame, this._screencastFrame, this); this._model = model; - this._model.addEventListener(WebInspector.AnimationModel.Events.ModelReset, this._stopScreencast, this); + this._model.addEventListener(Animation.AnimationModel.Events.ModelReset, this._stopScreencast, this); } /** @@ -827,11 +827,11 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _screencastFrame(event) { /** - * @param {!WebInspector.AnimationModel.ScreenshotCapture.Request} request + * @param {!Animation.AnimationModel.ScreenshotCapture.Request} request * @return {boolean} */ function isAnimating(request) { @@ -861,4 +861,4 @@ }; /** @typedef {{ endTime: number, screenshots: !Array.<string>}} */ -WebInspector.AnimationModel.ScreenshotCapture.Request; +Animation.AnimationModel.ScreenshotCapture.Request;
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationScreenshotPopover.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationScreenshotPopover.js index 2ec9630..1205c27 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationScreenshotPopover.js +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationScreenshotPopover.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.AnimationScreenshotPopover = class extends WebInspector.VBox { +Animation.AnimationScreenshotPopover = class extends UI.VBox { /** * @param {!Array.<!Image>} images */
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js index 1d097be..a884d37 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.AnimationTimeline = class extends WebInspector.VBox { +Animation.AnimationTimeline = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('animation/animationTimeline.css'); @@ -18,31 +18,31 @@ this._createHeader(); this._animationsContainer = this.contentElement.createChild('div', 'animation-timeline-rows'); var timelineHint = this.contentElement.createChild('div', 'animation-timeline-rows-hint'); - timelineHint.textContent = WebInspector.UIString('Select an effect above to inspect and modify.'); + timelineHint.textContent = Common.UIString('Select an effect above to inspect and modify.'); /** @const */ this._defaultDuration = 100; this._duration = this._defaultDuration; /** @const */ this._timelineControlsWidth = 150; - /** @type {!Map.<!Protocol.DOM.BackendNodeId, !WebInspector.AnimationTimeline.NodeUI>} */ + /** @type {!Map.<!Protocol.DOM.BackendNodeId, !Animation.AnimationTimeline.NodeUI>} */ this._nodesMap = new Map(); this._uiAnimations = []; this._groupBuffer = []; - /** @type {!Map.<!WebInspector.AnimationModel.AnimationGroup, !WebInspector.AnimationGroupPreviewUI>} */ + /** @type {!Map.<!Animation.AnimationModel.AnimationGroup, !Animation.AnimationGroupPreviewUI>} */ this._previewMap = new Map(); this._symbol = Symbol('animationTimeline'); - /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */ + /** @type {!Map.<string, !Animation.AnimationModel.Animation>} */ this._animationsMap = new Map(); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.DOM); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nodeChanged, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.DOM); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._nodeChanged, this); } /** * @override */ wasShown() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) this._addEventListeners(target); } @@ -50,14 +50,14 @@ * @override */ willHide() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) this._removeEventListeners(target); this._popoverHelper.hidePopover(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this.isShowing()) @@ -66,31 +66,31 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._removeEventListeners(target); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _addEventListeners(target) { - var animationModel = WebInspector.AnimationModel.fromTarget(target); + var animationModel = Animation.AnimationModel.fromTarget(target); animationModel.ensureEnabled(); animationModel.addEventListener( - WebInspector.AnimationModel.Events.AnimationGroupStarted, this._animationGroupStarted, this); - animationModel.addEventListener(WebInspector.AnimationModel.Events.ModelReset, this._reset, this); + Animation.AnimationModel.Events.AnimationGroupStarted, this._animationGroupStarted, this); + animationModel.addEventListener(Animation.AnimationModel.Events.ModelReset, this._reset, this); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _removeEventListeners(target) { - var animationModel = WebInspector.AnimationModel.fromTarget(target); + var animationModel = Animation.AnimationModel.fromTarget(target); animationModel.removeEventListener( - WebInspector.AnimationModel.Events.AnimationGroupStarted, this._animationGroupStarted, this); - animationModel.removeEventListener(WebInspector.AnimationModel.Events.ModelReset, this._reset, this); + Animation.AnimationModel.Events.AnimationGroupStarted, this._animationGroupStarted, this); + animationModel.removeEventListener(Animation.AnimationModel.Events.ModelReset, this._reset, this); } _nodeChanged() { @@ -111,54 +111,54 @@ _createHeader() { var toolbarContainer = this.contentElement.createChild('div', 'animation-timeline-toolbar-container'); - var topToolbar = new WebInspector.Toolbar('animation-timeline-toolbar', toolbarContainer); - var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString('Clear all'), 'largeicon-clear'); + var topToolbar = new UI.Toolbar('animation-timeline-toolbar', toolbarContainer); + var clearButton = new UI.ToolbarButton(Common.UIString('Clear all'), 'largeicon-clear'); clearButton.addEventListener('click', this._reset.bind(this)); topToolbar.appendToolbarItem(clearButton); topToolbar.appendSeparator(); - this._pauseButton = new WebInspector.ToolbarToggle(WebInspector.UIString('Pause all'), 'largeicon-pause', 'largeicon-resume'); + this._pauseButton = new UI.ToolbarToggle(Common.UIString('Pause all'), 'largeicon-pause', 'largeicon-resume'); this._pauseButton.addEventListener('click', this._togglePauseAll.bind(this)); topToolbar.appendToolbarItem(this._pauseButton); var playbackRateControl = toolbarContainer.createChild('div', 'animation-playback-rate-control'); this._playbackRateButtons = []; - for (var playbackRate of WebInspector.AnimationTimeline.GlobalPlaybackRates) { + for (var playbackRate of Animation.AnimationTimeline.GlobalPlaybackRates) { var button = playbackRateControl.createChild('div', 'animation-playback-rate-button'); button.textContent = - playbackRate ? WebInspector.UIString(playbackRate * 100 + '%') : WebInspector.UIString('Pause'); + playbackRate ? Common.UIString(playbackRate * 100 + '%') : Common.UIString('Pause'); button.playbackRate = playbackRate; button.addEventListener('click', this._setPlaybackRate.bind(this, playbackRate)); - button.title = WebInspector.UIString('Set speed to ') + button.textContent; + button.title = Common.UIString('Set speed to ') + button.textContent; this._playbackRateButtons.push(button); } this._updatePlaybackControls(); this._previewContainer = this.contentElement.createChild('div', 'animation-timeline-buffer'); - this._popoverHelper = new WebInspector.PopoverHelper(this._previewContainer, true); + this._popoverHelper = new UI.PopoverHelper(this._previewContainer, true); this._popoverHelper.initializeCallbacks( this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.bind(this)); this._popoverHelper.setTimeout(0); var emptyBufferHint = this.contentElement.createChild('div', 'animation-timeline-buffer-hint'); - emptyBufferHint.textContent = WebInspector.UIString('Listening for animations...'); + emptyBufferHint.textContent = Common.UIString('Listening for animations...'); var container = this.contentElement.createChild('div', 'animation-timeline-header'); var controls = container.createChild('div', 'animation-controls'); this._currentTime = controls.createChild('div', 'animation-timeline-current-time monospace'); - var toolbar = new WebInspector.Toolbar('animation-controls-toolbar', controls); + var toolbar = new UI.Toolbar('animation-controls-toolbar', controls); this._controlButton = - new WebInspector.ToolbarToggle(WebInspector.UIString('Replay timeline'), 'largeicon-replay-animation'); - this._controlState = WebInspector.AnimationTimeline._ControlState.Replay; + new UI.ToolbarToggle(Common.UIString('Replay timeline'), 'largeicon-replay-animation'); + this._controlState = Animation.AnimationTimeline._ControlState.Replay; this._controlButton.setToggled(true); this._controlButton.addEventListener('click', this._controlButtonToggle.bind(this)); toolbar.appendToolbarItem(this._controlButton); var gridHeader = container.createChild('div', 'animation-grid-header'); - WebInspector.installDragHandle( + UI.installDragHandle( gridHeader, this._repositionScrubber.bind(this), this._scrubberDragMove.bind(this), this._scrubberDragEnd.bind(this), 'text'); container.appendChild(this._createScrubber()); - WebInspector.installDragHandle( + UI.installDragHandle( this._timelineScrubberLine, this._scrubberDragStart.bind(this), this._scrubberDragMove.bind(this), this._scrubberDragEnd.bind(this), 'col-resize'); this._currentTime.textContent = ''; @@ -178,7 +178,7 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { var animGroup; @@ -200,7 +200,7 @@ * @param {!Array.<!Image>} screenshots */ function onFirstScreenshotLoaded(screenshots) { - var content = new WebInspector.AnimationScreenshotPopover(screenshots); + var content = new Animation.AnimationScreenshotPopover(screenshots); popover.setNoPadding(true); popover.showView(content, anchor); } @@ -214,7 +214,7 @@ this._pauseButton.setToggled(this._allPaused); this._setPlaybackRate(this._playbackRate); this._pauseButton.setTitle( - this._allPaused ? WebInspector.UIString('Resume all') : WebInspector.UIString('Pause all')); + this._allPaused ? Common.UIString('Resume all') : Common.UIString('Pause all')); } /** @@ -222,10 +222,10 @@ */ _setPlaybackRate(playbackRate) { this._playbackRate = playbackRate; - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); if (target) - WebInspector.AnimationModel.fromTarget(target).setPlaybackRate(this._allPaused ? 0 : this._playbackRate); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.AnimationsPlaybackRateChanged); + Animation.AnimationModel.fromTarget(target).setPlaybackRate(this._allPaused ? 0 : this._playbackRate); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.AnimationsPlaybackRateChanged); if (this._scrubberPlayer) this._scrubberPlayer.playbackRate = this._effectivePlaybackRate(); @@ -240,9 +240,9 @@ } _controlButtonToggle() { - if (this._controlState === WebInspector.AnimationTimeline._ControlState.Play) + if (this._controlState === Animation.AnimationTimeline._ControlState.Play) this._togglePause(false); - else if (this._controlState === WebInspector.AnimationTimeline._ControlState.Replay) + else if (this._controlState === Animation.AnimationTimeline._ControlState.Replay) this._replay(); else this._togglePause(true); @@ -251,19 +251,19 @@ _updateControlButton() { this._controlButton.setEnabled(!!this._selectedGroup); if (this._selectedGroup && this._selectedGroup.paused()) { - this._controlState = WebInspector.AnimationTimeline._ControlState.Play; + this._controlState = Animation.AnimationTimeline._ControlState.Play; this._controlButton.setToggled(true); - this._controlButton.setTitle(WebInspector.UIString('Play timeline')); + this._controlButton.setTitle(Common.UIString('Play timeline')); this._controlButton.setGlyph('largeicon-play-animation'); } else if (!this._scrubberPlayer || this._scrubberPlayer.currentTime >= this.duration()) { - this._controlState = WebInspector.AnimationTimeline._ControlState.Replay; + this._controlState = Animation.AnimationTimeline._ControlState.Replay; this._controlButton.setToggled(true); - this._controlButton.setTitle(WebInspector.UIString('Replay timeline')); + this._controlButton.setTitle(Common.UIString('Replay timeline')); this._controlButton.setGlyph('largeicon-replay-animation'); } else { - this._controlState = WebInspector.AnimationTimeline._ControlState.Pause; + this._controlState = Animation.AnimationTimeline._ControlState.Pause; this._controlButton.setToggled(false); - this._controlButton.setTitle(WebInspector.UIString('Pause timeline')); + this._controlButton.setTitle(Common.UIString('Pause timeline')); this._controlButton.setGlyph('largeicon-pause-animation'); } } @@ -342,19 +342,19 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _animationGroupStarted(event) { - this._addAnimationGroup(/** @type {!WebInspector.AnimationModel.AnimationGroup} */ (event.data)); + this._addAnimationGroup(/** @type {!Animation.AnimationModel.AnimationGroup} */ (event.data)); } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} group + * @param {!Animation.AnimationModel.AnimationGroup} group */ _addAnimationGroup(group) { /** - * @param {!WebInspector.AnimationModel.AnimationGroup} left - * @param {!WebInspector.AnimationModel.AnimationGroup} right + * @param {!Animation.AnimationModel.AnimationGroup} left + * @param {!Animation.AnimationModel.AnimationGroup} right */ function startTimeComparator(left, right) { return left.startTime() > right.startTime(); @@ -381,7 +381,7 @@ g.release(); } // Generate preview - var preview = new WebInspector.AnimationGroupPreviewUI(group); + var preview = new Animation.AnimationGroupPreviewUI(group); this._groupBuffer.push(group); this._previewMap.set(group, preview); this._previewContainer.appendChild(preview.element); @@ -390,7 +390,7 @@ } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} group + * @param {!Animation.AnimationModel.AnimationGroup} group * @param {!Event} event */ _removeAnimationGroup(group, event) { @@ -407,13 +407,13 @@ } /** - * @param {!WebInspector.AnimationModel.AnimationGroup} group + * @param {!Animation.AnimationModel.AnimationGroup} group */ _selectAnimationGroup(group) { /** - * @param {!WebInspector.AnimationGroupPreviewUI} ui - * @param {!WebInspector.AnimationModel.AnimationGroup} group - * @this {!WebInspector.AnimationTimeline} + * @param {!Animation.AnimationGroupPreviewUI} ui + * @param {!Animation.AnimationModel.AnimationGroup} group + * @this {!Animation.AnimationTimeline} */ function applySelectionClass(ui, group) { ui.element.classList.toggle('selected', this._selectedGroup === group); @@ -437,12 +437,12 @@ } /** - * @param {!WebInspector.AnimationModel.Animation} animation + * @param {!Animation.AnimationModel.Animation} animation */ _addAnimation(animation) { /** - * @param {?WebInspector.DOMNode} node - * @this {WebInspector.AnimationTimeline} + * @param {?SDK.DOMNode} node + * @this {Animation.AnimationTimeline} */ function nodeResolved(node) { nodeUI.nodeResolved(node); @@ -453,19 +453,19 @@ var nodeUI = this._nodesMap.get(animation.source().backendNodeId()); if (!nodeUI) { - nodeUI = new WebInspector.AnimationTimeline.NodeUI(animation.source()); + nodeUI = new Animation.AnimationTimeline.NodeUI(animation.source()); this._animationsContainer.appendChild(nodeUI.element); this._nodesMap.set(animation.source().backendNodeId(), nodeUI); } var nodeRow = nodeUI.createNewRow(); - var uiAnimation = new WebInspector.AnimationUI(animation, this, nodeRow); + var uiAnimation = new Animation.AnimationUI(animation, this, nodeRow); animation.source().deferredNode().resolve(nodeResolved.bind(this)); this._uiAnimations.push(uiAnimation); this._animationsMap.set(animation.id(), animation); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _nodeRemoved(event) { var node = event.data.node; @@ -492,7 +492,7 @@ if (lastDraw === undefined || gridWidth - lastDraw > 50) { lastDraw = gridWidth; var label = this._grid.createSVGChild('text', 'animation-timeline-grid-label'); - label.textContent = WebInspector.UIString(Number.millisToString(time)); + label.textContent = Common.UIString(Number.millisToString(time)); label.setAttribute('x', gridWidth + 10); label.setAttribute('y', 16); } @@ -542,7 +542,7 @@ } /** - * @param {!WebInspector.AnimationModel.Animation} animation + * @param {!Animation.AnimationModel.Animation} animation * @return {boolean} */ _resizeWindow(animation) { @@ -595,7 +595,7 @@ _updateScrubber(timestamp) { if (!this._scrubberPlayer) return; - this._currentTime.textContent = WebInspector.UIString(Number.millisToString(this._scrubberPlayer.currentTime)); + this._currentTime.textContent = Common.UIString(Number.millisToString(this._scrubberPlayer.currentTime)); if (this._scrubberPlayer.playState === 'pending' || this._scrubberPlayer.playState === 'running') { this.element.window().requestAnimationFrame(this._updateScrubber.bind(this)); } else if (this._scrubberPlayer.playState === 'finished') { @@ -649,7 +649,7 @@ var delta = event.x - this._originalMousePosition; var currentTime = Math.max(0, Math.min(this._originalScrubberTime + delta / this.pixelMsRatio(), this.duration())); this._scrubberPlayer.currentTime = currentTime; - this._currentTime.textContent = WebInspector.UIString(Number.millisToString(Math.round(currentTime))); + this._currentTime.textContent = Common.UIString(Number.millisToString(Math.round(currentTime))); this._selectedGroup.seekTo(currentTime); } @@ -664,10 +664,10 @@ } }; -WebInspector.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1]; +Animation.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1]; /** @enum {string} */ -WebInspector.AnimationTimeline._ControlState = { +Animation.AnimationTimeline._ControlState = { Play: 'play-outline', Replay: 'replay-outline', Pause: 'pause-outline' @@ -676,9 +676,9 @@ /** * @unrestricted */ -WebInspector.AnimationTimeline.NodeUI = class { +Animation.AnimationTimeline.NodeUI = class { /** - * @param {!WebInspector.AnimationModel.AnimationEffect} animationEffect + * @param {!Animation.AnimationModel.AnimationEffect} animationEffect */ constructor(animationEffect) { this.element = createElementWithClass('div', 'animation-node-row'); @@ -687,16 +687,16 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ nodeResolved(node) { if (!node) { - this._description.createTextChild(WebInspector.UIString('<node>')); + this._description.createTextChild(Common.UIString('<node>')); return; } this._node = node; this._nodeChanged(); - this._description.appendChild(WebInspector.DOMPresentationUtils.linkifyNodeReference(node)); + this._description.appendChild(Components.DOMPresentationUtils.linkifyNodeReference(node)); if (!node.ownerDocument) this.nodeRemoved(); } @@ -715,14 +715,14 @@ _nodeChanged() { this.element.classList.toggle( - 'animation-node-selected', this._node && this._node === WebInspector.context.flavor(WebInspector.DOMNode)); + 'animation-node-selected', this._node && this._node === UI.context.flavor(SDK.DOMNode)); } }; /** * @unrestricted */ -WebInspector.AnimationTimeline.StepTimingFunction = class { +Animation.AnimationTimeline.StepTimingFunction = class { /** * @param {number} steps * @param {string} stepAtPosition @@ -734,15 +734,15 @@ /** * @param {string} text - * @return {?WebInspector.AnimationTimeline.StepTimingFunction} + * @return {?Animation.AnimationTimeline.StepTimingFunction} */ static parse(text) { var match = text.match(/^steps\((\d+), (start|middle)\)$/); if (match) - return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(match[1], 10), match[2]); + return new Animation.AnimationTimeline.StepTimingFunction(parseInt(match[1], 10), match[2]); match = text.match(/^steps\((\d+)\)$/); if (match) - return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(match[1], 10), 'end'); + return new Animation.AnimationTimeline.StepTimingFunction(parseInt(match[1], 10), 'end'); return null; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationUI.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationUI.js index 6c815da..7ccc3c3 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationUI.js +++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationUI.js
@@ -4,10 +4,10 @@ /** * @unrestricted */ -WebInspector.AnimationUI = class { +Animation.AnimationUI = class { /** - * @param {!WebInspector.AnimationModel.Animation} animation - * @param {!WebInspector.AnimationTimeline} timeline + * @param {!Animation.AnimationModel.Animation} animation + * @param {!Animation.AnimationTimeline} timeline * @param {!Element} parentElement */ constructor(animation, timeline, parentElement) { @@ -22,41 +22,41 @@ this._nameElement.textContent = this._animation.name(); this._svg = parentElement.createSVGChild('svg', 'animation-ui'); - this._svg.setAttribute('height', WebInspector.AnimationUI.Options.AnimationSVGHeight); - this._svg.style.marginLeft = '-' + WebInspector.AnimationUI.Options.AnimationMargin + 'px'; + this._svg.setAttribute('height', Animation.AnimationUI.Options.AnimationSVGHeight); + this._svg.style.marginLeft = '-' + Animation.AnimationUI.Options.AnimationMargin + 'px'; this._svg.addEventListener('contextmenu', this._onContextMenu.bind(this)); this._activeIntervalGroup = this._svg.createSVGChild('g'); - WebInspector.installDragHandle( - this._activeIntervalGroup, this._mouseDown.bind(this, WebInspector.AnimationUI.MouseEvents.AnimationDrag, null), + UI.installDragHandle( + this._activeIntervalGroup, this._mouseDown.bind(this, Animation.AnimationUI.MouseEvents.AnimationDrag, null), this._mouseMove.bind(this), this._mouseUp.bind(this), '-webkit-grabbing', '-webkit-grab'); /** @type {!Array.<{group: ?Element, animationLine: ?Element, keyframePoints: !Object.<number, !Element>, keyframeRender: !Object.<number, !Element>}>} */ this._cachedElements = []; this._movementInMs = 0; - this._color = WebInspector.AnimationUI.Color(this._animation); + this._color = Animation.AnimationUI.Color(this._animation); } /** - * @param {!WebInspector.AnimationModel.Animation} animation + * @param {!Animation.AnimationModel.Animation} animation * @return {string} */ static Color(animation) { - var names = Object.keys(WebInspector.AnimationUI.Colors); + var names = Object.keys(Animation.AnimationUI.Colors); var color = - WebInspector.AnimationUI.Colors[names[String.hashCode(animation.name() || animation.id()) % names.length]]; - return color.asString(WebInspector.Color.Format.RGB); + Animation.AnimationUI.Colors[names[String.hashCode(animation.name() || animation.id()) % names.length]]; + return color.asString(Common.Color.Format.RGB); } /** - * @return {!WebInspector.AnimationModel.Animation} + * @return {!Animation.AnimationModel.Animation} */ animation() { return this._animation; } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ setNode(node) { this._node = node; @@ -68,9 +68,9 @@ */ _createLine(parentElement, className) { var line = parentElement.createSVGChild('line', className); - line.setAttribute('x1', WebInspector.AnimationUI.Options.AnimationMargin); - line.setAttribute('y1', WebInspector.AnimationUI.Options.AnimationHeight); - line.setAttribute('y2', WebInspector.AnimationUI.Options.AnimationHeight); + line.setAttribute('x1', Animation.AnimationUI.Options.AnimationMargin); + line.setAttribute('y1', Animation.AnimationUI.Options.AnimationHeight); + line.setAttribute('y2', Animation.AnimationUI.Options.AnimationHeight); line.style.stroke = this._color; return line; } @@ -84,7 +84,7 @@ if (!cache.animationLine) cache.animationLine = this._createLine(parentElement, 'animation-line'); cache.animationLine.setAttribute( - 'x2', (this._duration() * this._timeline.pixelMsRatio() + WebInspector.AnimationUI.Options.AnimationMargin) + 'x2', (this._duration() * this._timeline.pixelMsRatio() + Animation.AnimationUI.Options.AnimationMargin) .toFixed(2)); } @@ -98,7 +98,7 @@ } var fill = this._animation.source().fill(); this._delayLine.classList.toggle('animation-fill', fill === 'backwards' || fill === 'both'); - var margin = WebInspector.AnimationUI.Options.AnimationMargin; + var margin = Animation.AnimationUI.Options.AnimationMargin; this._delayLine.setAttribute('x1', margin); this._delayLine.setAttribute('x2', (this._delay() * this._timeline.pixelMsRatio() + margin).toFixed(2)); var forwardsFill = fill === 'forwards' || fill === 'both'; @@ -129,9 +129,9 @@ var circle = parentElement.createSVGChild('circle', keyframeIndex <= 0 ? 'animation-endpoint' : 'animation-keyframe-point'); circle.setAttribute('cx', x.toFixed(2)); - circle.setAttribute('cy', WebInspector.AnimationUI.Options.AnimationHeight); + circle.setAttribute('cy', Animation.AnimationUI.Options.AnimationHeight); circle.style.stroke = this._color; - circle.setAttribute('r', WebInspector.AnimationUI.Options.AnimationMargin / 2); + circle.setAttribute('r', Animation.AnimationUI.Options.AnimationMargin / 2); if (keyframeIndex <= 0) circle.style.fill = this._color; @@ -143,12 +143,12 @@ var eventType; if (keyframeIndex === 0) - eventType = WebInspector.AnimationUI.MouseEvents.StartEndpointMove; + eventType = Animation.AnimationUI.MouseEvents.StartEndpointMove; else if (keyframeIndex === -1) - eventType = WebInspector.AnimationUI.MouseEvents.FinishEndpointMove; + eventType = Animation.AnimationUI.MouseEvents.FinishEndpointMove; else - eventType = WebInspector.AnimationUI.MouseEvents.KeyframeMove; - WebInspector.installDragHandle( + eventType = Animation.AnimationUI.MouseEvents.KeyframeMove; + UI.installDragHandle( circle, this._mouseDown.bind(this, eventType, keyframeIndex), this._mouseMove.bind(this), this._mouseUp.bind(this), 'ew-resize'); } @@ -171,12 +171,12 @@ var line = parentElement.createSVGChild('line'); line.setAttribute('x1', x); line.setAttribute('x2', x); - line.setAttribute('y1', WebInspector.AnimationUI.Options.AnimationMargin); - line.setAttribute('y2', WebInspector.AnimationUI.Options.AnimationHeight); + line.setAttribute('y1', Animation.AnimationUI.Options.AnimationMargin); + line.setAttribute('y2', Animation.AnimationUI.Options.AnimationHeight); line.style.stroke = strokeColor; } - var bezier = WebInspector.Geometry.CubicBezier.parse(easing); + var bezier = Common.Geometry.CubicBezier.parse(easing); var cache = this._cachedElements[iteration].keyframeRender; if (!cache[keyframeIndex]) cache[keyframeIndex] = bezier ? parentElement.createSVGChild('path', 'animation-keyframe') : @@ -186,14 +186,14 @@ if (easing === 'linear') { group.style.fill = this._color; - var height = WebInspector.BezierUI.Height; + var height = UI.BezierUI.Height; group.setAttribute( 'd', ['M', 0, height, 'L', 0, 5, 'L', width.toFixed(2), 5, 'L', width.toFixed(2), height, 'Z'].join(' ')); } else if (bezier) { group.style.fill = this._color; - WebInspector.BezierUI.drawVelocityChart(bezier, group, width); + UI.BezierUI.drawVelocityChart(bezier, group, width); } else { - var stepFunction = WebInspector.AnimationTimeline.StepTimingFunction.parse(easing); + var stepFunction = Animation.AnimationTimeline.StepTimingFunction.parse(easing); group.removeChildren(); /** @const */ var offsetMap = {'start': 0, 'middle': 0.5, 'end': 1}; /** @const */ var offsetWeight = offsetMap[stepFunction.stepAtPosition]; @@ -205,14 +205,14 @@ redraw() { var durationWithDelay = this._delay() + this._duration() * this._animation.source().iterations() + this._animation.source().endDelay(); - var maxWidth = this._timeline.width() - WebInspector.AnimationUI.Options.AnimationMargin; + var maxWidth = this._timeline.width() - Animation.AnimationUI.Options.AnimationMargin; - this._svg.setAttribute('width', (maxWidth + 2 * WebInspector.AnimationUI.Options.AnimationMargin).toFixed(2)); + this._svg.setAttribute('width', (maxWidth + 2 * Animation.AnimationUI.Options.AnimationMargin).toFixed(2)); this._activeIntervalGroup.style.transform = 'translateX(' + (this._delay() * this._timeline.pixelMsRatio()).toFixed(2) + 'px)'; this._nameElement.style.transform = 'translateX(' + - (this._delay() * this._timeline.pixelMsRatio() + WebInspector.AnimationUI.Options.AnimationMargin).toFixed(2) + + (this._delay() * this._timeline.pixelMsRatio() + Animation.AnimationUI.Options.AnimationMargin).toFixed(2) + 'px)'; this._nameElement.style.width = (this._duration() * this._timeline.pixelMsRatio()).toFixed(2) + 'px'; this._drawDelayLine(this._svg); @@ -239,12 +239,12 @@ this._cachedElements[0] = {animationLine: null, keyframePoints: {}, keyframeRender: {}, group: null}; this._drawAnimationLine(0, this._activeIntervalGroup); this._renderKeyframe( - 0, 0, this._activeIntervalGroup, WebInspector.AnimationUI.Options.AnimationMargin, + 0, 0, this._activeIntervalGroup, Animation.AnimationUI.Options.AnimationMargin, this._duration() * this._timeline.pixelMsRatio(), this._animation.source().easing()); - this._drawPoint(0, this._activeIntervalGroup, WebInspector.AnimationUI.Options.AnimationMargin, 0, true); + this._drawPoint(0, this._activeIntervalGroup, Animation.AnimationUI.Options.AnimationMargin, 0, true); this._drawPoint( 0, this._activeIntervalGroup, - this._duration() * this._timeline.pixelMsRatio() + WebInspector.AnimationUI.Options.AnimationMargin, -1, true); + this._duration() * this._timeline.pixelMsRatio() + Animation.AnimationUI.Options.AnimationMargin, -1, true); } /** @@ -262,7 +262,7 @@ console.assert(this._keyframes.length > 1); for (var i = 0; i < this._keyframes.length - 1; i++) { var leftDistance = this._offset(i) * this._duration() * this._timeline.pixelMsRatio() + - WebInspector.AnimationUI.Options.AnimationMargin; + Animation.AnimationUI.Options.AnimationMargin; var width = this._duration() * (this._offset(i + 1) - this._offset(i)) * this._timeline.pixelMsRatio(); this._renderKeyframe(iteration, i, group, leftDistance, width, this._keyframes[i].easing()); if (i || (!i && iteration === 0)) @@ -270,7 +270,7 @@ } this._drawPoint( iteration, group, - this._duration() * this._timeline.pixelMsRatio() + WebInspector.AnimationUI.Options.AnimationMargin, -1, + this._duration() * this._timeline.pixelMsRatio() + Animation.AnimationUI.Options.AnimationMargin, -1, iteration === 0); } @@ -279,8 +279,8 @@ */ _delay() { var delay = this._animation.source().delay(); - if (this._mouseEventType === WebInspector.AnimationUI.MouseEvents.AnimationDrag || - this._mouseEventType === WebInspector.AnimationUI.MouseEvents.StartEndpointMove) + if (this._mouseEventType === Animation.AnimationUI.MouseEvents.AnimationDrag || + this._mouseEventType === Animation.AnimationUI.MouseEvents.StartEndpointMove) delay += this._movementInMs; // FIXME: add support for negative start delay return Math.max(0, delay); @@ -291,9 +291,9 @@ */ _duration() { var duration = this._animation.source().duration(); - if (this._mouseEventType === WebInspector.AnimationUI.MouseEvents.FinishEndpointMove) + if (this._mouseEventType === Animation.AnimationUI.MouseEvents.FinishEndpointMove) duration += this._movementInMs; - else if (this._mouseEventType === WebInspector.AnimationUI.MouseEvents.StartEndpointMove) + else if (this._mouseEventType === Animation.AnimationUI.MouseEvents.StartEndpointMove) duration -= Math.max(this._movementInMs, -this._animation.source().delay()); // Cannot have negative delay return Math.max(0, duration); } @@ -304,7 +304,7 @@ */ _offset(i) { var offset = this._keyframes[i].offsetAsNumber(); - if (this._mouseEventType === WebInspector.AnimationUI.MouseEvents.KeyframeMove && i === this._keyframeMoved) { + if (this._mouseEventType === Animation.AnimationUI.MouseEvents.KeyframeMove && i === this._keyframeMoved) { console.assert(i > 0 && i < this._keyframes.length - 1, 'First and last keyframe cannot be moved'); offset += this._movementInMs / this._animation.source().duration(); offset = Math.max(offset, this._keyframes[i - 1].offsetAsNumber()); @@ -314,7 +314,7 @@ } /** - * @param {!WebInspector.AnimationUI.MouseEvents} mouseEventType + * @param {!Animation.AnimationUI.MouseEvents} mouseEventType * @param {?number} keyframeIndex * @param {!Event} event */ @@ -328,7 +328,7 @@ this._downMouseX = event.clientX; event.consume(true); if (this._node) - WebInspector.Revealer.reveal(this._node); + Common.Revealer.reveal(this._node); return true; } @@ -349,7 +349,7 @@ this._movementInMs = (event.clientX - this._downMouseX) / this._timeline.pixelMsRatio(); // Commit changes - if (this._mouseEventType === WebInspector.AnimationUI.MouseEvents.KeyframeMove) + if (this._mouseEventType === Animation.AnimationUI.MouseEvents.KeyframeMove) this._keyframes[this._keyframeMoved].setOffset(this._offset(this._keyframeMoved)); else this._animation.setTiming(this._duration(), this._delay()); @@ -367,12 +367,12 @@ */ _onContextMenu(event) { /** - * @param {?WebInspector.RemoteObject} remoteObject + * @param {?SDK.RemoteObject} remoteObject */ function showContextMenu(remoteObject) { if (!remoteObject) return; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(remoteObject); contextMenu.show(); } @@ -385,14 +385,14 @@ /** * @enum {string} */ -WebInspector.AnimationUI.MouseEvents = { +Animation.AnimationUI.MouseEvents = { AnimationDrag: 'AnimationDrag', KeyframeMove: 'KeyframeMove', StartEndpointMove: 'StartEndpointMove', FinishEndpointMove: 'FinishEndpointMove' }; -WebInspector.AnimationUI.Options = { +Animation.AnimationUI.Options = { AnimationHeight: 26, AnimationSVGHeight: 50, AnimationMargin: 7, @@ -400,15 +400,15 @@ GridCanvasHeight: 40 }; -WebInspector.AnimationUI.Colors = { - 'Purple': WebInspector.Color.parse('#9C27B0'), - 'Light Blue': WebInspector.Color.parse('#03A9F4'), - 'Deep Orange': WebInspector.Color.parse('#FF5722'), - 'Blue': WebInspector.Color.parse('#5677FC'), - 'Lime': WebInspector.Color.parse('#CDDC39'), - 'Blue Grey': WebInspector.Color.parse('#607D8B'), - 'Pink': WebInspector.Color.parse('#E91E63'), - 'Green': WebInspector.Color.parse('#0F9D58'), - 'Brown': WebInspector.Color.parse('#795548'), - 'Cyan': WebInspector.Color.parse('#00BCD4') +Animation.AnimationUI.Colors = { + 'Purple': Common.Color.parse('#9C27B0'), + 'Light Blue': Common.Color.parse('#03A9F4'), + 'Deep Orange': Common.Color.parse('#FF5722'), + 'Blue': Common.Color.parse('#5677FC'), + 'Lime': Common.Color.parse('#CDDC39'), + 'Blue Grey': Common.Color.parse('#607D8B'), + 'Pink': Common.Color.parse('#E91E63'), + 'Green': Common.Color.parse('#0F9D58'), + 'Brown': Common.Color.parse('#795548'), + 'Cyan': Common.Color.parse('#00BCD4') };
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/module.json b/third_party/WebKit/Source/devtools/front_end/animation/module.json index 6a60acf..57e238cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/animation/module.json +++ b/third_party/WebKit/Source/devtools/front_end/animation/module.json
@@ -7,7 +7,7 @@ "title": "Animations", "persistence": "closeable", "order": 0, - "className": "WebInspector.AnimationTimeline" + "className": "Animation.AnimationTimeline" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditCategories.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditCategories.js index 7202a75..f7aa7d2 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditCategories.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditCategories.js
@@ -31,40 +31,40 @@ /** * @unrestricted */ -WebInspector.AuditCategories.PagePerformance = class extends WebInspector.AuditCategoryImpl { +Audits.AuditCategories.PagePerformance = class extends Audits.AuditCategoryImpl { constructor() { - super(WebInspector.AuditCategories.PagePerformance.AuditCategoryName); + super(Audits.AuditCategories.PagePerformance.AuditCategoryName); } initialize() { - this.addRule(new WebInspector.AuditRules.UnusedCssRule(), WebInspector.AuditRule.Severity.Warning); - this.addRule(new WebInspector.AuditRules.CssInHeadRule(), WebInspector.AuditRule.Severity.Severe); - this.addRule(new WebInspector.AuditRules.StylesScriptsOrderRule(), WebInspector.AuditRule.Severity.Severe); + this.addRule(new Audits.AuditRules.UnusedCssRule(), Audits.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.CssInHeadRule(), Audits.AuditRule.Severity.Severe); + this.addRule(new Audits.AuditRules.StylesScriptsOrderRule(), Audits.AuditRule.Severity.Severe); } }; -WebInspector.AuditCategories.PagePerformance.AuditCategoryName = WebInspector.UIString('Web Page Performance'); +Audits.AuditCategories.PagePerformance.AuditCategoryName = Common.UIString('Web Page Performance'); /** * @unrestricted */ -WebInspector.AuditCategories.NetworkUtilization = class extends WebInspector.AuditCategoryImpl { +Audits.AuditCategories.NetworkUtilization = class extends Audits.AuditCategoryImpl { constructor() { - super(WebInspector.AuditCategories.NetworkUtilization.AuditCategoryName); + super(Audits.AuditCategories.NetworkUtilization.AuditCategoryName); } initialize() { - this.addRule(new WebInspector.AuditRules.GzipRule(), WebInspector.AuditRule.Severity.Severe); - this.addRule(new WebInspector.AuditRules.ImageDimensionsRule(), WebInspector.AuditRule.Severity.Warning); - this.addRule(new WebInspector.AuditRules.CookieSizeRule(400), WebInspector.AuditRule.Severity.Warning); - this.addRule(new WebInspector.AuditRules.StaticCookielessRule(5), WebInspector.AuditRule.Severity.Warning); - this.addRule(new WebInspector.AuditRules.CombineJsResourcesRule(2), WebInspector.AuditRule.Severity.Severe); - this.addRule(new WebInspector.AuditRules.CombineCssResourcesRule(2), WebInspector.AuditRule.Severity.Severe); - this.addRule(new WebInspector.AuditRules.MinimizeDnsLookupsRule(4), WebInspector.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.GzipRule(), Audits.AuditRule.Severity.Severe); + this.addRule(new Audits.AuditRules.ImageDimensionsRule(), Audits.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.CookieSizeRule(400), Audits.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.StaticCookielessRule(5), Audits.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.CombineJsResourcesRule(2), Audits.AuditRule.Severity.Severe); + this.addRule(new Audits.AuditRules.CombineCssResourcesRule(2), Audits.AuditRule.Severity.Severe); + this.addRule(new Audits.AuditRules.MinimizeDnsLookupsRule(4), Audits.AuditRule.Severity.Warning); this.addRule( - new WebInspector.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), WebInspector.AuditRule.Severity.Warning); - this.addRule(new WebInspector.AuditRules.BrowserCacheControlRule(), WebInspector.AuditRule.Severity.Severe); + new Audits.AuditRules.ParallelizeDownloadRule(4, 10, 0.5), Audits.AuditRule.Severity.Warning); + this.addRule(new Audits.AuditRules.BrowserCacheControlRule(), Audits.AuditRule.Severity.Severe); } }; -WebInspector.AuditCategories.NetworkUtilization.AuditCategoryName = WebInspector.UIString('Network Utilization'); +Audits.AuditCategories.NetworkUtilization.AuditCategoryName = Common.UIString('Network Utilization');
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditCategory.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditCategory.js index ed953c6..82a13704 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditCategory.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditCategory.js
@@ -28,9 +28,9 @@ /** * @interface */ -WebInspector.AuditCategory = function() {}; +Audits.AuditCategory = function() {}; -WebInspector.AuditCategory.prototype = { +Audits.AuditCategory.prototype = { /** * @return {string} */ @@ -42,10 +42,10 @@ get displayName() {}, /** - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {function(!Audits.AuditRuleResult)} ruleResultCallback + * @param {!Common.Progress} progress */ run: function(target, requests, ruleResultCallback, progress) {} };
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditController.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditController.js index 699d141..b98970d 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditController.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditController.js
@@ -32,29 +32,29 @@ /** * @unrestricted */ -WebInspector.AuditController = class { +Audits.AuditController = class { /** - * @param {!WebInspector.AuditsPanel} auditsPanel + * @param {!Audits.AuditsPanel} auditsPanel */ constructor(auditsPanel) { this._auditsPanel = auditsPanel; - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.Load, this._didMainResourceLoad, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestFinished, this._didLoadResource, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.Load, this._didMainResourceLoad, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._didLoadResource, this); } /** - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.AuditCategory>} categories - * @param {function(string, !Array.<!WebInspector.AuditCategoryResult>)} resultCallback + * @param {!SDK.Target} target + * @param {!Array.<!Audits.AuditCategory>} categories + * @param {function(string, !Array.<!Audits.AuditCategoryResult>)} resultCallback */ _executeAudit(target, categories, resultCallback) { - this._progress.setTitle(WebInspector.UIString('Running audit')); + this._progress.setTitle(Common.UIString('Running audit')); /** - * @param {!WebInspector.AuditCategoryResult} categoryResult - * @param {!WebInspector.AuditRuleResult} ruleResult + * @param {!Audits.AuditCategoryResult} categoryResult + * @param {!Audits.AuditRuleResult} ruleResult */ function ruleResultReadyCallback(categoryResult, ruleResult) { if (ruleResult && ruleResult.children) @@ -71,19 +71,19 @@ resultCallback(mainResourceURL, results); } - var networkLog = WebInspector.NetworkLog.fromTarget(target); + var networkLog = SDK.NetworkLog.fromTarget(target); var requests = networkLog ? networkLog.requests().slice() : []; - var compositeProgress = new WebInspector.CompositeProgress(this._progress); + var compositeProgress = new Common.CompositeProgress(this._progress); var subprogresses = []; for (var i = 0; i < categories.length; ++i) - subprogresses.push(new WebInspector.ProgressProxy(compositeProgress.createSubProgress(), categoryDoneCallback)); + subprogresses.push(new Common.ProgressProxy(compositeProgress.createSubProgress(), categoryDoneCallback)); for (var i = 0; i < categories.length; ++i) { if (this._progress.isCanceled()) { subprogresses[i].done(); continue; } var category = categories[i]; - var result = new WebInspector.AuditCategoryResult(category); + var result = new Audits.AuditCategoryResult(category); results.push(result); category.run(target, requests, ruleResultReadyCallback.bind(null, result), subprogresses[i]); } @@ -91,7 +91,7 @@ /** * @param {string} mainResourceURL - * @param {!Array.<!WebInspector.AuditCategoryResult>} results + * @param {!Array.<!Audits.AuditCategoryResult>} results */ _auditFinishedCallback(mainResourceURL, results) { if (!this._progress.isCanceled()) @@ -101,12 +101,12 @@ /** * @param {!Array.<string>} categoryIds - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {boolean} runImmediately * @param {function()} startedCallback */ initiateAudit(categoryIds, progress, runImmediately, startedCallback) { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); if (!categoryIds || !categoryIds.length || !target) return; @@ -121,12 +121,12 @@ else this._reloadResources(this._startAuditWhenResourcesReady.bind(this, target, categories, startedCallback)); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.AuditsStarted); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.AuditsStarted); } /** - * @param {!WebInspector.Target} target - * @param {!Array<!WebInspector.AuditCategory>} categories + * @param {!SDK.Target} target + * @param {!Array<!Audits.AuditCategory>} categories * @param {function()} startedCallback */ _startAuditWhenResourcesReady(target, categories, startedCallback) { @@ -143,7 +143,7 @@ */ _reloadResources(callback) { this._pageReloadCallback = callback; - WebInspector.targetManager.reloadPage(); + SDK.targetManager.reloadPage(); } _didLoadResource() {
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditExtensionCategory.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditExtensionCategory.js index d515959..1b899f4e 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditExtensionCategory.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditExtensionCategory.js
@@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.AuditCategory} + * @implements {Audits.AuditCategory} * @unrestricted */ -WebInspector.AuditExtensionCategory = class { +Audits.AuditExtensionCategory = class { /** * @param {string} extensionOrigin * @param {string} id @@ -61,27 +61,27 @@ /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {function(!Audits.AuditRuleResult)} ruleResultCallback + * @param {!Common.Progress} progress */ run(target, requests, ruleResultCallback, progress) { - var results = new WebInspector.AuditExtensionCategoryResults(this, target, ruleResultCallback, progress); - WebInspector.extensionServer.startAuditRun(this.id, results); + var results = new Audits.AuditExtensionCategoryResults(this, target, ruleResultCallback, progress); + Extensions.extensionServer.startAuditRun(this.id, results); } }; /** - * @implements {WebInspector.ExtensionAuditCategoryResults} + * @implements {Extensions.ExtensionAuditCategoryResults} * @unrestricted */ -WebInspector.AuditExtensionCategoryResults = class { +Audits.AuditExtensionCategoryResults = class { /** - * @param {!WebInspector.AuditExtensionCategory} category - * @param {!WebInspector.Target} target - * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback - * @param {!WebInspector.Progress} progress + * @param {!Audits.AuditExtensionCategory} category + * @param {!SDK.Target} target + * @param {function(!Audits.AuditRuleResult)} ruleResultCallback + * @param {!Common.Progress} progress */ constructor(category, target, ruleResultCallback, progress) { this._target = target; @@ -92,7 +92,7 @@ this._expectedResults = category._ruleCount; this._actualResults = 0; - this._id = category.id + '-' + ++WebInspector.AuditExtensionCategoryResults._lastId; + this._id = category.id + '-' + ++Audits.AuditExtensionCategoryResults._lastId; } /** @@ -107,7 +107,7 @@ * @override */ done() { - WebInspector.extensionServer.stopAuditRun(this); + Extensions.extensionServer.stopAuditRun(this); this._progress.done(); } @@ -119,7 +119,7 @@ * @param {!Object} details */ addResult(displayName, description, severity, details) { - var result = new WebInspector.AuditRuleResult(displayName); + var result = new Audits.AuditRuleResult(displayName); if (description) result.addChild(description); result.severity = severity; @@ -130,7 +130,7 @@ _addNode(parent, node) { var contents = - WebInspector.auditFormatters.partiallyApply(WebInspector.AuditExtensionFormatters, this, node.contents); + Audits.auditFormatters.partiallyApply(Audits.AuditExtensionFormatters, this, node.contents); var addedNode = parent.addChild(contents, node.expanded); if (node.children) { for (var i = 0; i < node.children.length; ++i) @@ -159,14 +159,14 @@ /** * @param {string} expression * @param {?Object} evaluateOptions - * @param {function(!WebInspector.RemoteObject)} callback + * @param {function(!SDK.RemoteObject)} callback */ evaluate(expression, evaluateOptions, callback) { /** * @param {?string} error * @param {!Protocol.Runtime.RemoteObject} result * @param {boolean=} wasThrown - * @this {WebInspector.AuditExtensionCategoryResults} + * @this {Audits.AuditExtensionCategoryResults} */ function onEvaluate(error, result, wasThrown) { if (wasThrown) @@ -176,15 +176,15 @@ } var evaluateCallback = - /** @type {function(?string, ?WebInspector.RemoteObject, boolean=)} */ (onEvaluate.bind(this)); - WebInspector.extensionServer.evaluate( + /** @type {function(?string, ?SDK.RemoteObject, boolean=)} */ (onEvaluate.bind(this)); + Extensions.extensionServer.evaluate( expression, false, false, evaluateOptions, this._category._extensionOrigin, evaluateCallback); } }; -WebInspector.AuditExtensionFormatters = { +Audits.AuditExtensionFormatters = { /** - * @this {WebInspector.AuditExtensionCategoryResults} + * @this {Audits.AuditExtensionCategoryResults} * @param {string} expression * @param {string} title * @param {?Object} evaluateOptions @@ -193,7 +193,7 @@ object: function(expression, title, evaluateOptions) { var parentElement = createElement('div'); function onEvaluate(remoteObject) { - var section = new WebInspector.ObjectPropertiesSection(remoteObject, title); + var section = new Components.ObjectPropertiesSection(remoteObject, title); section.expand(); section.editable = false; parentElement.appendChild(section.element); @@ -203,7 +203,7 @@ }, /** - * @this {WebInspector.AuditExtensionCategoryResults} + * @this {Audits.AuditExtensionCategoryResults} * @param {string} expression * @param {?Object} evaluateOptions * @return {!Element} @@ -213,10 +213,10 @@ this.evaluate(expression, evaluateOptions, onEvaluate); /** - * @param {!WebInspector.RemoteObject} remoteObject + * @param {!SDK.RemoteObject} remoteObject */ function onEvaluate(remoteObject) { - WebInspector.Renderer.renderPromise(remoteObject) + Common.Renderer.renderPromise(remoteObject) .then(appendRenderer) .then(remoteObject.release.bind(remoteObject)); @@ -231,4 +231,4 @@ } }; -WebInspector.AuditExtensionCategoryResults._lastId = 0; +Audits.AuditExtensionCategoryResults._lastId = 0;
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditFormatters.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditFormatters.js index ba21be45..49ab84e 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditFormatters.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditFormatters.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.AuditFormatters = class { +Audits.AuditFormatters = class { /** * @param {string|boolean|number|!Object} value * @return {!Node} @@ -45,7 +45,7 @@ case 'string': case 'boolean': case 'number': - formatter = WebInspector.AuditFormatters.Registry.text; + formatter = Audits.AuditFormatters.Registry.text; args = [value.toString()]; break; @@ -53,10 +53,10 @@ if (value instanceof Node) return value; if (Array.isArray(value)) { - formatter = WebInspector.AuditFormatters.Registry.concat; + formatter = Audits.AuditFormatters.Registry.concat; args = value; } else if (value.type && value.arguments) { - formatter = WebInspector.AuditFormatters.Registry[value.type]; + formatter = Audits.AuditFormatters.Registry[value.type]; args = value.arguments; } } @@ -81,7 +81,7 @@ } }; -WebInspector.AuditFormatters.Registry = { +Audits.AuditFormatters.Registry = { /** * @param {string} text @@ -108,7 +108,7 @@ concat: function() { var parent = createElement('span'); for (var arg = 0; arg < arguments.length; ++arg) - parent.appendChild(WebInspector.auditFormatters.apply(arguments[arg])); + parent.appendChild(Audits.auditFormatters.apply(arguments[arg])); return parent; }, @@ -118,7 +118,7 @@ * @return {!Element} */ url: function(url, displayText) { - return WebInspector.linkifyURLAsNode(url, displayText, undefined, true); + return UI.linkifyURLAsNode(url, displayText, undefined, true); }, /** @@ -127,9 +127,9 @@ * @return {!Element} */ resourceLink: function(url, line) { - // FIXME: use WebInspector.Linkifier - return WebInspector.linkifyResourceAsNode(url, line, undefined, 'resource-url webkit-html-resource-link'); + // FIXME: use Components.Linkifier + return Components.linkifyResourceAsNode(url, line, undefined, 'resource-url webkit-html-resource-link'); } }; -WebInspector.auditFormatters = new WebInspector.AuditFormatters(); +Audits.auditFormatters = new Audits.AuditFormatters();
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditLauncherView.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditLauncherView.js index 78d12692..135b123 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditLauncherView.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditLauncherView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.AuditLauncherView = class extends WebInspector.VBox { +Audits.AuditLauncherView = class extends UI.VBox { /** - * @param {!WebInspector.AuditController} auditController + * @param {!Audits.AuditController} auditController */ constructor(auditController) { super(); @@ -58,18 +58,18 @@ this._headerElement = createElement('h1'); this._headerElement.className = 'no-audits'; - this._headerElement.textContent = WebInspector.UIString('No audits to run'); + this._headerElement.textContent = Common.UIString('No audits to run'); this._contentElement.appendChild(this._headerElement); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); var defaultSelectedAuditCategory = {}; - defaultSelectedAuditCategory[WebInspector.AuditLauncherView.AllCategoriesKey] = true; + defaultSelectedAuditCategory[Audits.AuditLauncherView.AllCategoriesKey] = true; this._selectedCategoriesSetting = - WebInspector.settings.createSetting('selectedAuditCategories', defaultSelectedAuditCategory); + Common.settings.createSetting('selectedAuditCategories', defaultSelectedAuditCategory); } _resetResourceCount() { @@ -78,25 +78,25 @@ } _onRequestStarted(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway. - if (request.resourceType() === WebInspector.resourceTypes.WebSocket) + if (request.resourceType() === Common.resourceTypes.WebSocket) return; ++this._totalResources; this._updateResourceProgress(); } _onRequestFinished(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); // See resorceStarted for details. - if (request.resourceType() === WebInspector.resourceTypes.WebSocket) + if (request.resourceType() === Common.resourceTypes.WebSocket) return; ++this._loadedResources; this._updateResourceProgress(); } /** - * @param {!WebInspector.AuditCategory} category + * @param {!Audits.AuditCategory} category */ addCategory(category) { if (!this._sortedCategories.length) @@ -111,8 +111,8 @@ } /** - * @param {!WebInspector.AuditCategory} a - * @param {!WebInspector.AuditCategory} b + * @param {!Audits.AuditCategory} a + * @param {!Audits.AuditCategory} b * @return {number} */ function compareCategories(a, b) { @@ -138,18 +138,18 @@ } this._resetResourceCount(); - this._progressIndicator = new WebInspector.ProgressIndicator(); + this._progressIndicator = new UI.ProgressIndicator(); this._buttonContainerElement.appendChild(this._progressIndicator.element); this._displayResourceLoadingProgress = true; /** - * @this {WebInspector.AuditLauncherView} + * @this {Audits.AuditLauncherView} */ function onAuditStarted() { this._displayResourceLoadingProgress = false; } this._auditController.initiateAudit( - catIds, new WebInspector.ProgressProxy(this._progressIndicator, this._auditsDone.bind(this)), + catIds, new Common.ProgressProxy(this._progressIndicator, this._auditsDone.bind(this)), this._auditPresentStateElement.checked, onAuditStarted.bind(this)); } @@ -221,23 +221,23 @@ _createLauncherUI() { this._headerElement = createElement('h1'); - this._headerElement.textContent = WebInspector.UIString('Select audits to run'); + this._headerElement.textContent = Common.UIString('Select audits to run'); this._contentElement.removeChildren(); this._contentElement.appendChild(this._headerElement); /** * @param {!Event} event - * @this {WebInspector.AuditLauncherView} + * @this {Audits.AuditLauncherView} */ function handleSelectAllClick(event) { this._selectAllClicked(event.target.checked, true); } - var categoryElement = this._createCategoryElement(WebInspector.UIString('Select All'), ''); + var categoryElement = this._createCategoryElement(Common.UIString('Select All'), ''); categoryElement.id = 'audit-launcher-selectall'; this._selectAllCheckboxElement = categoryElement.checkboxElement; this._selectAllCheckboxElement.checked = - this._selectedCategoriesSetting.get()[WebInspector.AuditLauncherView.AllCategoriesKey]; + this._selectedCategoriesSetting.get()[Audits.AuditLauncherView.AllCategoriesKey]; this._selectAllCheckboxElement.addEventListener('click', handleSelectAllClick.bind(this), false); this._contentElement.appendChild(categoryElement); @@ -248,18 +248,18 @@ this._buttonContainerElement = this._contentElement.createChild('div', 'button-container'); - var radio = createRadioLabel('audit-mode', WebInspector.UIString('Audit Present State'), true); + var radio = createRadioLabel('audit-mode', Common.UIString('Audit Present State'), true); this._buttonContainerElement.appendChild(radio); this._auditPresentStateElement = radio.radioElement; - radio = createRadioLabel('audit-mode', WebInspector.UIString('Reload Page and Audit on Load')); + radio = createRadioLabel('audit-mode', Common.UIString('Reload Page and Audit on Load')); this._buttonContainerElement.appendChild(radio); this._auditReloadedStateElement = radio.radioElement; - this._launchButton = createTextButton(WebInspector.UIString('Run'), this._launchButtonClicked.bind(this)); + this._launchButton = createTextButton(Common.UIString('Run'), this._launchButtonClicked.bind(this)); this._buttonContainerElement.appendChild(this._launchButton); - this._clearButton = createTextButton(WebInspector.UIString('Clear'), this._clearButtonClicked.bind(this)); + this._clearButton = createTextButton(Common.UIString('Clear'), this._clearButtonClicked.bind(this)); this._buttonContainerElement.appendChild(this._clearButton); this._selectAllClicked(this._selectAllCheckboxElement.checked); @@ -268,7 +268,7 @@ _updateResourceProgress() { if (this._displayResourceLoadingProgress) this._progressIndicator.setTitle( - WebInspector.UIString('Loading (%d of %d)', this._loadedResources, this._totalResources)); + Common.UIString('Loading (%d of %d)', this._loadedResources, this._totalResources)); } /** @@ -282,15 +282,15 @@ var childNodes = this._categoriesElement.childNodes; for (var i = 0, length = childNodes.length; i < length; ++i) selectedCategories[childNodes[i].__displayName] = childNodes[i].checkboxElement.checked; - selectedCategories[WebInspector.AuditLauncherView.AllCategoriesKey] = this._selectAllCheckboxElement.checked; + selectedCategories[Audits.AuditLauncherView.AllCategoriesKey] = this._selectAllCheckboxElement.checked; this._selectedCategoriesSetting.set(selectedCategories); this._updateButton(); } _updateButton() { - this._launchButton.textContent = this._auditRunning ? WebInspector.UIString('Stop') : WebInspector.UIString('Run'); + this._launchButton.textContent = this._auditRunning ? Common.UIString('Stop') : Common.UIString('Run'); this._launchButton.disabled = !this._currentCategoriesCount; } }; -WebInspector.AuditLauncherView.AllCategoriesKey = '__AllCategories'; +Audits.AuditLauncherView.AllCategoriesKey = '__AllCategories';
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditResultView.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditResultView.js index 1a72cc75..85bf3fa 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditResultView.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditResultView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.AuditCategoryResultPane = class extends WebInspector.SimpleView { +Audits.AuditCategoryResultPane = class extends UI.SimpleView { /** - * @param {!WebInspector.AuditCategoryResult} categoryResult + * @param {!Audits.AuditCategoryResult} categoryResult */ constructor(categoryResult) { super(categoryResult.title); @@ -45,7 +45,7 @@ function ruleSorter(a, b) { var result = - WebInspector.AuditRule.SeverityOrder[a.severity || 0] - WebInspector.AuditRule.SeverityOrder[b.severity || 0]; + Audits.AuditRule.SeverityOrder[a.severity || 0] - Audits.AuditRule.SeverityOrder[b.severity || 0]; if (!result) result = (a.value || '').localeCompare(b.value || ''); return result; @@ -63,8 +63,8 @@ /** * @param {!TreeElement} parentTreeNode - * @param {!WebInspector.AuditRuleResult} result - * @param {?WebInspector.AuditRule.Severity=} severity + * @param {!Audits.AuditRuleResult} result + * @param {?Audits.AuditRule.Severity=} severity */ _appendResult(parentTreeNode, result, severity) { var title = ''; @@ -77,12 +77,12 @@ var titleFragment = createDocumentFragment(); if (severity) { - var severityElement = WebInspector.Icon.create(); - if (severity === WebInspector.AuditRule.Severity.Info) + var severityElement = UI.Icon.create(); + if (severity === Audits.AuditRule.Severity.Info) severityElement.setIconType('smallicon-green-ball'); - else if (severity === WebInspector.AuditRule.Severity.Warning) + else if (severity === Audits.AuditRule.Severity.Warning) severityElement.setIconType('smallicon-orange-ball'); - else if (severity === WebInspector.AuditRule.Severity.Severe) + else if (severity === Audits.AuditRule.Severity.Severe) severityElement.setIconType('smallicon-red-ball'); severityElement.classList.add('severity'); titleFragment.appendChild(severityElement); @@ -96,7 +96,7 @@ if (result.className) treeElement.listItemElement.classList.add(result.className); if (typeof result.value !== 'string') - treeElement.listItemElement.appendChild(WebInspector.auditFormatters.apply(result.value)); + treeElement.listItemElement.appendChild(Audits.auditFormatters.apply(result.value)); if (result.children) { for (var i = 0; i < result.children.length; ++i)
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditRules.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditRules.js index cdadbaef..1509b39 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditRules.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditRules.js
@@ -27,9 +27,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.AuditRules.IPAddressRegexp = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; +Audits.AuditRules.IPAddressRegexp = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; -WebInspector.AuditRules.CacheableResponseCodes = { +Audits.AuditRules.CacheableResponseCodes = { 200: true, 203: true, 206: true, @@ -41,12 +41,12 @@ }; /** - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {?Array.<!WebInspector.ResourceType>} types + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {?Array.<!Common.ResourceType>} types * @param {boolean} needFullResources - * @return {!Object.<string, !Array.<!WebInspector.NetworkRequest|string>>} + * @return {!Object.<string, !Array.<!SDK.NetworkRequest|string>>} */ -WebInspector.AuditRules.getDomainToResourcesMap = function(requests, types, needFullResources) { +Audits.AuditRules.getDomainToResourcesMap = function(requests, types, needFullResources) { var domainToResourcesMap = {}; for (var i = 0, size = requests.length; i < size; ++i) { var request = requests[i]; @@ -69,18 +69,18 @@ /** * @unrestricted */ -WebInspector.AuditRules.GzipRule = class extends WebInspector.AuditRule { +Audits.AuditRules.GzipRule = class extends Audits.AuditRule { constructor() { - super('network-gzip', WebInspector.UIString('Enable gzip compression')); + super('network-gzip', Common.UIString('Enable gzip compression')); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { var totalSavings = 0; @@ -108,14 +108,14 @@ callback(null); return; } - summary.value = WebInspector.UIString( + summary.value = Common.UIString( 'Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):', Number.bytesToString(totalSavings)); callback(result); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _isCompressed(request) { var encodingHeader = request.responseHeaderValue('Content-Encoding'); @@ -126,7 +126,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _shouldCompress(request) { return request.resourceType().isTextType() && request.parsedURL.host && request.resourceSize !== undefined && @@ -137,11 +137,11 @@ /** * @unrestricted */ -WebInspector.AuditRules.CombineExternalResourcesRule = class extends WebInspector.AuditRule { +Audits.AuditRules.CombineExternalResourcesRule = class extends Audits.AuditRule { /** * @param {string} id * @param {string} name - * @param {!WebInspector.ResourceType} type + * @param {!Common.ResourceType} type * @param {string} resourceTypeName * @param {boolean} allowedPerDomain */ @@ -154,14 +154,14 @@ /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests, [this._type], false); + var domainToResourcesMap = Audits.AuditRules.getDomainToResourcesMap(requests, [this._type], false); var penalizedResourceCount = 0; // TODO: refactor according to the chosen i18n approach var summary = result.addChild('', true); @@ -171,9 +171,9 @@ if (extraResourceCount <= 0) continue; penalizedResourceCount += extraResourceCount - 1; - summary.addChild(WebInspector.UIString( + summary.addChild(Common.UIString( '%d %s resources served from %s.', domainResources.length, this._resourceTypeName, - WebInspector.AuditRuleResult.resourceDomain(domain))); + Audits.AuditRuleResult.resourceDomain(domain))); result.violationCount += domainResources.length; } if (!penalizedResourceCount) { @@ -181,7 +181,7 @@ return; } - summary.value = WebInspector.UIString( + summary.value = Common.UIString( 'There are multiple resources served from same domain. Consider combining them into as few files as possible.'); callback(result); } @@ -190,10 +190,10 @@ /** * @unrestricted */ -WebInspector.AuditRules.CombineJsResourcesRule = class extends WebInspector.AuditRules.CombineExternalResourcesRule { +Audits.AuditRules.CombineJsResourcesRule = class extends Audits.AuditRules.CombineExternalResourcesRule { constructor(allowedPerDomain) { super( - 'page-externaljs', WebInspector.UIString('Combine external JavaScript'), WebInspector.resourceTypes.Script, + 'page-externaljs', Common.UIString('Combine external JavaScript'), Common.resourceTypes.Script, 'JavaScript', allowedPerDomain); } }; @@ -201,10 +201,10 @@ /** * @unrestricted */ -WebInspector.AuditRules.CombineCssResourcesRule = class extends WebInspector.AuditRules.CombineExternalResourcesRule { +Audits.AuditRules.CombineCssResourcesRule = class extends Audits.AuditRules.CombineExternalResourcesRule { constructor(allowedPerDomain) { super( - 'page-externalcss', WebInspector.UIString('Combine external CSS'), WebInspector.resourceTypes.Stylesheet, 'CSS', + 'page-externalcss', Common.UIString('Combine external CSS'), Common.resourceTypes.Stylesheet, 'CSS', allowedPerDomain); } }; @@ -212,30 +212,30 @@ /** * @unrestricted */ -WebInspector.AuditRules.MinimizeDnsLookupsRule = class extends WebInspector.AuditRule { +Audits.AuditRules.MinimizeDnsLookupsRule = class extends Audits.AuditRule { constructor(hostCountThreshold) { - super('network-minimizelookups', WebInspector.UIString('Minimize DNS lookups')); + super('network-minimizelookups', Common.UIString('Minimize DNS lookups')); this._hostCountThreshold = hostCountThreshold; } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { var summary = result.addChild(''); - var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests, null, false); + var domainToResourcesMap = Audits.AuditRules.getDomainToResourcesMap(requests, null, false); for (var domain in domainToResourcesMap) { if (domainToResourcesMap[domain].length > 1) continue; var parsedURL = domain.asParsedURL(); if (!parsedURL) continue; - if (!parsedURL.host.search(WebInspector.AuditRules.IPAddressRegexp)) + if (!parsedURL.host.search(Audits.AuditRules.IPAddressRegexp)) continue; // an IP address summary.addSnippet(domain); result.violationCount++; @@ -245,7 +245,7 @@ return; } - summary.value = WebInspector.UIString( + summary.value = Common.UIString( 'The following domains only serve one resource each. If possible, avoid the extra DNS lookups by serving these resources from existing domains.'); callback(result); } @@ -254,9 +254,9 @@ /** * @unrestricted */ -WebInspector.AuditRules.ParallelizeDownloadRule = class extends WebInspector.AuditRule { +Audits.AuditRules.ParallelizeDownloadRule = class extends Audits.AuditRule { constructor(optimalHostnameCount, minRequestThreshold, minBalanceThreshold) { - super('network-parallelizehosts', WebInspector.UIString('Parallelize downloads across hostnames')); + super('network-parallelizehosts', Common.UIString('Parallelize downloads across hostnames')); this._optimalHostnameCount = optimalHostnameCount; this._minRequestThreshold = minRequestThreshold; this._minBalanceThreshold = minBalanceThreshold; @@ -264,11 +264,11 @@ /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { /** @@ -281,8 +281,8 @@ return (aCount < bCount) ? 1 : (aCount === bCount) ? 0 : -1; } - var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap( - requests, [WebInspector.resourceTypes.Stylesheet, WebInspector.resourceTypes.Image], true); + var domainToResourcesMap = Audits.AuditRules.getDomainToResourcesMap( + requests, [Common.resourceTypes.Stylesheet, Common.resourceTypes.Image], true); var hosts = []; for (var url in domainToResourcesMap) @@ -323,7 +323,7 @@ var requestsOnBusiestHost = domainToResourcesMap[hosts[0]]; var entry = result.addChild( - WebInspector.UIString( + Common.UIString( 'This page makes %d parallelizable requests to %s. Increase download parallelization by distributing the following requests across multiple hostnames.', busiestHostResourceCount, hosts[0]), true); @@ -338,33 +338,33 @@ /** * @unrestricted */ -WebInspector.AuditRules.UnusedCssRule = class extends WebInspector.AuditRule { +Audits.AuditRules.UnusedCssRule = class extends Audits.AuditRule { /** * The reported CSS rule size is incorrect (parsed != original in WebKit), * so use percentages instead, which gives a better approximation. */ constructor() { - super('page-unusedcss', WebInspector.UIString('Remove unused CSS rules')); + super('page-unusedcss', Common.UIString('Remove unused CSS rules')); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var domModel = WebInspector.DOMModel.fromTarget(target); - var cssModel = WebInspector.CSSModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (!domModel || !cssModel) { callback(null); return; } /** - * @param {!Array.<!WebInspector.AuditRules.ParsedStyleSheet>} styleSheets + * @param {!Array.<!Audits.AuditRules.ParsedStyleSheet>} styleSheets */ function evalCallback(styleSheets) { if (!styleSheets.length) @@ -386,7 +386,7 @@ var foundSelectors = {}; /** - * @param {!Array.<!WebInspector.AuditRules.ParsedStyleSheet>} styleSheets + * @param {!Array.<!Audits.AuditRules.ParsedStyleSheet>} styleSheets */ function selectorsCallback(styleSheets) { if (progress.isCanceled()) { @@ -414,11 +414,11 @@ if (!unusedRules.length) continue; - var resource = WebInspector.resourceForURL(styleSheet.sourceURL); + var resource = Bindings.resourceForURL(styleSheet.sourceURL); var isInlineBlock = - resource && resource.request && resource.request.resourceType() === WebInspector.resourceTypes.Document; - var url = !isInlineBlock ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : - WebInspector.UIString('Inline block #%d', ++inlineBlockOrdinal); + resource && resource.request && resource.request.resourceType() === Common.resourceTypes.Document; + var url = !isInlineBlock ? Audits.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : + Common.UIString('Inline block #%d', ++inlineBlockOrdinal); var pctUnused = Math.round(100 * unusedRules.length / styleSheet.rules.length); if (!summary) summary = result.addChild('', true); @@ -434,7 +434,7 @@ return callback(null); var totalUnusedPercent = Math.round(100 * totalUnusedStylesheetSize / totalStylesheetSize); - summary.value = WebInspector.UIString( + summary.value = Common.UIString( '%s rules (%d%) of CSS not used by the current page.', totalUnusedStylesheetSize, totalUnusedPercent); callback(result); @@ -454,7 +454,7 @@ /** * @param {!Array.<string>} selectors - * @param {!WebInspector.DOMDocument} document + * @param {!SDK.DOMDocument} document */ function documentLoaded(selectors, document) { var pseudoSelectorRegexp = /::?(?:[\w-]+)(?:\(.*?\))?/g; @@ -483,24 +483,24 @@ evalCallback([]); return; } - var styleSheetProcessor = new WebInspector.AuditRules.StyleSheetProcessor(styleSheetInfos, progress, evalCallback); + var styleSheetProcessor = new Audits.AuditRules.StyleSheetProcessor(styleSheetInfos, progress, evalCallback); styleSheetProcessor.run(); } }; /** - * @typedef {!{sourceURL: string, rules: !Array.<!WebInspector.CSSParser.StyleRule>}} + * @typedef {!{sourceURL: string, rules: !Array.<!SDK.CSSParser.StyleRule>}} */ -WebInspector.AuditRules.ParsedStyleSheet; +Audits.AuditRules.ParsedStyleSheet; /** * @unrestricted */ -WebInspector.AuditRules.StyleSheetProcessor = class { +Audits.AuditRules.StyleSheetProcessor = class { /** - * @param {!Array.<!WebInspector.CSSStyleSheetHeader>} styleSheetHeaders - * @param {!WebInspector.Progress} progress - * @param {function(!Array.<!WebInspector.AuditRules.ParsedStyleSheet>)} styleSheetsParsedCallback + * @param {!Array.<!SDK.CSSStyleSheetHeader>} styleSheetHeaders + * @param {!Common.Progress} progress + * @param {function(!Array.<!Audits.AuditRules.ParsedStyleSheet>)} styleSheetsParsedCallback */ constructor(styleSheetHeaders, progress, styleSheetsParsedCallback) { this._styleSheetHeaders = styleSheetHeaders; @@ -510,7 +510,7 @@ } run() { - this._parser = new WebInspector.CSSParser(); + this._parser = new SDK.CSSParser(); this._processNextStyleSheet(); } @@ -536,7 +536,7 @@ } /** - * @param {!Array.<!WebInspector.CSSParser.Rule>} rules + * @param {!Array.<!SDK.CSSParser.Rule>} rules */ _onStyleSheetParsed(rules) { if (this._progress.isCanceled()) { @@ -558,18 +558,18 @@ /** * @unrestricted */ -WebInspector.AuditRules.CacheControlRule = class extends WebInspector.AuditRule { +Audits.AuditRules.CacheControlRule = class extends Audits.AuditRule { constructor(id, name) { super(id, name); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(!WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(!Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { var cacheableAndNonCacheableResources = this._cacheableAndNonCacheableResources(requests); @@ -612,7 +612,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} timeMs * @return {boolean} */ @@ -643,7 +643,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} header * @return {string|undefined} */ @@ -652,7 +652,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} header * @return {boolean} */ @@ -661,7 +661,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ isCompressible(request) { @@ -669,7 +669,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ isPubliclyCacheable(request) { @@ -683,7 +683,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} header * @param {string} regexp * @return {?Array.<string>} @@ -694,7 +694,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ hasExplicitExpiration(request) { @@ -703,7 +703,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ _isExplicitlyNonCacheable(request) { @@ -716,22 +716,22 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ isCacheableResource(request) { - return request.statusCode !== undefined && WebInspector.AuditRules.CacheableResponseCodes[request.statusCode]; + return request.statusCode !== undefined && Audits.AuditRules.CacheableResponseCodes[request.statusCode]; } }; -WebInspector.AuditRules.CacheControlRule.MillisPerMonth = 1000 * 60 * 60 * 24 * 30; +Audits.AuditRules.CacheControlRule.MillisPerMonth = 1000 * 60 * 60 * 24 * 30; /** * @unrestricted */ -WebInspector.AuditRules.BrowserCacheControlRule = class extends WebInspector.AuditRules.CacheControlRule { +Audits.AuditRules.BrowserCacheControlRule = class extends Audits.AuditRules.CacheControlRule { constructor() { - super('http-browsercache', WebInspector.UIString('Leverage browser caching')); + super('http-browsercache', Common.UIString('Leverage browser caching')); } /** @@ -740,7 +740,7 @@ handleNonCacheableResources(requests, result) { if (requests.length) { var entry = result.addChild( - WebInspector.UIString( + Common.UIString( 'The following resources are explicitly non-cacheable. Consider making them cacheable if possible:'), true); result.violationCount += requests.length; @@ -751,20 +751,20 @@ runChecks(requests, result, callback) { this.execCheck( - WebInspector.UIString( + Common.UIString( 'The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers:'), this._missingExpirationCheck, requests, result); this.execCheck( - WebInspector.UIString( + Common.UIString( 'The following resources specify a "Vary" header that disables caching in most versions of Internet Explorer:'), this._varyCheck, requests, result); this.execCheck( - WebInspector.UIString('The following cacheable resources have a short freshness lifetime:'), + Common.UIString('The following cacheable resources have a short freshness lifetime:'), this._oneMonthExpirationCheck, requests, result); // Unable to implement the favicon check due to the WebKit limitations. this.execCheck( - WebInspector.UIString( + Common.UIString( 'To further improve cache hit rate, specify an expiration one year in the future for the following cacheable resources:'), this._oneYearExpirationCheck, requests, result); } @@ -787,36 +787,36 @@ _oneMonthExpirationCheck(request) { return this.isCacheableResource(request) && !this.hasResponseHeader(request, 'Set-Cookie') && - !this.freshnessLifetimeGreaterThan(request, WebInspector.AuditRules.CacheControlRule.MillisPerMonth) && + !this.freshnessLifetimeGreaterThan(request, Audits.AuditRules.CacheControlRule.MillisPerMonth) && this.freshnessLifetimeGreaterThan(request, 0); } _oneYearExpirationCheck(request) { return this.isCacheableResource(request) && !this.hasResponseHeader(request, 'Set-Cookie') && - !this.freshnessLifetimeGreaterThan(request, 11 * WebInspector.AuditRules.CacheControlRule.MillisPerMonth) && - this.freshnessLifetimeGreaterThan(request, WebInspector.AuditRules.CacheControlRule.MillisPerMonth); + !this.freshnessLifetimeGreaterThan(request, 11 * Audits.AuditRules.CacheControlRule.MillisPerMonth) && + this.freshnessLifetimeGreaterThan(request, Audits.AuditRules.CacheControlRule.MillisPerMonth); } }; /** * @unrestricted */ -WebInspector.AuditRules.ImageDimensionsRule = class extends WebInspector.AuditRule { +Audits.AuditRules.ImageDimensionsRule = class extends Audits.AuditRule { constructor() { - super('page-imagedims', WebInspector.UIString('Specify image dimensions')); + super('page-imagedims', Common.UIString('Specify image dimensions')); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var domModel = WebInspector.DOMModel.fromTarget(target); - var cssModel = WebInspector.CSSModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (!domModel || !cssModel) { callback(null); return; @@ -828,7 +828,7 @@ for (var url in urlToNoDimensionCount) { var entry = entry || result.addChild( - WebInspector.UIString( + Common.UIString( 'A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:'), true); var format = '%r'; @@ -852,7 +852,7 @@ for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) { if (frameOwnerCandidate.baseURL) { - var completeSrc = WebInspector.ParsedURL.completeURL(frameOwnerCandidate.baseURL, src); + var completeSrc = Common.ParsedURL.completeURL(frameOwnerCandidate.baseURL, src); break; } } @@ -892,7 +892,7 @@ var targetResult = {}; /** - * @param {?WebInspector.CSSMatchedStyles} matchedStyleResult + * @param {?SDK.CSSMatchedStyles} matchedStyleResult */ function matchedCallback(matchedStyleResult) { if (!matchedStyleResult) @@ -941,21 +941,21 @@ /** * @unrestricted */ -WebInspector.AuditRules.CssInHeadRule = class extends WebInspector.AuditRule { +Audits.AuditRules.CssInHeadRule = class extends Audits.AuditRule { constructor() { - super('page-cssinhead', WebInspector.UIString('Put CSS in the document head')); + super('page-cssinhead', Common.UIString('Put CSS in the document head')); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (!domModel) { callback(null); return; @@ -983,12 +983,12 @@ result.addFormatted('Link node %r should be moved to the document head in %r', urlViolations[1][i], url); result.violationCount += urlViolations[1].length; } - summary.value = WebInspector.UIString('CSS in the document body adversely impacts rendering performance.'); + summary.value = Common.UIString('CSS in the document body adversely impacts rendering performance.'); callback(result); } /** - * @param {!WebInspector.DOMNode} root + * @param {!SDK.DOMNode} root * @param {!Array.<!Protocol.DOM.NodeId>=} inlineStyleNodeIds * @param {!Array.<!Protocol.DOM.NodeId>=} nodeIds */ @@ -1008,7 +1008,7 @@ for (var j = 0; j < externalStylesheetNodeIds.length; ++j) { var linkNode = domModel.nodeForId(externalStylesheetNodeIds[j]); var completeHref = - WebInspector.ParsedURL.completeURL(linkNode.ownerDocument.baseURL, linkNode.getAttribute('href')); + Common.ParsedURL.completeURL(linkNode.ownerDocument.baseURL, linkNode.getAttribute('href')); externalStylesheetHrefs.push(completeHref || '<empty>'); } urlToViolationsArray[root.documentURL] = [inlineStyleNodeIds.length, externalStylesheetHrefs]; @@ -1018,7 +1018,7 @@ } /** - * @param {!WebInspector.DOMNode} root + * @param {!SDK.DOMNode} root * @param {!Array.<!Protocol.DOM.NodeId>=} nodeIds */ function inlineStylesReceived(root, nodeIds) { @@ -1034,7 +1034,7 @@ } /** - * @param {!WebInspector.DOMNode} root + * @param {!SDK.DOMNode} root */ function onDocumentAvailable(root) { if (progress.isCanceled()) { @@ -1052,21 +1052,21 @@ /** * @unrestricted */ -WebInspector.AuditRules.StylesScriptsOrderRule = class extends WebInspector.AuditRule { +Audits.AuditRules.StylesScriptsOrderRule = class extends Audits.AuditRule { constructor() { - super('page-stylescriptorder', WebInspector.UIString('Optimize the order of styles and scripts')); + super('page-stylescriptorder', Common.UIString('Optimize the order of styles and scripts')); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (!domModel) { callback(null); return; @@ -1086,7 +1086,7 @@ if (lateCssUrls.length) { var entry = result.addChild( - WebInspector.UIString( + Common.UIString( 'The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.'), true); entry.addURLs(lateCssUrls); @@ -1094,7 +1094,7 @@ } if (cssBeforeInlineCount) { - result.addChild(WebInspector.UIString( + result.addChild(Common.UIString( ' %d inline script block%s found in the head between an external CSS file and another resource. To allow parallel downloading, move the inline script before the external CSS file, or after the next resource.', cssBeforeInlineCount, cssBeforeInlineCount > 1 ? 's were' : ' was')); result.violationCount += cssBeforeInlineCount; @@ -1121,7 +1121,7 @@ var lateStyleUrls = []; for (var i = 0; i < lateStyleIds.length; ++i) { var lateStyleNode = domModel.nodeForId(lateStyleIds[i]); - var completeHref = WebInspector.ParsedURL.completeURL( + var completeHref = Common.ParsedURL.completeURL( lateStyleNode.ownerDocument.baseURL, lateStyleNode.getAttribute('href')); lateStyleUrls.push(completeHref || '<empty>'); } @@ -1132,7 +1132,7 @@ } /** - * @param {!WebInspector.DOMDocument} root + * @param {!SDK.DOMDocument} root * @param {!Array.<!Protocol.DOM.NodeId>=} nodeIds */ function lateStylesReceived(root, nodeIds) { @@ -1150,7 +1150,7 @@ } /** - * @param {!WebInspector.DOMDocument} root + * @param {!SDK.DOMDocument} root */ function onDocumentAvailable(root) { if (progress.isCanceled()) { @@ -1169,21 +1169,21 @@ /** * @unrestricted */ -WebInspector.AuditRules.CSSRuleBase = class extends WebInspector.AuditRule { +Audits.AuditRules.CSSRuleBase = class extends Audits.AuditRule { constructor(id, name) { super(id, name); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (!cssModel) { callback(null); return; @@ -1200,16 +1200,16 @@ activeHeaders.push(headers[i]); } - var styleSheetProcessor = new WebInspector.AuditRules.StyleSheetProcessor( + var styleSheetProcessor = new Audits.AuditRules.StyleSheetProcessor( activeHeaders, progress, this._styleSheetsLoaded.bind(this, result, callback, progress)); styleSheetProcessor.run(); } /** - * @param {!WebInspector.AuditRuleResult} result - * @param {function(!WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress - * @param {!Array.<!WebInspector.AuditRules.ParsedStyleSheet>} styleSheets + * @param {!Audits.AuditRuleResult} result + * @param {function(!Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress + * @param {!Array.<!Audits.AuditRules.ParsedStyleSheet>} styleSheets */ _styleSheetsLoaded(result, callback, progress, styleSheets) { for (var i = 0; i < styleSheets.length; ++i) @@ -1218,8 +1218,8 @@ } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!Audits.AuditRuleResult} result */ _visitStyleSheet(styleSheet, result) { this.visitStyleSheet(styleSheet, result); @@ -1231,9 +1231,9 @@ } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.CSSParser.StyleRule} rule - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!SDK.CSSParser.StyleRule} rule + * @param {!Audits.AuditRuleResult} result */ _visitRule(styleSheet, rule, result) { this.visitRule(styleSheet, rule, result); @@ -1244,44 +1244,44 @@ } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!Audits.AuditRuleResult} result */ visitStyleSheet(styleSheet, result) { // Subclasses can implement. } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!Audits.AuditRuleResult} result */ didVisitStyleSheet(styleSheet, result) { // Subclasses can implement. } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.CSSParser.StyleRule} rule - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!SDK.CSSParser.StyleRule} rule + * @param {!Audits.AuditRuleResult} result */ visitRule(styleSheet, rule, result) { // Subclasses can implement. } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.CSSParser.StyleRule} rule - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!SDK.CSSParser.StyleRule} rule + * @param {!Audits.AuditRuleResult} result */ didVisitRule(styleSheet, rule, result) { // Subclasses can implement. } /** - * @param {!WebInspector.AuditRules.ParsedStyleSheet} styleSheet - * @param {!WebInspector.CSSParser.StyleRule} rule - * @param {!WebInspector.CSSParser.Property} property - * @param {!WebInspector.AuditRuleResult} result + * @param {!Audits.AuditRules.ParsedStyleSheet} styleSheet + * @param {!SDK.CSSParser.StyleRule} rule + * @param {!SDK.CSSParser.Property} property + * @param {!Audits.AuditRuleResult} result */ visitProperty(styleSheet, rule, property, result) { // Subclasses can implement. @@ -1291,18 +1291,18 @@ /** * @unrestricted */ -WebInspector.AuditRules.CookieRuleBase = class extends WebInspector.AuditRule { +Audits.AuditRules.CookieRuleBase = class extends Audits.AuditRule { constructor(id, name) { super(id, name); } /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(!WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(!Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { var self = this; @@ -1316,13 +1316,13 @@ callback(result); } - WebInspector.Cookies.getCookiesAsync(resultCallback); + SDK.Cookies.getCookiesAsync(resultCallback); } mapResourceCookies(requestsByDomain, allCookies, callback) { for (var i = 0; i < allCookies.length; ++i) { for (var requestDomain in requestsByDomain) { - if (WebInspector.Cookies.cookieDomainMatchesResourceDomain(allCookies[i].domain(), requestDomain)) + if (SDK.Cookies.cookieDomainMatchesResourceDomain(allCookies[i].domain(), requestDomain)) this._callbackForResourceCookiePairs(requestsByDomain[requestDomain], allCookies[i], callback); } } @@ -1332,7 +1332,7 @@ if (!requests) return; for (var i = 0; i < requests.length; ++i) { - if (WebInspector.Cookies.cookieMatchesResourceURL(cookie, requests[i].url)) + if (SDK.Cookies.cookieMatchesResourceURL(cookie, requests[i].url)) callback(requests[i], cookie); } } @@ -1341,9 +1341,9 @@ /** * @unrestricted */ -WebInspector.AuditRules.CookieSizeRule = class extends WebInspector.AuditRules.CookieRuleBase { +Audits.AuditRules.CookieSizeRule = class extends Audits.AuditRules.CookieRuleBase { constructor(avgBytesThreshold) { - super('http-cookiesize', WebInspector.UIString('Minimize cookie size')); + super('http-cookiesize', Common.UIString('Minimize cookie size')); this._avgBytesThreshold = avgBytesThreshold; this._maxBytesThreshold = 1000; } @@ -1387,7 +1387,7 @@ var sortedCookieSizes = []; - var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap(requests, null, true); + var domainToResourcesMap = Audits.AuditRules.getDomainToResourcesMap(requests, null, true); this.mapResourceCookies(domainToResourcesMap, allCookies, collectorCallback); for (var requestDomain in cookiesPerResourceDomain) { @@ -1404,7 +1404,7 @@ var maxCookieSize = sortedCookieSizes[i].maxCookieSize; if (maxCookieSize > this._maxBytesThreshold) hugeCookieDomains.push( - WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ': ' + + Audits.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ': ' + Number.bytesToString(maxCookieSize)); } @@ -1415,14 +1415,14 @@ var avgCookieSize = sortedCookieSizes[i].avgCookieSize; if (avgCookieSize > this._avgBytesThreshold && avgCookieSize < this._maxBytesThreshold) bigAvgCookieDomains.push( - WebInspector.AuditRuleResult.resourceDomain(domain) + ': ' + Number.bytesToString(avgCookieSize)); + Audits.AuditRuleResult.resourceDomain(domain) + ': ' + Number.bytesToString(avgCookieSize)); } - result.addChild(WebInspector.UIString( + result.addChild(Common.UIString( 'The average cookie size for all requests on this page is %s', Number.bytesToString(avgAllCookiesSize))); if (hugeCookieDomains.length) { var entry = result.addChild( - WebInspector.UIString( + Common.UIString( 'The following domains have a cookie size in excess of 1KB. This is harmful because requests with cookies larger than 1KB typically cannot fit into a single network packet.'), true); entry.addURLs(hugeCookieDomains); @@ -1431,7 +1431,7 @@ if (bigAvgCookieDomains.length) { var entry = result.addChild( - WebInspector.UIString( + Common.UIString( 'The following domains have an average cookie size in excess of %d bytes. Reducing the size of cookies for these domains can reduce the time it takes to send requests.', this._avgBytesThreshold), true); @@ -1444,15 +1444,15 @@ /** * @unrestricted */ -WebInspector.AuditRules.StaticCookielessRule = class extends WebInspector.AuditRules.CookieRuleBase { +Audits.AuditRules.StaticCookielessRule = class extends Audits.AuditRules.CookieRuleBase { constructor(minResources) { - super('http-staticcookieless', WebInspector.UIString('Serve static content from a cookieless domain')); + super('http-staticcookieless', Common.UIString('Serve static content from a cookieless domain')); this._minResources = minResources; } processCookies(allCookies, requests, result) { - var domainToResourcesMap = WebInspector.AuditRules.getDomainToResourcesMap( - requests, [WebInspector.resourceTypes.Stylesheet, WebInspector.resourceTypes.Image], true); + var domainToResourcesMap = Audits.AuditRules.getDomainToResourcesMap( + requests, [Common.resourceTypes.Stylesheet, Common.resourceTypes.Image], true); var totalStaticResources = 0; for (var domain in domainToResourcesMap) totalStaticResources += domainToResourcesMap[domain].length; @@ -1471,7 +1471,7 @@ return; var entry = result.addChild( - WebInspector.UIString( + Common.UIString( '%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:', Number.bytesToString(cookieBytes)), true);
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/AuditsPanel.js b/third_party/WebKit/Source/devtools/front_end/audits/AuditsPanel.js index 52e867a7..54230e2 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/AuditsPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/audits/AuditsPanel.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.AuditsPanel = class extends WebInspector.PanelWithSidebar { +Audits.AuditsPanel = class extends UI.PanelWithSidebar { constructor() { super('audits'); this.registerRequiredCSS('ui/panelEnablerView.css'); @@ -41,10 +41,10 @@ this._sidebarTree.registerRequiredCSS('audits/auditsSidebarTree.css'); this.panelSidebarElement().appendChild(this._sidebarTree.element); - this._auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement(this); + this._auditsItemTreeElement = new Audits.AuditsSidebarTreeElement(this); this._sidebarTree.appendChild(this._auditsItemTreeElement); - this._auditResultsTreeElement = new TreeElement(WebInspector.UIString('RESULTS'), true); + this._auditResultsTreeElement = new TreeElement(Common.UIString('RESULTS'), true); this._auditResultsTreeElement.selectable = false; this._auditResultsTreeElement.listItemElement.classList.add('audits-sidebar-results'); this._auditResultsTreeElement.expand(); @@ -52,37 +52,37 @@ this._constructCategories(); - this._auditController = new WebInspector.AuditController(this); - this._launcherView = new WebInspector.AuditLauncherView(this._auditController); + this._auditController = new Audits.AuditController(this); + this._launcherView = new Audits.AuditLauncherView(this._auditController); for (var id in this.categoriesById) this._launcherView.addCategory(this.categoriesById[id]); - var extensionCategories = WebInspector.extensionServer.auditCategories(); + var extensionCategories = Extensions.extensionServer.auditCategories(); for (var i = 0; i < extensionCategories.length; ++i) { var category = extensionCategories[i]; - this.addCategory(new WebInspector.AuditExtensionCategory( + this.addCategory(new Audits.AuditExtensionCategory( category.extensionOrigin, category.id, category.displayName, category.ruleCount)); } - WebInspector.extensionServer.addEventListener( - WebInspector.ExtensionServer.Events.AuditCategoryAdded, this._extensionAuditCategoryAdded, this); + Extensions.extensionServer.addEventListener( + Extensions.ExtensionServer.Events.AuditCategoryAdded, this._extensionAuditCategoryAdded, this); } /** - * @return {!WebInspector.AuditsPanel} + * @return {!Audits.AuditsPanel} */ static instance() { - return /** @type {!WebInspector.AuditsPanel} */ (self.runtime.sharedInstance(WebInspector.AuditsPanel)); + return /** @type {!Audits.AuditsPanel} */ (self.runtime.sharedInstance(Audits.AuditsPanel)); } /** - * @return {!Object.<string, !WebInspector.AuditCategory>} + * @return {!Object.<string, !Audits.AuditCategory>} */ get categoriesById() { return this._auditCategoriesById; } /** - * @param {!WebInspector.AuditCategory} category + * @param {!Audits.AuditCategory} category */ addCategory(category) { this.categoriesById[category.id] = category; @@ -91,7 +91,7 @@ /** * @param {string} id - * @return {!WebInspector.AuditCategory} + * @return {!Audits.AuditCategory} */ getCategory(id) { return this.categoriesById[id]; @@ -99,8 +99,8 @@ _constructCategories() { this._auditCategoriesById = {}; - for (var categoryCtorID in WebInspector.AuditCategories) { - var auditCategory = new WebInspector.AuditCategories[categoryCtorID](); + for (var categoryCtorID in Audits.AuditCategories) { + var auditCategory = new Audits.AuditCategories[categoryCtorID](); auditCategory._id = categoryCtorID; this.categoriesById[categoryCtorID] = auditCategory; } @@ -108,7 +108,7 @@ /** * @param {string} mainResourceURL - * @param {!Array.<!WebInspector.AuditCategoryResult>} results + * @param {!Array.<!Audits.AuditCategoryResult>} results */ auditFinishedCallback(mainResourceURL, results) { var ordinal = 1; @@ -117,21 +117,21 @@ ordinal++; } - var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(this, results, mainResourceURL, ordinal); + var resultTreeElement = new Audits.AuditResultSidebarTreeElement(this, results, mainResourceURL, ordinal); this._auditResultsTreeElement.appendChild(resultTreeElement); resultTreeElement.revealAndSelect(); } /** - * @param {!Array.<!WebInspector.AuditCategoryResult>} categoryResults + * @param {!Array.<!Audits.AuditCategoryResult>} categoryResults */ showResults(categoryResults) { if (!categoryResults._resultLocation) { categoryResults.sort((a, b) => (a.title || '').localeCompare(b.title || '')); - var resultView = WebInspector.viewManager.createStackLocation(); + var resultView = UI.viewManager.createStackLocation(); resultView.widget().element.classList.add('audit-result-view'); for (var i = 0; i < categoryResults.length; ++i) - resultView.showView(new WebInspector.AuditCategoryResultPane(categoryResults[i])); + resultView.showView(new Audits.AuditCategoryResultPane(categoryResults[i])); categoryResults._resultLocation = resultView; } this.visibleView = categoryResults._resultLocation.widget(); @@ -180,20 +180,20 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _extensionAuditCategoryAdded(event) { - var category = /** @type {!WebInspector.ExtensionAuditCategory} */ (event.data); - this.addCategory(new WebInspector.AuditExtensionCategory( + var category = /** @type {!Extensions.ExtensionAuditCategory} */ (event.data); + this.addCategory(new Audits.AuditExtensionCategory( category.extensionOrigin, category.id, category.displayName, category.ruleCount)); } }; /** - * @implements {WebInspector.AuditCategory} + * @implements {Audits.AuditCategory} * @unrestricted */ -WebInspector.AuditCategoryImpl = class { +Audits.AuditCategoryImpl = class { /** * @param {string} displayName */ @@ -220,8 +220,8 @@ } /** - * @param {!WebInspector.AuditRule} rule - * @param {!WebInspector.AuditRule.Severity} severity + * @param {!Audits.AuditRule} rule + * @param {!Audits.AuditRule.Severity} severity */ addRule(rule, severity) { rule.severity = severity; @@ -230,10 +230,10 @@ /** * @override - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {function(!Audits.AuditRuleResult)} ruleResultCallback + * @param {!Common.Progress} progress */ run(target, requests, ruleResultCallback, progress) { this._ensureInitialized(); @@ -265,7 +265,7 @@ /** * @unrestricted */ -WebInspector.AuditRule = class { +Audits.AuditRule = class { /** * @param {string} id * @param {string} displayName @@ -284,33 +284,33 @@ } /** - * @param {!WebInspector.AuditRule.Severity} severity + * @param {!Audits.AuditRule.Severity} severity */ set severity(severity) { this._severity = severity; } /** - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ run(target, requests, callback, progress) { if (progress.isCanceled()) return; - var result = new WebInspector.AuditRuleResult(this.displayName); + var result = new Audits.AuditRuleResult(this.displayName); result.severity = this._severity; this.doRun(target, requests, result, callback, progress); } /** - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.AuditRuleResult} result - * @param {function(?WebInspector.AuditRuleResult)} callback - * @param {!WebInspector.Progress} progress + * @param {!SDK.Target} target + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Audits.AuditRuleResult} result + * @param {function(?Audits.AuditRuleResult)} callback + * @param {!Common.Progress} progress */ doRun(target, requests, result, callback, progress) { throw new Error('doRun() not implemented'); @@ -320,13 +320,13 @@ /** * @enum {string} */ -WebInspector.AuditRule.Severity = { +Audits.AuditRule.Severity = { Info: 'info', Warning: 'warning', Severe: 'severe' }; -WebInspector.AuditRule.SeverityOrder = { +Audits.AuditRule.SeverityOrder = { 'info': 3, 'warning': 2, 'severe': 1 @@ -335,9 +335,9 @@ /** * @unrestricted */ -WebInspector.AuditCategoryResult = class { +Audits.AuditCategoryResult = class { /** - * @param {!WebInspector.AuditCategory} category + * @param {!Audits.AuditCategory} category */ constructor(category) { this.title = category.displayName; @@ -345,7 +345,7 @@ } /** - * @param {!WebInspector.AuditRuleResult} ruleResult + * @param {!Audits.AuditRuleResult} ruleResult */ addRuleResult(ruleResult) { this.ruleResults.push(ruleResult); @@ -355,7 +355,7 @@ /** * @unrestricted */ -WebInspector.AuditRuleResult = class { +Audits.AuditRuleResult = class { /** * @param {(string|boolean|number|!Object)} value * @param {boolean=} expanded @@ -366,7 +366,7 @@ this.className = className; this.expanded = expanded; this.violationCount = 0; - this._formatters = {r: WebInspector.AuditRuleResult.linkifyDisplayName}; + this._formatters = {r: Audits.AuditRuleResult.linkifyDisplayName}; var standardFormatters = Object.keys(String.standardFormatters); for (var i = 0; i < standardFormatters.length; ++i) this._formatters[standardFormatters[i]] = String.standardFormatters[standardFormatters[i]]; @@ -377,7 +377,7 @@ * @return {!Element} */ static linkifyDisplayName(url) { - return WebInspector.linkifyURLAsNode(url, WebInspector.displayNameForURL(url)); + return UI.linkifyURLAsNode(url, Bindings.displayNameForURL(url)); } /** @@ -385,19 +385,19 @@ * @return {string} */ static resourceDomain(domain) { - return domain || WebInspector.UIString('[empty domain]'); + return domain || Common.UIString('[empty domain]'); } /** * @param {(string|boolean|number|!Object)} value * @param {boolean=} expanded * @param {string=} className - * @return {!WebInspector.AuditRuleResult} + * @return {!Audits.AuditRuleResult} */ addChild(value, expanded, className) { if (!this.children) this.children = []; - var entry = new WebInspector.AuditRuleResult(value, expanded, className); + var entry = new Audits.AuditRuleResult(value, expanded, className); this.children.push(entry); return entry; } @@ -406,7 +406,7 @@ * @param {string} url */ addURL(url) { - this.addChild(WebInspector.AuditRuleResult.linkifyDisplayName(url)); + this.addChild(Audits.AuditRuleResult.linkifyDisplayName(url)); } /** @@ -427,7 +427,7 @@ /** * @param {string} format * @param {...*} vararg - * @return {!WebInspector.AuditRuleResult} + * @return {!Audits.AuditRuleResult} */ addFormatted(format, vararg) { var substitutions = Array.prototype.slice.call(arguments, 1); @@ -451,12 +451,12 @@ /** * @unrestricted */ -WebInspector.AuditsSidebarTreeElement = class extends TreeElement { +Audits.AuditsSidebarTreeElement = class extends TreeElement { /** - * @param {!WebInspector.AuditsPanel} panel + * @param {!Audits.AuditsPanel} panel */ constructor(panel) { - super(WebInspector.UIString('Audits'), false); + super(Common.UIString('Audits'), false); this.selectable = true; this._panel = panel; this.listItemElement.classList.add('audits-sidebar-header'); @@ -476,10 +476,10 @@ /** * @unrestricted */ -WebInspector.AuditResultSidebarTreeElement = class extends TreeElement { +Audits.AuditResultSidebarTreeElement = class extends TreeElement { /** - * @param {!WebInspector.AuditsPanel} panel - * @param {!Array.<!WebInspector.AuditCategoryResult>} results + * @param {!Audits.AuditsPanel} panel + * @param {!Array.<!Audits.AuditCategoryResult>} results * @param {string} mainResourceURL * @param {number} ordinal */ @@ -505,10 +505,10 @@ // Contributed audit rules should go into this namespace. -WebInspector.AuditRules = {}; +Audits.AuditRules = {}; /** * Contributed audit categories should go into this namespace. - * @type {!Object.<string, function(new:WebInspector.AuditCategory)>} + * @type {!Object.<string, function(new:Audits.AuditCategory)>} */ -WebInspector.AuditCategories = {}; +Audits.AuditCategories = {};
diff --git a/third_party/WebKit/Source/devtools/front_end/audits/module.json b/third_party/WebKit/Source/devtools/front_end/audits/module.json index 50c5869..437d99a 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits/module.json +++ b/third_party/WebKit/Source/devtools/front_end/audits/module.json
@@ -6,7 +6,7 @@ "id": "audits", "title": "Audits", "order": 90, - "className": "WebInspector.AuditsPanel" + "className": "Audits.AuditsPanel" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js index b54389d..5bbc40bf 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js +++ b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
@@ -4,21 +4,21 @@ /** * @unrestricted */ -WebInspector.Audits2Panel = class extends WebInspector.Panel { +Audits2.Audits2Panel = class extends UI.Panel { constructor() { super('audits2'); this.contentElement.classList.add('vbox'); - this.contentElement.appendChild(createTextButton(WebInspector.UIString('Start'), this._start.bind(this))); - this.contentElement.appendChild(createTextButton(WebInspector.UIString('Stop'), this._stop.bind(this))); + this.contentElement.appendChild(createTextButton(Common.UIString('Start'), this._start.bind(this))); + this.contentElement.appendChild(createTextButton(Common.UIString('Stop'), this._stop.bind(this))); this._resultElement = this.contentElement.createChild('div', 'overflow-auto'); } _start() { - WebInspector.targetManager.interceptMainConnection(this._dispatchProtocolMessage.bind(this)).then(rawConnection => { + SDK.targetManager.interceptMainConnection(this._dispatchProtocolMessage.bind(this)).then(rawConnection => { this._rawConnection = rawConnection; this._send('start').then(result => { - var section = new WebInspector.ObjectPropertiesSection( - WebInspector.RemoteObject.fromLocalObject(result), WebInspector.UIString('Audit Results')); + var section = new Components.ObjectPropertiesSection( + SDK.RemoteObject.fromLocalObject(result), Common.UIString('Audit Results')); this._resultElement.appendChild(section.element); this._stop(); }); @@ -49,7 +49,7 @@ _send(method, params) { if (!this._backendPromise) { this._backendPromise = - WebInspector.serviceManager.createAppService('audits2_worker', 'Audits2Service', false).then(backend => { + Services.serviceManager.createAppService('audits2_worker', 'Audits2Service', false).then(backend => { this._backend = backend; this._backend.on('sendProtocolMessage', result => this._rawConnection.sendMessage(result.message)); });
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/module.json b/third_party/WebKit/Source/devtools/front_end/audits2/module.json index 5f276a6..a8a6f78c0 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits2/module.json +++ b/third_party/WebKit/Source/devtools/front_end/audits2/module.json
@@ -7,7 +7,7 @@ "title": "Audits 2.0", "order": 90, "persistence": "closeable", - "className": "WebInspector.Audits2Panel" + "className": "Audits2.Audits2Panel" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js index bc28fb0a..0072787 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
@@ -2,72 +2,72 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.BlackboxManager = class { +Bindings.BlackboxManager = class { /** - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerWorkspaceBinding) { this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, this); - WebInspector.moduleSetting('skipStackFramesPattern').addChangeListener(this._patternChanged.bind(this)); - WebInspector.moduleSetting('skipContentScripts').addChangeListener(this._patternChanged.bind(this)); + Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._patternChanged.bind(this)); + Common.moduleSetting('skipContentScripts').addChangeListener(this._patternChanged.bind(this)); - /** @type {!Map<!WebInspector.DebuggerModel, !Map<string, !Array<!Protocol.Debugger.ScriptPosition>>>} */ + /** @type {!Map<!SDK.DebuggerModel, !Map<string, !Array<!Protocol.Debugger.ScriptPosition>>>} */ this._debuggerModelData = new Map(); /** @type {!Map<string, boolean>} */ this._isBlackboxedURLCache = new Map(); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ addChangeListener(listener, thisObject) { - WebInspector.moduleSetting('skipStackFramesPattern').addChangeListener(listener, thisObject); + Common.moduleSetting('skipStackFramesPattern').addChangeListener(listener, thisObject); } /** - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeChangeListener(listener, thisObject) { - WebInspector.moduleSetting('skipStackFramesPattern').removeChangeListener(listener, thisObject); + Common.moduleSetting('skipStackFramesPattern').removeChangeListener(listener, thisObject); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel) this._setBlackboxPatterns(debuggerModel); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @return {!Promise<boolean>} */ _setBlackboxPatterns(debuggerModel) { - var regexPatterns = WebInspector.moduleSetting('skipStackFramesPattern').getAsArray(); + var regexPatterns = Common.moduleSetting('skipStackFramesPattern').getAsArray(); var patterns = /** @type {!Array<string>} */ ([]); for (var item of regexPatterns) { if (!item.disabled && item.pattern) @@ -77,7 +77,7 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} location + * @param {!SDK.DebuggerModel.Location} location * @return {boolean} */ isBlackboxedRawLocation(location) { @@ -91,7 +91,7 @@ return !!(index % 2); /** - * @param {!WebInspector.DebuggerModel.Location} a + * @param {!SDK.DebuggerModel.Location} a * @param {!Protocol.Debugger.ScriptPosition} b * @return {number} */ @@ -103,13 +103,13 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ isBlackboxedUISourceCode(uiSourceCode) { var projectType = uiSourceCode.project().type(); - var isContentScript = projectType === WebInspector.projectTypes.ContentScripts; - if (isContentScript && WebInspector.moduleSetting('skipContentScripts').get()) + var isContentScript = projectType === Workspace.projectTypes.ContentScripts; + if (isContentScript && Common.moduleSetting('skipContentScripts').get()) return true; var url = this._uiSourceCodeURL(uiSourceCode); return url ? this.isBlackboxedURL(url) : false; @@ -123,17 +123,17 @@ isBlackboxedURL(url, isContentScript) { if (this._isBlackboxedURLCache.has(url)) return !!this._isBlackboxedURLCache.get(url); - if (isContentScript && WebInspector.moduleSetting('skipContentScripts').get()) + if (isContentScript && Common.moduleSetting('skipContentScripts').get()) return true; - var regex = WebInspector.moduleSetting('skipStackFramesPattern').asRegExp(); + var regex = Common.moduleSetting('skipStackFramesPattern').asRegExp(); var isBlackboxed = regex && regex.test(url); this._isBlackboxedURLCache.set(url, isBlackboxed); return isBlackboxed; } /** - * @param {!WebInspector.Script} script - * @param {?WebInspector.TextSourceMap} sourceMap + * @param {!SDK.Script} script + * @param {?SDK.TextSourceMap} sourceMap * @return {!Promise<undefined>} */ sourceMapLoaded(script, sourceMap) { @@ -169,8 +169,8 @@ } return this._setScriptState(script, !isBlackboxed ? [] : positions); /** - * @param {!WebInspector.SourceMapEntry} a - * @param {!WebInspector.SourceMapEntry} b + * @param {!SDK.SourceMapEntry} a + * @param {!SDK.SourceMapEntry} b * @return {number} */ function mappingComparator(a, b) { @@ -181,15 +181,15 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {?string} */ _uiSourceCodeURL(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.Debugger ? null : uiSourceCode.url(); + return uiSourceCode.project().type() === Workspace.projectTypes.Debugger ? null : uiSourceCode.url(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ canBlackboxUISourceCode(uiSourceCode) { @@ -198,7 +198,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ blackboxUISourceCode(uiSourceCode) { var url = this._uiSourceCodeURL(uiSourceCode); @@ -207,7 +207,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ unblackboxUISourceCode(uiSourceCode) { var url = this._uiSourceCodeURL(uiSourceCode); @@ -216,18 +216,18 @@ } blackboxContentScripts() { - WebInspector.moduleSetting('skipContentScripts').set(true); + Common.moduleSetting('skipContentScripts').set(true); } unblackboxContentScripts() { - WebInspector.moduleSetting('skipContentScripts').set(false); + Common.moduleSetting('skipContentScripts').set(false); } /** * @param {string} url */ _blackboxURL(url) { - var regexPatterns = WebInspector.moduleSetting('skipStackFramesPattern').getAsArray(); + var regexPatterns = Common.moduleSetting('skipStackFramesPattern').getAsArray(); var regexValue = this._urlToRegExpString(url); if (!regexValue) return; @@ -242,15 +242,15 @@ } if (!found) regexPatterns.push({pattern: regexValue}); - WebInspector.moduleSetting('skipStackFramesPattern').setAsArray(regexPatterns); + Common.moduleSetting('skipStackFramesPattern').setAsArray(regexPatterns); } /** * @param {string} url */ _unblackboxURL(url) { - var regexPatterns = WebInspector.moduleSetting('skipStackFramesPattern').getAsArray(); - var regexValue = WebInspector.blackboxManager._urlToRegExpString(url); + var regexPatterns = Common.moduleSetting('skipStackFramesPattern').getAsArray(); + var regexValue = Bindings.blackboxManager._urlToRegExpString(url); if (!regexValue) return; regexPatterns = regexPatterns.filter(function(item) { @@ -267,14 +267,14 @@ } catch (e) { } } - WebInspector.moduleSetting('skipStackFramesPattern').setAsArray(regexPatterns); + Common.moduleSetting('skipStackFramesPattern').setAsArray(regexPatterns); } _patternChanged() { this._isBlackboxedURLCache.clear(); var promises = []; - for (var debuggerModel of WebInspector.DebuggerModel.instances()) { + for (var debuggerModel of SDK.DebuggerModel.instances()) { promises.push(this._setBlackboxPatterns.bind(this, debuggerModel)); for (var scriptId in debuggerModel.scripts) { var script = debuggerModel.scripts[scriptId]; @@ -284,9 +284,9 @@ Promise.all(promises).then(this._patternChangeFinishedForTests.bind(this)); /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @return {!Promise<undefined>} - * @this {WebInspector.BlackboxManager} + * @this {Bindings.BlackboxManager} */ function loadSourceMap(script) { return this.sourceMapLoaded(script, this._debuggerWorkspaceBinding.sourceMapForScript(script)); @@ -298,24 +298,24 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _globalObjectCleared(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); this._debuggerModelData.delete(debuggerModel); this._isBlackboxedURLCache.clear(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _parsedScriptSource(event) { - var script = /** @type {!WebInspector.Script} */ (event.data); + var script = /** @type {!SDK.Script} */ (event.data); this._addScript(script); } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @return {!Promise<undefined>} */ _addScript(script) { @@ -324,7 +324,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @return {boolean} */ _isBlackboxedScript(script) { @@ -332,7 +332,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @return {?Array<!Protocol.Debugger.ScriptPosition>} */ _scriptPositions(script) { @@ -342,7 +342,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @param {!Array<!Protocol.Debugger.ScriptPosition>} positions */ _setScriptPositions(script, positions) { @@ -353,7 +353,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @param {!Array<!Protocol.Debugger.ScriptPosition>} positions * @return {!Promise<undefined>} */ @@ -376,7 +376,7 @@ /** * @param {boolean} success - * @this {WebInspector.BlackboxManager} + * @this {Bindings.BlackboxManager} */ function updateState(success) { if (success) { @@ -398,7 +398,7 @@ * @return {string} */ _urlToRegExpString(url) { - var parsedURL = new WebInspector.ParsedURL(url); + var parsedURL = new Common.ParsedURL(url); if (parsedURL.isAboutBlank() || parsedURL.isDataURL()) return ''; if (!parsedURL.isValid) @@ -424,5 +424,5 @@ } }; -/** @type {!WebInspector.BlackboxManager} */ -WebInspector.blackboxManager; +/** @type {!Bindings.BlackboxManager} */ +Bindings.blackboxManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js index 4c45f44..ce05b45 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
@@ -28,37 +28,37 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.BreakpointManager = class extends WebInspector.Object { +Bindings.BreakpointManager = class extends Common.Object { /** - * @param {?WebInspector.Setting} breakpointsSetting - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {?Common.Setting} breakpointsSetting + * @param {!Workspace.Workspace} workspace + * @param {!SDK.TargetManager} targetManager + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(breakpointsSetting, workspace, targetManager, debuggerWorkspaceBinding) { super(); - this._storage = new WebInspector.BreakpointManager.Storage(this, breakpointsSetting); + this._storage = new Bindings.BreakpointManager.Storage(this, breakpointsSetting); this._workspace = workspace; this._targetManager = targetManager; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; this._breakpointsActive = true; - /** @type {!Map<!WebInspector.UISourceCode, !Map<number, !Map<number, !Array<!WebInspector.BreakpointManager.Breakpoint>>>>} */ + /** @type {!Map<!Workspace.UISourceCode, !Map<number, !Map<number, !Array<!Bindings.BreakpointManager.Breakpoint>>>>} */ this._breakpointsForUISourceCode = new Map(); - /** @type {!Map<!WebInspector.UISourceCode, !Array<!WebInspector.BreakpointManager.Breakpoint>>} */ + /** @type {!Map<!Workspace.UISourceCode, !Array<!Bindings.BreakpointManager.Breakpoint>>} */ this._breakpointsForPrimaryUISourceCode = new Map(); - /** @type {!Multimap.<string, !WebInspector.BreakpointManager.Breakpoint>} */ + /** @type {!Multimap.<string, !Bindings.BreakpointManager.Breakpoint>} */ this._provisionalBreakpoints = new Multimap(); - this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this); - this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); + this._workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); + Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - targetManager.observeTargets(this, WebInspector.Target.Capability.JS); + targetManager.observeTargets(this, SDK.Target.Capability.JS); } /** @@ -74,7 +74,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ _sourceFileId(uiSourceCode) { @@ -84,24 +84,24 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel && !this._breakpointsActive) debuggerModel.setBreakpointsActive(this._breakpointsActive); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } /** * @param {string} sourceFileId - * @return {!Map.<string, !WebInspector.BreakpointManager.Breakpoint>} + * @return {!Map.<string, !Bindings.BreakpointManager.Breakpoint>} */ _provisionalBreakpointsForSourceFileId(sourceFileId) { var result = new Map(); @@ -119,7 +119,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _restoreBreakpoints(uiSourceCode) { var sourceFileId = this._sourceFileId(uiSourceCode); @@ -131,7 +131,7 @@ var provisionalBreakpoints = this._provisionalBreakpointsForSourceFileId(sourceFileId); for (var i = 0; i < breakpointItems.length; ++i) { var breakpointItem = breakpointItems[i]; - var itemStorageId = WebInspector.BreakpointManager._breakpointStorageId( + var itemStorageId = Bindings.BreakpointManager._breakpointStorageId( breakpointItem.sourceFileId, breakpointItem.lineNumber, breakpointItem.columnNumber); var provisionalBreakpoint = provisionalBreakpoints.get(itemStorageId); if (provisionalBreakpoint) { @@ -150,32 +150,32 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._restoreBreakpoints(uiSourceCode); if (uiSourceCode.contentType().hasScripts()) { uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); + Workspace.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._removeUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeMappingChanged(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); var isIdentity = /** @type {boolean} */ (event.data.isIdentity); - var target = /** @type {!WebInspector.Target} */ (event.data.target); + var target = /** @type {!SDK.Target} */ (event.data.target); if (isIdentity) return; var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || []; @@ -184,7 +184,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeUISourceCode(uiSourceCode) { var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || []; @@ -195,23 +195,23 @@ this._provisionalBreakpoints.set(sourceFileId, breakpoints[i]); } uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); + Workspace.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); this._breakpointsForPrimaryUISourceCode.remove(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber * @param {string} condition * @param {boolean} enabled - * @return {!WebInspector.BreakpointManager.Breakpoint} + * @return {!Bindings.BreakpointManager.Breakpoint} */ setBreakpoint(uiSourceCode, lineNumber, columnNumber, condition, enabled) { - var uiLocation = new WebInspector.UILocation(uiSourceCode, lineNumber, columnNumber); + var uiLocation = new Workspace.UILocation(uiSourceCode, lineNumber, columnNumber); var normalizedLocation = this._debuggerWorkspaceBinding.normalizeUILocation(uiLocation); if (normalizedLocation.id() !== uiLocation.id()) { - WebInspector.Revealer.reveal(normalizedLocation); + Common.Revealer.reveal(normalizedLocation); uiLocation = normalizedLocation; } this.setBreakpointsActive(true); @@ -220,12 +220,12 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber * @param {string} condition * @param {boolean} enabled - * @return {!WebInspector.BreakpointManager.Breakpoint} + * @return {!Bindings.BreakpointManager.Breakpoint} */ _innerSetBreakpoint(uiSourceCode, lineNumber, columnNumber, condition, enabled) { var breakpoint = this.findBreakpoint(uiSourceCode, lineNumber, columnNumber); @@ -236,7 +236,7 @@ var projectId = uiSourceCode.project().id(); var path = uiSourceCode.url(); var sourceFileId = this._sourceFileId(uiSourceCode); - breakpoint = new WebInspector.BreakpointManager.Breakpoint( + breakpoint = new Bindings.BreakpointManager.Breakpoint( this, projectId, path, sourceFileId, lineNumber, columnNumber, condition, enabled); if (!this._breakpointsForPrimaryUISourceCode.get(uiSourceCode)) this._breakpointsForPrimaryUISourceCode.set(uiSourceCode, []); @@ -245,9 +245,9 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber - * @return {!Array<!WebInspector.BreakpointManager.Breakpoint>} + * @return {!Array<!Bindings.BreakpointManager.Breakpoint>} */ findBreakpoints(uiSourceCode, lineNumber) { var breakpoints = this._breakpointsForUISourceCode.get(uiSourceCode); @@ -256,10 +256,10 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.BreakpointManager.Breakpoint} + * @return {?Bindings.BreakpointManager.Breakpoint} */ findBreakpoint(uiSourceCode, lineNumber, columnNumber) { var breakpoints = this._breakpointsForUISourceCode.get(uiSourceCode); @@ -269,12 +269,12 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.TextRange} textRange - * @return {!Promise<!Array<!WebInspector.UILocation>>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Common.TextRange} textRange + * @return {!Promise<!Array<!Workspace.UILocation>>} */ possibleBreakpoints(uiSourceCode, textRange) { - var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); + var targets = this._targetManager.targets(SDK.Target.Capability.JS); if (!targets.length) return Promise.resolve([]); for (var target of targets) { @@ -284,20 +284,20 @@ var endLocation = this._debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode, textRange.endLine, textRange.endColumn); if (!endLocation) continue; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); return debuggerModel.getPossibleBreakpoints(startLocation, endLocation).then(toUILocations.bind(this)); } return Promise.resolve([]); /** - * @this {!WebInspector.BreakpointManager} - * @param {!Array<!WebInspector.DebuggerModel.Location>} locations - * @return {!Array<!WebInspector.UILocation>} + * @this {!Bindings.BreakpointManager} + * @param {!Array<!SDK.DebuggerModel.Location>} locations + * @return {!Array<!Workspace.UILocation>} */ function toUILocations(locations) { var sortedLocations = locations.map(location => this._debuggerWorkspaceBinding.rawLocationToUILocation(location)); sortedLocations = sortedLocations.filter(location => location && location.uiSourceCode === uiSourceCode); - sortedLocations.sort(WebInspector.UILocation.comparator); + sortedLocations.sort(Workspace.UILocation.comparator); if (!sortedLocations.length) return []; var result = [ sortedLocations[0] ]; @@ -313,8 +313,8 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Array.<!WebInspector.BreakpointManager.Breakpoint>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Array.<!Bindings.BreakpointManager.Breakpoint>} */ breakpointsForUISourceCode(uiSourceCode) { var result = []; @@ -329,7 +329,7 @@ } /** - * @return {!Array.<!WebInspector.BreakpointManager.Breakpoint>} + * @return {!Array.<!Bindings.BreakpointManager.Breakpoint>} */ allBreakpoints() { var result = []; @@ -340,8 +340,8 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Array.<!{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLocation: !Workspace.UILocation}>} */ breakpointLocationsForUISourceCode(uiSourceCode) { var uiSourceCodeBreakpoints = this._breakpointsForUISourceCode.get(uiSourceCode); @@ -365,7 +365,7 @@ } /** - * @return {!Array.<!{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>} + * @return {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLocation: !Workspace.UILocation}>} */ allBreakpointLocations() { var result = []; @@ -391,14 +391,14 @@ } _projectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); var uiSourceCodes = project.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) this._removeUISourceCode(uiSourceCodes[i]); } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint * @param {boolean} removeFromStorage */ _removeBreakpoint(breakpoint, removeFromStorage) { @@ -411,8 +411,8 @@ } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint - * @param {!WebInspector.UILocation} uiLocation + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint + * @param {!Workspace.UILocation} uiLocation */ _uiLocationAdded(breakpoint, uiLocation) { var breakpoints = this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode); @@ -432,12 +432,12 @@ } columnBreakpoints.push(breakpoint); this.dispatchEventToListeners( - WebInspector.BreakpointManager.Events.BreakpointAdded, {breakpoint: breakpoint, uiLocation: uiLocation}); + Bindings.BreakpointManager.Events.BreakpointAdded, {breakpoint: breakpoint, uiLocation: uiLocation}); } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint - * @param {!WebInspector.UILocation} uiLocation + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint + * @param {!Workspace.UILocation} uiLocation */ _uiLocationRemoved(breakpoint, uiLocation) { var breakpoints = this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode); @@ -458,7 +458,7 @@ if (!breakpoints.size) this._breakpointsForUISourceCode.remove(uiLocation.uiSourceCode); this.dispatchEventToListeners( - WebInspector.BreakpointManager.Events.BreakpointRemoved, {breakpoint: breakpoint, uiLocation: uiLocation}); + Bindings.BreakpointManager.Events.BreakpointRemoved, {breakpoint: breakpoint, uiLocation: uiLocation}); } /** @@ -469,11 +469,11 @@ return; this._breakpointsActive = active; - var debuggerModels = WebInspector.DebuggerModel.instances(); + var debuggerModels = SDK.DebuggerModel.instances(); for (var i = 0; i < debuggerModels.length; ++i) debuggerModels[i].setBreakpointsActive(active); - this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointsActiveStateChanged, active); + this.dispatchEventToListeners(Bindings.BreakpointManager.Events.BreakpointsActiveStateChanged, active); } /** @@ -485,7 +485,7 @@ }; /** @enum {symbol} */ -WebInspector.BreakpointManager.Events = { +Bindings.BreakpointManager.Events = { BreakpointAdded: Symbol('breakpoint-added'), BreakpointRemoved: Symbol('breakpoint-removed'), BreakpointsActiveStateChanged: Symbol('BreakpointsActiveStateChanged') @@ -493,12 +493,12 @@ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.BreakpointManager.Breakpoint = class { +Bindings.BreakpointManager.Breakpoint = class { /** - * @param {!WebInspector.BreakpointManager} breakpointManager + * @param {!Bindings.BreakpointManager} breakpointManager * @param {string} projectId * @param {string} path * @param {string} sourceFileId @@ -522,10 +522,10 @@ /** @type {string} */ this._condition; /** @type {boolean} */ this._enabled; /** @type {boolean} */ this._isRemoved; - /** @type {!WebInspector.UILocation|undefined} */ this._fakePrimaryLocation; + /** @type {!Workspace.UILocation|undefined} */ this._fakePrimaryLocation; this._currentState = null; - /** @type {!Map.<!WebInspector.Target, !WebInspector.BreakpointManager.TargetBreakpoint>}*/ + /** @type {!Map.<!SDK.Target, !Bindings.BreakpointManager.TargetBreakpoint>}*/ this._targetBreakpoints = new Map(); this._updateState(condition, enabled); this._breakpointManager._targetManager.observeTargets(this); @@ -533,23 +533,23 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return; var debuggerWorkspaceBinding = this._breakpointManager._debuggerWorkspaceBinding; this._targetBreakpoints.set( - target, new WebInspector.BreakpointManager.TargetBreakpoint(debuggerModel, this, debuggerWorkspaceBinding)); + target, new Bindings.BreakpointManager.TargetBreakpoint(debuggerModel, this, debuggerWorkspaceBinding)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return; var targetBreakpoint = this._targetBreakpoints.remove(target); @@ -586,15 +586,15 @@ } /** - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCode() { return this._breakpointManager._workspace.uiSourceCode(this._projectId, this._path); } /** - * @param {?WebInspector.UILocation} oldUILocation - * @param {!WebInspector.UILocation} newUILocation + * @param {?Workspace.UILocation} oldUILocation + * @param {!Workspace.UILocation} newUILocation */ _replaceUILocation(oldUILocation, newUILocation) { if (this._isRemoved) @@ -610,7 +610,7 @@ } /** - * @param {?WebInspector.UILocation} uiLocation + * @param {?Workspace.UILocation} uiLocation * @param {boolean=} muteCreationFakeBreakpoint */ _removeUILocation(uiLocation, muteCreationFakeBreakpoint) { @@ -694,7 +694,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _updateInDebuggerForTarget(target) { this._targetBreakpoints.get(target)._scheduleUpdateInDebugger(); @@ -704,7 +704,7 @@ * @return {string} */ _breakpointStorageId() { - return WebInspector.BreakpointManager._breakpointStorageId( + return Bindings.BreakpointManager._breakpointStorageId( this._sourceFileId, this._lineNumber, this._columnNumber); } @@ -739,11 +739,11 @@ /** * @unrestricted */ -WebInspector.BreakpointManager.TargetBreakpoint = class extends WebInspector.SDKObject { +Bindings.BreakpointManager.TargetBreakpoint = class extends SDK.SDKObject { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, breakpoint, debuggerWorkspaceBinding) { super(debuggerModel.target()); @@ -751,14 +751,14 @@ this._breakpoint = breakpoint; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; - this._liveLocations = new WebInspector.LiveLocationPool(); + this._liveLocations = new Bindings.LiveLocationPool(); - /** @type {!Map<string, !WebInspector.UILocation>} */ + /** @type {!Map<string, !Workspace.UILocation>} */ this._uiLocations = new Map(); this._debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._cleanUpAfterDebuggerIsGone, this); + SDK.DebuggerModel.Events.DebuggerWasDisabled, this._cleanUpAfterDebuggerIsGone, this); this._debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._scheduleUpdateInDebugger, this); + SDK.DebuggerModel.Events.DebuggerWasEnabled, this._scheduleUpdateInDebugger, this); this._hasPendingUpdate = false; this._isUpdating = false; this._cancelCallback = false; @@ -828,20 +828,20 @@ else if (debuggerLocation) { var script = debuggerLocation.script(); if (script.sourceURL) - newState = new WebInspector.BreakpointManager.Breakpoint.State( + newState = new Bindings.BreakpointManager.Breakpoint.State( script.sourceURL, null, debuggerLocation.lineNumber, debuggerLocation.columnNumber, condition); else - newState = new WebInspector.BreakpointManager.Breakpoint.State( + newState = new Bindings.BreakpointManager.Breakpoint.State( null, debuggerLocation.scriptId, debuggerLocation.lineNumber, debuggerLocation.columnNumber, condition); } else if (this._breakpoint._currentState && this._breakpoint._currentState.url) { var position = this._breakpoint._currentState; - newState = new WebInspector.BreakpointManager.Breakpoint.State( + newState = new Bindings.BreakpointManager.Breakpoint.State( position.url, null, position.lineNumber, position.columnNumber, condition); } else if (uiSourceCode) { - newState = new WebInspector.BreakpointManager.Breakpoint.State( + newState = new Bindings.BreakpointManager.Breakpoint.State( uiSourceCode.url(), null, lineNumber, columnNumber, condition); } - if (this._debuggerId && WebInspector.BreakpointManager.Breakpoint.State.equals(newState, this._currentState)) { + if (this._debuggerId && Bindings.BreakpointManager.Breakpoint.State.equals(newState, this._currentState)) { callback(); return; } @@ -867,7 +867,7 @@ newState.url, newState.lineNumber, newState.columnNumber, this._breakpoint.condition(), updateCallback); else if (newState.scriptId) this._debuggerModel.setBreakpointBySourceId( - /** @type {!WebInspector.DebuggerModel.Location} */ (debuggerLocation), condition, updateCallback); + /** @type {!SDK.DebuggerModel.Location} */ (debuggerLocation), condition, updateCallback); this._currentState = newState; } @@ -875,7 +875,7 @@ /** * @param {function()} callback * @param {?Protocol.Debugger.BreakpointId} breakpointId - * @param {!Array.<!WebInspector.DebuggerModel.Location>} locations + * @param {!Array.<!SDK.DebuggerModel.Location>} locations */ _didSetBreakpointInDebugger(callback, breakpointId, locations) { if (this._cancelCallback) { @@ -916,15 +916,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _breakpointResolved(event) { - this._addResolvedLocation(/** @type {!WebInspector.DebuggerModel.Location}*/ (event.data)); + this._addResolvedLocation(/** @type {!SDK.DebuggerModel.Location}*/ (event.data)); } /** - * @param {!WebInspector.DebuggerModel.Location} location - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!SDK.DebuggerModel.Location} location + * @param {!Bindings.LiveLocation} liveLocation */ _locationUpdated(location, liveLocation) { var uiLocation = liveLocation.uiLocation(); @@ -936,7 +936,7 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} location + * @param {!SDK.DebuggerModel.Location} location * @return {boolean} */ _addResolvedLocation(location) { @@ -965,16 +965,16 @@ _removeEventListeners() { this._debuggerModel.removeEventListener( - WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._cleanUpAfterDebuggerIsGone, this); + SDK.DebuggerModel.Events.DebuggerWasDisabled, this._cleanUpAfterDebuggerIsGone, this); this._debuggerModel.removeEventListener( - WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._scheduleUpdateInDebugger, this); + SDK.DebuggerModel.Events.DebuggerWasEnabled, this._scheduleUpdateInDebugger, this); } }; /** * @unrestricted */ -WebInspector.BreakpointManager.Breakpoint.State = class { +Bindings.BreakpointManager.Breakpoint.State = class { /** * @param {?string} url * @param {?string} scriptId @@ -991,8 +991,8 @@ } /** - * @param {?WebInspector.BreakpointManager.Breakpoint.State|undefined} stateA - * @param {?WebInspector.BreakpointManager.Breakpoint.State|undefined} stateB + * @param {?Bindings.BreakpointManager.Breakpoint.State|undefined} stateA + * @param {?Bindings.BreakpointManager.Breakpoint.State|undefined} stateB * @return {boolean} */ static equals(stateA, stateB) { @@ -1011,19 +1011,19 @@ /** * @unrestricted */ -WebInspector.BreakpointManager.Storage = class { +Bindings.BreakpointManager.Storage = class { /** - * @param {!WebInspector.BreakpointManager} breakpointManager - * @param {?WebInspector.Setting} setting + * @param {!Bindings.BreakpointManager} breakpointManager + * @param {?Common.Setting} setting */ constructor(breakpointManager, setting) { this._breakpointManager = breakpointManager; - this._setting = setting || WebInspector.settings.createLocalSetting('breakpoints', []); + this._setting = setting || Common.settings.createLocalSetting('breakpoints', []); var breakpoints = this._setting.get(); - /** @type {!Object.<string, !WebInspector.BreakpointManager.Storage.Item>} */ + /** @type {!Object.<string, !Bindings.BreakpointManager.Storage.Item>} */ this._breakpoints = {}; for (var i = 0; i < breakpoints.length; ++i) { - var breakpoint = /** @type {!WebInspector.BreakpointManager.Storage.Item} */ (breakpoints[i]); + var breakpoint = /** @type {!Bindings.BreakpointManager.Storage.Item} */ (breakpoints[i]); breakpoint.columnNumber = breakpoint.columnNumber || 0; this._breakpoints[breakpoint.sourceFileId + ':' + breakpoint.lineNumber + ':' + breakpoint.columnNumber] = breakpoint; @@ -1040,7 +1040,7 @@ /** * @param {string} sourceFileId - * @return {!Array.<!WebInspector.BreakpointManager.Storage.Item>} + * @return {!Array.<!Bindings.BreakpointManager.Storage.Item>} */ breakpointItems(sourceFileId) { var result = []; @@ -1053,17 +1053,17 @@ } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint */ _updateBreakpoint(breakpoint) { if (this._muted || !breakpoint._breakpointStorageId()) return; - this._breakpoints[breakpoint._breakpointStorageId()] = new WebInspector.BreakpointManager.Storage.Item(breakpoint); + this._breakpoints[breakpoint._breakpointStorageId()] = new Bindings.BreakpointManager.Storage.Item(breakpoint); this._save(); } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint */ _removeBreakpoint(breakpoint) { if (this._muted) @@ -1083,9 +1083,9 @@ /** * @unrestricted */ -WebInspector.BreakpointManager.Storage.Item = class { +Bindings.BreakpointManager.Storage.Item = class { /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint */ constructor(breakpoint) { this.sourceFileId = breakpoint._sourceFileId; @@ -1096,5 +1096,5 @@ } }; -/** @type {!WebInspector.BreakpointManager} */ -WebInspector.breakpointManager; +/** @type {!Bindings.BreakpointManager} */ +Bindings.breakpointManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js index dd962fd..f563b5e 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
@@ -2,69 +2,69 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.CSSWorkspaceBinding = class { +Bindings.CSSWorkspaceBinding = class { /** - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping + * @param {!SDK.TargetManager} targetManager + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping */ constructor(targetManager, workspace, networkMapping) { this._workspace = workspace; this._networkMapping = networkMapping; - /** @type {!Map.<!WebInspector.CSSModel, !WebInspector.CSSWorkspaceBinding.TargetInfo>} */ + /** @type {!Map.<!SDK.CSSModel, !Bindings.CSSWorkspaceBinding.TargetInfo>} */ this._modelToTargetInfo = new Map(); targetManager.observeTargets(this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (cssModel) this._modelToTargetInfo.set( - cssModel, new WebInspector.CSSWorkspaceBinding.TargetInfo(cssModel, this._workspace, this._networkMapping)); + cssModel, new Bindings.CSSWorkspaceBinding.TargetInfo(cssModel, this._workspace, this._networkMapping)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (cssModel) this._modelToTargetInfo.remove(cssModel)._dispose(); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header - * @return {?WebInspector.CSSWorkspaceBinding.TargetInfo} + * @param {!SDK.CSSStyleSheetHeader} header + * @return {?Bindings.CSSWorkspaceBinding.TargetInfo} */ _targetInfo(header) { return this._modelToTargetInfo.get(header.cssModel()) || null; } /** - * @param {!WebInspector.CSSStyleSheetHeader} header - * @return {!WebInspector.CSSWorkspaceBinding.TargetInfo} + * @param {!SDK.CSSStyleSheetHeader} header + * @return {!Bindings.CSSWorkspaceBinding.TargetInfo} */ _ensureTargetInfo(header) { var targetInfo = this._modelToTargetInfo.get(header.cssModel()); if (!targetInfo) { targetInfo = - new WebInspector.CSSWorkspaceBinding.TargetInfo(header.cssModel(), this._workspace, this._networkMapping); + new Bindings.CSSWorkspaceBinding.TargetInfo(header.cssModel(), this._workspace, this._networkMapping); this._modelToTargetInfo.set(header.cssModel(), targetInfo); } return targetInfo; } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ updateLocations(header) { var targetInfo = this._targetInfo(header); @@ -73,27 +73,27 @@ } /** - * @param {!WebInspector.CSSLocation} rawLocation - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool - * @return {!WebInspector.CSSWorkspaceBinding.LiveLocation} + * @param {!SDK.CSSLocation} rawLocation + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool + * @return {!Bindings.CSSWorkspaceBinding.LiveLocation} */ createLiveLocation(rawLocation, updateDelegate, locationPool) { var header = rawLocation.styleSheetId ? rawLocation.cssModel().styleSheetHeaderForId(rawLocation.styleSheetId) : null; - return new WebInspector.CSSWorkspaceBinding.LiveLocation( + return new Bindings.CSSWorkspaceBinding.LiveLocation( rawLocation.cssModel(), header, rawLocation, this, updateDelegate, locationPool); } /** - * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location + * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location */ _addLiveLocation(location) { this._ensureTargetInfo(location._header)._addLocation(location); } /** - * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location + * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location */ _removeLiveLocation(location) { var targetInfo = this._targetInfo(location._header); @@ -102,13 +102,13 @@ } /** - * @param {!WebInspector.CSSProperty} cssProperty + * @param {!SDK.CSSProperty} cssProperty * @param {boolean} forName - * @return {?WebInspector.UILocation} + * @return {?Workspace.UILocation} */ propertyUILocation(cssProperty, forName) { var style = cssProperty.ownerStyle; - if (!style || style.type !== WebInspector.CSSStyleDeclaration.Type.Regular || !style.styleSheetId) + if (!style || style.type !== SDK.CSSStyleDeclaration.Type.Regular || !style.styleSheetId) return null; var header = style.cssModel().styleSheetHeaderForId(style.styleSheetId); if (!header) @@ -120,14 +120,14 @@ var lineNumber = range.startLine; var columnNumber = range.startColumn; - var rawLocation = new WebInspector.CSSLocation( + var rawLocation = new SDK.CSSLocation( header, header.lineNumberInSource(lineNumber), header.columnNumberInSource(lineNumber, columnNumber)); return this.rawLocationToUILocation(rawLocation); } /** - * @param {?WebInspector.CSSLocation} rawLocation - * @return {?WebInspector.UILocation} + * @param {?SDK.CSSLocation} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { if (!rawLocation) @@ -144,24 +144,24 @@ /** * @unrestricted */ -WebInspector.CSSWorkspaceBinding.TargetInfo = class { +Bindings.CSSWorkspaceBinding.TargetInfo = class { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping + * @param {!SDK.CSSModel} cssModel + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping */ constructor(cssModel, workspace, networkMapping) { this._cssModel = cssModel; - this._stylesSourceMapping = new WebInspector.StylesSourceMapping(cssModel, workspace, networkMapping); - this._sassSourceMapping = new WebInspector.SASSSourceMapping( - cssModel, networkMapping, WebInspector.NetworkProject.forTarget(cssModel.target())); + this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, workspace, networkMapping); + this._sassSourceMapping = new Bindings.SASSSourceMapping( + cssModel, networkMapping, Bindings.NetworkProject.forTarget(cssModel.target())); - /** @type {!Multimap<!WebInspector.CSSStyleSheetHeader, !WebInspector.LiveLocation>} */ + /** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.LiveLocation>} */ this._locations = new Multimap(); } /** - * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location + * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location */ _addLocation(location) { var header = location._header; @@ -170,14 +170,14 @@ } /** - * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location + * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location */ _removeLocation(location) { this._locations.remove(location._header, location); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ _updateLocations(header) { for (var location of this._locations.get(header)) @@ -185,13 +185,13 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @param {number} lineNumber * @param {number=} columnNumber - * @return {?WebInspector.UILocation} + * @return {?Workspace.UILocation} */ _rawLocationToUILocation(header, lineNumber, columnNumber) { - var rawLocation = new WebInspector.CSSLocation(header, lineNumber, columnNumber); + var rawLocation = new SDK.CSSLocation(header, lineNumber, columnNumber); var uiLocation = null; uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(rawLocation); uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation(rawLocation); @@ -207,14 +207,14 @@ /** * @unrestricted */ -WebInspector.CSSWorkspaceBinding.LiveLocation = class extends WebInspector.LiveLocationWithPool { +Bindings.CSSWorkspaceBinding.LiveLocation = class extends Bindings.LiveLocationWithPool { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {?WebInspector.CSSStyleSheetHeader} header - * @param {!WebInspector.CSSLocation} rawLocation - * @param {!WebInspector.CSSWorkspaceBinding} binding - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {!SDK.CSSModel} cssModel + * @param {?SDK.CSSStyleSheetHeader} header + * @param {!SDK.CSSLocation} rawLocation + * @param {!Bindings.CSSWorkspaceBinding} binding + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(cssModel, header, rawLocation, binding, updateDelegate, locationPool) { super(updateDelegate, locationPool); @@ -228,21 +228,21 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetAdded(event) { console.assert(!this._header); - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); if (header.sourceURL && header.sourceURL === this._rawLocation.url) this._setStyleSheet(header); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetRemoved(event) { console.assert(this._header); - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); if (this._header !== header) return; this._binding._removeLiveLocation(this); @@ -250,24 +250,24 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ _setStyleSheet(header) { this._header = header; this._binding._addLiveLocation(this); - this._cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); - this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); + this._cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); + this._cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); } _clearStyleSheet() { delete this._header; - this._cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); - this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); + this._cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); + this._cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); } /** * @override - * @return {?WebInspector.UILocation} + * @return {?Workspace.UILocation} */ uiLocation() { var cssLocation = this._rawLocation; @@ -288,8 +288,8 @@ super.dispose(); if (this._header) this._binding._removeLiveLocation(this); - this._cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); - this._cssModel.removeEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); + this._cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this); + this._cssModel.removeEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this); } /** @@ -302,6 +302,6 @@ }; /** - * @type {!WebInspector.CSSWorkspaceBinding} + * @type {!Bindings.CSSWorkspaceBinding} */ -WebInspector.cssWorkspaceBinding; +Bindings.cssWorkspaceBinding;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js index 93d569d..23f0356 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -28,16 +28,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.DebuggerSourceMapping} + * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ -WebInspector.CompilerScriptMapping = class { +Bindings.CompilerScriptMapping = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping - * @param {!WebInspector.NetworkProject} networkProject - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping + * @param {!Bindings.NetworkProject} networkProject + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, workspace, networkMapping, networkProject, debuggerWorkspaceBinding) { this._target = debuggerModel.target(); @@ -46,37 +46,37 @@ this._networkProject = networkProject; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; - /** @type {!Map<string, !Promise<?WebInspector.TextSourceMap>>} */ + /** @type {!Map<string, !Promise<?SDK.TextSourceMap>>} */ this._sourceMapLoadingPromises = new Map(); - /** @type {!Map<string, !WebInspector.TextSourceMap>} */ + /** @type {!Map<string, !SDK.TextSourceMap>} */ this._sourceMapForScriptId = new Map(); - /** @type {!Map.<!WebInspector.TextSourceMap, !WebInspector.Script>} */ + /** @type {!Map.<!SDK.TextSourceMap, !SDK.Script>} */ this._scriptForSourceMap = new Map(); - /** @type {!Map.<string, !WebInspector.TextSourceMap>} */ + /** @type {!Map.<string, !SDK.TextSourceMap>} */ this._sourceMapForURL = new Map(); - /** @type {!Map.<string, !WebInspector.UISourceCode>} */ + /** @type {!Map.<string, !Workspace.UISourceCode>} */ this._stubUISourceCodes = new Map(); - var projectId = WebInspector.CompilerScriptMapping.projectIdForTarget(this._target); + var projectId = Bindings.CompilerScriptMapping.projectIdForTarget(this._target); this._stubProject = - new WebInspector.ContentProviderBasedProject(workspace, projectId, WebInspector.projectTypes.Service, ''); + new Bindings.ContentProviderBasedProject(workspace, projectId, Workspace.projectTypes.Service, ''); this._eventListeners = [ workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this), - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this) + Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this), + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this) ]; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {?string} */ static uiSourceCodeOrigin(uiSourceCode) { - return uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] || null; + return uiSourceCode[Bindings.CompilerScriptMapping._originSymbol] || null; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {string} */ static projectIdForTarget(target) { @@ -84,7 +84,7 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation + * @param {!SDK.DebuggerModel.Location} rawLocation * @return {boolean} */ mapsToSourceCode(rawLocation) { @@ -97,15 +97,15 @@ /** * @override - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation); + var debuggerModelLocation = /** @type {!SDK.DebuggerModel.Location} */ (rawLocation); var stubUISourceCode = this._stubUISourceCodes.get(debuggerModelLocation.scriptId); if (stubUISourceCode) - return new WebInspector.UILocation(stubUISourceCode, rawLocation.lineNumber, rawLocation.columnNumber); + return new Workspace.UILocation(stubUISourceCode, rawLocation.lineNumber, rawLocation.columnNumber); var sourceMap = this._sourceMapForScriptId.get(debuggerModelLocation.scriptId); if (!sourceMap) @@ -127,18 +127,18 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { - if (uiSourceCode.project().type() === WebInspector.projectTypes.Service) + if (uiSourceCode.project().type() === Workspace.projectTypes.Service) return null; var sourceMap = this._sourceMapForURL.get(uiSourceCode.url()); if (!sourceMap) return null; - var script = /** @type {!WebInspector.Script} */ (this._scriptForSourceMap.get(sourceMap)); + var script = /** @type {!SDK.Script} */ (this._scriptForSourceMap.get(sourceMap)); console.assert(script); var entry = sourceMap.firstSourceLineMapping(uiSourceCode.url(), lineNumber); if (!entry) @@ -147,11 +147,11 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ addScript(script) { if (!script.sourceMapURL) { - script.addEventListener(WebInspector.Script.Events.SourceMapURLAdded, this._sourceMapURLAdded.bind(this)); + script.addEventListener(SDK.Script.Events.SourceMapURLAdded, this._sourceMapURLAdded.bind(this)); return; } @@ -159,15 +159,15 @@ } /** - * @param {!WebInspector.Script} script - * @return {?WebInspector.TextSourceMap} + * @param {!SDK.Script} script + * @return {?SDK.TextSourceMap} */ sourceMapForScript(script) { return this._sourceMapForScriptId.get(script.scriptId) || null; } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ maybeLoadSourceMap(script) { if (!script.sourceMapURL) @@ -180,26 +180,26 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _sourceMapURLAdded(event) { - var script = /** @type {!WebInspector.Script} */ (event.target); + var script = /** @type {!SDK.Script} */ (event.target); if (!script.sourceMapURL) return; this._processScript(script); } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ _processScript(script) { - if (WebInspector.blackboxManager.isBlackboxedURL(script.sourceURL, script.isContentScript())) + if (Bindings.blackboxManager.isBlackboxedURL(script.sourceURL, script.isContentScript())) return; // Create stub UISourceCode for the time source mapping is being loaded. var stubUISourceCode = this._stubProject.addContentProvider( script.sourceURL, - WebInspector.StaticContentProvider.fromString( - script.sourceURL, WebInspector.resourceTypes.Script, + Common.StaticContentProvider.fromString( + script.sourceURL, Common.resourceTypes.Script, '\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source map is being loaded!')); this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); @@ -208,12 +208,12 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @param {string} uiSourceCodePath - * @param {?WebInspector.TextSourceMap} sourceMap + * @param {?SDK.TextSourceMap} sourceMap */ _sourceMapLoaded(script, uiSourceCodePath, sourceMap) { - WebInspector.blackboxManager.sourceMapLoaded(script, sourceMap); + Bindings.blackboxManager.sourceMapLoaded(script, sourceMap); this._stubUISourceCodes.delete(script.scriptId); this._stubProject.removeFile(uiSourceCodePath); @@ -240,13 +240,13 @@ this._sourceMapForURL.set(sourceURL, sourceMap); var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sourceURL, script); if (!uiSourceCode) { - var contentProvider = sourceMap.sourceContentProvider(sourceURL, WebInspector.resourceTypes.SourceMapScript); + var contentProvider = sourceMap.sourceContentProvider(sourceURL, Common.resourceTypes.SourceMapScript); var embeddedContent = sourceMap.embeddedContentByURL(sourceURL); var embeddedContentLength = typeof embeddedContent === 'string' ? embeddedContent.length : null; uiSourceCode = this._networkProject.addFile( - contentProvider, WebInspector.ResourceTreeFrame.fromScript(script), script.isContentScript(), + contentProvider, SDK.ResourceTreeFrame.fromScript(script), script.isContentScript(), embeddedContentLength); - uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] = script.sourceURL; + uiSourceCode[Bindings.CompilerScriptMapping._originSymbol] = script.sourceURL; } if (uiSourceCode) { this._bindUISourceCode(uiSourceCode); @@ -258,7 +258,7 @@ } } if (missingSources.length) { - WebInspector.console.warn(WebInspector.UIString( + Common.console.warn(Common.UIString( 'Source map %s points to the files missing from the workspace: [%s]', sourceMap.url(), missingSources.join(', '))); } @@ -276,7 +276,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -288,59 +288,59 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _bindUISourceCode(uiSourceCode) { this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _unbindUISourceCode(uiSourceCode) { this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, null); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAddedToWorkspace(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (!this._sourceMapForURL.get(uiSourceCode.url())) return; this._bindUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.Script} script - * @return {!Promise<?WebInspector.TextSourceMap>} + * @param {!SDK.Script} script + * @return {!Promise<?SDK.TextSourceMap>} */ _loadSourceMapForScript(script) { // script.sourceURL can be a random string, but is generally an absolute path -> complete it to inspected page url for // relative links. - var scriptURL = WebInspector.ParsedURL.completeURL(this._target.inspectedURL(), script.sourceURL); + var scriptURL = Common.ParsedURL.completeURL(this._target.inspectedURL(), script.sourceURL); if (!scriptURL) - return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */ (null)); + return Promise.resolve(/** @type {?SDK.TextSourceMap} */ (null)); console.assert(script.sourceMapURL); var scriptSourceMapURL = /** @type {string} */ (script.sourceMapURL); - var sourceMapURL = WebInspector.ParsedURL.completeURL(scriptURL, scriptSourceMapURL); + var sourceMapURL = Common.ParsedURL.completeURL(scriptURL, scriptSourceMapURL); if (!sourceMapURL) - return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */ (null)); + return Promise.resolve(/** @type {?SDK.TextSourceMap} */ (null)); var loadingPromise = this._sourceMapLoadingPromises.get(sourceMapURL); if (!loadingPromise) { loadingPromise = - WebInspector.TextSourceMap.load(sourceMapURL, scriptURL).then(sourceMapLoaded.bind(this, sourceMapURL)); + SDK.TextSourceMap.load(sourceMapURL, scriptURL).then(sourceMapLoaded.bind(this, sourceMapURL)); this._sourceMapLoadingPromises.set(sourceMapURL, loadingPromise); } return loadingPromise; /** * @param {string} url - * @param {?WebInspector.TextSourceMap} sourceMap - * @this {WebInspector.CompilerScriptMapping} + * @param {?SDK.TextSourceMap} sourceMap + * @this {Bindings.CompilerScriptMapping} */ function sourceMapLoaded(url, sourceMap) { if (!sourceMap) { @@ -354,8 +354,8 @@ _debuggerReset() { /** - * @param {!WebInspector.TextSourceMap} sourceMap - * @this {WebInspector.CompilerScriptMapping} + * @param {!SDK.TextSourceMap} sourceMap + * @this {Bindings.CompilerScriptMapping} */ function unbindSourceMapSources(sourceMap) { var script = this._scriptForSourceMap.get(sourceMap); @@ -377,10 +377,10 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); this._debuggerReset(); this._stubProject.dispose(); } }; -WebInspector.CompilerScriptMapping._originSymbol = Symbol('origin'); +Bindings.CompilerScriptMapping._originSymbol = Symbol('origin');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js b/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js index 0cbe1aee..4bb95ea7 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ContentProviderBasedProject.js
@@ -29,26 +29,26 @@ */ /** - * @implements {WebInspector.Project} + * @implements {Workspace.Project} * @unrestricted */ -WebInspector.ContentProviderBasedProject = class extends WebInspector.ProjectStore { +Bindings.ContentProviderBasedProject = class extends Workspace.ProjectStore { /** - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.Workspace} workspace * @param {string} id - * @param {!WebInspector.projectTypes} type + * @param {!Workspace.projectTypes} type * @param {string} displayName */ constructor(workspace, id, type, displayName) { super(workspace, id, type, displayName); - /** @type {!Object.<string, !WebInspector.ContentProvider>} */ + /** @type {!Object.<string, !Common.ContentProvider>} */ this._contentProviders = {}; workspace.addProject(this); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(?string)} callback */ requestFileContent(uiSourceCode, callback) { @@ -58,11 +58,11 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Promise<?WebInspector.UISourceCodeMetadata>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Promise<?Workspace.UISourceCodeMetadata>} */ requestMetadata(uiSourceCode) { - return Promise.resolve(uiSourceCode[WebInspector.ContentProviderBasedProject._metadata]); + return Promise.resolve(uiSourceCode[Bindings.ContentProviderBasedProject._metadata]); } /** @@ -75,7 +75,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newContent * @param {function(?string)} callback */ @@ -93,9 +93,9 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newName - * @param {function(boolean, string=, string=, !WebInspector.ResourceType=)} callback + * @param {function(boolean, string=, string=, !Common.ResourceType=)} callback */ rename(uiSourceCode, newName, callback) { var path = uiSourceCode.url(); @@ -104,7 +104,7 @@ /** * @param {boolean} success * @param {string=} newName - * @this {WebInspector.ContentProviderBasedProject} + * @this {Bindings.ContentProviderBasedProject} */ function innerCallback(success, newName) { if (success && newName) { @@ -131,7 +131,7 @@ * @param {string} path * @param {?string} name * @param {string} content - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ createFile(path, name, content, callback) { } @@ -160,11 +160,11 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInFileContent(uiSourceCode, query, caseSensitive, isRegex, callback) { var contentProvider = this._contentProviders[uiSourceCode.url()]; @@ -173,9 +173,9 @@ /** * @override - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {!Array.<string>} filesMathingFileQuery - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {function(!Array.<string>)} callback */ findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress, callback) { @@ -197,14 +197,14 @@ /** * @param {string} path * @param {function(boolean)} callback - * @this {WebInspector.ContentProviderBasedProject} + * @this {Bindings.ContentProviderBasedProject} */ function searchInContent(path, callback) { var queriesToRun = searchConfig.queries().slice(); searchNextQuery.call(this); /** - * @this {WebInspector.ContentProviderBasedProject} + * @this {Bindings.ContentProviderBasedProject} */ function searchNextQuery() { if (!queriesToRun.length) { @@ -217,8 +217,8 @@ } /** - * @param {!Array.<!WebInspector.ContentProvider.SearchMatch>} searchMatches - * @this {WebInspector.ContentProviderBasedProject} + * @param {!Array.<!Common.ContentProvider.SearchMatch>} searchMatches + * @this {Bindings.ContentProviderBasedProject} */ function contentCallback(searchMatches) { if (!searchMatches.length) { @@ -247,27 +247,27 @@ /** * @override - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ indexContent(progress) { setImmediate(progress.done.bind(progress)); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.ContentProvider} contentProvider - * @param {?WebInspector.UISourceCodeMetadata} metadata + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Common.ContentProvider} contentProvider + * @param {?Workspace.UISourceCodeMetadata} metadata */ addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata) { this._contentProviders[uiSourceCode.url()] = contentProvider; - uiSourceCode[WebInspector.ContentProviderBasedProject._metadata] = metadata; + uiSourceCode[Bindings.ContentProviderBasedProject._metadata] = metadata; this.addUISourceCode(uiSourceCode, true); } /** * @param {string} url - * @param {!WebInspector.ContentProvider} contentProvider - * @return {!WebInspector.UISourceCode} + * @param {!Common.ContentProvider} contentProvider + * @return {!Workspace.UISourceCode} */ addContentProvider(url, contentProvider) { var uiSourceCode = this.createUISourceCode(url, contentProvider.contentType()); @@ -295,4 +295,4 @@ } }; -WebInspector.ContentProviderBasedProject._metadata = Symbol('ContentProviderBasedProject.Metadata'); +Bindings.ContentProviderBasedProject._metadata = Symbol('ContentProviderBasedProject.Metadata');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js index c49fc31..dbf9f63f 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
@@ -2,52 +2,52 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.DebuggerWorkspaceBinding = class { +Bindings.DebuggerWorkspaceBinding = class { /** - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping + * @param {!SDK.TargetManager} targetManager + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping */ constructor(targetManager, workspace, networkMapping) { this._workspace = workspace; this._networkMapping = networkMapping; // FIXME: Migrate from _targetToData to _debuggerModelToData. - /** @type {!Map.<!WebInspector.Target, !WebInspector.DebuggerWorkspaceBinding.TargetData>} */ + /** @type {!Map.<!SDK.Target, !Bindings.DebuggerWorkspaceBinding.TargetData>} */ this._targetToData = new Map(); targetManager.observeTargets(this); targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, + SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, this); targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.BeforeDebuggerPaused, this._beforeDebuggerPaused, + SDK.DebuggerModel, SDK.DebuggerModel.Events.BeforeDebuggerPaused, this._beforeDebuggerPaused, this); targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); + workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel) - this._targetToData.set(target, new WebInspector.DebuggerWorkspaceBinding.TargetData(debuggerModel, this)); + this._targetToData.set(target, new Bindings.DebuggerWorkspaceBinding.TargetData(debuggerModel, this)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - if (!WebInspector.DebuggerModel.fromTarget(target)) + if (!SDK.DebuggerModel.fromTarget(target)) return; var targetData = this._targetToData.get(target); targetData._dispose(); @@ -55,20 +55,20 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); var targetDatas = this._targetToData.valuesArray(); for (var i = 0; i < targetDatas.length; ++i) targetDatas[i]._uiSourceCodeRemoved(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _projectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); var targetDatas = this._targetToData.valuesArray(); var uiSourceCodes = project.uiSourceCodes(); for (var i = 0; i < targetDatas.length; ++i) { @@ -78,8 +78,8 @@ } /** - * @param {!WebInspector.Script} script - * @param {!WebInspector.DebuggerSourceMapping} sourceMapping + * @param {!SDK.Script} script + * @param {!Bindings.DebuggerSourceMapping} sourceMapping */ pushSourceMapping(script, sourceMapping) { var info = this._ensureInfoForScript(script); @@ -87,8 +87,8 @@ } /** - * @param {!WebInspector.Script} script - * @return {!WebInspector.DebuggerSourceMapping} + * @param {!SDK.Script} script + * @return {!Bindings.DebuggerSourceMapping} */ popSourceMapping(script) { var info = this._infoForScript(script.target(), script.scriptId); @@ -97,9 +97,9 @@ } /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {?WebInspector.DebuggerSourceMapping} sourceMapping + * @param {!SDK.Target} target + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {?Bindings.DebuggerSourceMapping} sourceMapping */ setSourceMapping(target, uiSourceCode, sourceMapping) { var data = this._targetToData.get(target); @@ -108,7 +108,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ updateLocations(script) { var info = this._infoForScript(script.target(), script.scriptId); @@ -117,39 +117,39 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool - * @return {!WebInspector.DebuggerWorkspaceBinding.Location} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool + * @return {!Bindings.DebuggerWorkspaceBinding.Location} */ createLiveLocation(rawLocation, updateDelegate, locationPool) { var info = this._infoForScript(rawLocation.target(), rawLocation.scriptId); console.assert(info); - var location = new WebInspector.DebuggerWorkspaceBinding.Location( + var location = new Bindings.DebuggerWorkspaceBinding.Location( info._script, rawLocation, this, updateDelegate, locationPool); info._addLocation(location); return location; } /** - * @param {!Array<!WebInspector.DebuggerModel.Location>} rawLocations - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool - * @return {!WebInspector.LiveLocation} + * @param {!Array<!SDK.DebuggerModel.Location>} rawLocations + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool + * @return {!Bindings.LiveLocation} */ createStackTraceTopFrameLiveLocation(rawLocations, updateDelegate, locationPool) { console.assert(rawLocations.length); - var location = new WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation( + var location = new Bindings.DebuggerWorkspaceBinding.StackTraceTopFrameLocation( rawLocations, this, updateDelegate, locationPool); location.update(); return location; } /** - * @param {!WebInspector.DebuggerModel.Location} location - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool - * @return {?WebInspector.DebuggerWorkspaceBinding.Location} + * @param {!SDK.DebuggerModel.Location} location + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool + * @return {?Bindings.DebuggerWorkspaceBinding.Location} */ createCallFrameLiveLocation(location, updateDelegate, locationPool) { var script = location.script(); @@ -163,8 +163,8 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {!WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {!Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { var info = this._infoForScript(rawLocation.target(), rawLocation.scriptId); @@ -173,24 +173,24 @@ } /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!SDK.Target} target + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(target, uiSourceCode, lineNumber, columnNumber) { var targetData = this._targetToData.get(target); - return targetData ? /** @type {?WebInspector.DebuggerModel.Location} */ ( + return targetData ? /** @type {?SDK.DebuggerModel.Location} */ ( targetData._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber)) : null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {!Array.<!WebInspector.DebuggerModel.Location>} + * @return {!Array.<!SDK.DebuggerModel.Location>} */ uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { var result = []; @@ -204,11 +204,11 @@ } /** - * @param {!WebInspector.UILocation} uiLocation - * @return {!WebInspector.UILocation} + * @param {!Workspace.UILocation} uiLocation + * @return {!Workspace.UILocation} */ normalizeUILocation(uiLocation) { - var target = WebInspector.NetworkProject.targetForUISourceCode(uiLocation.uiSourceCode); + var target = Bindings.NetworkProject.targetForUISourceCode(uiLocation.uiSourceCode); if (target) { var rawLocation = this.uiLocationToRawLocation(target, uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber); @@ -219,7 +219,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -233,9 +233,9 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.Target} target - * @return {?WebInspector.ResourceScriptFile} + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!SDK.Target} target + * @return {?Bindings.ResourceScriptFile} */ scriptFile(uiSourceCode, target) { var targetData = this._targetToData.get(target); @@ -243,8 +243,8 @@ } /** - * @param {!WebInspector.Script} script - * @return {?WebInspector.TextSourceMap} + * @param {!SDK.Script} script + * @return {?SDK.TextSourceMap} */ sourceMapForScript(script) { var targetData = this._targetToData.get(script.target()); @@ -254,7 +254,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ maybeLoadSourceMap(script) { var targetData = this._targetToData.get(script.target()); @@ -264,15 +264,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _globalObjectCleared(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); this._reset(debuggerModel.target()); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _reset(target) { var targetData = this._targetToData.get(target); @@ -281,23 +281,23 @@ } /** - * @param {!WebInspector.Script} script - * @return {!WebInspector.DebuggerWorkspaceBinding.ScriptInfo} + * @param {!SDK.Script} script + * @return {!Bindings.DebuggerWorkspaceBinding.ScriptInfo} */ _ensureInfoForScript(script) { var scriptDataMap = this._targetToData.get(script.target()).scriptDataMap; var info = scriptDataMap.get(script.scriptId); if (!info) { - info = new WebInspector.DebuggerWorkspaceBinding.ScriptInfo(script); + info = new Bindings.DebuggerWorkspaceBinding.ScriptInfo(script); scriptDataMap.set(script.scriptId, info); } return info; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} scriptId - * @return {?WebInspector.DebuggerWorkspaceBinding.ScriptInfo} + * @return {?Bindings.DebuggerWorkspaceBinding.ScriptInfo} */ _infoForScript(target, scriptId) { var data = this._targetToData.get(target); @@ -307,8 +307,8 @@ } /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location + * @param {!SDK.Target} target + * @param {!Bindings.DebuggerWorkspaceBinding.Location} location */ _registerCallFrameLiveLocation(target, location) { var locations = this._targetToData.get(target).callFrameLocations; @@ -316,7 +316,7 @@ } /** - * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location + * @param {!Bindings.DebuggerWorkspaceBinding.Location} location */ _removeLiveLocation(location) { var info = this._infoForScript(location._script.target(), location._script.scriptId); @@ -325,15 +325,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerResumed(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); this._reset(debuggerModel.target()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _beforeDebuggerPaused(event) { var rawLocation = event.data.callFrames[0].location(); @@ -348,56 +348,56 @@ /** * @unrestricted */ -WebInspector.DebuggerWorkspaceBinding.TargetData = class { +Bindings.DebuggerWorkspaceBinding.TargetData = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, debuggerWorkspaceBinding) { this._target = debuggerModel.target(); - /** @type {!Map.<string, !WebInspector.DebuggerWorkspaceBinding.ScriptInfo>} */ + /** @type {!Map.<string, !Bindings.DebuggerWorkspaceBinding.ScriptInfo>} */ this.scriptDataMap = new Map(); - /** @type {!Set.<!WebInspector.DebuggerWorkspaceBinding.Location>} */ + /** @type {!Set.<!Bindings.DebuggerWorkspaceBinding.Location>} */ this.callFrameLocations = new Set(); var workspace = debuggerWorkspaceBinding._workspace; var networkMapping = debuggerWorkspaceBinding._networkMapping; - this._defaultMapping = new WebInspector.DefaultScriptMapping(debuggerModel, workspace, debuggerWorkspaceBinding); + this._defaultMapping = new Bindings.DefaultScriptMapping(debuggerModel, workspace, debuggerWorkspaceBinding); this._resourceMapping = - new WebInspector.ResourceScriptMapping(debuggerModel, workspace, networkMapping, debuggerWorkspaceBinding); - this._compilerMapping = new WebInspector.CompilerScriptMapping( - debuggerModel, workspace, networkMapping, WebInspector.NetworkProject.forTarget(this._target), + new Bindings.ResourceScriptMapping(debuggerModel, workspace, networkMapping, debuggerWorkspaceBinding); + this._compilerMapping = new Bindings.CompilerScriptMapping( + debuggerModel, workspace, networkMapping, Bindings.NetworkProject.forTarget(this._target), debuggerWorkspaceBinding); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.DebuggerSourceMapping>} */ + /** @type {!Map.<!Workspace.UISourceCode, !Bindings.DebuggerSourceMapping>} */ this._uiSourceCodeToSourceMapping = new Map(); this._eventListeners = [ debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this), + SDK.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this), debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this) + SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this) ]; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _parsedScriptSource(event) { - var script = /** @type {!WebInspector.Script} */ (event.data); + var script = /** @type {!SDK.Script} */ (event.data); this._defaultMapping.addScript(script); this._resourceMapping.addScript(script); - if (WebInspector.moduleSetting('jsSourceMapsEnabled').get()) + if (Common.moduleSetting('jsSourceMapsEnabled').get()) this._compilerMapping.addScript(script); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {?WebInspector.DebuggerSourceMapping} sourceMapping + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {?Bindings.DebuggerSourceMapping} sourceMapping */ _setSourceMapping(uiSourceCode, sourceMapping) { if (this._uiSourceCodeToSourceMapping.get(uiSourceCode) === sourceMapping) @@ -409,15 +409,15 @@ this._uiSourceCodeToSourceMapping.remove(uiSourceCode); uiSourceCode.dispatchEventToListeners( - WebInspector.UISourceCode.Events.SourceMappingChanged, + Workspace.UISourceCode.Events.SourceMappingChanged, {target: this._target, isIdentity: sourceMapping ? sourceMapping.isIdentity() : false}); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ _uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var sourceMapping = this._uiSourceCodeToSourceMapping.get(uiSourceCode); @@ -425,7 +425,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -435,14 +435,14 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _uiSourceCodeRemoved(uiSourceCode) { this._uiSourceCodeToSourceMapping.remove(uiSourceCode); } _dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); this._compilerMapping.dispose(); this._resourceMapping.dispose(); this._defaultMapping.dispose(); @@ -453,22 +453,22 @@ /** * @unrestricted */ -WebInspector.DebuggerWorkspaceBinding.ScriptInfo = class { +Bindings.DebuggerWorkspaceBinding.ScriptInfo = class { /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ constructor(script) { this._script = script; - /** @type {!Array.<!WebInspector.DebuggerSourceMapping>} */ + /** @type {!Array.<!Bindings.DebuggerSourceMapping>} */ this._sourceMappings = []; - /** @type {!Set<!WebInspector.LiveLocation>} */ + /** @type {!Set<!Bindings.LiveLocation>} */ this._locations = new Set(); } /** - * @param {!WebInspector.DebuggerSourceMapping} sourceMapping + * @param {!Bindings.DebuggerSourceMapping} sourceMapping */ _pushSourceMapping(sourceMapping) { this._sourceMappings.push(sourceMapping); @@ -476,7 +476,7 @@ } /** - * @return {!WebInspector.DebuggerSourceMapping} + * @return {!Bindings.DebuggerSourceMapping} */ _popSourceMapping() { var sourceMapping = this._sourceMappings.pop(); @@ -485,7 +485,7 @@ } /** - * @param {!WebInspector.LiveLocation} location + * @param {!Bindings.LiveLocation} location */ _addLocation(location) { this._locations.add(location); @@ -493,7 +493,7 @@ } /** - * @param {!WebInspector.LiveLocation} location + * @param {!Bindings.LiveLocation} location */ _removeLocation(location) { this._locations.delete(location); @@ -505,28 +505,28 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {!WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {!Workspace.UILocation} */ _rawLocationToUILocation(rawLocation) { var uiLocation; for (var i = this._sourceMappings.length - 1; !uiLocation && i >= 0; --i) uiLocation = this._sourceMappings[i].rawLocationToUILocation(rawLocation); console.assert(uiLocation, 'Script raw location cannot be mapped to any UI location.'); - return /** @type {!WebInspector.UILocation} */ (uiLocation); + return /** @type {!Workspace.UILocation} */ (uiLocation); } }; /** * @unrestricted */ -WebInspector.DebuggerWorkspaceBinding.Location = class extends WebInspector.LiveLocationWithPool { +Bindings.DebuggerWorkspaceBinding.Location = class extends Bindings.LiveLocationWithPool { /** - * @param {!WebInspector.Script} script - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @param {!WebInspector.DebuggerWorkspaceBinding} binding - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {!SDK.Script} script + * @param {!SDK.DebuggerModel.Location} rawLocation + * @param {!Bindings.DebuggerWorkspaceBinding} binding + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(script, rawLocation, binding, updateDelegate, locationPool) { super(updateDelegate, locationPool); @@ -537,7 +537,7 @@ /** * @override - * @return {!WebInspector.UILocation} + * @return {!Workspace.UILocation} */ uiLocation() { var debuggerModelLocation = this._rawLocation; @@ -557,25 +557,25 @@ * @return {boolean} */ isBlackboxed() { - return WebInspector.blackboxManager.isBlackboxedRawLocation(this._rawLocation); + return Bindings.blackboxManager.isBlackboxedRawLocation(this._rawLocation); } }; /** * @unrestricted */ -WebInspector.DebuggerWorkspaceBinding.StackTraceTopFrameLocation = class extends WebInspector.LiveLocationWithPool { +Bindings.DebuggerWorkspaceBinding.StackTraceTopFrameLocation = class extends Bindings.LiveLocationWithPool { /** - * @param {!Array<!WebInspector.DebuggerModel.Location>} rawLocations - * @param {!WebInspector.DebuggerWorkspaceBinding} binding - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {!Array<!SDK.DebuggerModel.Location>} rawLocations + * @param {!Bindings.DebuggerWorkspaceBinding} binding + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(rawLocations, binding, updateDelegate, locationPool) { super(updateDelegate, locationPool); this._updateScheduled = true; - /** @type {!Set<!WebInspector.LiveLocation>} */ + /** @type {!Set<!Bindings.LiveLocation>} */ this._locations = new Set(); for (var location of rawLocations) this._locations.add(binding.createLiveLocation(location, this._scheduleUpdate.bind(this), locationPool)); @@ -584,7 +584,7 @@ /** * @override - * @return {!WebInspector.UILocation} + * @return {!Workspace.UILocation} */ uiLocation() { return this._current.uiLocation(); @@ -630,20 +630,20 @@ /** * @interface */ -WebInspector.DebuggerSourceMapping = function() {}; +Bindings.DebuggerSourceMapping = function() {}; -WebInspector.DebuggerSourceMapping.prototype = { +Bindings.DebuggerSourceMapping.prototype = { /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation: function(rawLocation) {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) {}, @@ -653,7 +653,7 @@ isIdentity: function() {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -661,6 +661,6 @@ }; /** - * @type {!WebInspector.DebuggerWorkspaceBinding} + * @type {!Bindings.DebuggerWorkspaceBinding} */ -WebInspector.debuggerWorkspaceBinding; +Bindings.debuggerWorkspaceBinding;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js index 2d1b5bb..004fd11 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js
@@ -28,39 +28,39 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.DebuggerSourceMapping} + * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ -WebInspector.DefaultScriptMapping = class { +Bindings.DefaultScriptMapping = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, workspace, debuggerWorkspaceBinding) { this._debuggerModel = debuggerModel; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; - var projectId = WebInspector.DefaultScriptMapping.projectIdForTarget(debuggerModel.target()); + var projectId = Bindings.DefaultScriptMapping.projectIdForTarget(debuggerModel.target()); this._project = - new WebInspector.ContentProviderBasedProject(workspace, projectId, WebInspector.projectTypes.Debugger, ''); - /** @type {!Map.<string, !WebInspector.UISourceCode>} */ + new Bindings.ContentProviderBasedProject(workspace, projectId, Workspace.projectTypes.Debugger, ''); + /** @type {!Map.<string, !Workspace.UISourceCode>} */ this._uiSourceCodeForScriptId = new Map(); - /** @type {!Map.<!WebInspector.UISourceCode, string>} */ + /** @type {!Map.<!Workspace.UISourceCode, string>} */ this._scriptIdForUISourceCode = new Map(); this._eventListeners = [debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this)]; + SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this)]; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.Script} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?SDK.Script} */ static scriptForUISourceCode(uiSourceCode) { - return uiSourceCode[WebInspector.DefaultScriptMapping._scriptSymbol] || null; + return uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol] || null; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {string} */ static projectIdForTarget(target) { @@ -69,11 +69,11 @@ /** * @override - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {!WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {!Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation); + var debuggerModelLocation = /** @type {!SDK.DebuggerModel.Location} */ (rawLocation); var script = debuggerModelLocation.script(); var uiSourceCode = this._uiSourceCodeForScriptId.get(script.scriptId); var lineNumber = debuggerModelLocation.lineNumber - (script.isInlineScriptWithSourceURL() ? script.lineOffset : 0); @@ -85,10 +85,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var scriptId = this._scriptIdForUISourceCode.get(uiSourceCode); @@ -100,14 +100,14 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ addScript(script) { - var name = WebInspector.ParsedURL.extractName(script.sourceURL); + var name = Common.ParsedURL.extractName(script.sourceURL); var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : ''); - var uiSourceCode = this._project.createUISourceCode(url, WebInspector.resourceTypes.Script); - uiSourceCode[WebInspector.DefaultScriptMapping._scriptSymbol] = script; + var uiSourceCode = this._project.createUISourceCode(url, Common.resourceTypes.Script); + uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol] = script; this._uiSourceCodeForScriptId.set(script.scriptId, uiSourceCode); this._scriptIdForUISourceCode.set(uiSourceCode, script.scriptId); this._project.addUISourceCodeWithProvider(uiSourceCode, script, null); @@ -126,7 +126,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -141,10 +141,10 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); this._debuggerReset(); this._project.dispose(); } }; -WebInspector.DefaultScriptMapping._scriptSymbol = Symbol('symbol'); +Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js index 9dfe6f0f..3250515 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js
@@ -31,23 +31,23 @@ /** * @unrestricted */ -WebInspector.FileSystemWorkspaceBinding = class { +Bindings.FileSystemWorkspaceBinding = class { /** - * @param {!WebInspector.IsolatedFileSystemManager} isolatedFileSystemManager - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.IsolatedFileSystemManager} isolatedFileSystemManager + * @param {!Workspace.Workspace} workspace */ constructor(isolatedFileSystemManager, workspace) { this._isolatedFileSystemManager = isolatedFileSystemManager; this._workspace = workspace; this._eventListeners = [ this._isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, this._onFileSystemAdded, this), + Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, this._onFileSystemAdded, this), this._isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._onFileSystemRemoved, this), + Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, this._onFileSystemRemoved, this), this._isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemFilesChanged, this._fileSystemFilesChanged, this) + Workspace.IsolatedFileSystemManager.Events.FileSystemFilesChanged, this._fileSystemFilesChanged, this) ]; - /** @type {!Map.<string, !WebInspector.FileSystemWorkspaceBinding.FileSystem>} */ + /** @type {!Map.<string, !Bindings.FileSystemWorkspaceBinding.FileSystem>} */ this._boundFileSystems = new Map(); this._isolatedFileSystemManager.waitForFileSystems().then(this._onFileSystemsLoaded.bind(this)); } @@ -61,39 +61,39 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {!Array<string>} */ static relativePath(uiSourceCode) { var baseURL = - /** @type {!WebInspector.FileSystemWorkspaceBinding.FileSystem}*/ (uiSourceCode.project())._fileSystemBaseURL; + /** @type {!Bindings.FileSystemWorkspaceBinding.FileSystem}*/ (uiSourceCode.project())._fileSystemBaseURL; return uiSourceCode.url().substring(baseURL.length).split('/'); } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {string} relativePath * @return {string} */ static completeURL(project, relativePath) { - var fsProject = /** @type {!WebInspector.FileSystemWorkspaceBinding.FileSystem}*/ (project); + var fsProject = /** @type {!Bindings.FileSystemWorkspaceBinding.FileSystem}*/ (project); return fsProject._fileSystemBaseURL + relativePath; } /** * @param {string} extension - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ static _contentTypeForExtension(extension) { - if (WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions.has(extension)) - return WebInspector.resourceTypes.Stylesheet; - if (WebInspector.FileSystemWorkspaceBinding._documentExtensions.has(extension)) - return WebInspector.resourceTypes.Document; - if (WebInspector.FileSystemWorkspaceBinding._imageExtensions.has(extension)) - return WebInspector.resourceTypes.Image; - if (WebInspector.FileSystemWorkspaceBinding._scriptExtensions.has(extension)) - return WebInspector.resourceTypes.Script; - return WebInspector.resourceTypes.Other; + if (Bindings.FileSystemWorkspaceBinding._styleSheetExtensions.has(extension)) + return Common.resourceTypes.Stylesheet; + if (Bindings.FileSystemWorkspaceBinding._documentExtensions.has(extension)) + return Common.resourceTypes.Document; + if (Bindings.FileSystemWorkspaceBinding._imageExtensions.has(extension)) + return Common.resourceTypes.Image; + if (Bindings.FileSystemWorkspaceBinding._scriptExtensions.has(extension)) + return Common.resourceTypes.Script; + return Common.resourceTypes.Other; } /** @@ -105,14 +105,14 @@ } /** - * @return {!WebInspector.IsolatedFileSystemManager} + * @return {!Workspace.IsolatedFileSystemManager} */ fileSystemManager() { return this._isolatedFileSystemManager; } /** - * @param {!Array<!WebInspector.IsolatedFileSystem>} fileSystems + * @param {!Array<!Workspace.IsolatedFileSystem>} fileSystems */ _onFileSystemsLoaded(fileSystems) { for (var fileSystem of fileSystems) @@ -120,33 +120,33 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemAdded(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); this._addFileSystem(fileSystem); } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem */ _addFileSystem(fileSystem) { - var boundFileSystem = new WebInspector.FileSystemWorkspaceBinding.FileSystem(this, fileSystem, this._workspace); + var boundFileSystem = new Bindings.FileSystemWorkspaceBinding.FileSystem(this, fileSystem, this._workspace); this._boundFileSystems.set(fileSystem.path(), boundFileSystem); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemRemoved(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); var boundFileSystem = this._boundFileSystems.get(fileSystem.path()); boundFileSystem.dispose(); this._boundFileSystems.remove(fileSystem.path()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _fileSystemFilesChanged(event) { var paths = /** @type {!Array<string>} */ (event.data); @@ -160,7 +160,7 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); for (var fileSystem of this._boundFileSystems.values()) { fileSystem.dispose(); this._boundFileSystems.remove(fileSystem._fileSystem.path()); @@ -168,33 +168,33 @@ } }; -WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(['css', 'scss', 'sass', 'less']); -WebInspector.FileSystemWorkspaceBinding._documentExtensions = new Set(['htm', 'html', 'asp', 'aspx', 'phtml', 'jsp']); -WebInspector.FileSystemWorkspaceBinding._scriptExtensions = new Set([ +Bindings.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(['css', 'scss', 'sass', 'less']); +Bindings.FileSystemWorkspaceBinding._documentExtensions = new Set(['htm', 'html', 'asp', 'aspx', 'phtml', 'jsp']); +Bindings.FileSystemWorkspaceBinding._scriptExtensions = new Set([ 'asp', 'aspx', 'c', 'cc', 'cljs', 'coffee', 'cpp', 'cs', 'dart', 'java', 'js', 'jsp', 'jsx', 'h', 'm', 'mm', 'py', 'sh', 'ts', 'tsx', 'ls' ]); -WebInspector.FileSystemWorkspaceBinding._imageExtensions = WebInspector.IsolatedFileSystem.ImageExtensions; +Bindings.FileSystemWorkspaceBinding._imageExtensions = Workspace.IsolatedFileSystem.ImageExtensions; /** - * @implements {WebInspector.Project} + * @implements {Workspace.Project} * @unrestricted */ -WebInspector.FileSystemWorkspaceBinding.FileSystem = class extends WebInspector.ProjectStore { +Bindings.FileSystemWorkspaceBinding.FileSystem = class extends Workspace.ProjectStore { /** - * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding - * @param {!WebInspector.IsolatedFileSystem} isolatedFileSystem - * @param {!WebInspector.Workspace} workspace + * @param {!Bindings.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding + * @param {!Workspace.IsolatedFileSystem} isolatedFileSystem + * @param {!Workspace.Workspace} workspace */ constructor(fileSystemWorkspaceBinding, isolatedFileSystem, workspace) { var fileSystemPath = isolatedFileSystem.path(); - var id = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystemPath); + var id = Bindings.FileSystemWorkspaceBinding.projectId(fileSystemPath); console.assert(!workspace.project(id)); var displayName = fileSystemPath.substr(fileSystemPath.lastIndexOf('/') + 1); - super(workspace, id, WebInspector.projectTypes.FileSystem, displayName); + super(workspace, id, Workspace.projectTypes.FileSystem, displayName); this._fileSystem = isolatedFileSystem; this._fileSystemBaseURL = this._fileSystem.path() + '/'; @@ -220,7 +220,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ _filePathForUISourceCode(uiSourceCode) { @@ -229,37 +229,37 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Promise<?WebInspector.UISourceCodeMetadata>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Promise<?Workspace.UISourceCodeMetadata>} */ requestMetadata(uiSourceCode) { - if (uiSourceCode[WebInspector.FileSystemWorkspaceBinding._metadata]) - return uiSourceCode[WebInspector.FileSystemWorkspaceBinding._metadata]; + if (uiSourceCode[Bindings.FileSystemWorkspaceBinding._metadata]) + return uiSourceCode[Bindings.FileSystemWorkspaceBinding._metadata]; var relativePath = this._filePathForUISourceCode(uiSourceCode); var promise = this._fileSystem.getMetadata(relativePath).then(onMetadata); - uiSourceCode[WebInspector.FileSystemWorkspaceBinding._metadata] = promise; + uiSourceCode[Bindings.FileSystemWorkspaceBinding._metadata] = promise; return promise; /** * @param {?{modificationTime: !Date, size: number}} metadata - * @return {?WebInspector.UISourceCodeMetadata} + * @return {?Workspace.UISourceCodeMetadata} */ function onMetadata(metadata) { if (!metadata) return null; - return new WebInspector.UISourceCodeMetadata(metadata.modificationTime, metadata.size); + return new Workspace.UISourceCodeMetadata(metadata.modificationTime, metadata.size); } } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(?string)} callback */ requestFileContent(uiSourceCode, callback) { var filePath = this._filePathForUISourceCode(uiSourceCode); var isImage = - WebInspector.FileSystemWorkspaceBinding._imageExtensions.has(WebInspector.ParsedURL.extractExtension(filePath)); + Bindings.FileSystemWorkspaceBinding._imageExtensions.has(Common.ParsedURL.extractExtension(filePath)); this._fileSystem.requestFileContent(filePath, isImage ? base64CallbackWrapper : callback); @@ -286,7 +286,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newContent * @param {function(?string)} callback */ @@ -305,9 +305,9 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newName - * @param {function(boolean, string=, string=, !WebInspector.ResourceType=)} callback + * @param {function(boolean, string=, string=, !Common.ResourceType=)} callback */ rename(uiSourceCode, newName, callback) { if (newName === uiSourceCode.name()) { @@ -321,7 +321,7 @@ /** * @param {boolean} success * @param {string=} newName - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function innerCallback(success, newName) { if (!success || !newName) { @@ -335,7 +335,7 @@ filePath = filePath.substr(1); var extension = this._extensionForPath(newName); var newURL = this._fileSystemBaseURL + filePath; - var newContentType = WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension(extension); + var newContentType = Bindings.FileSystemWorkspaceBinding._contentTypeForExtension(extension); this.renameUISourceCode(uiSourceCode, newName); callback(true, newName, newURL, newContentType); } @@ -343,11 +343,11 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInFileContent(uiSourceCode, query, caseSensitive, isRegex, callback) { var filePath = this._filePathForUISourceCode(uiSourceCode); @@ -359,16 +359,16 @@ function contentCallback(content) { var result = []; if (content !== null) - result = WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex); + result = Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex); callback(result); } } /** * @override - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {!Array.<string>} filesMathingFileQuery - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {function(!Array.<string>)} callback */ findFilesMatchingSearchRequest(searchConfig, filesMathingFileQuery, progress, callback) { @@ -380,7 +380,7 @@ searchNextQuery.call(this); /** - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function searchNextQuery() { if (!queriesToRun.length) { @@ -394,7 +394,7 @@ /** * @param {!Array.<string>} files - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function innerCallback(files) { files = files.sort(); @@ -406,7 +406,7 @@ /** * @override - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ indexContent(progress) { this._fileSystem.indexContent(progress); @@ -430,7 +430,7 @@ /** * @param {number} from - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function reportFileChunk(from) { var to = Math.min(from + chunkSize, filePaths.length); @@ -466,7 +466,7 @@ * @param {string} path * @param {?string} name * @param {string} content - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ createFile(path, name, content, callback) { this._fileSystem.createFile(path, name, innerCallback.bind(this)); @@ -474,7 +474,7 @@ /** * @param {?string} filePath - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function innerCallback(filePath) { if (!filePath) { @@ -490,7 +490,7 @@ } /** - * @this {WebInspector.FileSystemWorkspaceBinding.FileSystem} + * @this {Bindings.FileSystemWorkspaceBinding.FileSystem} */ function contentSet() { callback(this._addFile(createFilePath)); @@ -515,11 +515,11 @@ /** * @param {string} filePath - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ _addFile(filePath) { var extension = this._extensionForPath(filePath); - var contentType = WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension(extension); + var contentType = Bindings.FileSystemWorkspaceBinding._contentTypeForExtension(extension); var uiSourceCode = this.createUISourceCode(this._fileSystemBaseURL + filePath, contentType); this.addUISourceCode(uiSourceCode); @@ -532,11 +532,11 @@ _fileChanged(path) { var uiSourceCode = this.uiSourceCodeForURL(path); if (!uiSourceCode) { - var contentType = WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension(this._extensionForPath(path)); + var contentType = Bindings.FileSystemWorkspaceBinding._contentTypeForExtension(this._extensionForPath(path)); this.addUISourceCode(this.createUISourceCode(path, contentType)); return; } - uiSourceCode[WebInspector.FileSystemWorkspaceBinding._metadata] = null; + uiSourceCode[Bindings.FileSystemWorkspaceBinding._metadata] = null; uiSourceCode.checkContentUpdated(); } @@ -545,4 +545,4 @@ } }; -WebInspector.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBinding.Metadata'); +Bindings.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBinding.Metadata');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/FileUtils.js b/third_party/WebKit/Source/devtools/front_end/bindings/FileUtils.js index 444c6e0..6f104c5 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/FileUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/FileUtils.js
@@ -30,20 +30,20 @@ /** * @interface */ -WebInspector.OutputStreamDelegate = function() {}; +Bindings.OutputStreamDelegate = function() {}; -WebInspector.OutputStreamDelegate.prototype = { +Bindings.OutputStreamDelegate.prototype = { onTransferStarted: function() {}, onTransferFinished: function() {}, /** - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred: function(reader) {}, /** - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} event */ onError: function(reader, event) {}, @@ -52,9 +52,9 @@ /** * @interface */ -WebInspector.ChunkedReader = function() {}; +Bindings.ChunkedReader = function() {}; -WebInspector.ChunkedReader.prototype = { +Bindings.ChunkedReader.prototype = { /** * @return {number} */ @@ -74,14 +74,14 @@ }; /** - * @implements {WebInspector.ChunkedReader} + * @implements {Bindings.ChunkedReader} * @unrestricted */ -WebInspector.ChunkedFileReader = class { +Bindings.ChunkedFileReader = class { /** * @param {!File} file * @param {number} chunkSize - * @param {!WebInspector.OutputStreamDelegate} delegate + * @param {!Bindings.OutputStreamDelegate} delegate */ constructor(file, chunkSize, delegate) { this._file = file; @@ -94,7 +94,7 @@ } /** - * @param {!WebInspector.OutputStream} output + * @param {!Common.OutputStream} output */ start(output) { this._output = output; @@ -179,7 +179,7 @@ * @param {function(!File)} callback * @return {!Node} */ -WebInspector.createFileSelectorElement = function(callback) { +Bindings.createFileSelectorElement = function(callback) { var fileSelectorElement = createElement('input'); fileSelectorElement.type = 'file'; fileSelectorElement.style.display = 'none'; @@ -192,10 +192,10 @@ }; /** - * @implements {WebInspector.OutputStream} + * @implements {Common.OutputStream} * @unrestricted */ -WebInspector.FileOutputStream = class { +Bindings.FileOutputStream = class { /** * @param {string} fileName * @param {function(boolean)} callback @@ -207,25 +207,25 @@ /** * @param {boolean} accepted - * @this {WebInspector.FileOutputStream} + * @this {Bindings.FileOutputStream} */ function callbackWrapper(accepted) { if (accepted) - WebInspector.fileManager.addEventListener( - WebInspector.FileManager.Events.AppendedToURL, this._onAppendDone, this); + Workspace.fileManager.addEventListener( + Workspace.FileManager.Events.AppendedToURL, this._onAppendDone, this); callback(accepted); } - WebInspector.fileManager.save(this._fileName, '', true, callbackWrapper.bind(this)); + Workspace.fileManager.save(this._fileName, '', true, callbackWrapper.bind(this)); } /** * @override * @param {string} data - * @param {function(!WebInspector.OutputStream)=} callback + * @param {function(!Common.OutputStream)=} callback */ write(data, callback) { this._writeCallbacks.push(callback); - WebInspector.fileManager.append(this._fileName, data); + Workspace.fileManager.append(this._fileName, data); } /** @@ -235,13 +235,13 @@ this._closed = true; if (this._writeCallbacks.length) return; - WebInspector.fileManager.removeEventListener( - WebInspector.FileManager.Events.AppendedToURL, this._onAppendDone, this); - WebInspector.fileManager.close(this._fileName); + Workspace.fileManager.removeEventListener( + Workspace.FileManager.Events.AppendedToURL, this._onAppendDone, this); + Workspace.fileManager.close(this._fileName); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onAppendDone(event) { if (event.data !== this._fileName) @@ -251,9 +251,9 @@ callback(this); if (!this._writeCallbacks.length) { if (this._closed) { - WebInspector.fileManager.removeEventListener( - WebInspector.FileManager.Events.AppendedToURL, this._onAppendDone, this); - WebInspector.fileManager.close(this._fileName); + Workspace.fileManager.removeEventListener( + Workspace.FileManager.Events.AppendedToURL, this._onAppendDone, this); + Workspace.fileManager.close(this._fileName); } } }
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/LiveLocation.js b/third_party/WebKit/Source/devtools/front_end/bindings/LiveLocation.js index 6e68454d4..8e8974b 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/LiveLocation.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/LiveLocation.js
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** @interface */ -WebInspector.LiveLocation = function() {}; +Bindings.LiveLocation = function() {}; -WebInspector.LiveLocation.prototype = { +Bindings.LiveLocation.prototype = { update: function() {}, /** - * @return {?WebInspector.UILocation} + * @return {?Workspace.UILocation} */ uiLocation: function() {}, @@ -21,13 +21,13 @@ }; /** - * @implements {WebInspector.LiveLocation} + * @implements {Bindings.LiveLocation} * @unrestricted */ -WebInspector.LiveLocationWithPool = class { +Bindings.LiveLocationWithPool = class { /** - * @param {function(!WebInspector.LiveLocation)} updateDelegate - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {function(!Bindings.LiveLocation)} updateDelegate + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(updateDelegate, locationPool) { this._updateDelegate = updateDelegate; @@ -44,7 +44,7 @@ /** * @override - * @return {?WebInspector.UILocation} + * @return {?Workspace.UILocation} */ uiLocation() { throw 'Not implemented'; @@ -70,20 +70,20 @@ /** * @unrestricted */ -WebInspector.LiveLocationPool = class { +Bindings.LiveLocationPool = class { constructor() { this._locations = new Set(); } /** - * @param {!WebInspector.LiveLocation} location + * @param {!Bindings.LiveLocation} location */ _add(location) { this._locations.add(location); } /** - * @param {!WebInspector.LiveLocation} location + * @param {!Bindings.LiveLocation} location */ _delete(location) { this._locations.delete(location);
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js index 862c8a0d..bb6d9614 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
@@ -4,12 +4,12 @@ /** * @unrestricted */ -WebInspector.NetworkMapping = class { +Bindings.NetworkMapping = class { /** - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding - * @param {!WebInspector.FileSystemMapping} fileSystemMapping + * @param {!SDK.TargetManager} targetManager + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding + * @param {!Workspace.FileSystemMapping} fileSystemMapping */ constructor(targetManager, workspace, fileSystemWorkspaceBinding, fileSystemMapping) { this._targetManager = targetManager; @@ -22,15 +22,15 @@ var fileSystemManager = fileSystemWorkspaceBinding.fileSystemManager(); this._eventListeners = [ fileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this), + Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this), fileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this), + Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this), ]; fileSystemManager.waitForFileSystems().then(this._fileSystemsLoaded.bind(this)); } /** - * @param {!Array<!WebInspector.IsolatedFileSystem>} fileSystems + * @param {!Array<!Workspace.IsolatedFileSystem>} fileSystems */ _fileSystemsLoaded(fileSystems) { for (var fileSystem of fileSystems) @@ -38,15 +38,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _fileSystemAdded(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); this._addMappingsForFilesystem(fileSystem); } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem */ _addMappingsForFilesystem(fileSystem) { this._addingFileSystem = true; @@ -67,38 +67,38 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _fileSystemRemoved(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); this._fileSystemMapping.removeFileSystem(fileSystem.path()); } /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ _networkUISourceCodeForURL(target, frame, url) { - return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target, frame, false), url); + return this._workspace.uiSourceCode(Bindings.NetworkProject.projectId(target, frame, false), url); } /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ _contentScriptUISourceCodeForURL(target, frame, url) { - return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target, frame, true), url); + return this._workspace.uiSourceCode(Bindings.NetworkProject.projectId(target, frame, true), url); } /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ _uiSourceCodeForURL(target, frame, url) { return this._networkUISourceCodeForURL(target, frame, url) || @@ -107,50 +107,50 @@ /** * @param {string} url - * @param {!WebInspector.Script} script - * @return {?WebInspector.UISourceCode} + * @param {!SDK.Script} script + * @return {?Workspace.UISourceCode} */ uiSourceCodeForScriptURL(url, script) { - var frame = WebInspector.ResourceTreeFrame.fromScript(script); + var frame = SDK.ResourceTreeFrame.fromScript(script); return this._uiSourceCodeForURL(script.target(), frame, url); } /** * @param {string} url - * @param {!WebInspector.CSSStyleSheetHeader} header - * @return {?WebInspector.UISourceCode} + * @param {!SDK.CSSStyleSheetHeader} header + * @return {?Workspace.UISourceCode} */ uiSourceCodeForStyleURL(url, header) { - var frame = WebInspector.ResourceTreeFrame.fromStyleSheet(header); + var frame = SDK.ResourceTreeFrame.fromStyleSheet(header); return this._uiSourceCodeForURL(header.target(), frame, url); } /** * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCodeForURLForAnyTarget(url) { - return WebInspector.workspace.uiSourceCodeForURL(url); + return Workspace.workspace.uiSourceCodeForURL(url); } /** - * @param {!WebInspector.UISourceCode} networkUISourceCode - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} networkUISourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ addMapping(networkUISourceCode, uiSourceCode) { - var fileSystemPath = WebInspector.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id()); + var fileSystemPath = Bindings.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id()); this._fileSystemMapping.addMappingForResource(networkUISourceCode.url(), fileSystemPath, uiSourceCode.url()); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ removeMapping(uiSourceCode) { this._fileSystemMapping.removeMappingForURL(uiSourceCode.url()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _revealSourceLine(event) { var url = /** @type {string} */ (event.data['url']); @@ -159,31 +159,31 @@ var uiSourceCode = this.uiSourceCodeForURLForAnyTarget(url); if (uiSourceCode) { - WebInspector.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber)); + Common.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber)); return; } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.NetworkMapping} + * @param {!Common.Event} event + * @this {Bindings.NetworkMapping} */ function listener(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (uiSourceCode.url() === url) { - WebInspector.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber)); - this._workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, listener, this); + Common.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber)); + this._workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, listener, this); } } - this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, listener, this); + this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, listener, this); } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } }; /** - * @type {!WebInspector.NetworkMapping} + * @type {!Bindings.NetworkMapping} */ -WebInspector.networkMapping; +Bindings.networkMapping;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js index c8fa0d5a..728f81ec 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
@@ -28,13 +28,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.NetworkProjectManager = class { +Bindings.NetworkProjectManager = class { /** - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.Workspace} workspace + * @param {!SDK.TargetManager} targetManager + * @param {!Workspace.Workspace} workspace */ constructor(targetManager, workspace) { this._workspace = workspace; @@ -43,71 +43,71 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - new WebInspector.NetworkProject(target, this._workspace, WebInspector.ResourceTreeModel.fromTarget(target)); + new Bindings.NetworkProject(target, this._workspace, SDK.ResourceTreeModel.fromTarget(target)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - WebInspector.NetworkProject.forTarget(target)._dispose(); + Bindings.NetworkProject.forTarget(target)._dispose(); } }; /** * @unrestricted */ -WebInspector.NetworkProject = class extends WebInspector.SDKObject { +Bindings.NetworkProject = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.Workspace} workspace - * @param {?WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.Target} target + * @param {!Workspace.Workspace} workspace + * @param {?SDK.ResourceTreeModel} resourceTreeModel */ constructor(target, workspace, resourceTreeModel) { super(target); this._workspace = workspace; - /** @type {!Map<string, !WebInspector.ContentProviderBasedProject>} */ + /** @type {!Map<string, !Bindings.ContentProviderBasedProject>} */ this._workspaceProjects = new Map(); this._resourceTreeModel = resourceTreeModel; - target[WebInspector.NetworkProject._networkProjectSymbol] = this; + target[Bindings.NetworkProject._networkProjectSymbol] = this; this._eventListeners = []; if (resourceTreeModel) { this._eventListeners.push( resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.ResourceAdded, this._resourceAdded, this), + SDK.ResourceTreeModel.Events.ResourceAdded, this._resourceAdded, this), resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.FrameWillNavigate, this._frameWillNavigate, this), + SDK.ResourceTreeModel.Events.FrameWillNavigate, this._frameWillNavigate, this), resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this)); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this)); } - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel) { this._eventListeners.push( debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this), + SDK.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this), debuggerModel.addEventListener( - WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this)); + SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this)); } - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (cssModel) { this._eventListeners.push( - cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this), - cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this)); + cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this), + cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this)); } this._eventListeners.push(target.targetManager().addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._suspendStateChanged, this)); + SDK.TargetManager.Events.SuspendStateChanged, this._suspendStateChanged, this)); } /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {boolean} isContentScripts * @return {string} */ @@ -116,93 +116,93 @@ } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.NetworkProject} + * @param {!SDK.Target} target + * @return {!Bindings.NetworkProject} */ static forTarget(target) { - return target[WebInspector.NetworkProject._networkProjectSymbol]; + return target[Bindings.NetworkProject._networkProjectSymbol]; } /** - * @param {!WebInspector.Project} project - * @return {?WebInspector.Target} target + * @param {!Workspace.Project} project + * @return {?SDK.Target} target */ static targetForProject(project) { - return project[WebInspector.NetworkProject._targetSymbol] || null; + return project[Bindings.NetworkProject._targetSymbol] || null; } /** - * @param {!WebInspector.Project} project - * @return {?WebInspector.ResourceTreeFrame} + * @param {!Workspace.Project} project + * @return {?SDK.ResourceTreeFrame} */ static frameForProject(project) { - return project[WebInspector.NetworkProject._frameSymbol] || null; + return project[Bindings.NetworkProject._frameSymbol] || null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.Target} target + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?SDK.Target} target */ static targetForUISourceCode(uiSourceCode) { - return uiSourceCode[WebInspector.NetworkProject._targetSymbol] || null; + return uiSourceCode[Bindings.NetworkProject._targetSymbol] || null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ static uiSourceCodeMimeType(uiSourceCode) { - if (uiSourceCode[WebInspector.NetworkProject._scriptSymbol] || - uiSourceCode[WebInspector.NetworkProject._styleSheetSymbol]) { + if (uiSourceCode[Bindings.NetworkProject._scriptSymbol] || + uiSourceCode[Bindings.NetworkProject._styleSheetSymbol]) { return uiSourceCode.contentType().canonicalMimeType(); } - var resource = uiSourceCode[WebInspector.NetworkProject._resourceSymbol]; + var resource = uiSourceCode[Bindings.NetworkProject._resourceSymbol]; if (resource) return resource.mimeType; - var mimeType = WebInspector.ResourceType.mimeFromURL(uiSourceCode.url()); + var mimeType = Common.ResourceType.mimeFromURL(uiSourceCode.url()); return mimeType || uiSourceCode.contentType().canonicalMimeType(); } /** - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {?SDK.ResourceTreeFrame} frame * @param {boolean} isContentScripts - * @return {!WebInspector.ContentProviderBasedProject} + * @return {!Bindings.ContentProviderBasedProject} */ _workspaceProject(frame, isContentScripts) { - var projectId = WebInspector.NetworkProject.projectId(this.target(), frame, isContentScripts); - var projectType = isContentScripts ? WebInspector.projectTypes.ContentScripts : WebInspector.projectTypes.Network; + var projectId = Bindings.NetworkProject.projectId(this.target(), frame, isContentScripts); + var projectType = isContentScripts ? Workspace.projectTypes.ContentScripts : Workspace.projectTypes.Network; var project = this._workspaceProjects.get(projectId); if (project) return project; - project = new WebInspector.ContentProviderBasedProject(this._workspace, projectId, projectType, ''); - project[WebInspector.NetworkProject._targetSymbol] = this.target(); - project[WebInspector.NetworkProject._frameSymbol] = frame; + project = new Bindings.ContentProviderBasedProject(this._workspace, projectId, projectType, ''); + project[Bindings.NetworkProject._targetSymbol] = this.target(); + project[Bindings.NetworkProject._frameSymbol] = frame; this._workspaceProjects.set(projectId, project); return project; } /** - * @param {!WebInspector.ContentProvider} contentProvider - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!Common.ContentProvider} contentProvider + * @param {?SDK.ResourceTreeFrame} frame * @param {boolean} isContentScript * @param {?number} contentSize - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ addFile(contentProvider, frame, isContentScript, contentSize) { var uiSourceCode = this._createFile(contentProvider, frame, isContentScript || false); - var metadata = typeof contentSize === 'number' ? new WebInspector.UISourceCodeMetadata(null, contentSize) : null; + var metadata = typeof contentSize === 'number' ? new Workspace.UISourceCodeMetadata(null, contentSize) : null; this._addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata); return uiSourceCode; } /** - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {?SDK.ResourceTreeFrame} frame * @param {string} url */ _removeFileForURL(frame, url) { - var project = this._workspaceProjects.get(WebInspector.NetworkProject.projectId(this.target(), frame, false)); + var project = this._workspaceProjects.get(Bindings.NetworkProject.projectId(this.target(), frame, false)); if (!project) return; project.removeFile(url); @@ -210,8 +210,8 @@ _populate() { /** - * @param {!WebInspector.ResourceTreeFrame} frame - * @this {WebInspector.NetworkProject} + * @param {!SDK.ResourceTreeFrame} frame + * @this {Bindings.NetworkProject} */ function populateFrame(frame) { for (var i = 0; i < frame.childFrames.length; ++i) @@ -229,88 +229,88 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.ContentProvider} contentProvider - * @param {?WebInspector.UISourceCodeMetadata} metadata + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Common.ContentProvider} contentProvider + * @param {?Workspace.UISourceCodeMetadata} metadata */ _addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata) { - /** @type {!WebInspector.ContentProviderBasedProject} */ (uiSourceCode.project()) + /** @type {!Bindings.ContentProviderBasedProject} */ (uiSourceCode.project()) .addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _parsedScriptSource(event) { - var script = /** @type {!WebInspector.Script} */ (event.data); + var script = /** @type {!SDK.Script} */ (event.data); if (!script.sourceURL || script.isLiveEdit() || (script.isInlineScript() && !script.hasSourceURL)) return; // Filter out embedder injected content scripts. if (script.isContentScript() && !script.hasSourceURL) { - var parsedURL = new WebInspector.ParsedURL(script.sourceURL); + var parsedURL = new Common.ParsedURL(script.sourceURL); if (!parsedURL.isValid) return; } var uiSourceCode = - this._createFile(script, WebInspector.ResourceTreeFrame.fromScript(script), script.isContentScript()); - uiSourceCode[WebInspector.NetworkProject._scriptSymbol] = script; - var resource = WebInspector.ResourceTreeModel.resourceForURL(uiSourceCode.url()); + this._createFile(script, SDK.ResourceTreeFrame.fromScript(script), script.isContentScript()); + uiSourceCode[Bindings.NetworkProject._scriptSymbol] = script; + var resource = SDK.ResourceTreeModel.resourceForURL(uiSourceCode.url()); this._addUISourceCodeWithProvider(uiSourceCode, script, this._resourceMetadata(resource)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetAdded(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector') return; var originalContentProvider = header.originalContentProvider(); var uiSourceCode = - this._createFile(originalContentProvider, WebInspector.ResourceTreeFrame.fromStyleSheet(header), false); - uiSourceCode[WebInspector.NetworkProject._styleSheetSymbol] = header; - var resource = WebInspector.ResourceTreeModel.resourceForURL(uiSourceCode.url()); + this._createFile(originalContentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false); + uiSourceCode[Bindings.NetworkProject._styleSheetSymbol] = header; + var resource = SDK.ResourceTreeModel.resourceForURL(uiSourceCode.url()); this._addUISourceCodeWithProvider(uiSourceCode, originalContentProvider, this._resourceMetadata(resource)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetRemoved(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); if (header.isInline && !header.hasSourceURL && header.origin !== 'inspector') return; - this._removeFileForURL(WebInspector.ResourceTreeFrame.fromStyleSheet(header), header.resourceURL()); + this._removeFileForURL(SDK.ResourceTreeFrame.fromStyleSheet(header), header.resourceURL()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _resourceAdded(event) { - var resource = /** @type {!WebInspector.Resource} */ (event.data); + var resource = /** @type {!SDK.Resource} */ (event.data); this._addResource(resource); } /** - * @param {!WebInspector.Resource} resource + * @param {!SDK.Resource} resource */ _addResource(resource) { var resourceType = resource.resourceType(); // Only load selected resource types from resources. - if (resourceType !== WebInspector.resourceTypes.Image && resourceType !== WebInspector.resourceTypes.Font && - resourceType !== WebInspector.resourceTypes.Document && resourceType !== WebInspector.resourceTypes.Manifest) { + if (resourceType !== Common.resourceTypes.Image && resourceType !== Common.resourceTypes.Font && + resourceType !== Common.resourceTypes.Document && resourceType !== Common.resourceTypes.Manifest) { return; } // Ignore non-images and non-fonts. - if (resourceType === WebInspector.resourceTypes.Image && resource.mimeType && + if (resourceType === Common.resourceTypes.Image && resource.mimeType && !resource.mimeType.startsWith('image')) return; - if (resourceType === WebInspector.resourceTypes.Font && resource.mimeType && !resource.mimeType.includes('font')) + if (resourceType === Common.resourceTypes.Font && resource.mimeType && !resource.mimeType.includes('font')) return; - if ((resourceType === WebInspector.resourceTypes.Image || resourceType === WebInspector.resourceTypes.Font) && + if ((resourceType === Common.resourceTypes.Image || resourceType === Common.resourceTypes.Font) && resource.contentURL().startsWith('data:')) return; @@ -318,16 +318,16 @@ if (this._workspace.uiSourceCodeForURL(resource.url)) return; - var uiSourceCode = this._createFile(resource, WebInspector.ResourceTreeFrame.fromResource(resource), false); - uiSourceCode[WebInspector.NetworkProject._resourceSymbol] = resource; + var uiSourceCode = this._createFile(resource, SDK.ResourceTreeFrame.fromResource(resource), false); + uiSourceCode[Bindings.NetworkProject._resourceSymbol] = resource; this._addUISourceCodeWithProvider(uiSourceCode, resource, this._resourceMetadata(resource)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _frameWillNavigate(event) { - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); var project = this._workspaceProject(frame, false); for (var resource of frame.resources()) project.removeUISourceCode(resource.url); @@ -337,7 +337,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _mainFrameNavigated(event) { this._reset(); @@ -352,33 +352,33 @@ } /** - * @param {!WebInspector.ContentProvider} contentProvider - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!Common.ContentProvider} contentProvider + * @param {?SDK.ResourceTreeFrame} frame * @param {boolean} isContentScript - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ _createFile(contentProvider, frame, isContentScript) { var url = contentProvider.contentURL(); var project = this._workspaceProject(frame, isContentScript); var uiSourceCode = project.createUISourceCode(url, contentProvider.contentType()); - uiSourceCode[WebInspector.NetworkProject._targetSymbol] = this.target(); + uiSourceCode[Bindings.NetworkProject._targetSymbol] = this.target(); return uiSourceCode; } /** - * @param {?WebInspector.Resource} resource - * @return {?WebInspector.UISourceCodeMetadata} + * @param {?SDK.Resource} resource + * @return {?Workspace.UISourceCodeMetadata} */ _resourceMetadata(resource) { if (!resource || (typeof resource.contentSize() !== 'number' && !resource.lastModified())) return null; - return new WebInspector.UISourceCodeMetadata(resource.lastModified(), resource.contentSize()); + return new Workspace.UISourceCodeMetadata(resource.lastModified(), resource.contentSize()); } _dispose() { this._reset(); - WebInspector.EventTarget.removeEventListeners(this._eventListeners); - delete this.target()[WebInspector.NetworkProject._networkProjectSymbol]; + Common.EventTarget.removeEventListeners(this._eventListeners); + delete this.target()[Bindings.NetworkProject._networkProjectSymbol]; } _reset() { @@ -388,9 +388,9 @@ } }; -WebInspector.NetworkProject._networkProjectSymbol = Symbol('networkProject'); -WebInspector.NetworkProject._resourceSymbol = Symbol('resource'); -WebInspector.NetworkProject._scriptSymbol = Symbol('script'); -WebInspector.NetworkProject._styleSheetSymbol = Symbol('styleSheet'); -WebInspector.NetworkProject._targetSymbol = Symbol('target'); -WebInspector.NetworkProject._frameSymbol = Symbol('frame'); +Bindings.NetworkProject._networkProjectSymbol = Symbol('networkProject'); +Bindings.NetworkProject._resourceSymbol = Symbol('resource'); +Bindings.NetworkProject._scriptSymbol = Symbol('script'); +Bindings.NetworkProject._styleSheetSymbol = Symbol('styleSheet'); +Bindings.NetworkProject._targetSymbol = Symbol('target'); +Bindings.NetworkProject._frameSymbol = Symbol('frame');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js b/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js index 2b10d7d..f53aa60f 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js
@@ -31,46 +31,46 @@ /** * @unrestricted */ -WebInspector.PresentationConsoleMessageHelper = class { +Bindings.PresentationConsoleMessageHelper = class { /** - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.Workspace} workspace */ constructor(workspace) { this._workspace = workspace; - /** @type {!Object.<string, !Array.<!WebInspector.ConsoleMessage>>} */ + /** @type {!Object.<string, !Array.<!SDK.ConsoleMessage>>} */ this._pendingConsoleMessages = {}; - /** @type {!Array.<!WebInspector.PresentationConsoleMessage>} */ + /** @type {!Array.<!Bindings.PresentationConsoleMessage>} */ this._presentationConsoleMessages = []; - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this); - WebInspector.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this); + SDK.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.FailedToParseScriptSource, + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); - this._locationPool = new WebInspector.LiveLocationPool(); + this._locationPool = new Bindings.LiveLocationPool(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onConsoleMessageAdded(event) { - var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data); + var message = /** @type {!SDK.ConsoleMessage} */ (event.data); this._consoleMessageAdded(message); } /** - * @param {!WebInspector.ConsoleMessage} message + * @param {!SDK.ConsoleMessage} message */ _consoleMessageAdded(message) { if (!message.isErrorOrWarning()) @@ -84,11 +84,11 @@ } /** - * @param {!WebInspector.ConsoleMessage} message - * @return {?WebInspector.DebuggerModel.Location} + * @param {!SDK.ConsoleMessage} message + * @return {?SDK.DebuggerModel.Location} */ _rawLocation(message) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(message.target()); + var debuggerModel = SDK.DebuggerModel.fromTarget(message.target()); if (!debuggerModel) return null; if (message.scriptId) @@ -103,16 +103,16 @@ } /** - * @param {!WebInspector.ConsoleMessage} message - * @param {!WebInspector.DebuggerModel.Location} rawLocation + * @param {!SDK.ConsoleMessage} message + * @param {!SDK.DebuggerModel.Location} rawLocation */ _addConsoleMessageToScript(message, rawLocation) { this._presentationConsoleMessages.push( - new WebInspector.PresentationConsoleMessage(message, rawLocation, this._locationPool)); + new Bindings.PresentationConsoleMessage(message, rawLocation, this._locationPool)); } /** - * @param {!WebInspector.ConsoleMessage} message + * @param {!SDK.ConsoleMessage} message */ _addPendingConsoleMessage(message) { if (!message.url) @@ -123,10 +123,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _parsedScriptSource(event) { - var script = /** @type {!WebInspector.Script} */ (event.data); + var script = /** @type {!SDK.Script} */ (event.data); var messages = this._pendingConsoleMessages[script.sourceURL]; if (!messages) @@ -166,23 +166,23 @@ /** * @unrestricted */ -WebInspector.PresentationConsoleMessage = class { +Bindings.PresentationConsoleMessage = class { /** - * @param {!WebInspector.ConsoleMessage} message - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {!SDK.ConsoleMessage} message + * @param {!SDK.DebuggerModel.Location} rawLocation + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(message, rawLocation, locationPool) { this._text = message.messageText; - this._level = message.level === WebInspector.ConsoleMessage.MessageLevel.Error ? - WebInspector.UISourceCode.Message.Level.Error : - WebInspector.UISourceCode.Message.Level.Warning; - WebInspector.debuggerWorkspaceBinding.createLiveLocation( + this._level = message.level === SDK.ConsoleMessage.MessageLevel.Error ? + Workspace.UISourceCode.Message.Level.Error : + Workspace.UISourceCode.Message.Level.Warning; + Bindings.debuggerWorkspaceBinding.createLiveLocation( rawLocation, this._updateLocation.bind(this), locationPool); } /** - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!Bindings.LiveLocation} liveLocation */ _updateLocation(liveLocation) { if (this._uiMessage) @@ -200,5 +200,5 @@ } }; -/** @type {!WebInspector.PresentationConsoleMessageHelper} */ -WebInspector.presentationConsoleMessageHelper; +/** @type {!Bindings.PresentationConsoleMessageHelper} */ +Bindings.presentationConsoleMessageHelper;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js index dd3e4dd..6acf340 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -28,41 +28,41 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.DebuggerSourceMapping} + * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ -WebInspector.ResourceScriptMapping = class { +Bindings.ResourceScriptMapping = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, workspace, networkMapping, debuggerWorkspaceBinding) { this._target = debuggerModel.target(); this._debuggerModel = debuggerModel; this._networkMapping = networkMapping; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; - /** @type {!Set<!WebInspector.UISourceCode>} */ + /** @type {!Set<!Workspace.UISourceCode>} */ this._boundUISourceCodes = new Set(); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.ResourceScriptFile>} */ + /** @type {!Map.<!Workspace.UISourceCode, !Bindings.ResourceScriptFile>} */ this._uiSourceCodeToScriptFile = new Map(); this._eventListeners = [ - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this), - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this), - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this) + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this), + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this), + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this) ]; } /** * @override - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation); + var debuggerModelLocation = /** @type {!SDK.DebuggerModel.Location} */ (rawLocation); var script = debuggerModelLocation.script(); if (!script) return null; @@ -82,10 +82,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var scripts = this._scriptsForUISourceCode(uiSourceCode); @@ -98,7 +98,7 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ addScript(script) { if (script.isAnonymousScript()) @@ -122,7 +122,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -131,16 +131,16 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.ResourceScriptFile} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?Bindings.ResourceScriptFile} */ scriptFile(uiSourceCode) { return this._uiSourceCodeToScriptFile.get(uiSourceCode) || null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {?WebInspector.ResourceScriptFile} scriptFile + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {?Bindings.ResourceScriptFile} scriptFile */ _setScriptFile(uiSourceCode, scriptFile) { if (scriptFile) @@ -150,10 +150,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (uiSourceCode.isFromServiceProject()) return; var scripts = this._scriptsForUISourceCode(uiSourceCode); @@ -164,10 +164,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (uiSourceCode.isFromServiceProject() || !this._boundUISourceCodes.has(uiSourceCode)) return; @@ -175,7 +175,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _updateLocations(uiSourceCode) { var scripts = this._scriptsForUISourceCode(uiSourceCode); @@ -186,8 +186,8 @@ } /** - * @param {!WebInspector.Script} script - * @return {?WebInspector.UISourceCode} + * @param {!SDK.Script} script + * @return {?Workspace.UISourceCode} */ _workspaceUISourceCodeForScript(script) { if (script.isAnonymousScript()) @@ -196,19 +196,19 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Array.<!WebInspector.Script>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Array.<!SDK.Script>} */ _scriptsForUISourceCode(uiSourceCode) { - var target = WebInspector.NetworkProject.targetForUISourceCode(uiSourceCode); + var target = Bindings.NetworkProject.targetForUISourceCode(uiSourceCode); if (target !== this._debuggerModel.target()) return []; return this._debuggerModel.scriptsForSourceURL(uiSourceCode.url()); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!Array.<!WebInspector.Script>} scripts + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Array.<!SDK.Script>} scripts */ _bindUISourceCodeToScripts(uiSourceCode, scripts) { console.assert(scripts.length); @@ -218,7 +218,7 @@ if (boundScriptFile && boundScriptFile._hasScripts(scripts)) return; - var scriptFile = new WebInspector.ResourceScriptFile(this, uiSourceCode, scripts); + var scriptFile = new Bindings.ResourceScriptFile(this, uiSourceCode, scripts); this._setScriptFile(uiSourceCode, scriptFile); for (var i = 0; i < scripts.length; ++i) this._debuggerWorkspaceBinding.updateLocations(scripts[i]); @@ -227,7 +227,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _unbindUISourceCode(uiSourceCode) { var scriptFile = this.scriptFile(uiSourceCode); @@ -247,7 +247,7 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); this._debuggerReset(); } }; @@ -255,11 +255,11 @@ /** * @unrestricted */ -WebInspector.ResourceScriptFile = class extends WebInspector.Object { +Bindings.ResourceScriptFile = class extends Common.Object { /** - * @param {!WebInspector.ResourceScriptMapping} resourceScriptMapping - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!Array.<!WebInspector.Script>} scripts + * @param {!Bindings.ResourceScriptMapping} resourceScriptMapping + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Array.<!SDK.Script>} scripts */ constructor(resourceScriptMapping, uiSourceCode, scripts) { super(); @@ -272,13 +272,13 @@ this._script = scripts[scripts.length - 1]; this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); } /** - * @param {!Array.<!WebInspector.Script>} scripts + * @param {!Array.<!SDK.Script>} scripts * @return {boolean} */ _hasScripts(scripts) { @@ -301,18 +301,18 @@ if (!workingCopy.startsWith(this._scriptSource.trimRight())) return true; var suffix = this._uiSourceCode.workingCopy().substr(this._scriptSource.length); - return !!suffix.length && !suffix.match(WebInspector.Script.sourceURLRegex); + return !!suffix.length && !suffix.match(SDK.Script.sourceURLRegex); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _workingCopyChanged(event) { this._update(); } _workingCopyCommitted(event) { - if (this._uiSourceCode.project().type() === WebInspector.projectTypes.Snippets) + if (this._uiSourceCode.project().type() === Workspace.projectTypes.Snippets) return; if (!this._script) return; @@ -323,7 +323,7 @@ /** * @param {?string} error * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.ResourceScriptFile} + * @this {Bindings.ResourceScriptFile} */ function scriptSourceWasSet(error, exceptionDetails) { if (!error && !exceptionDetails) @@ -333,13 +333,13 @@ if (!error && !exceptionDetails) return; if (!exceptionDetails) { - WebInspector.console.addMessage( - WebInspector.UIString('LiveEdit failed: %s', error), WebInspector.Console.MessageLevel.Warning); + Common.console.addMessage( + Common.UIString('LiveEdit failed: %s', error), Common.Console.MessageLevel.Warning); return; } - var messageText = WebInspector.UIString('LiveEdit compile failed: %s', exceptionDetails.text); + var messageText = Common.UIString('LiveEdit compile failed: %s', exceptionDetails.text); this._uiSourceCode.addLineMessage( - WebInspector.UISourceCode.Message.Level.Error, messageText, exceptionDetails.lineNumber, + Workspace.UISourceCode.Message.Level.Error, messageText, exceptionDetails.lineNumber, exceptionDetails.columnNumber); } } @@ -356,7 +356,7 @@ this._resourceScriptMapping._updateLocations(this._uiSourceCode); delete this._isDivergingFromVM; this._hasDivergedFromVM = true; - this.dispatchEventToListeners(WebInspector.ResourceScriptFile.Events.DidDivergeFromVM, this._uiSourceCode); + this.dispatchEventToListeners(Bindings.ResourceScriptFile.Events.DidDivergeFromVM, this._uiSourceCode); } _mergeToVM() { @@ -364,7 +364,7 @@ this._isMergingToVM = true; this._resourceScriptMapping._updateLocations(this._uiSourceCode); delete this._isMergingToVM; - this.dispatchEventToListeners(WebInspector.ResourceScriptFile.Events.DidMergeToVM, this._uiSourceCode); + this.dispatchEventToListeners(Bindings.ResourceScriptFile.Events.DidMergeToVM, this._uiSourceCode); } /** @@ -397,7 +397,7 @@ /** * @param {?string} source - * @this {WebInspector.ResourceScriptFile} + * @this {Bindings.ResourceScriptFile} */ function callback(source) { this._scriptSource = source; @@ -410,7 +410,7 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { if (!this._script) @@ -420,9 +420,9 @@ dispose() { this._uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); this._uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); } /** @@ -443,7 +443,7 @@ }; /** @enum {symbol} */ -WebInspector.ResourceScriptFile.Events = { +Bindings.ResourceScriptFile.Events = { DidMergeToVM: Symbol('DidMergeToVM'), DidDivergeFromVM: Symbol('DidDivergeFromVM'), };
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js index 927299f..76c7c37 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
@@ -29,12 +29,12 @@ */ /** * @param {string} url - * @return {?WebInspector.Resource} + * @return {?SDK.Resource} */ -WebInspector.resourceForURL = function(url) { - var targets = WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM); +Bindings.resourceForURL = function(url) { + var targets = SDK.targetManager.targets(SDK.Target.Capability.DOM); for (var i = 0; i < targets.length; ++i) { - var resource = WebInspector.ResourceTreeModel.fromTarget(targets[i]).resourceForURL(url); + var resource = SDK.ResourceTreeModel.fromTarget(targets[i]).resourceForURL(url); if (resource) return resource; } @@ -42,31 +42,31 @@ }; /** - * @param {function(!WebInspector.Resource)} callback + * @param {function(!SDK.Resource)} callback */ -WebInspector.forAllResources = function(callback) { - var targets = WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM); +Bindings.forAllResources = function(callback) { + var targets = SDK.targetManager.targets(SDK.Target.Capability.DOM); for (var i = 0; i < targets.length; ++i) - WebInspector.ResourceTreeModel.fromTarget(targets[i]).forAllResources(callback); + SDK.ResourceTreeModel.fromTarget(targets[i]).forAllResources(callback); }; /** * @param {string} url * @return {string} */ -WebInspector.displayNameForURL = function(url) { +Bindings.displayNameForURL = function(url) { if (!url) return ''; - var resource = WebInspector.resourceForURL(url); + var resource = Bindings.resourceForURL(url); if (resource) return resource.displayName; - var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url); + var uiSourceCode = Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(url); if (uiSourceCode) return uiSourceCode.displayName(); - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); var inspectedURL = mainTarget && mainTarget.inspectedURL(); if (!inspectedURL) return url.trimURL('');
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js index e8dde61..333c87a 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js
@@ -31,57 +31,57 @@ /** * @unrestricted */ -WebInspector.SASSSourceMapping = class { +Bindings.SASSSourceMapping = class { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.NetworkMapping} networkMapping - * @param {!WebInspector.NetworkProject} networkProject + * @param {!SDK.CSSModel} cssModel + * @param {!Bindings.NetworkMapping} networkMapping + * @param {!Bindings.NetworkProject} networkProject */ constructor(cssModel, networkMapping, networkProject) { this._cssModel = cssModel; this._networkProject = networkProject; this._networkMapping = networkMapping; this._eventListeners = [ - this._cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapAttached, this._sourceMapAttached, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapDetached, this._sourceMapDetached, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.SourceMapChanged, this._sourceMapChanged, this) + this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, this._sourceMapAttached, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapDetached, this._sourceMapDetached, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapChanged, this._sourceMapChanged, this) ]; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _sourceMapAttached(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); var sourceMap = this._cssModel.sourceMapForHeader(header); for (var sassURL of sourceMap.sourceURLs()) { - var contentProvider = sourceMap.sourceContentProvider(sassURL, WebInspector.resourceTypes.SourceMapStyleSheet); + var contentProvider = sourceMap.sourceContentProvider(sassURL, Common.resourceTypes.SourceMapStyleSheet); var embeddedContent = sourceMap.embeddedContentByURL(sassURL); var embeddedContentLength = typeof embeddedContent === 'string' ? embeddedContent.length : null; this._networkProject.addFile( - contentProvider, WebInspector.ResourceTreeFrame.fromStyleSheet(header), false, embeddedContentLength); + contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false, embeddedContentLength); } - WebInspector.cssWorkspaceBinding.updateLocations(header); + Bindings.cssWorkspaceBinding.updateLocations(header); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _sourceMapDetached(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); - WebInspector.cssWorkspaceBinding.updateLocations(header); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); + Bindings.cssWorkspaceBinding.updateLocations(header); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _sourceMapChanged(event) { - var sourceMap = /** @type {!WebInspector.SourceMap} */ (event.data.sourceMap); + var sourceMap = /** @type {!SDK.SourceMap} */ (event.data.sourceMap); var newSources = /** @type {!Map<string, string>} */ (event.data.newSources); var headers = this._cssModel.headersForSourceMap(sourceMap); var handledUISourceCodes = new Set(); for (var header of headers) { - WebInspector.cssWorkspaceBinding.updateLocations(header); + Bindings.cssWorkspaceBinding.updateLocations(header); for (var sourceURL of newSources.keys()) { var uiSourceCode = this._networkMapping.uiSourceCodeForStyleURL(sourceURL, header); if (!uiSourceCode) { @@ -98,8 +98,8 @@ } /** - * @param {!WebInspector.CSSLocation} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.CSSLocation} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { var sourceMap = this._cssModel.sourceMapForHeader(rawLocation.header()); @@ -115,6 +115,6 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js index 0262121e..f5469f58 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.js
@@ -31,40 +31,40 @@ /** * @unrestricted */ -WebInspector.StylesSourceMapping = class { +Bindings.StylesSourceMapping = class { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.NetworkMapping} networkMapping + * @param {!SDK.CSSModel} cssModel + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.NetworkMapping} networkMapping */ constructor(cssModel, workspace, networkMapping) { this._cssModel = cssModel; this._workspace = workspace; this._networkMapping = networkMapping; - /** @type {!Map<string, !Map<string, !Map<string, !WebInspector.CSSStyleSheetHeader>>>} */ + /** @type {!Map<string, !Map<string, !Map<string, !SDK.CSSStyleSheetHeader>>>} */ this._urlToHeadersByFrameId = new Map(); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} */ + /** @type {!Map.<!Workspace.UISourceCode, !Bindings.StyleFile>} */ this._styleFiles = new Map(); this._eventListeners = [ - this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this), + this._workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this), this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this), + Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this), this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetChanged, this._styleSheetChanged, this), - WebInspector.ResourceTreeModel.fromTarget(cssModel.target()) + Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetChanged, this._styleSheetChanged, this), + SDK.ResourceTreeModel.fromTarget(cssModel.target()) .addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._unbindAllUISourceCodes, this) + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._unbindAllUISourceCodes, this) ]; } /** - * @param {!WebInspector.CSSLocation} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.CSSLocation} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { var uiSourceCode = this._networkMapping.uiSourceCodeForStyleURL(rawLocation.url, rawLocation.header()); @@ -81,22 +81,22 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetAdded(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); var url = header.resourceURL(); if (!url) return; var map = this._urlToHeadersByFrameId.get(url); if (!map) { - map = /** @type {!Map.<string, !Map.<string, !WebInspector.CSSStyleSheetHeader>>} */ (new Map()); + map = /** @type {!Map.<string, !Map.<string, !SDK.CSSStyleSheetHeader>>} */ (new Map()); this._urlToHeadersByFrameId.set(url, map); } var headersById = map.get(header.frameId); if (!headersById) { - headersById = /** @type {!Map.<string, !WebInspector.CSSStyleSheetHeader>} */ (new Map()); + headersById = /** @type {!Map.<string, !SDK.CSSStyleSheetHeader>} */ (new Map()); map.set(header.frameId, headersById); } headersById.set(header.id, header); @@ -106,10 +106,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetRemoved(event) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); var url = header.resourceURL(); if (!url) return; @@ -132,7 +132,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _unbindUISourceCode(uiSourceCode) { var styleFile = this._styleFiles.get(uiSourceCode); @@ -143,7 +143,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _unbindAllUISourceCodes(event) { if (event.data.target() !== this._cssModel.target()) @@ -155,10 +155,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAddedToWorkspace(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (!this._urlToHeadersByFrameId.has(uiSourceCode.url())) return; this._bindUISourceCode( @@ -166,36 +166,36 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!SDK.CSSStyleSheetHeader} header */ _bindUISourceCode(uiSourceCode, header) { if (this._styleFiles.get(uiSourceCode) || (header.isInline && !header.hasSourceURL)) return; - this._styleFiles.set(uiSourceCode, new WebInspector.StyleFile(uiSourceCode, this)); - WebInspector.cssWorkspaceBinding.updateLocations(header); + this._styleFiles.set(uiSourceCode, new Bindings.StyleFile(uiSourceCode, this)); + Bindings.cssWorkspaceBinding.updateLocations(header); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _projectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); var uiSourceCodes = project.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) this._unbindUISourceCode(uiSourceCodes[i]); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._unbindUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} content * @param {boolean} majorChange * @return {!Promise<?string>} @@ -209,7 +209,7 @@ /** * @param {?string} error - * @this {WebInspector.StylesSourceMapping} + * @this {Bindings.StylesSourceMapping} * @return {?string} */ function callback(error) { @@ -225,7 +225,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _styleSheetChanged(event) { if (this._isSettingContent) @@ -242,7 +242,7 @@ clearTimeout(this._updateStyleSheetTextTimer); this._updateStyleSheetTextTimer = setTimeout( - this._updateStyleSheetText.bind(this, styleSheetId), WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs); + this._updateStyleSheetText.bind(this, styleSheetId), Bindings.StylesSourceMapping.ChangeUpdateTimeoutMs); } /** @@ -266,9 +266,9 @@ header.requestContent().then(callback.bind(this, uiSourceCode)); /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {?string} content - * @this {WebInspector.StylesSourceMapping} + * @this {Bindings.StylesSourceMapping} */ function callback(uiSourceCode, content) { var styleFile = this._styleFiles.get(uiSourceCode); @@ -278,35 +278,35 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } }; -WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs = 200; +Bindings.StylesSourceMapping.ChangeUpdateTimeoutMs = 200; /** * @unrestricted */ -WebInspector.StyleFile = class { +Bindings.StyleFile = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.StylesSourceMapping} mapping + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Bindings.StylesSourceMapping} mapping */ constructor(uiSourceCode, mapping) { this._uiSourceCode = uiSourceCode; this._mapping = mapping; this._eventListeners = [ this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this), + Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this), this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this) + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this) ]; - this._commitThrottler = new WebInspector.Throttler(WebInspector.StyleFile.updateTimeout); + this._commitThrottler = new Common.Throttler(Bindings.StyleFile.updateTimeout); this._terminated = false; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _workingCopyCommitted(event) { if (this._isAddingRevision) @@ -317,7 +317,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _workingCopyChanged(event) { if (this._isAddingRevision) @@ -357,8 +357,8 @@ if (this._terminated) return; this._terminated = true; - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } }; -WebInspector.StyleFile.updateTimeout = 200; +Bindings.StyleFile.updateTimeout = 200;
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js b/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js index a6d66c8..ed0573d 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/TempFile.js
@@ -32,7 +32,7 @@ /** * @unrestricted */ -WebInspector.TempFile = class { +Bindings.TempFile = class { constructor() { this._fileEntry = null; this._writer = null; @@ -41,10 +41,10 @@ /** * @param {string} dirPath * @param {string} name - * @return {!Promise.<!WebInspector.TempFile>} + * @return {!Promise.<!Bindings.TempFile>} */ static create(dirPath, name) { - var file = new WebInspector.TempFile(); + var file = new Bindings.TempFile(); function requestTempFileSystem() { return new Promise(window.requestFileSystem.bind(window, window.TEMPORARY, 10)); @@ -107,7 +107,7 @@ return new Promise(truncate).then(didTruncate, onTruncateError); } - return WebInspector.TempFile.ensureTempStorageCleared() + return Bindings.TempFile.ensureTempStorageCleared() .then(requestTempFileSystem) .then(getDirectoryEntry) .then(getFileEntry) @@ -119,14 +119,14 @@ * @return {!Promise.<undefined>} */ static ensureTempStorageCleared() { - if (!WebInspector.TempFile._storageCleanerPromise) { - WebInspector.TempFile._storageCleanerPromise = - WebInspector.serviceManager.createAppService('utility_shared_worker', 'TempStorage', true).then(service => { + if (!Bindings.TempFile._storageCleanerPromise) { + Bindings.TempFile._storageCleanerPromise = + Services.serviceManager.createAppService('utility_shared_worker', 'TempStorage', true).then(service => { if (service) return service.send('clear'); }); } - return WebInspector.TempFile._storageCleanerPromise; + return Bindings.TempFile._storageCleanerPromise; } /** @@ -136,7 +136,7 @@ write(strings, callback) { var blob = new Blob(strings, {type: 'text/plain'}); this._writer.onerror = function(e) { - WebInspector.console.error('Failed to write into a temp file: ' + e.target.error.message); + Common.console.error('Failed to write into a temp file: ' + e.target.error.message); callback(-1); }; this._writer.onwriteend = function(e) { @@ -177,32 +177,32 @@ callback(/** @type {?string} */ (this.result)); }; reader.onerror = function(error) { - WebInspector.console.error('Failed to read from temp file: ' + error.message); + Common.console.error('Failed to read from temp file: ' + error.message); }; reader.readAsText(file); } function didFailToGetFile(error) { - WebInspector.console.error('Failed to load temp file: ' + error.message); + Common.console.error('Failed to load temp file: ' + error.message); callback(null); } this._fileEntry.file(didGetFile, didFailToGetFile); } /** - * @param {!WebInspector.OutputStream} outputStream - * @param {!WebInspector.OutputStreamDelegate} delegate + * @param {!Common.OutputStream} outputStream + * @param {!Bindings.OutputStreamDelegate} delegate */ copyToOutputStream(outputStream, delegate) { /** * @param {!File} file */ function didGetFile(file) { - var reader = new WebInspector.ChunkedFileReader(file, 10 * 1000 * 1000, delegate); + var reader = new Bindings.ChunkedFileReader(file, 10 * 1000 * 1000, delegate); reader.start(outputStream); } function didFailToGetFile(error) { - WebInspector.console.error('Failed to load temp file: ' + error.message); + Common.console.error('Failed to load temp file: ' + error.message); outputStream.close(); } @@ -219,7 +219,7 @@ /** * @unrestricted */ -WebInspector.DeferredTempFile = class { +Bindings.DeferredTempFile = class { /** * @param {string} dirPath * @param {string} name @@ -233,7 +233,7 @@ this._finishedWriting = false; this._callsPendingOpen = []; this._pendingReads = []; - WebInspector.TempFile.create(dirPath, name) + Bindings.TempFile.create(dirPath, name) .then(this._didCreateTempFile.bind(this), this._failedToCreateTempFile.bind(this)); } @@ -250,7 +250,7 @@ } /** - * @param {function(?WebInspector.TempFile)} callback + * @param {function(?Bindings.TempFile)} callback */ finishWriting(callback) { this._finishCallback = callback; @@ -264,12 +264,12 @@ * @param {*} e */ _failedToCreateTempFile(e) { - WebInspector.console.error('Failed to create temp file ' + e.code + ' : ' + e.message); + Common.console.error('Failed to create temp file ' + e.code + ' : ' + e.message); this._notifyFinished(); } /** - * @param {!WebInspector.TempFile} tempFile + * @param {!Bindings.TempFile} tempFile */ _didCreateTempFile(tempFile) { this._tempFile = tempFile; @@ -346,8 +346,8 @@ } /** - * @param {!WebInspector.OutputStream} outputStream - * @param {!WebInspector.OutputStreamDelegate} delegate + * @param {!Common.OutputStream} outputStream + * @param {!Bindings.OutputStreamDelegate} delegate */ copyToOutputStream(outputStream, delegate) { if (!this._finishedWriting) { @@ -371,10 +371,10 @@ /** - * @implements {WebInspector.BackingStorage} + * @implements {SDK.BackingStorage} * @unrestricted */ -WebInspector.TempFileBackingStorage = class { +Bindings.TempFileBackingStorage = class { /** * @param {string} dirName */ @@ -403,11 +403,11 @@ appendAccessibleString(string) { this._flush(false); this._strings.push(string); - var chunk = /** @type {!WebInspector.TempFileBackingStorage.Chunk} */ (this._flush(true)); + var chunk = /** @type {!Bindings.TempFileBackingStorage.Chunk} */ (this._flush(true)); /** - * @param {!WebInspector.TempFileBackingStorage.Chunk} chunk - * @param {!WebInspector.DeferredTempFile} file + * @param {!Bindings.TempFileBackingStorage.Chunk} chunk + * @param {!Bindings.DeferredTempFile} file * @return {!Promise.<?string>} */ function readString(chunk, file) { @@ -435,7 +435,7 @@ /** * @param {boolean} createChunk - * @return {?WebInspector.TempFileBackingStorage.Chunk} + * @return {?Bindings.TempFileBackingStorage.Chunk} */ _flush(createChunk) { if (!this._strings.length) @@ -448,8 +448,8 @@ } /** - * @this {WebInspector.TempFileBackingStorage} - * @param {?WebInspector.TempFileBackingStorage.Chunk} chunk + * @this {Bindings.TempFileBackingStorage} + * @param {?Bindings.TempFileBackingStorage.Chunk} chunk * @param {number} fileSize */ function didWrite(chunk, fileSize) { @@ -483,7 +483,7 @@ reset() { if (this._file) this._file.remove(); - this._file = new WebInspector.DeferredTempFile(this._dirName, String(Date.now())); + this._file = new Bindings.DeferredTempFile(this._dirName, String(Date.now())); /** * @type {!Array.<string>} */ @@ -493,8 +493,8 @@ } /** - * @param {!WebInspector.OutputStream} outputStream - * @param {!WebInspector.OutputStreamDelegate} delegate + * @param {!Common.OutputStream} outputStream + * @param {!Bindings.OutputStreamDelegate} delegate */ writeToStream(outputStream, delegate) { this._file.copyToOutputStream(outputStream, delegate); @@ -508,4 +508,4 @@ * endOffset: number * }} */ -WebInspector.TempFileBackingStorage.Chunk; +Bindings.TempFileBackingStorage.Chunk;
diff --git a/third_party/WebKit/Source/devtools/front_end/cm_modes/DefaultCodeMirrorMimeMode.js b/third_party/WebKit/Source/devtools/front_end/cm_modes/DefaultCodeMirrorMimeMode.js index 2b63c9aa..31497d4 100644 --- a/third_party/WebKit/Source/devtools/front_end/cm_modes/DefaultCodeMirrorMimeMode.js +++ b/third_party/WebKit/Source/devtools/front_end/cm_modes/DefaultCodeMirrorMimeMode.js
@@ -4,13 +4,13 @@ /** * @constructor - * @implements {WebInspector.CodeMirrorMimeMode} + * @implements {TextEditor.CodeMirrorMimeMode} */ -WebInspector.DefaultCodeMirrorMimeMode = function() +CmModes.DefaultCodeMirrorMimeMode = function() { } -WebInspector.DefaultCodeMirrorMimeMode.prototype = { +CmModes.DefaultCodeMirrorMimeMode.prototype = { /** * @param {!Runtime.Extension} extension * @override
diff --git a/third_party/WebKit/Source/devtools/front_end/cm_modes/module.json b/third_party/WebKit/Source/devtools/front_end/cm_modes/module.json index fc489b7..7d11d98b 100644 --- a/third_party/WebKit/Source/devtools/front_end/cm_modes/module.json +++ b/third_party/WebKit/Source/devtools/front_end/cm_modes/module.json
@@ -1,8 +1,8 @@ { "extensions": [ { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "clike.js", "mimeTypes": [ "text/x-csrc", @@ -18,16 +18,16 @@ ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "coffeescript.js", "mimeTypes": [ "text/x-coffeescript" ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "php.js", "dependencies": [ "clike.js" @@ -39,8 +39,8 @@ ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "python.js", "mimeTypes": [ "text/x-python", @@ -48,40 +48,40 @@ ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "shell.js", "mimeTypes": [ "text/x-sh" ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "livescript.js", "mimeTypes": [ "text/x-livescript" ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "clojure.js", "mimeTypes": [ "text/x-clojure" ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "jsx.js", "mimeTypes": [ "text/jsx" ] }, { - "type": "@WebInspector.CodeMirrorMimeMode", - "className": "WebInspector.DefaultCodeMirrorMimeMode", + "type": "@TextEditor.CodeMirrorMimeMode", + "className": "CmModes.DefaultCodeMirrorMimeMode", "fileName": "stylus.js", "mimeTypes": [ "text/x-styl"
diff --git a/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js b/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js index a2b3557d..a34098e 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js +++ b/third_party/WebKit/Source/devtools/front_end/common/CSSShadowModel.js
@@ -4,46 +4,46 @@ /** * @unrestricted */ -WebInspector.CSSShadowModel = class { +Common.CSSShadowModel = class { /** * @param {boolean} isBoxShadow */ constructor(isBoxShadow) { this._isBoxShadow = isBoxShadow; this._inset = false; - this._offsetX = WebInspector.CSSLength.zero(); - this._offsetY = WebInspector.CSSLength.zero(); - this._blurRadius = WebInspector.CSSLength.zero(); - this._spreadRadius = WebInspector.CSSLength.zero(); - this._color = /** @type {!WebInspector.Color} */ (WebInspector.Color.parse('black')); - this._format = [WebInspector.CSSShadowModel._Part.OffsetX, WebInspector.CSSShadowModel._Part.OffsetY]; + this._offsetX = Common.CSSLength.zero(); + this._offsetY = Common.CSSLength.zero(); + this._blurRadius = Common.CSSLength.zero(); + this._spreadRadius = Common.CSSLength.zero(); + this._color = /** @type {!Common.Color} */ (Common.Color.parse('black')); + this._format = [Common.CSSShadowModel._Part.OffsetX, Common.CSSShadowModel._Part.OffsetY]; } /** * @param {string} text - * @return {!Array<!WebInspector.CSSShadowModel>} + * @return {!Array<!Common.CSSShadowModel>} */ static parseTextShadow(text) { - return WebInspector.CSSShadowModel._parseShadow(text, false); + return Common.CSSShadowModel._parseShadow(text, false); } /** * @param {string} text - * @return {!Array<!WebInspector.CSSShadowModel>} + * @return {!Array<!Common.CSSShadowModel>} */ static parseBoxShadow(text) { - return WebInspector.CSSShadowModel._parseShadow(text, true); + return Common.CSSShadowModel._parseShadow(text, true); } /** * @param {string} text * @param {boolean} isBoxShadow - * @return {!Array<!WebInspector.CSSShadowModel>} + * @return {!Array<!Common.CSSShadowModel>} */ static _parseShadow(text, isBoxShadow) { var shadowTexts = []; // Split by commas that aren't inside of color values to get the individual shadow values. - var splits = WebInspector.TextUtils.splitStringByRegexes(text, [WebInspector.Color.Regex, /,/g]); + var splits = Common.TextUtils.splitStringByRegexes(text, [Common.Color.Regex, /,/g]); var currentIndex = 0; for (var i = 0; i < splits.length; i++) { if (splits[i].regexIndex === 1) { @@ -56,11 +56,11 @@ var shadows = []; for (var i = 0; i < shadowTexts.length; i++) { - var shadow = new WebInspector.CSSShadowModel(isBoxShadow); + var shadow = new Common.CSSShadowModel(isBoxShadow); shadow._format = []; var nextPartAllowed = true; - var regexes = [/inset/gi, WebInspector.Color.Regex, WebInspector.CSSLength.Regex]; - var results = WebInspector.TextUtils.splitStringByRegexes(shadowTexts[i], regexes); + var regexes = [/inset/gi, Common.Color.Regex, Common.CSSLength.Regex]; + var results = Common.TextUtils.splitStringByRegexes(shadowTexts[i], regexes); for (var j = 0; j < results.length; j++) { var result = results[j]; if (result.regexIndex === -1) { @@ -76,40 +76,40 @@ if (result.regexIndex === 0) { shadow._inset = true; - shadow._format.push(WebInspector.CSSShadowModel._Part.Inset); + shadow._format.push(Common.CSSShadowModel._Part.Inset); } else if (result.regexIndex === 1) { - var color = WebInspector.Color.parse(result.value); + var color = Common.Color.parse(result.value); if (!color) return []; shadow._color = color; - shadow._format.push(WebInspector.CSSShadowModel._Part.Color); + shadow._format.push(Common.CSSShadowModel._Part.Color); } else if (result.regexIndex === 2) { - var length = WebInspector.CSSLength.parse(result.value); + var length = Common.CSSLength.parse(result.value); if (!length) return []; var previousPart = shadow._format.length > 0 ? shadow._format[shadow._format.length - 1] : ''; - if (previousPart === WebInspector.CSSShadowModel._Part.OffsetX) { + if (previousPart === Common.CSSShadowModel._Part.OffsetX) { shadow._offsetY = length; - shadow._format.push(WebInspector.CSSShadowModel._Part.OffsetY); - } else if (previousPart === WebInspector.CSSShadowModel._Part.OffsetY) { + shadow._format.push(Common.CSSShadowModel._Part.OffsetY); + } else if (previousPart === Common.CSSShadowModel._Part.OffsetY) { shadow._blurRadius = length; - shadow._format.push(WebInspector.CSSShadowModel._Part.BlurRadius); - } else if (previousPart === WebInspector.CSSShadowModel._Part.BlurRadius) { + shadow._format.push(Common.CSSShadowModel._Part.BlurRadius); + } else if (previousPart === Common.CSSShadowModel._Part.BlurRadius) { shadow._spreadRadius = length; - shadow._format.push(WebInspector.CSSShadowModel._Part.SpreadRadius); + shadow._format.push(Common.CSSShadowModel._Part.SpreadRadius); } else { shadow._offsetX = length; - shadow._format.push(WebInspector.CSSShadowModel._Part.OffsetX); + shadow._format.push(Common.CSSShadowModel._Part.OffsetX); } } } } - if (invalidCount(WebInspector.CSSShadowModel._Part.OffsetX, 1, 1) || - invalidCount(WebInspector.CSSShadowModel._Part.OffsetY, 1, 1) || - invalidCount(WebInspector.CSSShadowModel._Part.Color, 0, 1) || - invalidCount(WebInspector.CSSShadowModel._Part.BlurRadius, 0, 1) || - invalidCount(WebInspector.CSSShadowModel._Part.Inset, 0, isBoxShadow ? 1 : 0) || - invalidCount(WebInspector.CSSShadowModel._Part.SpreadRadius, 0, isBoxShadow ? 1 : 0)) + if (invalidCount(Common.CSSShadowModel._Part.OffsetX, 1, 1) || + invalidCount(Common.CSSShadowModel._Part.OffsetY, 1, 1) || + invalidCount(Common.CSSShadowModel._Part.Color, 0, 1) || + invalidCount(Common.CSSShadowModel._Part.BlurRadius, 0, 1) || + invalidCount(Common.CSSShadowModel._Part.Inset, 0, isBoxShadow ? 1 : 0) || + invalidCount(Common.CSSShadowModel._Part.SpreadRadius, 0, isBoxShadow ? 1 : 0)) return []; shadows.push(shadow); } @@ -136,54 +136,54 @@ */ setInset(inset) { this._inset = inset; - if (this._format.indexOf(WebInspector.CSSShadowModel._Part.Inset) === -1) - this._format.unshift(WebInspector.CSSShadowModel._Part.Inset); + if (this._format.indexOf(Common.CSSShadowModel._Part.Inset) === -1) + this._format.unshift(Common.CSSShadowModel._Part.Inset); } /** - * @param {!WebInspector.CSSLength} offsetX + * @param {!Common.CSSLength} offsetX */ setOffsetX(offsetX) { this._offsetX = offsetX; } /** - * @param {!WebInspector.CSSLength} offsetY + * @param {!Common.CSSLength} offsetY */ setOffsetY(offsetY) { this._offsetY = offsetY; } /** - * @param {!WebInspector.CSSLength} blurRadius + * @param {!Common.CSSLength} blurRadius */ setBlurRadius(blurRadius) { this._blurRadius = blurRadius; - if (this._format.indexOf(WebInspector.CSSShadowModel._Part.BlurRadius) === -1) { - var yIndex = this._format.indexOf(WebInspector.CSSShadowModel._Part.OffsetY); - this._format.splice(yIndex + 1, 0, WebInspector.CSSShadowModel._Part.BlurRadius); + if (this._format.indexOf(Common.CSSShadowModel._Part.BlurRadius) === -1) { + var yIndex = this._format.indexOf(Common.CSSShadowModel._Part.OffsetY); + this._format.splice(yIndex + 1, 0, Common.CSSShadowModel._Part.BlurRadius); } } /** - * @param {!WebInspector.CSSLength} spreadRadius + * @param {!Common.CSSLength} spreadRadius */ setSpreadRadius(spreadRadius) { this._spreadRadius = spreadRadius; - if (this._format.indexOf(WebInspector.CSSShadowModel._Part.SpreadRadius) === -1) { + if (this._format.indexOf(Common.CSSShadowModel._Part.SpreadRadius) === -1) { this.setBlurRadius(this._blurRadius); - var blurIndex = this._format.indexOf(WebInspector.CSSShadowModel._Part.BlurRadius); - this._format.splice(blurIndex + 1, 0, WebInspector.CSSShadowModel._Part.SpreadRadius); + var blurIndex = this._format.indexOf(Common.CSSShadowModel._Part.BlurRadius); + this._format.splice(blurIndex + 1, 0, Common.CSSShadowModel._Part.SpreadRadius); } } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color */ setColor(color) { this._color = color; - if (this._format.indexOf(WebInspector.CSSShadowModel._Part.Color) === -1) - this._format.push(WebInspector.CSSShadowModel._Part.Color); + if (this._format.indexOf(Common.CSSShadowModel._Part.Color) === -1) + this._format.push(Common.CSSShadowModel._Part.Color); } /** @@ -201,35 +201,35 @@ } /** - * @return {!WebInspector.CSSLength} + * @return {!Common.CSSLength} */ offsetX() { return this._offsetX; } /** - * @return {!WebInspector.CSSLength} + * @return {!Common.CSSLength} */ offsetY() { return this._offsetY; } /** - * @return {!WebInspector.CSSLength} + * @return {!Common.CSSLength} */ blurRadius() { return this._blurRadius; } /** - * @return {!WebInspector.CSSLength} + * @return {!Common.CSSLength} */ spreadRadius() { return this._spreadRadius; } /** - * @return {!WebInspector.Color} + * @return {!Common.Color} */ color() { return this._color; @@ -242,17 +242,17 @@ var parts = []; for (var i = 0; i < this._format.length; i++) { var part = this._format[i]; - if (part === WebInspector.CSSShadowModel._Part.Inset && this._inset) + if (part === Common.CSSShadowModel._Part.Inset && this._inset) parts.push('inset'); - else if (part === WebInspector.CSSShadowModel._Part.OffsetX) + else if (part === Common.CSSShadowModel._Part.OffsetX) parts.push(this._offsetX.asCSSText()); - else if (part === WebInspector.CSSShadowModel._Part.OffsetY) + else if (part === Common.CSSShadowModel._Part.OffsetY) parts.push(this._offsetY.asCSSText()); - else if (part === WebInspector.CSSShadowModel._Part.BlurRadius) + else if (part === Common.CSSShadowModel._Part.BlurRadius) parts.push(this._blurRadius.asCSSText()); - else if (part === WebInspector.CSSShadowModel._Part.SpreadRadius) + else if (part === Common.CSSShadowModel._Part.SpreadRadius) parts.push(this._spreadRadius.asCSSText()); - else if (part === WebInspector.CSSShadowModel._Part.Color) + else if (part === Common.CSSShadowModel._Part.Color) parts.push(this._color.asString(this._color.format())); } return parts.join(' '); @@ -262,7 +262,7 @@ /** * @enum {string} */ -WebInspector.CSSShadowModel._Part = { +Common.CSSShadowModel._Part = { Inset: 'I', OffsetX: 'X', OffsetY: 'Y', @@ -275,7 +275,7 @@ /** * @unrestricted */ -WebInspector.CSSLength = class { +Common.CSSLength = class { /** * @param {number} amount * @param {string} unit @@ -287,23 +287,23 @@ /** * @param {string} text - * @return {?WebInspector.CSSLength} + * @return {?Common.CSSLength} */ static parse(text) { - var lengthRegex = new RegExp('^(?:' + WebInspector.CSSLength.Regex.source + ')$', 'i'); + var lengthRegex = new RegExp('^(?:' + Common.CSSLength.Regex.source + ')$', 'i'); var match = text.match(lengthRegex); if (!match) return null; if (match.length > 2 && match[2]) - return new WebInspector.CSSLength(parseFloat(match[1]), match[2]); - return WebInspector.CSSLength.zero(); + return new Common.CSSLength(parseFloat(match[1]), match[2]); + return Common.CSSLength.zero(); } /** - * @return {!WebInspector.CSSLength} + * @return {!Common.CSSLength} */ static zero() { - return new WebInspector.CSSLength(0, ''); + return new Common.CSSLength(0, ''); } /** @@ -315,7 +315,7 @@ }; /** @type {!RegExp} */ -WebInspector.CSSLength.Regex = (function() { +Common.CSSLength.Regex = (function() { var number = '([+-]?(?:[0-9]*[.])?[0-9]+(?:[eE][+-]?[0-9]+)?)'; var unit = '(ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw)'; var zero = '[+-]?(?:0*[.])?0+(?:[eE][+-]?[0-9]+)?';
diff --git a/third_party/WebKit/Source/devtools/front_end/common/CharacterIdMap.js b/third_party/WebKit/Source/devtools/front_end/common/CharacterIdMap.js index 5f9a9f64..dedb0b05 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/CharacterIdMap.js +++ b/third_party/WebKit/Source/devtools/front_end/common/CharacterIdMap.js
@@ -5,7 +5,7 @@ * @template T * @unrestricted */ -WebInspector.CharacterIdMap = class { +Common.CharacterIdMap = class { constructor() { /** @type {!Map<T, string>} */ this._elementToCharacter = new Map();
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Color.js b/third_party/WebKit/Source/devtools/front_end/common/Color.js index afc04c9..2fffeac 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Color.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Color.js
@@ -30,10 +30,10 @@ /** * @unrestricted */ -WebInspector.Color = class { +Common.Color = class { /** * @param {!Array.<number>} rgba - * @param {!WebInspector.Color.Format} format + * @param {!Common.Color.Format} format * @param {string=} originalText */ constructor(rgba, format, originalText) { @@ -58,7 +58,7 @@ /** * @param {string} text - * @return {?WebInspector.Color} + * @return {?Common.Color} */ static parse(text) { // Simple - #hex, rgb(), nickname, hsl() @@ -71,31 +71,31 @@ var hex = match[1].toLowerCase(); var format; if (hex.length === 3) { - format = WebInspector.Color.Format.ShortHEX; + format = Common.Color.Format.ShortHEX; hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2); } else - format = WebInspector.Color.Format.HEX; + format = Common.Color.Format.HEX; var r = parseInt(hex.substring(0, 2), 16); var g = parseInt(hex.substring(2, 4), 16); var b = parseInt(hex.substring(4, 6), 16); - return new WebInspector.Color([r / 255, g / 255, b / 255, 1], format, text); + return new Common.Color([r / 255, g / 255, b / 255, 1], format, text); } if (match[2]) { // rgb var rgbString = match[2].split(/\s*,\s*/); var rgba = [ - WebInspector.Color._parseRgbNumeric(rgbString[0]), WebInspector.Color._parseRgbNumeric(rgbString[1]), - WebInspector.Color._parseRgbNumeric(rgbString[2]), 1 + Common.Color._parseRgbNumeric(rgbString[0]), Common.Color._parseRgbNumeric(rgbString[1]), + Common.Color._parseRgbNumeric(rgbString[2]), 1 ]; - return new WebInspector.Color(rgba, WebInspector.Color.Format.RGB, text); + return new Common.Color(rgba, Common.Color.Format.RGB, text); } if (match[3]) { // nickname var nickname = match[3].toLowerCase(); - if (nickname in WebInspector.Color.Nicknames) { - var rgba = WebInspector.Color.Nicknames[nickname]; - var color = WebInspector.Color.fromRGBA(rgba); - color._format = WebInspector.Color.Format.Nickname; + if (nickname in Common.Color.Nicknames) { + var rgba = Common.Color.Nicknames[nickname]; + var color = Common.Color.fromRGBA(rgba); + color._format = Common.Color.Format.Nickname; color._originalText = text; return color; } @@ -105,12 +105,12 @@ if (match[4]) { // hsl var hslString = match[4].replace(/%/g, '').split(/\s*,\s*/); var hsla = [ - WebInspector.Color._parseHueNumeric(hslString[0]), WebInspector.Color._parseSatLightNumeric(hslString[1]), - WebInspector.Color._parseSatLightNumeric(hslString[2]), 1 + Common.Color._parseHueNumeric(hslString[0]), Common.Color._parseSatLightNumeric(hslString[1]), + Common.Color._parseSatLightNumeric(hslString[2]), 1 ]; var rgba = []; - WebInspector.Color.hsl2rgb(hsla, rgba); - return new WebInspector.Color(rgba, WebInspector.Color.Format.HSL, text); + Common.Color.hsl2rgb(hsla, rgba); + return new Common.Color(rgba, Common.Color.Format.HSL, text); } return null; @@ -124,21 +124,21 @@ if (match[1]) { // rgba var rgbaString = match[1].split(/\s*,\s*/); var rgba = [ - WebInspector.Color._parseRgbNumeric(rgbaString[0]), WebInspector.Color._parseRgbNumeric(rgbaString[1]), - WebInspector.Color._parseRgbNumeric(rgbaString[2]), WebInspector.Color._parseAlphaNumeric(rgbaString[3]) + Common.Color._parseRgbNumeric(rgbaString[0]), Common.Color._parseRgbNumeric(rgbaString[1]), + Common.Color._parseRgbNumeric(rgbaString[2]), Common.Color._parseAlphaNumeric(rgbaString[3]) ]; - return new WebInspector.Color(rgba, WebInspector.Color.Format.RGBA, text); + return new Common.Color(rgba, Common.Color.Format.RGBA, text); } if (match[2]) { // hsla var hslaString = match[2].replace(/%/g, '').split(/\s*,\s*/); var hsla = [ - WebInspector.Color._parseHueNumeric(hslaString[0]), WebInspector.Color._parseSatLightNumeric(hslaString[1]), - WebInspector.Color._parseSatLightNumeric(hslaString[2]), WebInspector.Color._parseAlphaNumeric(hslaString[3]) + Common.Color._parseHueNumeric(hslaString[0]), Common.Color._parseSatLightNumeric(hslaString[1]), + Common.Color._parseSatLightNumeric(hslaString[2]), Common.Color._parseAlphaNumeric(hslaString[3]) ]; var rgba = []; - WebInspector.Color.hsl2rgb(hsla, rgba); - return new WebInspector.Color(rgba, WebInspector.Color.Format.HSLA, text); + Common.Color.hsl2rgb(hsla, rgba); + return new Common.Color(rgba, Common.Color.Format.HSLA, text); } } @@ -147,21 +147,21 @@ /** * @param {!Array.<number>} rgba - * @return {!WebInspector.Color} + * @return {!Common.Color} */ static fromRGBA(rgba) { - return new WebInspector.Color( - [rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3]], WebInspector.Color.Format.RGBA); + return new Common.Color( + [rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3]], Common.Color.Format.RGBA); } /** * @param {!Array.<number>} hsva - * @return {!WebInspector.Color} + * @return {!Common.Color} */ static fromHSVA(hsva) { var rgba = []; - WebInspector.Color.hsva2rgba(hsva, rgba); - return new WebInspector.Color(rgba, WebInspector.Color.Format.HSLA); + Common.Color.hsva2rgba(hsva, rgba); + return new Common.Color(rgba, Common.Color.Format.HSLA); } /** @@ -272,11 +272,11 @@ * @param {!Array<number>} out_rgba */ static hsva2rgba(hsva, out_rgba) { - WebInspector.Color._hsva2hsla(hsva, WebInspector.Color.hsva2rgba._tmpHSLA); - WebInspector.Color.hsl2rgb(WebInspector.Color.hsva2rgba._tmpHSLA, out_rgba); + Common.Color._hsva2hsla(hsva, Common.Color.hsva2rgba._tmpHSLA); + Common.Color.hsl2rgb(Common.Color.hsva2rgba._tmpHSLA, out_rgba); - for (var i = 0; i < WebInspector.Color.hsva2rgba._tmpHSLA.length; i++) - WebInspector.Color.hsva2rgba._tmpHSLA[i] = 0; + for (var i = 0; i < Common.Color.hsva2rgba._tmpHSLA.length; i++) + Common.Color.hsva2rgba._tmpHSLA[i] = 0; } /** @@ -321,14 +321,14 @@ * @return {number} */ static calculateContrastRatio(fgRGBA, bgRGBA) { - WebInspector.Color.blendColors(fgRGBA, bgRGBA, WebInspector.Color.calculateContrastRatio._blendedFg); + Common.Color.blendColors(fgRGBA, bgRGBA, Common.Color.calculateContrastRatio._blendedFg); - var fgLuminance = WebInspector.Color.luminance(WebInspector.Color.calculateContrastRatio._blendedFg); - var bgLuminance = WebInspector.Color.luminance(bgRGBA); + var fgLuminance = Common.Color.luminance(Common.Color.calculateContrastRatio._blendedFg); + var bgLuminance = Common.Color.luminance(bgRGBA); var contrastRatio = (Math.max(fgLuminance, bgLuminance) + 0.05) / (Math.min(fgLuminance, bgLuminance) + 0.05); - for (var i = 0; i < WebInspector.Color.calculateContrastRatio._blendedFg.length; i++) - WebInspector.Color.calculateContrastRatio._blendedFg[i] = 0; + for (var i = 0; i < Common.Color.calculateContrastRatio._blendedFg.length; i++) + Common.Color.calculateContrastRatio._blendedFg[i] = 0; return contrastRatio; } @@ -360,13 +360,13 @@ } /** - * @param {!WebInspector.Color} color - * @return {!WebInspector.Color.Format} + * @param {!Common.Color} color + * @return {!Common.Color.Format} */ static detectColorFormat(color) { - const cf = WebInspector.Color.Format; + const cf = Common.Color.Format; var format; - var formatSetting = WebInspector.moduleSetting('colorFormat').get(); + var formatSetting = Common.moduleSetting('colorFormat').get(); if (formatSetting === cf.Original) format = cf.Original; else if (formatSetting === cf.RGB) @@ -382,7 +382,7 @@ } /** - * @return {!WebInspector.Color.Format} + * @return {!Common.Color.Format} */ format() { return this._format; @@ -504,35 +504,35 @@ } switch (format) { - case WebInspector.Color.Format.Original: + case Common.Color.Format.Original: return this._originalText; - case WebInspector.Color.Format.RGB: + case Common.Color.Format.RGB: if (this.hasAlpha()) return null; return String.sprintf( 'rgb(%d, %d, %d)', toRgbValue(this._rgba[0]), toRgbValue(this._rgba[1]), toRgbValue(this._rgba[2])); - case WebInspector.Color.Format.RGBA: + case Common.Color.Format.RGBA: return String.sprintf( 'rgba(%d, %d, %d, %f)', toRgbValue(this._rgba[0]), toRgbValue(this._rgba[1]), toRgbValue(this._rgba[2]), this._rgba[3]); - case WebInspector.Color.Format.HSL: + case Common.Color.Format.HSL: if (this.hasAlpha()) return null; var hsl = this.hsla(); return String.sprintf( 'hsl(%d, %d%, %d%)', Math.round(hsl[0] * 360), Math.round(hsl[1] * 100), Math.round(hsl[2] * 100)); - case WebInspector.Color.Format.HSLA: + case Common.Color.Format.HSLA: var hsla = this.hsla(); return String.sprintf( 'hsla(%d, %d%, %d%, %f)', Math.round(hsla[0] * 360), Math.round(hsla[1] * 100), Math.round(hsla[2] * 100), hsla[3]); - case WebInspector.Color.Format.HEX: + case Common.Color.Format.HEX: if (this.hasAlpha()) return null; return String .sprintf('#%s%s%s', toHexValue(this._rgba[0]), toHexValue(this._rgba[1]), toHexValue(this._rgba[2])) .toLowerCase(); - case WebInspector.Color.Format.ShortHEX: + case Common.Color.Format.ShortHEX: if (!this.canBeShortHex()) return null; return String @@ -540,7 +540,7 @@ '#%s%s%s', toShortHexValue(this._rgba[0]), toShortHexValue(this._rgba[1]), toShortHexValue(this._rgba[2])) .toLowerCase(); - case WebInspector.Color.Format.Nickname: + case Common.Color.Format.Nickname: return this.nickname(); } @@ -569,17 +569,17 @@ * @return {?string} nickname */ nickname() { - if (!WebInspector.Color._rgbaToNickname) { - WebInspector.Color._rgbaToNickname = {}; - for (var nickname in WebInspector.Color.Nicknames) { - var rgba = WebInspector.Color.Nicknames[nickname]; + if (!Common.Color._rgbaToNickname) { + Common.Color._rgbaToNickname = {}; + for (var nickname in Common.Color.Nicknames) { + var rgba = Common.Color.Nicknames[nickname]; if (rgba.length !== 4) rgba = rgba.concat(1); - WebInspector.Color._rgbaToNickname[rgba] = nickname; + Common.Color._rgbaToNickname[rgba] = nickname; } } - return WebInspector.Color._rgbaToNickname[this.canonicalRGBA()] || null; + return Common.Color._rgbaToNickname[this.canonicalRGBA()] || null; } /** @@ -594,7 +594,7 @@ } /** - * @return {!WebInspector.Color} + * @return {!Common.Color} */ invert() { var rgba = []; @@ -602,27 +602,27 @@ rgba[1] = 1 - this._rgba[1]; rgba[2] = 1 - this._rgba[2]; rgba[3] = this._rgba[3]; - return new WebInspector.Color(rgba, WebInspector.Color.Format.RGBA); + return new Common.Color(rgba, Common.Color.Format.RGBA); } /** * @param {number} alpha - * @return {!WebInspector.Color} + * @return {!Common.Color} */ setAlpha(alpha) { var rgba = this._rgba.slice(); rgba[3] = alpha; - return new WebInspector.Color(rgba, WebInspector.Color.Format.RGBA); + return new Common.Color(rgba, Common.Color.Format.RGBA); } }; /** @type {!RegExp} */ -WebInspector.Color.Regex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b[a-zA-Z]+\b(?!-))/g; +Common.Color.Regex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b[a-zA-Z]+\b(?!-))/g; /** * @enum {string} */ -WebInspector.Color.Format = { +Common.Color.Format = { Original: 'original', Nickname: 'nickname', HEX: 'hex', @@ -635,13 +635,13 @@ /** @type {!Array<number>} */ -WebInspector.Color.hsva2rgba._tmpHSLA = [0, 0, 0, 0]; +Common.Color.hsva2rgba._tmpHSLA = [0, 0, 0, 0]; -WebInspector.Color.calculateContrastRatio._blendedFg = [0, 0, 0, 0]; +Common.Color.calculateContrastRatio._blendedFg = [0, 0, 0, 0]; -WebInspector.Color.Nicknames = { +Common.Color.Nicknames = { 'aliceblue': [240, 248, 255], 'antiquewhite': [250, 235, 215], 'aqua': [0, 255, 255], @@ -793,17 +793,17 @@ 'transparent': [0, 0, 0, 0], }; -WebInspector.Color.PageHighlight = { - Content: WebInspector.Color.fromRGBA([111, 168, 220, .66]), - ContentLight: WebInspector.Color.fromRGBA([111, 168, 220, .5]), - ContentOutline: WebInspector.Color.fromRGBA([9, 83, 148]), - Padding: WebInspector.Color.fromRGBA([147, 196, 125, .55]), - PaddingLight: WebInspector.Color.fromRGBA([147, 196, 125, .4]), - Border: WebInspector.Color.fromRGBA([255, 229, 153, .66]), - BorderLight: WebInspector.Color.fromRGBA([255, 229, 153, .5]), - Margin: WebInspector.Color.fromRGBA([246, 178, 107, .66]), - MarginLight: WebInspector.Color.fromRGBA([246, 178, 107, .5]), - EventTarget: WebInspector.Color.fromRGBA([255, 196, 196, .66]), - Shape: WebInspector.Color.fromRGBA([96, 82, 177, 0.8]), - ShapeMargin: WebInspector.Color.fromRGBA([96, 82, 127, .6]) +Common.Color.PageHighlight = { + Content: Common.Color.fromRGBA([111, 168, 220, .66]), + ContentLight: Common.Color.fromRGBA([111, 168, 220, .5]), + ContentOutline: Common.Color.fromRGBA([9, 83, 148]), + Padding: Common.Color.fromRGBA([147, 196, 125, .55]), + PaddingLight: Common.Color.fromRGBA([147, 196, 125, .4]), + Border: Common.Color.fromRGBA([255, 229, 153, .66]), + BorderLight: Common.Color.fromRGBA([255, 229, 153, .5]), + Margin: Common.Color.fromRGBA([246, 178, 107, .66]), + MarginLight: Common.Color.fromRGBA([246, 178, 107, .5]), + EventTarget: Common.Color.fromRGBA([255, 196, 196, .66]), + Shape: Common.Color.fromRGBA([96, 82, 177, 0.8]), + ShapeMargin: Common.Color.fromRGBA([96, 82, 127, .6]) };
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Console.js b/third_party/WebKit/Source/devtools/front_end/common/Console.js index 2dbe241..e8d8ff6 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Console.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Console.js
@@ -4,48 +4,48 @@ /** * @unrestricted */ -WebInspector.Console = class extends WebInspector.Object { +Common.Console = class extends Common.Object { constructor() { super(); - /** @type {!Array.<!WebInspector.Console.Message>} */ + /** @type {!Array.<!Common.Console.Message>} */ this._messages = []; } /** * @param {string} text - * @param {!WebInspector.Console.MessageLevel} level + * @param {!Common.Console.MessageLevel} level * @param {boolean=} show */ addMessage(text, level, show) { - var message = new WebInspector.Console.Message( - text, level || WebInspector.Console.MessageLevel.Log, Date.now(), show || false); + var message = new Common.Console.Message( + text, level || Common.Console.MessageLevel.Log, Date.now(), show || false); this._messages.push(message); - this.dispatchEventToListeners(WebInspector.Console.Events.MessageAdded, message); + this.dispatchEventToListeners(Common.Console.Events.MessageAdded, message); } /** * @param {string} text */ log(text) { - this.addMessage(text, WebInspector.Console.MessageLevel.Log); + this.addMessage(text, Common.Console.MessageLevel.Log); } /** * @param {string} text */ warn(text) { - this.addMessage(text, WebInspector.Console.MessageLevel.Warning); + this.addMessage(text, Common.Console.MessageLevel.Warning); } /** * @param {string} text */ error(text) { - this.addMessage(text, WebInspector.Console.MessageLevel.Error, true); + this.addMessage(text, Common.Console.MessageLevel.Error, true); } /** - * @return {!Array.<!WebInspector.Console.Message>} + * @return {!Array.<!Common.Console.Message>} */ messages() { return this._messages; @@ -59,19 +59,19 @@ * @return {!Promise.<undefined>} */ showPromise() { - return WebInspector.Revealer.revealPromise(this); + return Common.Revealer.revealPromise(this); } }; /** @enum {symbol} */ -WebInspector.Console.Events = { +Common.Console.Events = { MessageAdded: Symbol('messageAdded') }; /** * @enum {string} */ -WebInspector.Console.MessageLevel = { +Common.Console.MessageLevel = { Log: 'log', Warning: 'warning', Error: 'error' @@ -80,10 +80,10 @@ /** * @unrestricted */ -WebInspector.Console.Message = class { +Common.Console.Message = class { /** * @param {string} text - * @param {!WebInspector.Console.MessageLevel} level + * @param {!Common.Console.MessageLevel} level * @param {number} timestamp * @param {boolean} show */ @@ -95,4 +95,4 @@ } }; -WebInspector.console = new WebInspector.Console(); +Common.console = new Common.Console();
diff --git a/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js b/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js index bfa5efe..5b4df3ea 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js +++ b/third_party/WebKit/Source/devtools/front_end/common/ContentProvider.js
@@ -30,16 +30,16 @@ /** * @interface */ -WebInspector.ContentProvider = function() {}; +Common.ContentProvider = function() {}; -WebInspector.ContentProvider.prototype = { +Common.ContentProvider.prototype = { /** * @return {string} */ contentURL: function() {}, /** - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType: function() {}, @@ -52,7 +52,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent: function(query, caseSensitive, isRegex, callback) {} }; @@ -60,7 +60,7 @@ /** * @unrestricted */ -WebInspector.ContentProvider.SearchMatch = class { +Common.ContentProvider.SearchMatch = class { /** * @param {number} lineNumber * @param {string} lineContent @@ -76,18 +76,18 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @return {!Array.<!WebInspector.ContentProvider.SearchMatch>} + * @return {!Array.<!Common.ContentProvider.SearchMatch>} */ -WebInspector.ContentProvider.performSearchInContent = function(content, query, caseSensitive, isRegex) { +Common.ContentProvider.performSearchInContent = function(content, query, caseSensitive, isRegex) { var regex = createSearchRegex(query, caseSensitive, isRegex); - var text = new WebInspector.Text(content); + var text = new Common.Text(content); var result = []; for (var i = 0; i < text.lineCount(); ++i) { var lineContent = text.lineAt(i); regex.lastIndex = 0; if (regex.exec(lineContent)) - result.push(new WebInspector.ContentProvider.SearchMatch(i, lineContent)); + result.push(new Common.ContentProvider.SearchMatch(i, lineContent)); } return result; }; @@ -99,7 +99,7 @@ * @param {?string=} charset * @return {?string} */ -WebInspector.ContentProvider.contentAsDataURL = function(content, mimeType, contentEncoded, charset) { +Common.ContentProvider.contentAsDataURL = function(content, mimeType, contentEncoded, charset) { const maxDataUrlSize = 1024 * 1024; if (content === null || content.length > maxDataUrlSize) return null;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/FormatterWorkerPool.js b/third_party/WebKit/Source/devtools/front_end/common/FormatterWorkerPool.js index 31a2ec5..3e3ed68 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/FormatterWorkerPool.js +++ b/third_party/WebKit/Source/devtools/front_end/common/FormatterWorkerPool.js
@@ -4,18 +4,18 @@ /** * @unrestricted */ -WebInspector.FormatterWorkerPool = class { +Common.FormatterWorkerPool = class { constructor() { this._taskQueue = []; - /** @type {!Map<!WebInspector.Worker, ?WebInspector.FormatterWorkerPool.Task>} */ + /** @type {!Map<!Common.Worker, ?Common.FormatterWorkerPool.Task>} */ this._workerTasks = new Map(); } /** - * @return {!WebInspector.Worker} + * @return {!Common.Worker} */ _createWorker() { - var worker = new WebInspector.Worker('formatter_worker'); + var worker = new Common.Worker('formatter_worker'); worker.onmessage = this._onWorkerMessage.bind(this, worker); worker.onerror = this._onWorkerError.bind(this, worker); return worker; @@ -26,7 +26,7 @@ return; var freeWorker = this._workerTasks.keysArray().find(worker => !this._workerTasks.get(worker)); - if (!freeWorker && this._workerTasks.size < WebInspector.FormatterWorkerPool.MaxWorkers) + if (!freeWorker && this._workerTasks.size < Common.FormatterWorkerPool.MaxWorkers) freeWorker = this._createWorker(); if (!freeWorker) return; @@ -37,7 +37,7 @@ } /** - * @param {!WebInspector.Worker} worker + * @param {!Common.Worker} worker * @param {!MessageEvent} event */ _onWorkerMessage(worker, event) { @@ -53,7 +53,7 @@ } /** - * @param {!WebInspector.Worker} worker + * @param {!Common.Worker} worker * @param {!Event} event */ _onWorkerError(worker, event) { @@ -74,7 +74,7 @@ * @param {function(?MessageEvent)} callback */ runChunkedTask(methodName, params, callback) { - var task = new WebInspector.FormatterWorkerPool.Task(methodName, params, callback, true); + var task = new Common.FormatterWorkerPool.Task(methodName, params, callback, true); this._taskQueue.push(task); this._processNextTask(); } @@ -87,19 +87,19 @@ runTask(methodName, params) { var callback; var promise = new Promise(fulfill => callback = fulfill); - var task = new WebInspector.FormatterWorkerPool.Task(methodName, params, callback, false); + var task = new Common.FormatterWorkerPool.Task(methodName, params, callback, false); this._taskQueue.push(task); this._processNextTask(); return promise; } }; -WebInspector.FormatterWorkerPool.MaxWorkers = 2; +Common.FormatterWorkerPool.MaxWorkers = 2; /** * @unrestricted */ -WebInspector.FormatterWorkerPool.Task = class { +Common.FormatterWorkerPool.Task = class { /** * @param {string} method * @param {!Object<string, string>} params @@ -114,5 +114,5 @@ } }; -/** @type {!WebInspector.FormatterWorkerPool} */ -WebInspector.formatterWorkerPool; +/** @type {!Common.FormatterWorkerPool} */ +Common.formatterWorkerPool;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Geometry.js b/third_party/WebKit/Source/devtools/front_end/common/Geometry.js index 95331cd..b90b92bb 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Geometry.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Geometry.js
@@ -27,17 +27,17 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.Geometry = {}; +Common.Geometry = {}; /** * @type {number} */ -WebInspector.Geometry._Eps = 1e-5; +Common.Geometry._Eps = 1e-5; /** * @unrestricted */ -WebInspector.Geometry.Vector = class { +Common.Geometry.Vector = class { /** * @param {number} x * @param {number} y @@ -58,7 +58,7 @@ normalize() { var length = this.length(); - if (length <= WebInspector.Geometry._Eps) + if (length <= Common.Geometry._Eps) return; this.x /= length; @@ -70,7 +70,7 @@ /** * @unrestricted */ -WebInspector.Geometry.Point = class { +Common.Geometry.Point = class { /** * @param {number} x * @param {number} y @@ -81,7 +81,7 @@ } /** - * @param {!WebInspector.Geometry.Point} p + * @param {!Common.Geometry.Point} p * @return {number} */ distanceTo(p) { @@ -89,21 +89,21 @@ } /** - * @param {!WebInspector.Geometry.Point} line - * @return {!WebInspector.Geometry.Point} + * @param {!Common.Geometry.Point} line + * @return {!Common.Geometry.Point} */ projectOn(line) { if (line.x === 0 && line.y === 0) - return new WebInspector.Geometry.Point(0, 0); + return new Common.Geometry.Point(0, 0); return line.scale((this.x * line.x + this.y * line.y) / (Math.pow(line.x, 2) + Math.pow(line.y, 2))); } /** * @param {number} scalar - * @return {!WebInspector.Geometry.Point} + * @return {!Common.Geometry.Point} */ scale(scalar) { - return new WebInspector.Geometry.Point(this.x * scalar, this.y * scalar); + return new Common.Geometry.Point(this.x * scalar, this.y * scalar); } /** @@ -118,10 +118,10 @@ /** * @unrestricted */ -WebInspector.Geometry.CubicBezier = class { +Common.Geometry.CubicBezier = class { /** - * @param {!WebInspector.Geometry.Point} point1 - * @param {!WebInspector.Geometry.Point} point2 + * @param {!Common.Geometry.Point} point1 + * @param {!Common.Geometry.Point} point2 */ constructor(point1, point2) { this.controlPoints = [point1, point2]; @@ -129,26 +129,26 @@ /** * @param {string} text - * @return {?WebInspector.Geometry.CubicBezier} + * @return {?Common.Geometry.CubicBezier} */ static parse(text) { - var keywordValues = WebInspector.Geometry.CubicBezier.KeywordValues; + var keywordValues = Common.Geometry.CubicBezier.KeywordValues; var value = text.toLowerCase().replace(/\s+/g, ''); if (Object.keys(keywordValues).indexOf(value) !== -1) - return WebInspector.Geometry.CubicBezier.parse(keywordValues[value]); + return Common.Geometry.CubicBezier.parse(keywordValues[value]); var bezierRegex = /^cubic-bezier\(([^,]+),([^,]+),([^,]+),([^,]+)\)$/; var match = value.match(bezierRegex); if (match) { - var control1 = new WebInspector.Geometry.Point(parseFloat(match[1]), parseFloat(match[2])); - var control2 = new WebInspector.Geometry.Point(parseFloat(match[3]), parseFloat(match[4])); - return new WebInspector.Geometry.CubicBezier(control1, control2); + var control1 = new Common.Geometry.Point(parseFloat(match[1]), parseFloat(match[2])); + var control2 = new Common.Geometry.Point(parseFloat(match[3]), parseFloat(match[4])); + return new Common.Geometry.CubicBezier(control1, control2); } return null; } /** * @param {number} t - * @return {!WebInspector.Geometry.Point} + * @return {!Common.Geometry.Point} */ evaluateAt(t) { /** @@ -162,7 +162,7 @@ var x = evaluate(this.controlPoints[0].x, this.controlPoints[1].x, t); var y = evaluate(this.controlPoints[0].y, this.controlPoints[1].y, t); - return new WebInspector.Geometry.Point(x, y); + return new Common.Geometry.Point(x, y); } /** @@ -170,7 +170,7 @@ */ asCSSText() { var raw = 'cubic-bezier(' + this.controlPoints.join(', ') + ')'; - var keywordValues = WebInspector.Geometry.CubicBezier.KeywordValues; + var keywordValues = Common.Geometry.CubicBezier.KeywordValues; for (var keyword in keywordValues) { if (raw === keywordValues[keyword]) return keyword; @@ -180,9 +180,9 @@ }; /** @type {!RegExp} */ -WebInspector.Geometry.CubicBezier.Regex = /((cubic-bezier\([^)]+\))|\b(linear|ease-in-out|ease-in|ease-out|ease)\b)/g; +Common.Geometry.CubicBezier.Regex = /((cubic-bezier\([^)]+\))|\b(linear|ease-in-out|ease-in|ease-out|ease)\b)/g; -WebInspector.Geometry.CubicBezier.KeywordValues = { +Common.Geometry.CubicBezier.KeywordValues = { 'linear': 'cubic-bezier(0, 0, 1, 1)', 'ease': 'cubic-bezier(0.25, 0.1, 0.25, 1)', 'ease-in': 'cubic-bezier(0.42, 0, 1, 1)', @@ -194,7 +194,7 @@ /** * @unrestricted */ -WebInspector.Geometry.EulerAngles = class { +Common.Geometry.EulerAngles = class { /** * @param {number} alpha * @param {number} beta @@ -208,7 +208,7 @@ /** * @param {!CSSMatrix} rotationMatrix - * @return {!WebInspector.Geometry.EulerAngles} + * @return {!Common.Geometry.EulerAngles} */ static fromRotationMatrix(rotationMatrix) { var beta = Math.atan2(rotationMatrix.m23, rotationMatrix.m33); @@ -216,17 +216,17 @@ -rotationMatrix.m13, Math.sqrt(rotationMatrix.m11 * rotationMatrix.m11 + rotationMatrix.m12 * rotationMatrix.m12)); var alpha = Math.atan2(rotationMatrix.m12, rotationMatrix.m11); - return new WebInspector.Geometry.EulerAngles( - WebInspector.Geometry.radiansToDegrees(alpha), WebInspector.Geometry.radiansToDegrees(beta), - WebInspector.Geometry.radiansToDegrees(gamma)); + return new Common.Geometry.EulerAngles( + Common.Geometry.radiansToDegrees(alpha), Common.Geometry.radiansToDegrees(beta), + Common.Geometry.radiansToDegrees(gamma)); } /** * @return {string} */ toRotate3DString() { - var gammaAxisY = -Math.sin(WebInspector.Geometry.degreesToRadians(this.beta)); - var gammaAxisZ = Math.cos(WebInspector.Geometry.degreesToRadians(this.beta)); + var gammaAxisY = -Math.sin(Common.Geometry.degreesToRadians(this.beta)); + var gammaAxisZ = Math.cos(Common.Geometry.degreesToRadians(this.beta)); var axis = {alpha: [0, 1, 0], beta: [-1, 0, 0], gamma: [0, gammaAxisY, gammaAxisZ]}; return 'rotate3d(' + axis.alpha.join(',') + ',' + this.alpha + 'deg) ' + 'rotate3d(' + axis.beta.join(',') + ',' + this.beta + 'deg) ' + @@ -236,72 +236,72 @@ /** - * @param {!WebInspector.Geometry.Vector} u - * @param {!WebInspector.Geometry.Vector} v + * @param {!Common.Geometry.Vector} u + * @param {!Common.Geometry.Vector} v * @return {number} */ -WebInspector.Geometry.scalarProduct = function(u, v) { +Common.Geometry.scalarProduct = function(u, v) { return u.x * v.x + u.y * v.y + u.z * v.z; }; /** - * @param {!WebInspector.Geometry.Vector} u - * @param {!WebInspector.Geometry.Vector} v - * @return {!WebInspector.Geometry.Vector} + * @param {!Common.Geometry.Vector} u + * @param {!Common.Geometry.Vector} v + * @return {!Common.Geometry.Vector} */ -WebInspector.Geometry.crossProduct = function(u, v) { +Common.Geometry.crossProduct = function(u, v) { var x = u.y * v.z - u.z * v.y; var y = u.z * v.x - u.x * v.z; var z = u.x * v.y - u.y * v.x; - return new WebInspector.Geometry.Vector(x, y, z); + return new Common.Geometry.Vector(x, y, z); }; /** - * @param {!WebInspector.Geometry.Vector} u - * @param {!WebInspector.Geometry.Vector} v - * @return {!WebInspector.Geometry.Vector} + * @param {!Common.Geometry.Vector} u + * @param {!Common.Geometry.Vector} v + * @return {!Common.Geometry.Vector} */ -WebInspector.Geometry.subtract = function(u, v) { +Common.Geometry.subtract = function(u, v) { var x = u.x - v.x; var y = u.y - v.y; var z = u.z - v.z; - return new WebInspector.Geometry.Vector(x, y, z); + return new Common.Geometry.Vector(x, y, z); }; /** - * @param {!WebInspector.Geometry.Vector} v + * @param {!Common.Geometry.Vector} v * @param {!CSSMatrix} m - * @return {!WebInspector.Geometry.Vector} + * @return {!Common.Geometry.Vector} */ -WebInspector.Geometry.multiplyVectorByMatrixAndNormalize = function(v, m) { +Common.Geometry.multiplyVectorByMatrixAndNormalize = function(v, m) { var t = v.x * m.m14 + v.y * m.m24 + v.z * m.m34 + m.m44; var x = (v.x * m.m11 + v.y * m.m21 + v.z * m.m31 + m.m41) / t; var y = (v.x * m.m12 + v.y * m.m22 + v.z * m.m32 + m.m42) / t; var z = (v.x * m.m13 + v.y * m.m23 + v.z * m.m33 + m.m43) / t; - return new WebInspector.Geometry.Vector(x, y, z); + return new Common.Geometry.Vector(x, y, z); }; /** - * @param {!WebInspector.Geometry.Vector} u - * @param {!WebInspector.Geometry.Vector} v + * @param {!Common.Geometry.Vector} u + * @param {!Common.Geometry.Vector} v * @return {number} */ -WebInspector.Geometry.calculateAngle = function(u, v) { +Common.Geometry.calculateAngle = function(u, v) { var uLength = u.length(); var vLength = v.length(); - if (uLength <= WebInspector.Geometry._Eps || vLength <= WebInspector.Geometry._Eps) + if (uLength <= Common.Geometry._Eps || vLength <= Common.Geometry._Eps) return 0; - var cos = WebInspector.Geometry.scalarProduct(u, v) / uLength / vLength; + var cos = Common.Geometry.scalarProduct(u, v) / uLength / vLength; if (Math.abs(cos) > 1) return 0; - return WebInspector.Geometry.radiansToDegrees(Math.acos(cos)); + return Common.Geometry.radiansToDegrees(Math.acos(cos)); }; /** * @param {number} deg * @return {number} */ -WebInspector.Geometry.degreesToRadians = function(deg) { +Common.Geometry.degreesToRadians = function(deg) { return deg * Math.PI / 180; }; @@ -309,7 +309,7 @@ * @param {number} rad * @return {number} */ -WebInspector.Geometry.radiansToDegrees = function(rad) { +Common.Geometry.radiansToDegrees = function(rad) { return rad * 180 / Math.PI; }; @@ -319,14 +319,14 @@ * @param {{minX: number, maxX: number, minY: number, maxY: number}=} aggregateBounds * @return {!{minX: number, maxX: number, minY: number, maxY: number}} */ -WebInspector.Geometry.boundsForTransformedPoints = function(matrix, points, aggregateBounds) { +Common.Geometry.boundsForTransformedPoints = function(matrix, points, aggregateBounds) { if (!aggregateBounds) aggregateBounds = {minX: Infinity, maxX: -Infinity, minY: Infinity, maxY: -Infinity}; if (points.length % 3) console.assert('Invalid size of points array'); for (var p = 0; p < points.length; p += 3) { - var vector = new WebInspector.Geometry.Vector(points[p], points[p + 1], points[p + 2]); - vector = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(vector, matrix); + var vector = new Common.Geometry.Vector(points[p], points[p + 1], points[p + 2]); + vector = Common.Geometry.multiplyVectorByMatrixAndNormalize(vector, matrix); aggregateBounds.minX = Math.min(aggregateBounds.minX, vector.x); aggregateBounds.maxX = Math.max(aggregateBounds.maxX, vector.x); aggregateBounds.minY = Math.min(aggregateBounds.minY, vector.y); @@ -419,7 +419,7 @@ /** * @unrestricted */ -WebInspector.Rect = class { +Common.Rect = class { /** * @param {number} left * @param {number} top @@ -434,7 +434,7 @@ } /** - * @param {?WebInspector.Rect} rect + * @param {?Common.Rect} rect * @return {boolean} */ isEqual(rect) { @@ -444,10 +444,10 @@ /** * @param {number} scale - * @return {!WebInspector.Rect} + * @return {!Common.Rect} */ scale(scale) { - return new WebInspector.Rect(this.left * scale, this.top * scale, this.width * scale, this.height * scale); + return new Common.Rect(this.left * scale, this.top * scale, this.width * scale, this.height * scale); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/common/ModuleExtensionInterfaces.js b/third_party/WebKit/Source/devtools/front_end/common/ModuleExtensionInterfaces.js index a3b1e33..91ff621 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/ModuleExtensionInterfaces.js +++ b/third_party/WebKit/Source/devtools/front_end/common/ModuleExtensionInterfaces.js
@@ -4,9 +4,9 @@ /** * @interface */ -WebInspector.Renderer = function() {}; +Common.Renderer = function() {}; -WebInspector.Renderer.prototype = { +Common.Renderer.prototype = { /** * @param {!Object} object * @return {!Promise.<!Element>} @@ -18,14 +18,14 @@ * @param {!Object} object * @return {!Promise.<!Element>} */ -WebInspector.Renderer.renderPromise = function(object) { +Common.Renderer.renderPromise = function(object) { if (!object) return Promise.reject(new Error('Can\'t render ' + object)); - return self.runtime.extension(WebInspector.Renderer, object).instance().then(render); + return self.runtime.extension(Common.Renderer, object).instance().then(render); /** - * @param {!WebInspector.Renderer} renderer + * @param {!Common.Renderer} renderer */ function render(renderer) { return renderer.render(object); @@ -35,14 +35,14 @@ /** * @interface */ -WebInspector.Revealer = function() {}; +Common.Revealer = function() {}; /** * @param {?Object} revealable * @param {boolean=} omitFocus */ -WebInspector.Revealer.reveal = function(revealable, omitFocus) { - WebInspector.Revealer.revealPromise(revealable, omitFocus); +Common.Revealer.reveal = function(revealable, omitFocus) { + Common.Revealer.revealPromise(revealable, omitFocus); }; /** @@ -50,13 +50,13 @@ * @param {boolean=} omitFocus * @return {!Promise.<undefined>} */ -WebInspector.Revealer.revealPromise = function(revealable, omitFocus) { +Common.Revealer.revealPromise = function(revealable, omitFocus) { if (!revealable) return Promise.reject(new Error('Can\'t reveal ' + revealable)); - return self.runtime.allInstances(WebInspector.Revealer, revealable).then(reveal); + return self.runtime.allInstances(Common.Revealer, revealable).then(reveal); /** - * @param {!Array.<!WebInspector.Revealer>} revealers + * @param {!Array.<!Common.Revealer>} revealers * @return {!Promise.<undefined>} */ function reveal(revealers) { @@ -67,7 +67,7 @@ } }; -WebInspector.Revealer.prototype = { +Common.Revealer.prototype = { /** * @param {!Object} object * @param {boolean=} omitFocus @@ -79,9 +79,9 @@ /** * @interface */ -WebInspector.App = function() {}; +Common.App = function() {}; -WebInspector.App.prototype = { +Common.App.prototype = { /** * @param {!Document} document */ @@ -91,11 +91,11 @@ /** * @interface */ -WebInspector.AppProvider = function() {}; +Common.AppProvider = function() {}; -WebInspector.AppProvider.prototype = { +Common.AppProvider.prototype = { /** - * @return {!WebInspector.App} + * @return {!Common.App} */ createApp: function() {} }; @@ -103,9 +103,9 @@ /** * @interface */ -WebInspector.QueryParamHandler = function() {}; +Common.QueryParamHandler = function() {}; -WebInspector.QueryParamHandler.prototype = { +Common.QueryParamHandler.prototype = { /** * @param {string} value */
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Object.js b/third_party/WebKit/Source/devtools/front_end/common/Object.js index 248eff7..3a6a890 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Object.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Object.js
@@ -23,16 +23,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.EventTarget} + * @implements {Common.EventTarget} * @unrestricted */ -WebInspector.Object = class { +Common.Object = class { /** * @override * @param {string|symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject - * @return {!WebInspector.EventTarget.EventDescriptor} + * @return {!Common.EventTarget.EventDescriptor} */ addEventListener(eventType, listener, thisObject) { if (!listener) @@ -43,13 +43,13 @@ if (!this._listeners.has(eventType)) this._listeners.set(eventType, []); this._listeners.get(eventType).push({thisObject: thisObject, listener: listener}); - return new WebInspector.EventTarget.EventDescriptor(this, eventType, thisObject, listener); + return new Common.EventTarget.EventDescriptor(this, eventType, thisObject, listener); } /** * @override * @param {string|symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeEventListener(eventType, listener, thisObject) { @@ -93,7 +93,7 @@ if (!this._listeners || !this._listeners.has(eventType)) return false; - var event = new WebInspector.Event(this, eventType, eventData); + var event = new Common.Event(this, eventType, eventData); var listeners = this._listeners.get(eventType).slice(0); for (var i = 0; i < listeners.length; ++i) { listeners[i].listener.call(listeners[i].thisObject, event); @@ -108,9 +108,9 @@ /** * @unrestricted */ -WebInspector.Event = class { +Common.Event = class { /** - * @param {!WebInspector.EventTarget} target + * @param {!Common.EventTarget} target * @param {string|symbol} type * @param {*=} data */ @@ -143,12 +143,12 @@ /** * @interface */ -WebInspector.EventTarget = function() {}; +Common.EventTarget = function() {}; /** - * @param {!Array<!WebInspector.EventTarget.EventDescriptor>} eventList + * @param {!Array<!Common.EventTarget.EventDescriptor>} eventList */ -WebInspector.EventTarget.removeEventListeners = function(eventList) { +Common.EventTarget.removeEventListeners = function(eventList) { for (var i = 0; i < eventList.length; ++i) { var eventInfo = eventList[i]; eventInfo.eventTarget.removeEventListener(eventInfo.eventType, eventInfo.method, eventInfo.receiver); @@ -157,18 +157,18 @@ eventList.splice(0, eventList.length); }; -WebInspector.EventTarget.prototype = { +Common.EventTarget.prototype = { /** * @param {string|symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject - * @return {!WebInspector.EventTarget.EventDescriptor} + * @return {!Common.EventTarget.EventDescriptor} */ addEventListener: function(eventType, listener, thisObject) {}, /** * @param {string|symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeEventListener: function(eventType, listener, thisObject) {}, @@ -192,9 +192,9 @@ /** * @unrestricted */ -WebInspector.EventTarget.EventDescriptor = class { +Common.EventTarget.EventDescriptor = class { /** - * @param {!WebInspector.EventTarget} eventTarget + * @param {!Common.EventTarget} eventTarget * @param {string|symbol} eventType * @param {(!Object|undefined)} receiver * @param {function(?):?} method
diff --git a/third_party/WebKit/Source/devtools/front_end/common/OutputStream.js b/third_party/WebKit/Source/devtools/front_end/common/OutputStream.js index 123e2a7b..ca0d2ee 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/OutputStream.js +++ b/third_party/WebKit/Source/devtools/front_end/common/OutputStream.js
@@ -4,12 +4,12 @@ /** * @interface */ -WebInspector.OutputStream = function() {}; +Common.OutputStream = function() {}; -WebInspector.OutputStream.prototype = { +Common.OutputStream.prototype = { /** * @param {string} data - * @param {function(!WebInspector.OutputStream)=} callback + * @param {function(!Common.OutputStream)=} callback */ write: function(data, callback) {}, @@ -17,10 +17,10 @@ }; /** - * @implements {WebInspector.OutputStream} + * @implements {Common.OutputStream} * @unrestricted */ -WebInspector.StringOutputStream = class { +Common.StringOutputStream = class { constructor() { this._data = ''; } @@ -28,7 +28,7 @@ /** * @override * @param {string} chunk - * @param {function(!WebInspector.OutputStream)=} callback + * @param {function(!Common.OutputStream)=} callback */ write(chunk, callback) { this._data += chunk;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js b/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js index 13eca1a2..a6629289 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js +++ b/third_party/WebKit/Source/devtools/front_end/common/ParsedURL.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -WebInspector.ParsedURL = class { +Common.ParsedURL = class { /** * @param {string} url */ @@ -45,7 +45,7 @@ this.folderPathComponents = ''; this.lastPathComponent = ''; - var match = url.match(WebInspector.ParsedURL._urlRegex()); + var match = url.match(Common.ParsedURL._urlRegex()); if (match) { this.isValid = true; this.scheme = match[1].toLowerCase(); @@ -94,8 +94,8 @@ * @return {!RegExp} */ static _urlRegex() { - if (WebInspector.ParsedURL._urlRegexInstance) - return WebInspector.ParsedURL._urlRegexInstance; + if (Common.ParsedURL._urlRegexInstance) + return Common.ParsedURL._urlRegexInstance; // RegExp groups: // 1 - scheme (using the RFC3986 grammar) // 2 - hostname @@ -110,10 +110,10 @@ var queryRegex = /(?:\?([^#]*))?/; var fragmentRegex = /(?:#(.*))?/; - WebInspector.ParsedURL._urlRegexInstance = new RegExp( + Common.ParsedURL._urlRegexInstance = new RegExp( '^' + schemeRegex.source + hostRegex.source + portRegex.source + pathRegex.source + queryRegex.source + fragmentRegex.source + '$'); - return WebInspector.ParsedURL._urlRegexInstance; + return Common.ParsedURL._urlRegexInstance; } /** @@ -321,10 +321,10 @@ /** - * @return {?WebInspector.ParsedURL} + * @return {?Common.ParsedURL} */ String.prototype.asParsedURL = function() { - var parsedURL = new WebInspector.ParsedURL(this.toString()); + var parsedURL = new Common.ParsedURL(this.toString()); if (parsedURL.isValid) return parsedURL; return null;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Progress.js b/third_party/WebKit/Source/devtools/front_end/common/Progress.js index 1fcdc97..65e01c4 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Progress.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Progress.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.Progress = function() {}; +Common.Progress = function() {}; -WebInspector.Progress.prototype = { +Common.Progress.prototype = { /** * @param {number} totalWork */ @@ -67,9 +67,9 @@ /** * @unrestricted */ -WebInspector.CompositeProgress = class { +Common.CompositeProgress = class { /** - * @param {!WebInspector.Progress} parent + * @param {!Common.Progress} parent */ constructor(parent) { this._parent = parent; @@ -87,10 +87,10 @@ /** * @param {number=} weight - * @return {!WebInspector.SubProgress} + * @return {!Common.SubProgress} */ createSubProgress(weight) { - var child = new WebInspector.SubProgress(this, weight); + var child = new Common.SubProgress(this, weight); this._children.push(child); return child; } @@ -110,12 +110,12 @@ }; /** - * @implements {WebInspector.Progress} + * @implements {Common.Progress} * @unrestricted */ -WebInspector.SubProgress = class { +Common.SubProgress = class { /** - * @param {!WebInspector.CompositeProgress} composite + * @param {!Common.CompositeProgress} composite * @param {number=} weight */ constructor(composite, weight) { @@ -179,12 +179,12 @@ }; /** - * @implements {WebInspector.Progress} + * @implements {Common.Progress} * @unrestricted */ -WebInspector.ProgressProxy = class { +Common.ProgressProxy = class { /** - * @param {?WebInspector.Progress} delegate + * @param {?Common.Progress} delegate * @param {function()=} doneCallback */ constructor(delegate, doneCallback) {
diff --git a/third_party/WebKit/Source/devtools/front_end/common/ResourceType.js b/third_party/WebKit/Source/devtools/front_end/common/ResourceType.js index fb3a1b35..2a0f75a 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/ResourceType.js +++ b/third_party/WebKit/Source/devtools/front_end/common/ResourceType.js
@@ -30,11 +30,11 @@ /** * @unrestricted */ -WebInspector.ResourceType = class { +Common.ResourceType = class { /** * @param {string} name * @param {string} title - * @param {!WebInspector.ResourceCategory} category + * @param {!Common.ResourceCategory} category * @param {boolean} isTextType */ constructor(name, title, category, isTextType) { @@ -49,12 +49,12 @@ * @return {string|undefined} */ static mimeFromURL(url) { - var name = WebInspector.ParsedURL.extractName(url); - if (WebInspector.ResourceType._mimeTypeByName.has(name)) { - return WebInspector.ResourceType._mimeTypeByName.get(name); + var name = Common.ParsedURL.extractName(url); + if (Common.ResourceType._mimeTypeByName.has(name)) { + return Common.ResourceType._mimeTypeByName.get(name); } - var ext = WebInspector.ParsedURL.extractExtension(url).toLowerCase(); - return WebInspector.ResourceType._mimeTypeByExtension.get(ext); + var ext = Common.ParsedURL.extractExtension(url).toLowerCase(); + return Common.ResourceType._mimeTypeByExtension.get(ext); } /** @@ -72,7 +72,7 @@ } /** - * @return {!WebInspector.ResourceCategory} + * @return {!Common.ResourceCategory} */ category() { return this._category; @@ -152,7 +152,7 @@ /** * @unrestricted */ -WebInspector.ResourceCategory = class { +Common.ResourceCategory = class { /** * @param {string} title * @param {string} shortTitle @@ -163,51 +163,51 @@ } }; -WebInspector.resourceCategories = { - XHR: new WebInspector.ResourceCategory('XHR and Fetch', 'XHR'), - Script: new WebInspector.ResourceCategory('Scripts', 'JS'), - Stylesheet: new WebInspector.ResourceCategory('Stylesheets', 'CSS'), - Image: new WebInspector.ResourceCategory('Images', 'Img'), - Media: new WebInspector.ResourceCategory('Media', 'Media'), - Font: new WebInspector.ResourceCategory('Fonts', 'Font'), - Document: new WebInspector.ResourceCategory('Documents', 'Doc'), - WebSocket: new WebInspector.ResourceCategory('WebSockets', 'WS'), - Manifest: new WebInspector.ResourceCategory('Manifest', 'Manifest'), - Other: new WebInspector.ResourceCategory('Other', 'Other') +Common.resourceCategories = { + XHR: new Common.ResourceCategory('XHR and Fetch', 'XHR'), + Script: new Common.ResourceCategory('Scripts', 'JS'), + Stylesheet: new Common.ResourceCategory('Stylesheets', 'CSS'), + Image: new Common.ResourceCategory('Images', 'Img'), + Media: new Common.ResourceCategory('Media', 'Media'), + Font: new Common.ResourceCategory('Fonts', 'Font'), + Document: new Common.ResourceCategory('Documents', 'Doc'), + WebSocket: new Common.ResourceCategory('WebSockets', 'WS'), + Manifest: new Common.ResourceCategory('Manifest', 'Manifest'), + Other: new Common.ResourceCategory('Other', 'Other') }; /** * Keep these in sync with WebCore::InspectorPageAgent::resourceTypeJson - * @enum {!WebInspector.ResourceType} + * @enum {!Common.ResourceType} */ -WebInspector.resourceTypes = { - XHR: new WebInspector.ResourceType('xhr', 'XHR', WebInspector.resourceCategories.XHR, true), - Fetch: new WebInspector.ResourceType('fetch', 'Fetch', WebInspector.resourceCategories.XHR, true), - EventSource: new WebInspector.ResourceType('eventsource', 'EventSource', WebInspector.resourceCategories.XHR, true), - Script: new WebInspector.ResourceType('script', 'Script', WebInspector.resourceCategories.Script, true), - Snippet: new WebInspector.ResourceType('snippet', 'Snippet', WebInspector.resourceCategories.Script, true), +Common.resourceTypes = { + XHR: new Common.ResourceType('xhr', 'XHR', Common.resourceCategories.XHR, true), + Fetch: new Common.ResourceType('fetch', 'Fetch', Common.resourceCategories.XHR, true), + EventSource: new Common.ResourceType('eventsource', 'EventSource', Common.resourceCategories.XHR, true), + Script: new Common.ResourceType('script', 'Script', Common.resourceCategories.Script, true), + Snippet: new Common.ResourceType('snippet', 'Snippet', Common.resourceCategories.Script, true), Stylesheet: - new WebInspector.ResourceType('stylesheet', 'Stylesheet', WebInspector.resourceCategories.Stylesheet, true), - Image: new WebInspector.ResourceType('image', 'Image', WebInspector.resourceCategories.Image, false), - Media: new WebInspector.ResourceType('media', 'Media', WebInspector.resourceCategories.Media, false), - Font: new WebInspector.ResourceType('font', 'Font', WebInspector.resourceCategories.Font, false), - Document: new WebInspector.ResourceType('document', 'Document', WebInspector.resourceCategories.Document, true), - TextTrack: new WebInspector.ResourceType('texttrack', 'TextTrack', WebInspector.resourceCategories.Other, true), - WebSocket: new WebInspector.ResourceType('websocket', 'WebSocket', WebInspector.resourceCategories.WebSocket, false), - Other: new WebInspector.ResourceType('other', 'Other', WebInspector.resourceCategories.Other, false), - SourceMapScript: new WebInspector.ResourceType('sm-script', 'Script', WebInspector.resourceCategories.Script, false), + new Common.ResourceType('stylesheet', 'Stylesheet', Common.resourceCategories.Stylesheet, true), + Image: new Common.ResourceType('image', 'Image', Common.resourceCategories.Image, false), + Media: new Common.ResourceType('media', 'Media', Common.resourceCategories.Media, false), + Font: new Common.ResourceType('font', 'Font', Common.resourceCategories.Font, false), + Document: new Common.ResourceType('document', 'Document', Common.resourceCategories.Document, true), + TextTrack: new Common.ResourceType('texttrack', 'TextTrack', Common.resourceCategories.Other, true), + WebSocket: new Common.ResourceType('websocket', 'WebSocket', Common.resourceCategories.WebSocket, false), + Other: new Common.ResourceType('other', 'Other', Common.resourceCategories.Other, false), + SourceMapScript: new Common.ResourceType('sm-script', 'Script', Common.resourceCategories.Script, false), SourceMapStyleSheet: - new WebInspector.ResourceType('sm-stylesheet', 'Stylesheet', WebInspector.resourceCategories.Stylesheet, false), - Manifest: new WebInspector.ResourceType('manifest', 'Manifest', WebInspector.resourceCategories.Manifest, true), + new Common.ResourceType('sm-stylesheet', 'Stylesheet', Common.resourceCategories.Stylesheet, false), + Manifest: new Common.ResourceType('manifest', 'Manifest', Common.resourceCategories.Manifest, true), }; -WebInspector.ResourceType._mimeTypeByName = new Map([ +Common.ResourceType._mimeTypeByName = new Map([ // CoffeeScript ['Cakefile', 'text/x-coffeescript'] ]); -WebInspector.ResourceType._mimeTypeByExtension = new Map([ +Common.ResourceType._mimeTypeByExtension = new Map([ // Web extensions ['js', 'text/javascript'], ['css', 'text/css'], ['html', 'text/html'], ['htm', 'text/html'], ['xml', 'application/xml'], ['xsl', 'application/xml'],
diff --git a/third_party/WebKit/Source/devtools/front_end/common/SegmentedRange.js b/third_party/WebKit/Source/devtools/front_end/common/SegmentedRange.js index be230e4..2960020 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/SegmentedRange.js +++ b/third_party/WebKit/Source/devtools/front_end/common/SegmentedRange.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.Segment = class { +Common.Segment = class { /** * @param {number} begin * @param {number} end @@ -19,7 +19,7 @@ } /** - * @param {!WebInspector.Segment} that + * @param {!Common.Segment} that * @return {boolean} */ intersects(that) { @@ -30,18 +30,18 @@ /** * @unrestricted */ -WebInspector.SegmentedRange = class { +Common.SegmentedRange = class { /** - * @param {(function(!WebInspector.Segment, !WebInspector.Segment): ?WebInspector.Segment)=} mergeCallback + * @param {(function(!Common.Segment, !Common.Segment): ?Common.Segment)=} mergeCallback */ constructor(mergeCallback) { - /** @type {!Array<!WebInspector.Segment>} */ + /** @type {!Array<!Common.Segment>} */ this._segments = []; this._mergeCallback = mergeCallback; } /** - * @param {!WebInspector.Segment} newSegment + * @param {!Common.Segment} newSegment */ append(newSegment) { // 1. Find the proper insertion point for new segment @@ -60,7 +60,7 @@ // If an old segment entirely contains new one, split it in two. if (newSegment.end < precedingSegment.end) this._segments.splice( - startIndex, 0, new WebInspector.Segment(newSegment.end, precedingSegment.end, precedingSegment.data)); + startIndex, 0, new Common.Segment(newSegment.end, precedingSegment.end, precedingSegment.data)); precedingSegment.end = newSegment.begin; } } @@ -80,23 +80,23 @@ } /** - * @param {!WebInspector.SegmentedRange} that + * @param {!Common.SegmentedRange} that */ appendRange(that) { that.segments().forEach(segment => this.append(segment)); } /** - * @return {!Array<!WebInspector.Segment>} + * @return {!Array<!Common.Segment>} */ segments() { return this._segments; } /** - * @param {!WebInspector.Segment} first - * @param {!WebInspector.Segment} second - * @return {?WebInspector.Segment} + * @param {!Common.Segment} first + * @param {!Common.Segment} second + * @return {?Common.Segment} */ _tryMerge(first, second) { var merged = this._mergeCallback && this._mergeCallback(first, second);
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Settings.js b/third_party/WebKit/Source/devtools/front_end/common/Settings.js index 2e04904..888ac91 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Settings.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Settings.js
@@ -31,19 +31,19 @@ /** * @unrestricted */ -WebInspector.Settings = class { +Common.Settings = class { /** - * @param {!WebInspector.SettingsStorage} globalStorage - * @param {!WebInspector.SettingsStorage} localStorage + * @param {!Common.SettingsStorage} globalStorage + * @param {!Common.SettingsStorage} localStorage */ constructor(globalStorage, localStorage) { this._settingsStorage = globalStorage; this._localStorage = localStorage; - this._eventSupport = new WebInspector.Object(); - /** @type {!Map<string, !WebInspector.Setting>} */ + this._eventSupport = new Common.Object(); + /** @type {!Map<string, !Common.Setting>} */ this._registry = new Map(); - /** @type {!Map<string, !WebInspector.Setting>} */ + /** @type {!Map<string, !Common.Setting>} */ this._moduleSettings = new Map(); self.runtime.extensions('setting').forEach(this._registerModuleSetting.bind(this)); } @@ -64,7 +64,7 @@ /** * @param {string} settingName - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ moduleSetting(settingName) { var setting = this._moduleSettings.get(settingName); @@ -75,7 +75,7 @@ /** * @param {string} settingName - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ settingForTest(settingName) { var setting = this._registry.get(settingName); @@ -88,20 +88,20 @@ * @param {string} key * @param {*} defaultValue * @param {boolean=} isLocal - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ createSetting(key, defaultValue, isLocal) { if (!this._registry.get(key)) this._registry.set( - key, new WebInspector.Setting( + key, new Common.Setting( this, key, defaultValue, this._eventSupport, isLocal ? this._localStorage : this._settingsStorage)); - return /** @type {!WebInspector.Setting} */ (this._registry.get(key)); + return /** @type {!Common.Setting} */ (this._registry.get(key)); } /** * @param {string} key * @param {*} defaultValue - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ createLocalSetting(key, defaultValue) { return this.createSetting(key, defaultValue, true); @@ -112,29 +112,29 @@ * @param {string} defaultValue * @param {string=} regexFlags * @param {boolean=} isLocal - * @return {!WebInspector.RegExpSetting} + * @return {!Common.RegExpSetting} */ createRegExpSetting(key, defaultValue, regexFlags, isLocal) { if (!this._registry.get(key)) this._registry.set( - key, new WebInspector.RegExpSetting( + key, new Common.RegExpSetting( this, key, defaultValue, this._eventSupport, isLocal ? this._localStorage : this._settingsStorage, regexFlags)); - return /** @type {!WebInspector.RegExpSetting} */ (this._registry.get(key)); + return /** @type {!Common.RegExpSetting} */ (this._registry.get(key)); } clearAll() { this._settingsStorage.removeAll(); this._localStorage.removeAll(); - var versionSetting = WebInspector.settings.createSetting(WebInspector.VersionController._currentVersionName, 0); - versionSetting.set(WebInspector.VersionController.currentVersion); + var versionSetting = Common.settings.createSetting(Common.VersionController._currentVersionName, 0); + versionSetting.set(Common.VersionController.currentVersion); } }; /** * @unrestricted */ -WebInspector.SettingsStorage = class { +Common.SettingsStorage = class { /** * @param {!Object} object * @param {function(string, string)=} setCallback @@ -193,7 +193,7 @@ } _dumpSizes() { - WebInspector.console.log('Ten largest settings: '); + Common.console.log('Ten largest settings: '); var sizes = {__proto__: null}; for (var key in this._object) @@ -207,7 +207,7 @@ keys.sort(comparator); for (var i = 0; i < 10 && i < keys.length; ++i) - WebInspector.console.log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]); + Common.console.log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]); } }; @@ -215,13 +215,13 @@ * @template V * @unrestricted */ -WebInspector.Setting = class { +Common.Setting = class { /** - * @param {!WebInspector.Settings} settings + * @param {!Common.Settings} settings * @param {string} name * @param {V} defaultValue - * @param {!WebInspector.Object} eventSupport - * @param {!WebInspector.SettingsStorage} storage + * @param {!Common.Object} eventSupport + * @param {!Common.SettingsStorage} storage */ constructor(settings, name, defaultValue, eventSupport, storage) { this._settings = settings; @@ -232,7 +232,7 @@ } /** - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ addChangeListener(listener, thisObject) { @@ -240,7 +240,7 @@ } /** - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeChangeListener(listener, thisObject) { @@ -282,7 +282,7 @@ this._printSettingsSavingError(e.message, this._name, settingString); } } catch (e) { - WebInspector.console.error('Cannot stringify setting with name: ' + this._name + ', error: ' + e.message); + Common.console.error('Cannot stringify setting with name: ' + this._name + ', error: ' + e.message); } this._eventSupport.dispatchEventToListeners(this._name, value); } @@ -302,7 +302,7 @@ var errorMessage = 'Error saving setting with name: ' + this._name + ', value length: ' + value.length + '. Error: ' + message; console.error(errorMessage); - WebInspector.console.error(errorMessage); + Common.console.error(errorMessage); this._storage._dumpSizes(); } }; @@ -310,13 +310,13 @@ /** * @unrestricted */ -WebInspector.RegExpSetting = class extends WebInspector.Setting { +Common.RegExpSetting = class extends Common.Setting { /** - * @param {!WebInspector.Settings} settings + * @param {!Common.Settings} settings * @param {string} name * @param {string} defaultValue - * @param {!WebInspector.Object} eventSupport - * @param {!WebInspector.SettingsStorage} storage + * @param {!Common.Object} eventSupport + * @param {!Common.SettingsStorage} storage * @param {string=} regexFlags */ constructor(settings, name, defaultValue, eventSupport, storage, regexFlags) { @@ -382,12 +382,12 @@ /** * @unrestricted */ -WebInspector.VersionController = class { +Common.VersionController = class { updateVersion() { var localStorageVersion = - window.localStorage ? window.localStorage[WebInspector.VersionController._currentVersionName] : 0; - var versionSetting = WebInspector.settings.createSetting(WebInspector.VersionController._currentVersionName, 0); - var currentVersion = WebInspector.VersionController.currentVersion; + window.localStorage ? window.localStorage[Common.VersionController._currentVersionName] : 0; + var versionSetting = Common.settings.createSetting(Common.VersionController._currentVersionName, 0); + var currentVersion = Common.VersionController.currentVersion; var oldVersion = versionSetting.get() || parseInt(localStorageVersion || '0', 10); if (oldVersion === 0) { // First run, no need to do anything. @@ -412,21 +412,21 @@ } _updateVersionFrom0To1() { - this._clearBreakpointsWhenTooMany(WebInspector.settings.createLocalSetting('breakpoints', []), 500000); + this._clearBreakpointsWhenTooMany(Common.settings.createLocalSetting('breakpoints', []), 500000); } _updateVersionFrom1To2() { - WebInspector.settings.createSetting('previouslyViewedFiles', []).set([]); + Common.settings.createSetting('previouslyViewedFiles', []).set([]); } _updateVersionFrom2To3() { - WebInspector.settings.createSetting('fileSystemMapping', {}).set({}); - WebInspector.settings.createSetting('fileMappingEntries', []).remove(); + Common.settings.createSetting('fileSystemMapping', {}).set({}); + Common.settings.createSetting('fileMappingEntries', []).remove(); } _updateVersionFrom3To4() { - var advancedMode = WebInspector.settings.createSetting('showHeaSnapshotObjectsHiddenProperties', false); - WebInspector.moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get()); + var advancedMode = Common.settings.createSetting('showHeaSnapshotObjectsHiddenProperties', false); + Common.moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get()); advancedMode.remove(); } @@ -458,14 +458,14 @@ var oldNameH = oldName + 'H'; var newValue = null; - var oldSetting = WebInspector.settings.createSetting(oldName, empty); + var oldSetting = Common.settings.createSetting(oldName, empty); if (oldSetting.get() !== empty) { newValue = newValue || {}; newValue.vertical = {}; newValue.vertical.size = oldSetting.get(); oldSetting.remove(); } - var oldSettingH = WebInspector.settings.createSetting(oldNameH, empty); + var oldSettingH = Common.settings.createSetting(oldNameH, empty); if (oldSettingH.get() !== empty) { newValue = newValue || {}; newValue.horizontal = {}; @@ -473,7 +473,7 @@ oldSettingH.remove(); } if (newValue) - WebInspector.settings.createSetting(newName, {}).set(newValue); + Common.settings.createSetting(newName, {}).set(newValue); } } @@ -485,7 +485,7 @@ }; for (var oldName in settingNames) { - var oldSetting = WebInspector.settings.createSetting(oldName, null); + var oldSetting = Common.settings.createSetting(oldName, null); if (oldSetting.get() === null) { oldSetting.remove(); continue; @@ -497,7 +497,7 @@ oldSetting.remove(); var showMode = hidden ? 'OnlyMain' : 'Both'; - var newSetting = WebInspector.settings.createSetting(newName, {}); + var newSetting = Common.settings.createSetting(newName, {}); var newValue = newSetting.get() || {}; newValue.vertical = newValue.vertical || {}; newValue.vertical.showMode = showMode; @@ -517,7 +517,7 @@ var empty = {}; for (var name in settingNames) { - var setting = WebInspector.settings.createSetting(name, empty); + var setting = Common.settings.createSetting(name, empty); var value = setting.get(); if (value === empty) continue; @@ -537,7 +537,7 @@ var settingNames = ['skipStackFramesPattern', 'workspaceFolderExcludePattern']; for (var i = 0; i < settingNames.length; ++i) { - var setting = WebInspector.settings.createSetting(settingNames[i], ''); + var setting = Common.settings.createSetting(settingNames[i], ''); var value = setting.get(); if (!value) return; @@ -564,7 +564,7 @@ _updateVersionFrom10To11() { var oldSettingName = 'customDevicePresets'; var newSettingName = 'customEmulatedDeviceList'; - var oldSetting = WebInspector.settings.createSetting(oldSettingName, undefined); + var oldSetting = Common.settings.createSetting(oldSettingName, undefined); var list = oldSetting.get(); if (!Array.isArray(list)) return; @@ -590,7 +590,7 @@ newList.push(device); } if (newList.length) - WebInspector.settings.createSetting(newSettingName, []).set(newList); + Common.settings.createSetting(newSettingName, []).set(newList); oldSetting.remove(); } @@ -600,16 +600,16 @@ _updateVersionFrom12To13() { this._migrateSettingsFromLocalStorage(); - WebInspector.settings.createSetting('timelineOverviewMode', '').remove(); + Common.settings.createSetting('timelineOverviewMode', '').remove(); } _updateVersionFrom13To14() { var defaultValue = {'throughput': -1, 'latency': 0}; - WebInspector.settings.createSetting('networkConditions', defaultValue).set(defaultValue); + Common.settings.createSetting('networkConditions', defaultValue).set(defaultValue); } _updateVersionFrom14To15() { - var setting = WebInspector.settings.createLocalSetting('workspaceExcludedFolders', {}); + var setting = Common.settings.createLocalSetting('workspaceExcludedFolders', {}); var oldValue = setting.get(); var newValue = {}; for (var fileSystemPath in oldValue) { @@ -621,7 +621,7 @@ } _updateVersionFrom15To16() { - var setting = WebInspector.settings.createSetting('InspectorView.panelOrder', {}); + var setting = Common.settings.createSetting('InspectorView.panelOrder', {}); var tabOrders = setting.get(); for (var key of Object.keys(tabOrders)) tabOrders[key] = (tabOrders[key] + 1) * 10; @@ -629,7 +629,7 @@ } _updateVersionFrom16To17() { - var setting = WebInspector.settings.createSetting('networkConditionsCustomProfiles', []); + var setting = Common.settings.createSetting('networkConditionsCustomProfiles', []); var oldValue = setting.get(); var newValue = []; if (Array.isArray(oldValue)) { @@ -647,7 +647,7 @@ } _updateVersionFrom17To18() { - var setting = WebInspector.settings.createLocalSetting('workspaceExcludedFolders', {}); + var setting = Common.settings.createLocalSetting('workspaceExcludedFolders', {}); var oldValue = setting.get(); var newValue = {}; for (var oldKey in oldValue) { @@ -665,7 +665,7 @@ _updateVersionFrom18To19() { var defaultColumns = {status: true, type: true, initiator: true, size: true, time: true}; - var visibleColumnSettings = WebInspector.settings.createSetting('networkLogColumnsVisibility', defaultColumns); + var visibleColumnSettings = Common.settings.createSetting('networkLogColumnsVisibility', defaultColumns); var visibleColumns = visibleColumnSettings.get(); visibleColumns.name = true; visibleColumns.timeline = true; @@ -676,14 +676,14 @@ continue; configs[columnId.toLowerCase()] = {visible: visibleColumns[columnId]}; } - var newSetting = WebInspector.settings.createSetting('networkLogColumns', {}); + var newSetting = Common.settings.createSetting('networkLogColumns', {}); newSetting.set(configs); visibleColumnSettings.remove(); } _updateVersionFrom19To20() { - var oldSetting = WebInspector.settings.createSetting('InspectorView.panelOrder', {}); - var newSetting = WebInspector.settings.createSetting('panel-tabOrder', {}); + var oldSetting = Common.settings.createSetting('InspectorView.panelOrder', {}); + var newSetting = Common.settings.createSetting('panel-tabOrder', {}); newSetting.set(oldSetting.get()); oldSetting.remove(); } @@ -703,12 +703,12 @@ continue; var value = window.localStorage[key]; window.localStorage.removeItem(key); - WebInspector.settings._settingsStorage[key] = value; + Common.settings._settingsStorage[key] = value; } } /** - * @param {!WebInspector.Setting} breakpointsSetting + * @param {!Common.Setting} breakpointsSetting * @param {number} maxBreakpointsCount */ _clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) { @@ -719,26 +719,26 @@ } }; -WebInspector.VersionController._currentVersionName = 'inspectorVersion'; -WebInspector.VersionController.currentVersion = 20; +Common.VersionController._currentVersionName = 'inspectorVersion'; +Common.VersionController.currentVersion = 20; /** - * @type {!WebInspector.Settings} + * @type {!Common.Settings} */ -WebInspector.settings; +Common.settings; /** * @param {string} settingName - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ -WebInspector.moduleSetting = function(settingName) { - return WebInspector.settings.moduleSetting(settingName); +Common.moduleSetting = function(settingName) { + return Common.settings.moduleSetting(settingName); }; /** * @param {string} settingName - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ -WebInspector.settingForTest = function(settingName) { - return WebInspector.settings.settingForTest(settingName); +Common.settingForTest = function(settingName) { + return Common.settings.settingForTest(settingName); };
diff --git a/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js b/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js index 6479e29..7403bb8 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js +++ b/third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.js
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.StaticContentProvider = class { +Common.StaticContentProvider = class { /** * @param {string} contentURL - * @param {!WebInspector.ResourceType} contentType + * @param {!Common.ResourceType} contentType * @param {function():!Promise<string>} lazyContent */ constructor(contentURL, contentType, lazyContent) { @@ -19,13 +19,13 @@ /** * @param {string} contentURL - * @param {!WebInspector.ResourceType} contentType + * @param {!Common.ResourceType} contentType * @param {string} content - * @return {!WebInspector.StaticContentProvider} + * @return {!Common.StaticContentProvider} */ static fromString(contentURL, contentType, content) { var lazyContent = () => Promise.resolve(content); - return new WebInspector.StaticContentProvider(contentURL, contentType, lazyContent); + return new Common.StaticContentProvider(contentURL, contentType, lazyContent); } /** @@ -38,7 +38,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._contentType; @@ -57,14 +57,14 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { /** * @param {string} content */ function performSearch(content) { - callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); + callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); } this._lazyContent().then(performSearch);
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Text.js b/third_party/WebKit/Source/devtools/front_end/common/Text.js index 23d4ceb..637bb50 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Text.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Text.js
@@ -1,10 +1,13 @@ // Copyright 2016 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. + +self['Common'] = self['Common'] || {}; + /** * @unrestricted */ -WebInspector.Text = class { +Common.Text = class { /** * @param {string} value */ @@ -59,22 +62,22 @@ } /** - * @param {!WebInspector.TextRange} range - * @return {!WebInspector.SourceRange} + * @param {!Common.TextRange} range + * @return {!Common.SourceRange} */ toSourceRange(range) { var start = this.offsetFromPosition(range.startLine, range.startColumn); var end = this.offsetFromPosition(range.endLine, range.endColumn); - return new WebInspector.SourceRange(start, end - start); + return new Common.SourceRange(start, end - start); } /** - * @param {!WebInspector.SourceRange} sourceRange - * @return {!WebInspector.TextRange} + * @param {!Common.SourceRange} sourceRange + * @return {!Common.TextRange} */ toTextRange(sourceRange) { - var cursor = new WebInspector.TextCursor(this.lineEndings()); - var result = WebInspector.TextRange.createFromLocation(0, 0); + var cursor = new Common.TextCursor(this.lineEndings()); + var result = Common.TextRange.createFromLocation(0, 0); cursor.resetTo(sourceRange.offset); result.startLine = cursor.lineNumber(); @@ -87,7 +90,7 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} replacement * @return {string} */ @@ -98,7 +101,7 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @return {string} */ extract(range) { @@ -110,7 +113,7 @@ /** * @unrestricted */ -WebInspector.TextCursor = class { +Common.TextCursor = class { /** * @param {!Array<number>} lineEndings */
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextDictionary.js b/third_party/WebKit/Source/devtools/front_end/common/TextDictionary.js index 5645373..d3ee3fb 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/TextDictionary.js +++ b/third_party/WebKit/Source/devtools/front_end/common/TextDictionary.js
@@ -31,11 +31,11 @@ /** * @unrestricted */ -WebInspector.TextDictionary = class { +Common.TextDictionary = class { constructor() { /** @type {!Map<string, number>} */ this._words = new Map(); - this._index = new WebInspector.Trie(); + this._index = new Common.Trie(); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js index 3dcb0ba..e1186862 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js +++ b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.TextRange = class { +Common.TextRange = class { /** * @param {number} startLine * @param {number} startColumn @@ -48,25 +48,25 @@ /** * @param {number} line * @param {number} column - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ static createFromLocation(line, column) { - return new WebInspector.TextRange(line, column, line, column); + return new Common.TextRange(line, column, line, column); } /** * @param {!Object} serializedTextRange - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ static fromObject(serializedTextRange) { - return new WebInspector.TextRange( + return new Common.TextRange( serializedTextRange.startLine, serializedTextRange.startColumn, serializedTextRange.endLine, serializedTextRange.endColumn); } /** - * @param {!WebInspector.TextRange} range1 - * @param {!WebInspector.TextRange} range2 + * @param {!Common.TextRange} range1 + * @param {!Common.TextRange} range2 * @return {number} */ static comparator(range1, range2) { @@ -74,9 +74,9 @@ } /** - * @param {!WebInspector.TextRange} oldRange + * @param {!Common.TextRange} oldRange * @param {string} newText - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ static fromEdit(oldRange, newText) { var endLine = oldRange.startLine; @@ -87,7 +87,7 @@ var len = lineEndings.length; endColumn = lineEndings[len - 1] - lineEndings[len - 2] - 1; } - return new WebInspector.TextRange(oldRange.startLine, oldRange.startColumn, endLine, endColumn); + return new Common.TextRange(oldRange.startLine, oldRange.startColumn, endLine, endColumn); } /** @@ -98,7 +98,7 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @return {boolean} */ immediatelyPrecedes(range) { @@ -108,7 +108,7 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @return {boolean} */ immediatelyFollows(range) { @@ -118,7 +118,7 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @return {boolean} */ follows(range) { @@ -133,34 +133,34 @@ } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ collapseToEnd() { - return new WebInspector.TextRange(this.endLine, this.endColumn, this.endLine, this.endColumn); + return new Common.TextRange(this.endLine, this.endColumn, this.endLine, this.endColumn); } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ collapseToStart() { - return new WebInspector.TextRange(this.startLine, this.startColumn, this.startLine, this.startColumn); + return new Common.TextRange(this.startLine, this.startColumn, this.startLine, this.startColumn); } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ normalize() { if (this.startLine > this.endLine || (this.startLine === this.endLine && this.startColumn > this.endColumn)) - return new WebInspector.TextRange(this.endLine, this.endColumn, this.startLine, this.startColumn); + return new Common.TextRange(this.endLine, this.endColumn, this.startLine, this.startColumn); else return this.clone(); } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ clone() { - return new WebInspector.TextRange(this.startLine, this.startColumn, this.endLine, this.endColumn); + return new Common.TextRange(this.startLine, this.startColumn, this.endLine, this.endColumn); } /** @@ -176,7 +176,7 @@ } /** - * @param {!WebInspector.TextRange} other + * @param {!Common.TextRange} other * @return {number} */ compareTo(other) { @@ -205,7 +205,7 @@ } /** - * @param {!WebInspector.TextRange} other + * @param {!Common.TextRange} other * @return {boolean} */ equal(other) { @@ -216,7 +216,7 @@ /** * @param {number} line * @param {number} column - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ relativeTo(line, column) { var relative = this.clone(); @@ -232,9 +232,9 @@ } /** - * @param {!WebInspector.TextRange} originalRange - * @param {!WebInspector.TextRange} editedRange - * @return {!WebInspector.TextRange} + * @param {!Common.TextRange} originalRange + * @param {!Common.TextRange} editedRange + * @return {!Common.TextRange} */ rebaseAfterTextEdit(originalRange, editedRange) { console.assert(originalRange.startLine === editedRange.startLine); @@ -281,7 +281,7 @@ /** * @unrestricted */ -WebInspector.SourceRange = class { +Common.SourceRange = class { /** * @param {number} offset * @param {number} length @@ -295,10 +295,10 @@ /** * @unrestricted */ -WebInspector.SourceEdit = class { +Common.SourceEdit = class { /** * @param {string} sourceURL - * @param {!WebInspector.TextRange} oldRange + * @param {!Common.TextRange} oldRange * @param {string} newText */ constructor(sourceURL, oldRange, newText) { @@ -308,18 +308,18 @@ } /** - * @param {!WebInspector.SourceEdit} edit1 - * @param {!WebInspector.SourceEdit} edit2 + * @param {!Common.SourceEdit} edit1 + * @param {!Common.SourceEdit} edit2 * @return {number} */ static comparator(edit1, edit2) { - return WebInspector.TextRange.comparator(edit1.oldRange, edit2.oldRange); + return Common.TextRange.comparator(edit1.oldRange, edit2.oldRange); } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ newRange() { - return WebInspector.TextRange.fromEdit(this.oldRange, this.newText); + return Common.TextRange.fromEdit(this.oldRange, this.newText); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextUtils.js b/third_party/WebKit/Source/devtools/front_end/common/TextUtils.js index aaa97e9e..ac042463 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/TextUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/common/TextUtils.js
@@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.TextUtils = { +Common.TextUtils = { /** * @param {string} char * @return {boolean} @@ -42,7 +42,7 @@ * @return {boolean} */ isWordChar: function(char) { - return !WebInspector.TextUtils.isStopChar(char) && !WebInspector.TextUtils.isSpaceChar(char); + return !Common.TextUtils.isStopChar(char) && !Common.TextUtils.isSpaceChar(char); }, /** @@ -50,7 +50,7 @@ * @return {boolean} */ isSpaceChar: function(char) { - return WebInspector.TextUtils._SpaceCharRegex.test(char); + return Common.TextUtils._SpaceCharRegex.test(char); }, /** @@ -59,7 +59,7 @@ */ isWord: function(word) { for (var i = 0; i < word.length; ++i) { - if (!WebInspector.TextUtils.isWordChar(word.charAt(i))) + if (!Common.TextUtils.isWordChar(word.charAt(i))) return false; } return true; @@ -86,7 +86,7 @@ * @return {boolean} */ isBraceChar: function(char) { - return WebInspector.TextUtils.isOpeningBraceChar(char) || WebInspector.TextUtils.isClosingBraceChar(char); + return Common.TextUtils.isOpeningBraceChar(char) || Common.TextUtils.isClosingBraceChar(char); }, /** @@ -114,7 +114,7 @@ */ lineIndent: function(line) { var indentation = 0; - while (indentation < line.length && WebInspector.TextUtils.isSpaceChar(line.charAt(indentation))) + while (indentation < line.length && Common.TextUtils.isSpaceChar(line.charAt(indentation))) ++indentation; return line.substr(0, indentation); }, @@ -183,12 +183,12 @@ } }; -WebInspector.TextUtils._SpaceCharRegex = /\s/; +Common.TextUtils._SpaceCharRegex = /\s/; /** * @enum {string} */ -WebInspector.TextUtils.Indent = { +Common.TextUtils.Indent = { TwoSpaces: ' ', FourSpaces: ' ', EightSpaces: ' ', @@ -198,7 +198,7 @@ /** * @unrestricted */ -WebInspector.TextUtils.BalancedJSONTokenizer = class { +Common.TextUtils.BalancedJSONTokenizer = class { /** * @param {function(string)} callback * @param {boolean=} findMultiple @@ -270,9 +270,9 @@ /** * @interface */ -WebInspector.TokenizerFactory = function() {}; +Common.TokenizerFactory = function() {}; -WebInspector.TokenizerFactory.prototype = { +Common.TokenizerFactory.prototype = { /** * @param {string} mimeType * @return {function(string, function(string, ?string, number, number))}
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Throttler.js b/third_party/WebKit/Source/devtools/front_end/common/Throttler.js index 9782788..5bc43cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Throttler.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Throttler.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.Throttler = class { +Common.Throttler = class { /** * @param {number} timeout */ @@ -95,4 +95,4 @@ }; /** @typedef {function(!Error=)} */ -WebInspector.Throttler.FinishCallback; +Common.Throttler.FinishCallback;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Trie.js b/third_party/WebKit/Source/devtools/front_end/common/Trie.js index f24b454a..d0936cad 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Trie.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Trie.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.Trie = class { +Common.Trie = class { constructor() { this.clear(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/common/UIString.js b/third_party/WebKit/Source/devtools/front_end/common/UIString.js index 8476699..dce656e 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/UIString.js +++ b/third_party/WebKit/Source/devtools/front_end/common/UIString.js
@@ -28,13 +28,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +self['Common'] = self['Common'] || {}; + /** * @param {string} string * @param {...*} vararg * @return {string} */ -WebInspector.UIString = function(string, vararg) { - return String.vsprintf(WebInspector.localize(string), Array.prototype.slice.call(arguments, 1)); +Common.UIString = function(string, vararg) { + return String.vsprintf(Common.localize(string), Array.prototype.slice.call(arguments, 1)); }; /** @@ -42,13 +45,13 @@ * @param {...*} vararg * @return {string} */ -WebInspector.UIString.capitalize = function(string, vararg) { - if (WebInspector._useLowerCaseMenuTitles === undefined) - throw 'WebInspector.setLocalizationPlatform() has not been called'; +Common.UIString.capitalize = function(string, vararg) { + if (Common._useLowerCaseMenuTitles === undefined) + throw 'Common.setLocalizationPlatform() has not been called'; - var localized = WebInspector.localize(string); + var localized = Common.localize(string); var capitalized; - if (WebInspector._useLowerCaseMenuTitles) + if (Common._useLowerCaseMenuTitles) capitalized = localized.replace(/\^(.)/g, '$1'); else capitalized = localized.replace(/\^(.)/g, function(str, char) { @@ -60,28 +63,28 @@ /** * @param {string} platform */ -WebInspector.setLocalizationPlatform = function(platform) { - WebInspector._useLowerCaseMenuTitles = platform === 'windows'; +Common.setLocalizationPlatform = function(platform) { + Common._useLowerCaseMenuTitles = platform === 'windows'; }; /** * @param {string} string * @return {string} */ -WebInspector.localize = function(string) { +Common.localize = function(string) { return string; }; /** * @unrestricted */ -WebInspector.UIStringFormat = class { +Common.UIStringFormat = class { /** * @param {string} format */ constructor(format) { /** @type {string} */ - this._localizedFormat = WebInspector.localize(format); + this._localizedFormat = Common.localize(format); /** @type {!Array.<!Object>} */ this._tokenizedFormat = String.tokenizeFormatString(this._localizedFormat, String.standardFormatters); } @@ -102,7 +105,7 @@ format(vararg) { return String .format( - this._localizedFormat, arguments, String.standardFormatters, '', WebInspector.UIStringFormat._append, + this._localizedFormat, arguments, String.standardFormatters, '', Common.UIStringFormat._append, this._tokenizedFormat) .formattedResult; }
diff --git a/third_party/WebKit/Source/devtools/front_end/common/WebInspector.js b/third_party/WebKit/Source/devtools/front_end/common/WebInspector.js deleted file mode 100644 index db423a4..0000000 --- a/third_party/WebKit/Source/devtools/front_end/common/WebInspector.js +++ /dev/null
@@ -1,6 +0,0 @@ -/* - * Copyright 2014 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. - */ -self.WebInspector = {};
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Worker.js b/third_party/WebKit/Source/devtools/front_end/common/Worker.js index b2a70fe9..72181edf 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Worker.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Worker.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.Worker = class { +Common.Worker = class { /** * @param {string} appName */ @@ -48,7 +48,7 @@ /** * @param {!Event} event - * @this {WebInspector.Worker} + * @this {Common.Worker} */ function onMessage(event) { console.assert(event.data === 'workerReady');
diff --git a/third_party/WebKit/Source/devtools/front_end/common/module.json b/third_party/WebKit/Source/devtools/front_end/common/module.json index 938d274f..5bed854 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/module.json +++ b/third_party/WebKit/Source/devtools/front_end/common/module.json
@@ -3,7 +3,6 @@ "platform" ], "scripts": [ - "WebInspector.js", "Worker.js", "TextDictionary.js", "Object.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/components/BreakpointsSidebarPaneBase.js b/third_party/WebKit/Source/devtools/front_end/components/BreakpointsSidebarPaneBase.js index ab57f74..1f02e3e 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/BreakpointsSidebarPaneBase.js +++ b/third_party/WebKit/Source/devtools/front_end/components/BreakpointsSidebarPaneBase.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.BreakpointsSidebarPaneBase = class extends WebInspector.VBox { +Components.BreakpointsSidebarPaneBase = class extends UI.VBox { constructor() { super(); this.registerRequiredCSS('components/breakpointsList.css'); @@ -41,7 +41,7 @@ this.emptyElement = createElement('div'); this.emptyElement.className = 'gray-info-message'; - this.emptyElement.textContent = WebInspector.UIString('No Breakpoints'); + this.emptyElement.textContent = Common.UIString('No Breakpoints'); this.element.appendChild(this.emptyElement); }
diff --git a/third_party/WebKit/Source/devtools/front_end/components/CustomPreviewSection.js b/third_party/WebKit/Source/devtools/front_end/components/CustomPreviewSection.js index 942af9c..3f76412 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/CustomPreviewSection.js +++ b/third_party/WebKit/Source/devtools/front_end/components/CustomPreviewSection.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.CustomPreviewSection = class { +Components.CustomPreviewSection = class { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ constructor(object) { this._sectionElement = createElementWithClass('span', 'custom-expandable-section'); @@ -18,12 +18,12 @@ try { var headerJSON = JSON.parse(customPreview.header); } catch (e) { - WebInspector.console.error('Broken formatter: header is invalid json ' + e); + Common.console.error('Broken formatter: header is invalid json ' + e); return; } this._header = this._renderJSONMLTag(headerJSON); if (this._header.nodeType === Node.TEXT_NODE) { - WebInspector.console.error('Broken formatter: header should be an element node.'); + Common.console.error('Broken formatter: header should be an element node.'); return; } @@ -64,8 +64,8 @@ */ _renderElement(object) { var tagName = object.shift(); - if (!WebInspector.CustomPreviewSection._tagsWhiteList.has(tagName)) { - WebInspector.console.error('Broken formatter: element ' + tagName + ' is not allowed!'); + if (!Components.CustomPreviewSection._tagsWhiteList.has(tagName)) { + Common.console.error('Broken formatter: element ' + tagName + ' is not allowed!'); return createElement('span'); } var element = createElement(/** @type {string} */ (tagName)); @@ -94,9 +94,9 @@ var remoteObject = this._object.target().runtimeModel.createRemoteObject(/** @type {!Protocol.Runtime.RemoteObject} */ (attributes)); if (remoteObject.customPreview()) - return (new WebInspector.CustomPreviewSection(remoteObject)).element(); + return (new Components.CustomPreviewSection(remoteObject)).element(); - var sectionElement = WebInspector.ObjectPropertiesSection.defaultObjectPresentation(remoteObject); + var sectionElement = Components.ObjectPropertiesSection.defaultObjectPresentation(remoteObject); sectionElement.classList.toggle('custom-expandable-section-standard-section', remoteObject.hasChildren); return sectionElement; } @@ -183,7 +183,7 @@ /** * @param {*} bodyJsonML - * @this {WebInspector.CustomPreviewSection} + * @this {Components.CustomPreviewSection} */ function onBodyLoaded(bodyJsonML) { if (!bodyJsonML) @@ -199,15 +199,15 @@ /** * @unrestricted */ -WebInspector.CustomPreviewComponent = class { +Components.CustomPreviewComponent = class { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ constructor(object) { this._object = object; - this._customPreviewSection = new WebInspector.CustomPreviewSection(object); + this._customPreviewSection = new Components.CustomPreviewSection(object); this.element = createElementWithClass('span', 'source-code'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'components/customPreviewSection.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'components/customPreviewSection.css'); this.element.addEventListener('contextmenu', this._contextMenuEventFired.bind(this), false); shadowRoot.appendChild(this._customPreviewSection.element()); } @@ -221,10 +221,10 @@ * @param {!Event} event */ _contextMenuEventFired(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (this._customPreviewSection) contextMenu.appendItem( - WebInspector.UIString.capitalize('Show as Javascript ^object'), this._disassemble.bind(this)); + Common.UIString.capitalize('Show as Javascript ^object'), this._disassemble.bind(this)); contextMenu.appendApplicableItems(this._object); contextMenu.show(); } @@ -232,8 +232,8 @@ _disassemble() { this.element.shadowRoot.textContent = ''; this._customPreviewSection = null; - this.element.shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.defaultObjectPresentation(this._object)); + this.element.shadowRoot.appendChild(Components.ObjectPropertiesSection.defaultObjectPresentation(this._object)); } }; -WebInspector.CustomPreviewSection._tagsWhiteList = new Set(['span', 'div', 'ol', 'li', 'table', 'tr', 'td']); +Components.CustomPreviewSection._tagsWhiteList = new Set(['span', 'div', 'ol', 'li', 'table', 'tr', 'td']);
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js index f5004d4..25a4ea3 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js
@@ -28,60 +28,60 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContextFlavorListener} + * @implements {UI.ContextFlavorListener} * @unrestricted */ -WebInspector.DOMBreakpointsSidebarPane = class extends WebInspector.BreakpointsSidebarPaneBase { +Components.DOMBreakpointsSidebarPane = class extends Components.BreakpointsSidebarPaneBase { constructor() { super(); - this._domBreakpointsSetting = WebInspector.settings.createLocalSetting('domBreakpoints', []); + this._domBreakpointsSetting = Common.settings.createLocalSetting('domBreakpoints', []); this.listElement.classList.add('dom-breakpoints-list'); /** @type {!Map<string, !Element>} */ this._breakpointElements = new Map(); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); this._update(); } /** - * @param {!WebInspector.DebuggerPausedDetails} details + * @param {!SDK.DebuggerPausedDetails} details * @return {!Element} */ static createBreakpointHitMessage(details) { var messageWrapper = createElement('span'); var mainElement = messageWrapper.createChild('div', 'status-main'); - mainElement.appendChild(WebInspector.Icon.create('smallicon-info', 'status-icon')); + mainElement.appendChild(UI.Icon.create('smallicon-info', 'status-icon')); var auxData = /** @type {!Object} */ (details.auxData); mainElement.appendChild(createTextNode( - String.sprintf('Paused on %s', WebInspector.DOMBreakpointsSidebarPane.BreakpointTypeNouns[auxData['type']]))); + String.sprintf('Paused on %s', Components.DOMBreakpointsSidebarPane.BreakpointTypeNouns[auxData['type']]))); - var domModel = WebInspector.DOMModel.fromTarget(details.target()); + var domModel = SDK.DOMModel.fromTarget(details.target()); if (domModel) { var subElement = messageWrapper.createChild('div', 'status-sub monospace'); var node = domModel.nodeForId(auxData['nodeId']); - var linkifiedNode = WebInspector.DOMPresentationUtils.linkifyNodeReference(node); + var linkifiedNode = Components.DOMPresentationUtils.linkifyNodeReference(node); subElement.appendChild(linkifiedNode); var targetNode = auxData['targetNodeId'] ? domModel.nodeForId(auxData['targetNodeId']) : null; - var targetNodeLink = targetNode ? WebInspector.DOMPresentationUtils.linkifyNodeReference(targetNode) : ''; + var targetNodeLink = targetNode ? Components.DOMPresentationUtils.linkifyNodeReference(targetNode) : ''; var message; - if (auxData.type === WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified) { + if (auxData.type === Components.DOMBreakpointsSidebarPane.BreakpointTypes.SubtreeModified) { if (auxData['insertion']) message = targetNode === node ? 'Child %s added' : 'Descendant %s added'; else message = 'Descendant %s removed'; subElement.appendChild(createElement('br')); - subElement.appendChild(WebInspector.formatLocalized(message, [targetNodeLink])); + subElement.appendChild(UI.formatLocalized(message, [targetNodeLink])); } } return messageWrapper; } /** - * @param {!WebInspector.DOMNode} node - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!SDK.DOMNode} node + * @param {!UI.ContextMenu} contextMenu * @param {boolean} createSubMenu */ populateNodeContextMenu(node, contextMenu, createSubMenu) { @@ -92,7 +92,7 @@ /** * @param {!Protocol.DOMDebugger.DOMBreakpointType} type - * @this {WebInspector.DOMBreakpointsSidebarPane} + * @this {Components.DOMBreakpointsSidebarPane} */ function toggleBreakpoint(type) { if (!nodeBreakpoints.has(type)) @@ -103,16 +103,16 @@ } var breakpointsMenu = - createSubMenu ? contextMenu.appendSubMenuItem(WebInspector.UIString('Break on...')) : contextMenu; - for (var key in WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes) { - var type = WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes[key]; - var label = WebInspector.DOMBreakpointsSidebarPane.BreakpointTypeNouns[type]; + createSubMenu ? contextMenu.appendSubMenuItem(Common.UIString('Break on...')) : contextMenu; + for (var key in Components.DOMBreakpointsSidebarPane.BreakpointTypes) { + var type = Components.DOMBreakpointsSidebarPane.BreakpointTypes[key]; + var label = Components.DOMBreakpointsSidebarPane.BreakpointTypeNouns[type]; breakpointsMenu.appendCheckboxItem(label, toggleBreakpoint.bind(this, type), nodeBreakpoints.has(type)); } } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {!Set<!Protocol.DOMDebugger.DOMBreakpointType>} */ _nodeBreakpoints(node) { @@ -126,7 +126,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {boolean} */ hasBreakpoints(node) { @@ -149,7 +149,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _removeBreakpointsForNode(node) { for (var element of this._breakpointElements.values()) { @@ -159,7 +159,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Protocol.DOMDebugger.DOMBreakpointType} type * @param {boolean} enabled */ @@ -174,11 +174,11 @@ } if (enabled) node.target().domdebuggerAgent().setDOMBreakpoint(node.id, type); - node.setMarker(WebInspector.DOMBreakpointsSidebarPane.Marker, true); + node.setMarker(Components.DOMBreakpointsSidebarPane.Marker, true); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Protocol.DOMDebugger.DOMBreakpointType} type * @param {boolean} enabled */ @@ -197,13 +197,13 @@ var labelElement = createElementWithClass('div', 'dom-breakpoint'); element.appendChild(labelElement); - var linkifiedNode = WebInspector.DOMPresentationUtils.linkifyNodeReference(node); + var linkifiedNode = Components.DOMPresentationUtils.linkifyNodeReference(node); linkifiedNode.classList.add('monospace'); linkifiedNode.style.display = 'block'; labelElement.appendChild(linkifiedNode); var description = createElement('div'); - description.textContent = WebInspector.DOMBreakpointsSidebarPane.BreakpointTypeLabels[type]; + description.textContent = Components.DOMBreakpointsSidebarPane.BreakpointTypeLabels[type]; labelElement.appendChild(description); var currentElement = this.listElement.firstChild; @@ -223,7 +223,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Protocol.DOMDebugger.DOMBreakpointType} type */ _removeBreakpoint(node, type) { @@ -236,32 +236,32 @@ this._breakpointElements.delete(breakpointId); if (element._checkboxElement.checked) node.target().domdebuggerAgent().removeDOMBreakpoint(node.id, type); - node.setMarker(WebInspector.DOMBreakpointsSidebarPane.Marker, this.hasBreakpoints(node) ? true : null); + node.setMarker(Components.DOMBreakpointsSidebarPane.Marker, this.hasBreakpoints(node) ? true : null); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Protocol.DOMDebugger.DOMBreakpointType} type * @param {!Event} event */ _contextMenu(node, type, event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); /** - * @this {WebInspector.DOMBreakpointsSidebarPane} + * @this {Components.DOMBreakpointsSidebarPane} */ function removeBreakpoint() { this._removeBreakpoint(node, type); this._saveBreakpoints(); } - contextMenu.appendItem(WebInspector.UIString.capitalize('Remove ^breakpoint'), removeBreakpoint.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Remove ^breakpoint'), removeBreakpoint.bind(this)); contextMenu.appendItem( - WebInspector.UIString.capitalize('Remove ^all DOM breakpoints'), this._removeAllBreakpoints.bind(this)); + Common.UIString.capitalize('Remove ^all DOM breakpoints'), this._removeAllBreakpoints.bind(this)); contextMenu.show(); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Protocol.DOMDebugger.DOMBreakpointType} type * @param {!Event} event */ @@ -282,8 +282,8 @@ } _update() { - var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails); - if (!details || details.reason !== WebInspector.DebuggerModel.BreakReason.DOM) { + var details = UI.context.flavor(SDK.DebuggerPausedDetails); + if (!details || details.reason !== SDK.DebuggerModel.BreakReason.DOM) { if (this._highlightedElement) { this._highlightedElement.classList.remove('breakpoint-hit'); delete this._highlightedElement; @@ -295,7 +295,7 @@ var element = this._breakpointElements.get(breakpointId); if (!element) return; - WebInspector.viewManager.showView('sources.domBreakpoints'); + UI.viewManager.showView('sources.domBreakpoints'); element.classList.add('breakpoint-hit'); this._highlightedElement = element; } @@ -327,7 +327,7 @@ } /** - * @param {!WebInspector.DOMDocument} domDocument + * @param {!SDK.DOMDocument} domDocument */ restoreBreakpoints(domDocument) { this._breakpointElements.clear(); @@ -340,7 +340,7 @@ /** * @param {string} path * @param {?Protocol.DOM.NodeId} nodeId - * @this {WebInspector.DOMBreakpointsSidebarPane} + * @this {Components.DOMBreakpointsSidebarPane} */ function didPushNodeByPathToFrontend(path, nodeId) { var node = nodeId ? domModel.nodeForId(nodeId) : null; @@ -367,31 +367,31 @@ } }; -WebInspector.DOMBreakpointsSidebarPane.BreakpointTypes = { +Components.DOMBreakpointsSidebarPane.BreakpointTypes = { SubtreeModified: 'subtree-modified', AttributeModified: 'attribute-modified', NodeRemoved: 'node-removed' }; -WebInspector.DOMBreakpointsSidebarPane.BreakpointTypeLabels = { - 'subtree-modified': WebInspector.UIString('Subtree Modified'), - 'attribute-modified': WebInspector.UIString('Attribute Modified'), - 'node-removed': WebInspector.UIString('Node Removed') +Components.DOMBreakpointsSidebarPane.BreakpointTypeLabels = { + 'subtree-modified': Common.UIString('Subtree Modified'), + 'attribute-modified': Common.UIString('Attribute Modified'), + 'node-removed': Common.UIString('Node Removed') }; -WebInspector.DOMBreakpointsSidebarPane.BreakpointTypeNouns = { - 'subtree-modified': WebInspector.UIString('subtree modifications'), - 'attribute-modified': WebInspector.UIString('attribute modifications'), - 'node-removed': WebInspector.UIString('node removal') +Components.DOMBreakpointsSidebarPane.BreakpointTypeNouns = { + 'subtree-modified': Common.UIString('subtree modifications'), + 'attribute-modified': Common.UIString('attribute modifications'), + 'node-removed': Common.UIString('node removal') }; -WebInspector.DOMBreakpointsSidebarPane.Marker = 'breakpoint-marker'; +Components.DOMBreakpointsSidebarPane.Marker = 'breakpoint-marker'; /** * @unrestricted */ -WebInspector.DOMBreakpointsSidebarPane.Proxy = class extends WebInspector.VBox { +Components.DOMBreakpointsSidebarPane.Proxy = class extends UI.VBox { constructor() { super(); this.registerRequiredCSS('components/breakpointsList.css'); @@ -402,13 +402,13 @@ */ wasShown() { super.wasShown(); - var pane = WebInspector.domBreakpointsSidebarPane; + var pane = Components.domBreakpointsSidebarPane; if (pane.element.parentNode !== this.element) pane.show(this.element); } }; /** - * @type {!WebInspector.DOMBreakpointsSidebarPane} + * @type {!Components.DOMBreakpointsSidebarPane} */ -WebInspector.domBreakpointsSidebarPane; +Components.domBreakpointsSidebarPane;
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js index 8173f07..a6a0fe6b 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
@@ -28,13 +28,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.DOMPresentationUtils = {}; +Components.DOMPresentationUtils = {}; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Element} parentElement */ -WebInspector.DOMPresentationUtils.decorateNodeLabel = function(node, parentElement) { +Components.DOMPresentationUtils.decorateNodeLabel = function(node, parentElement) { var originalNode = node; var isPseudo = node.nodeType() === Node.ELEMENT_NODE && node.pseudoType(); if (isPseudo && node.parentNode) @@ -88,7 +88,7 @@ * @param {!Element} container * @param {string} nodeTitle */ -WebInspector.DOMPresentationUtils.createSpansForNodeTitle = function(container, nodeTitle) { +Components.DOMPresentationUtils.createSpansForNodeTitle = function(container, nodeTitle) { var match = nodeTitle.match(/([^#.]+)(#[^.]+)?(\..*)?/); container.createChild('span', 'webkit-html-tag-name').textContent = match[1]; if (match[2]) @@ -98,62 +98,62 @@ }; /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {string=} idref * @return {!Node} */ -WebInspector.DOMPresentationUtils.linkifyNodeReference = function(node, idref) { +Components.DOMPresentationUtils.linkifyNodeReference = function(node, idref) { if (!node) - return createTextNode(WebInspector.UIString('<node>')); + return createTextNode(Common.UIString('<node>')); var root = createElementWithClass('span', 'monospace'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(root, 'components/domUtils.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(root, 'components/domUtils.css'); var link = shadowRoot.createChild('div', 'node-link'); if (idref) link.createChild('span', 'node-label-id').createTextChild('#' + idref); else - WebInspector.DOMPresentationUtils.decorateNodeLabel(node, link); + Components.DOMPresentationUtils.decorateNodeLabel(node, link); - link.addEventListener('click', WebInspector.Revealer.reveal.bind(WebInspector.Revealer, node, undefined), false); + link.addEventListener('click', Common.Revealer.reveal.bind(Common.Revealer, node, undefined), false); link.addEventListener('mouseover', node.highlight.bind(node, undefined, undefined), false); - link.addEventListener('mouseleave', WebInspector.DOMModel.hideDOMNodeHighlight.bind(WebInspector.DOMModel), false); + link.addEventListener('mouseleave', SDK.DOMModel.hideDOMNodeHighlight.bind(SDK.DOMModel), false); return root; }; /** - * @param {!WebInspector.DeferredDOMNode} deferredNode + * @param {!SDK.DeferredDOMNode} deferredNode * @return {!Node} */ -WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference = function(deferredNode) { +Components.DOMPresentationUtils.linkifyDeferredNodeReference = function(deferredNode) { var root = createElement('div'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(root, 'components/domUtils.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(root, 'components/domUtils.css'); var link = shadowRoot.createChild('div', 'node-link'); link.createChild('content'); link.addEventListener('click', deferredNode.resolve.bind(deferredNode, onDeferredNodeResolved), false); link.addEventListener('mousedown', (e) => e.consume(), false); /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ function onDeferredNodeResolved(node) { - WebInspector.Revealer.reveal(node); + Common.Revealer.reveal(node); } return root; }; /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} originalImageURL * @param {boolean} showDimensions * @param {function(!Element=)} userCallback * @param {!Object=} precomputedFeatures */ -WebInspector.DOMPresentationUtils.buildImagePreviewContents = function( +Components.DOMPresentationUtils.buildImagePreviewContents = function( target, originalImageURL, showDimensions, userCallback, precomputedFeatures) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (!resourceTreeModel) { userCallback(); return; @@ -180,11 +180,11 @@ } /** - * @param {?WebInspector.Resource} resource + * @param {?SDK.Resource} resource * @return {boolean} */ function isImageResource(resource) { - return !!resource && resource.resourceType() === WebInspector.resourceTypes.Image; + return !!resource && resource.resourceType() === Common.resourceTypes.Image; } function buildContent() { @@ -197,9 +197,9 @@ var description; if (showDimensions) { if (offsetHeight === naturalHeight && offsetWidth === naturalWidth) - description = WebInspector.UIString('%d \xd7 %d pixels', offsetWidth, offsetHeight); + description = Common.UIString('%d \xd7 %d pixels', offsetWidth, offsetHeight); else - description = WebInspector.UIString( + description = Common.UIString( '%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)', offsetWidth, offsetHeight, naturalWidth, naturalHeight); } @@ -214,15 +214,15 @@ }; /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.Target} target + * @param {!Components.Linkifier} linkifier * @param {!Protocol.Runtime.StackTrace=} stackTrace * @return {!Element} */ -WebInspector.DOMPresentationUtils.buildStackTracePreviewContents = function(target, linkifier, stackTrace) { +Components.DOMPresentationUtils.buildStackTracePreviewContents = function(target, linkifier, stackTrace) { var element = createElement('span'); element.style.display = 'inline-block'; - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(element, 'components/domUtils.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(element, 'components/domUtils.css'); var contentElement = shadowRoot.createChild('table', 'stack-preview-container'); /** @@ -232,7 +232,7 @@ for (var stackFrame of stackTrace.callFrames) { var row = createElement('tr'); row.createChild('td').textContent = '\n'; - row.createChild('td', 'function-name').textContent = WebInspector.beautifyFunctionName(stackFrame.functionName); + row.createChild('td', 'function-name').textContent = UI.beautifyFunctionName(stackFrame.functionName); var link = linkifier.maybeLinkifyConsoleCallFrame(target, stackFrame); if (link) { row.createChild('td').textContent = ' @ '; @@ -256,7 +256,7 @@ var row = contentElement.createChild('tr'); row.createChild('td').textContent = '\n'; row.createChild('td', 'stack-preview-async-description').textContent = - WebInspector.asyncStackTraceLabel(asyncStackTrace.description); + UI.asyncStackTraceLabel(asyncStackTrace.description); row.createChild('td'); row.createChild('td'); appendStackTrace(asyncStackTrace); @@ -267,21 +267,21 @@ }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} justSelector * @return {string} */ -WebInspector.DOMPresentationUtils.fullQualifiedSelector = function(node, justSelector) { +Components.DOMPresentationUtils.fullQualifiedSelector = function(node, justSelector) { if (node.nodeType() !== Node.ELEMENT_NODE) return node.localName() || node.nodeName().toLowerCase(); - return WebInspector.DOMPresentationUtils.cssPath(node, justSelector); + return Components.DOMPresentationUtils.cssPath(node, justSelector); }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {string} */ -WebInspector.DOMPresentationUtils.simpleSelector = function(node) { +Components.DOMPresentationUtils.simpleSelector = function(node) { var lowerCaseName = node.localName() || node.nodeName().toLowerCase(); if (node.nodeType() !== Node.ELEMENT_NODE) return lowerCaseName; @@ -296,18 +296,18 @@ }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} optimized * @return {string} */ -WebInspector.DOMPresentationUtils.cssPath = function(node, optimized) { +Components.DOMPresentationUtils.cssPath = function(node, optimized) { if (node.nodeType() !== Node.ELEMENT_NODE) return ''; var steps = []; var contextNode = node; while (contextNode) { - var step = WebInspector.DOMPresentationUtils._cssPathStep(contextNode, !!optimized, contextNode === node); + var step = Components.DOMPresentationUtils._cssPathStep(contextNode, !!optimized, contextNode === node); if (!step) break; // Error - bail out early. steps.push(step); @@ -321,33 +321,33 @@ }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean} optimized * @param {boolean} isTargetNode - * @return {?WebInspector.DOMNodePathStep} + * @return {?Components.DOMNodePathStep} */ -WebInspector.DOMPresentationUtils._cssPathStep = function(node, optimized, isTargetNode) { +Components.DOMPresentationUtils._cssPathStep = function(node, optimized, isTargetNode) { if (node.nodeType() !== Node.ELEMENT_NODE) return null; var id = node.getAttribute('id'); if (optimized) { if (id) - return new WebInspector.DOMNodePathStep(idSelector(id), true); + return new Components.DOMNodePathStep(idSelector(id), true); var nodeNameLower = node.nodeName().toLowerCase(); if (nodeNameLower === 'body' || nodeNameLower === 'head' || nodeNameLower === 'html') - return new WebInspector.DOMNodePathStep(node.nodeNameInCorrectCase(), true); + return new Components.DOMNodePathStep(node.nodeNameInCorrectCase(), true); } var nodeName = node.nodeNameInCorrectCase(); if (id) - return new WebInspector.DOMNodePathStep(nodeName + idSelector(id), true); + return new Components.DOMNodePathStep(nodeName + idSelector(id), true); var parent = node.parentNode; if (!parent || parent.nodeType() === Node.DOCUMENT_NODE) - return new WebInspector.DOMNodePathStep(nodeName, true); + return new Components.DOMNodePathStep(nodeName, true); /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {!Array.<string>} */ function prefixedElementClassNames(node) { @@ -470,22 +470,22 @@ result += '.' + escapeIdentifierIfNeeded(prefixedName.substr(1)); } - return new WebInspector.DOMNodePathStep(result, false); + return new Components.DOMNodePathStep(result, false); }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} optimized * @return {string} */ -WebInspector.DOMPresentationUtils.xPath = function(node, optimized) { +Components.DOMPresentationUtils.xPath = function(node, optimized) { if (node.nodeType() === Node.DOCUMENT_NODE) return '/'; var steps = []; var contextNode = node; while (contextNode) { - var step = WebInspector.DOMPresentationUtils._xPathValue(contextNode, optimized); + var step = Components.DOMPresentationUtils._xPathValue(contextNode, optimized); if (!step) break; // Error - bail out early. steps.push(step); @@ -499,20 +499,20 @@ }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} optimized - * @return {?WebInspector.DOMNodePathStep} + * @return {?Components.DOMNodePathStep} */ -WebInspector.DOMPresentationUtils._xPathValue = function(node, optimized) { +Components.DOMPresentationUtils._xPathValue = function(node, optimized) { var ownValue; - var ownIndex = WebInspector.DOMPresentationUtils._xPathIndex(node); + var ownIndex = Components.DOMPresentationUtils._xPathIndex(node); if (ownIndex === -1) return null; // Error. switch (node.nodeType()) { case Node.ELEMENT_NODE: if (optimized && node.getAttribute('id')) - return new WebInspector.DOMNodePathStep('//*[@id="' + node.getAttribute('id') + '"]', true); + return new Components.DOMNodePathStep('//*[@id="' + node.getAttribute('id') + '"]', true); ownValue = node.localName(); break; case Node.ATTRIBUTE_NODE: @@ -539,14 +539,14 @@ if (ownIndex > 0) ownValue += '[' + ownIndex + ']'; - return new WebInspector.DOMNodePathStep(ownValue, node.nodeType() === Node.DOCUMENT_NODE); + return new Components.DOMNodePathStep(ownValue, node.nodeType() === Node.DOCUMENT_NODE); }; /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {number} */ -WebInspector.DOMPresentationUtils._xPathIndex = function(node) { +Components.DOMPresentationUtils._xPathIndex = function(node) { // Returns -1 in case of error, 0 if no siblings matching the same expression, <XPath index among the same expression-matching sibling nodes> otherwise. function areNodesSimilar(left, right) { if (left === right) @@ -590,7 +590,7 @@ /** * @unrestricted */ -WebInspector.DOMNodePathStep = class { +Components.DOMNodePathStep = class { /** * @param {string} value * @param {boolean} optimized @@ -612,32 +612,32 @@ /** * @interface */ -WebInspector.DOMPresentationUtils.MarkerDecorator = function() {}; +Components.DOMPresentationUtils.MarkerDecorator = function() {}; -WebInspector.DOMPresentationUtils.MarkerDecorator.prototype = { +Components.DOMPresentationUtils.MarkerDecorator.prototype = { /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {?{title: string, color: string}} */ decorate: function(node) {} }; /** - * @implements {WebInspector.DOMPresentationUtils.MarkerDecorator} + * @implements {Components.DOMPresentationUtils.MarkerDecorator} * @unrestricted */ -WebInspector.DOMPresentationUtils.GenericDecorator = class { +Components.DOMPresentationUtils.GenericDecorator = class { /** * @param {!Runtime.Extension} extension */ constructor(extension) { - this._title = WebInspector.UIString(extension.title()); + this._title = Common.UIString(extension.title()); this._color = extension.descriptor()['color']; } /** * @override - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {?{title: string, color: string}} */ decorate(node) {
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DataSaverInfobar.js b/third_party/WebKit/Source/devtools/front_end/components/DataSaverInfobar.js index 0b196af4..9b578c1 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/DataSaverInfobar.js +++ b/third_party/WebKit/Source/devtools/front_end/components/DataSaverInfobar.js
@@ -4,26 +4,26 @@ /** * @unrestricted */ -WebInspector.DataSaverInfobar = class extends WebInspector.Infobar { +Components.DataSaverInfobar = class extends UI.Infobar { constructor() { super( - WebInspector.Infobar.Type.Warning, - WebInspector.UIString('Consider disabling Chrome Data Saver while debugging.'), - WebInspector.settings.moduleSetting('disableDataSaverInfobar')); + UI.Infobar.Type.Warning, + Common.UIString('Consider disabling Chrome Data Saver while debugging.'), + Common.settings.moduleSetting('disableDataSaverInfobar')); var message = this.createDetailsRowMessage(); message.createTextChild('More information about '); - message.appendChild(WebInspector.linkifyURLAsNode( + message.appendChild(UI.linkifyURLAsNode( 'https://support.google.com/chrome/answer/2392284?hl=en', 'Chrome Data Saver', undefined, true)); message.createTextChild('.'); } /** - * @param {!WebInspector.Panel} panel + * @param {!UI.Panel} panel */ static maybeShowInPanel(panel) { if (Runtime.queryParam('remoteFrontend')) { - var infobar = new WebInspector.DataSaverInfobar(); - WebInspector.DataSaverInfobar._infobars.push(infobar); + var infobar = new Components.DataSaverInfobar(); + Components.DataSaverInfobar._infobars.push(infobar); panel.showInfobar(infobar); } } @@ -32,9 +32,9 @@ * @override */ dispose() { - for (var infobar of WebInspector.DataSaverInfobar._infobars) + for (var infobar of Components.DataSaverInfobar._infobars) infobar.dispose(); } }; -WebInspector.DataSaverInfobar._infobars = []; +Components.DataSaverInfobar._infobars = [];
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DockController.js b/third_party/WebKit/Source/devtools/front_end/components/DockController.js index 55a3303..c4dfab20 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/DockController.js +++ b/third_party/WebKit/Source/devtools/front_end/components/DockController.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.DockController = class extends WebInspector.Object { +Components.DockController = class extends Common.Object { /** * @param {boolean} canDock */ @@ -39,22 +39,22 @@ super(); this._canDock = canDock; - this._closeButton = new WebInspector.ToolbarButton(WebInspector.UIString('Close'), 'largeicon-delete'); + this._closeButton = new UI.ToolbarButton(Common.UIString('Close'), 'largeicon-delete'); this._closeButton.addEventListener('click', InspectorFrontendHost.closeWindow.bind(InspectorFrontendHost)); if (!canDock) { - this._dockSide = WebInspector.DockController.State.Undocked; + this._dockSide = Components.DockController.State.Undocked; this._updateUI(); return; } this._states = [ - WebInspector.DockController.State.DockedToRight, WebInspector.DockController.State.DockedToBottom, - WebInspector.DockController.State.Undocked + Components.DockController.State.DockedToRight, Components.DockController.State.DockedToBottom, + Components.DockController.State.Undocked ]; - this._currentDockStateSetting = WebInspector.settings.moduleSetting('currentDockState'); + this._currentDockStateSetting = Common.settings.moduleSetting('currentDockState'); this._currentDockStateSetting.addChangeListener(this._dockSideChanged, this); - this._lastDockStateSetting = WebInspector.settings.createSetting('lastDockState', 'bottom'); + this._lastDockStateSetting = Common.settings.createSetting('lastDockState', 'bottom'); if (this._states.indexOf(this._currentDockStateSetting.get()) === -1) this._currentDockStateSetting.set('right'); if (this._states.indexOf(this._lastDockStateSetting.get()) === -1) @@ -66,8 +66,8 @@ return; this._titles = [ - WebInspector.UIString('Dock to right'), WebInspector.UIString('Dock to bottom'), - WebInspector.UIString('Undock into separate window') + Common.UIString('Dock to right'), Common.UIString('Dock to bottom'), + Common.UIString('Undock into separate window') ]; this._dockSideChanged(); } @@ -94,7 +94,7 @@ * @return {boolean} */ isVertical() { - return this._dockSide === WebInspector.DockController.State.DockedToRight; + return this._dockSide === Components.DockController.State.DockedToRight; } /** @@ -113,21 +113,21 @@ this._savedFocus = document.deepActiveElement(); var eventData = {from: this._dockSide, to: dockSide}; - this.dispatchEventToListeners(WebInspector.DockController.Events.BeforeDockSideChanged, eventData); + this.dispatchEventToListeners(Components.DockController.Events.BeforeDockSideChanged, eventData); console.timeStamp('DockController.setIsDocked'); this._dockSide = dockSide; this._currentDockStateSetting.set(dockSide); InspectorFrontendHost.setIsDocked( - dockSide !== WebInspector.DockController.State.Undocked, this._setIsDockedResponse.bind(this, eventData)); + dockSide !== Components.DockController.State.Undocked, this._setIsDockedResponse.bind(this, eventData)); this._updateUI(); - this.dispatchEventToListeners(WebInspector.DockController.Events.DockSideChanged, eventData); + this.dispatchEventToListeners(Components.DockController.Events.DockSideChanged, eventData); } /** * @param {{from: string, to: string}} eventData */ _setIsDockedResponse(eventData) { - this.dispatchEventToListeners(WebInspector.DockController.Events.AfterDockSideChanged, eventData); + this.dispatchEventToListeners(Components.DockController.Events.AfterDockSideChanged, eventData); if (this._savedFocus) { this._savedFocus.focus(); this._savedFocus = null; @@ -140,23 +140,23 @@ _updateUI() { var body = document.body; // Only for main window. switch (this._dockSide) { - case WebInspector.DockController.State.DockedToBottom: + case Components.DockController.State.DockedToBottom: body.classList.remove('undocked'); body.classList.remove('dock-to-right'); body.classList.add('dock-to-bottom'); break; - case WebInspector.DockController.State.DockedToRight: + case Components.DockController.State.DockedToRight: body.classList.remove('undocked'); body.classList.add('dock-to-right'); body.classList.remove('dock-to-bottom'); break; - case WebInspector.DockController.State.Undocked: + case Components.DockController.State.Undocked: body.classList.add('undocked'); body.classList.remove('dock-to-right'); body.classList.remove('dock-to-bottom'); break; } - this._closeButton.setVisible(this._dockSide !== WebInspector.DockController.State.Undocked); + this._closeButton.setVisible(this._dockSide !== Components.DockController.State.Undocked); } _toggleDockSide() { @@ -168,7 +168,7 @@ } }; -WebInspector.DockController.State = { +Components.DockController.State = { DockedToBottom: 'bottom', DockedToRight: 'right', Undocked: 'undocked' @@ -179,44 +179,44 @@ // after frontend is docked/undocked in the browser. /** @enum {symbol} */ -WebInspector.DockController.Events = { +Components.DockController.Events = { BeforeDockSideChanged: Symbol('BeforeDockSideChanged'), DockSideChanged: Symbol('DockSideChanged'), AfterDockSideChanged: Symbol('AfterDockSideChanged') }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.DockController.ToggleDockActionDelegate = class { +Components.DockController.ToggleDockActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - WebInspector.dockController._toggleDockSide(); + Components.dockController._toggleDockSide(); return true; } }; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.DockController.CloseButtonProvider = class { +Components.DockController.CloseButtonProvider = class { /** * @override - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item() { - return WebInspector.dockController._closeButton; + return Components.dockController._closeButton; } }; /** - * @type {!WebInspector.DockController} + * @type {!Components.DockController} */ -WebInspector.dockController; +Components.dockController;
diff --git a/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js b/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js index 7392c49a..e243ad0 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js
@@ -1,24 +1,24 @@ // Copyright 2015 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. -/** @typedef {{eventListeners:!Array<!WebInspector.EventListener>, internalHandlers:?WebInspector.RemoteArray}} */ -WebInspector.FrameworkEventListenersObject; +/** @typedef {{eventListeners:!Array<!SDK.EventListener>, internalHandlers:?SDK.RemoteArray}} */ +Components.FrameworkEventListenersObject; /** @typedef {{type: string, useCapture: boolean, passive: boolean, once: boolean, handler: function()}} */ -WebInspector.EventListenerObjectInInspectedPage; +Components.EventListenerObjectInInspectedPage; /** - * @param {!WebInspector.RemoteObject} object - * @return {!Promise<!WebInspector.FrameworkEventListenersObject>} + * @param {!SDK.RemoteObject} object + * @return {!Promise<!Components.FrameworkEventListenersObject>} */ -WebInspector.EventListener.frameworkEventListeners = function(object) { +SDK.EventListener.frameworkEventListeners = function(object) { if (!object.target().hasDOMCapability()) { // TODO(kozyatinskiy): figure out how this should work for |window|. return Promise.resolve( - /** @type {!WebInspector.FrameworkEventListenersObject} */ ({eventListeners: [], internalHandlers: null})); + /** @type {!Components.FrameworkEventListenersObject} */ ({eventListeners: [], internalHandlers: null})); } - var listenersResult = /** @type {!WebInspector.FrameworkEventListenersObject} */ ({eventListeners: []}); + var listenersResult = /** @type {!Components.FrameworkEventListenersObject} */ ({eventListeners: []}); return object.callFunctionPromise(frameworkEventListeners, undefined) .then(assertCallFunctionResult) .then(getOwnProperties) @@ -27,15 +27,15 @@ .catchException(listenersResult); /** - * @param {!WebInspector.RemoteObject} object - * @return {!Promise<!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}>} + * @param {!SDK.RemoteObject} object + * @return {!Promise<!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}>} */ function getOwnProperties(object) { return object.getOwnPropertiesPromise(); } /** - * @param {!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>}} result + * @param {!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}} result * @return {!Promise<undefined>} */ function createEventListeners(result) { @@ -54,17 +54,17 @@ } /** - * @param {!WebInspector.RemoteObject} pageEventListenersObject - * @return {!Promise<!Array<!WebInspector.EventListener>>} + * @param {!SDK.RemoteObject} pageEventListenersObject + * @return {!Promise<!Array<!SDK.EventListener>>} */ function convertToEventListeners(pageEventListenersObject) { - return WebInspector.RemoteArray.objectAsArray(pageEventListenersObject) + return SDK.RemoteArray.objectAsArray(pageEventListenersObject) .map(toEventListener) .then(filterOutEmptyObjects); /** - * @param {!WebInspector.RemoteObject} listenerObject - * @return {!Promise<?WebInspector.EventListener>} + * @param {!SDK.RemoteObject} listenerObject + * @return {!Promise<?SDK.EventListener>} */ function toEventListener(listenerObject) { /** @type {string} */ @@ -75,13 +75,13 @@ var passive; /** @type {boolean} */ var once; - /** @type {?WebInspector.RemoteObject} */ + /** @type {?SDK.RemoteObject} */ var handler = null; - /** @type {?WebInspector.RemoteObject} */ + /** @type {?SDK.RemoteObject} */ var originalHandler = null; - /** @type {?WebInspector.DebuggerModel.Location} */ + /** @type {?SDK.DebuggerModel.Location} */ var location = null; - /** @type {?WebInspector.RemoteObject} */ + /** @type {?SDK.RemoteObject} */ var removeFunctionObject = null; var promises = []; @@ -90,7 +90,7 @@ /** * @suppressReceiverCheck - * @this {WebInspector.EventListenerObjectInInspectedPage} + * @this {Components.EventListenerObjectInInspectedPage} * @return {!{type:string, useCapture:boolean, passive:boolean, once:boolean}} */ function truncatePageEventListener() { @@ -116,15 +116,15 @@ /** * @suppressReceiverCheck * @return {function()} - * @this {WebInspector.EventListenerObjectInInspectedPage} + * @this {Components.EventListenerObjectInInspectedPage} */ function handlerFunction() { return this.handler; } /** - * @param {!WebInspector.RemoteObject} functionObject - * @return {!WebInspector.RemoteObject} + * @param {!SDK.RemoteObject} functionObject + * @return {!SDK.RemoteObject} */ function storeOriginalHandler(functionObject) { originalHandler = functionObject; @@ -132,7 +132,7 @@ } /** - * @param {!WebInspector.RemoteObject} functionObject + * @param {!SDK.RemoteObject} functionObject * @return {!Promise<undefined>} */ function storeFunctionWithDetails(functionObject) { @@ -142,7 +142,7 @@ } /** - * @param {?WebInspector.DebuggerModel.FunctionDetails} functionDetails + * @param {?SDK.DebuggerModel.FunctionDetails} functionDetails */ function storeFunctionDetails(functionDetails) { location = functionDetails ? functionDetails.location : null; @@ -155,14 +155,14 @@ /** * @suppressReceiverCheck * @return {function()} - * @this {WebInspector.EventListenerObjectInInspectedPage} + * @this {Components.EventListenerObjectInInspectedPage} */ function getRemoveFunction() { return this.remove; } /** - * @param {!WebInspector.RemoteObject} functionObject + * @param {!SDK.RemoteObject} functionObject */ function storeRemoveFunction(functionObject) { if (functionObject.type !== 'function') @@ -172,15 +172,15 @@ return Promise.all(promises) .then(createEventListener) - .catchException(/** @type {?WebInspector.EventListener} */ (null)); + .catchException(/** @type {?SDK.EventListener} */ (null)); /** - * @return {!WebInspector.EventListener} + * @return {!SDK.EventListener} */ function createEventListener() { if (!location) throw new Error('Empty event listener\'s location'); - return new WebInspector.EventListener( + return new SDK.EventListener( handler._target, object, type, useCapture, passive, once, handler, originalHandler, location, removeFunctionObject, 'frameworkUser'); } @@ -188,54 +188,54 @@ } /** - * @param {!WebInspector.RemoteObject} pageInternalHandlersObject - * @return {!Promise<!WebInspector.RemoteArray>} + * @param {!SDK.RemoteObject} pageInternalHandlersObject + * @return {!Promise<!SDK.RemoteArray>} */ function convertToInternalHandlers(pageInternalHandlersObject) { - return WebInspector.RemoteArray.objectAsArray(pageInternalHandlersObject) + return SDK.RemoteArray.objectAsArray(pageInternalHandlersObject) .map(toTargetFunction) - .then(WebInspector.RemoteArray.createFromRemoteObjects); + .then(SDK.RemoteArray.createFromRemoteObjects); } /** - * @param {!WebInspector.RemoteObject} functionObject - * @return {!Promise<!WebInspector.RemoteObject>} + * @param {!SDK.RemoteObject} functionObject + * @return {!Promise<!SDK.RemoteObject>} */ function toTargetFunction(functionObject) { - return WebInspector.RemoteFunction.objectAsFunction(functionObject).targetFunction(); + return SDK.RemoteFunction.objectAsFunction(functionObject).targetFunction(); } /** - * @param {!Array<!WebInspector.EventListener>} eventListeners + * @param {!Array<!SDK.EventListener>} eventListeners */ function storeEventListeners(eventListeners) { listenersResult.eventListeners = eventListeners; } /** - * @param {!WebInspector.RemoteArray} internalHandlers + * @param {!SDK.RemoteArray} internalHandlers */ function storeInternalHandlers(internalHandlers) { listenersResult.internalHandlers = internalHandlers; } /** - * @param {!WebInspector.RemoteObject} errorString + * @param {!SDK.RemoteObject} errorString */ function printErrorString(errorString) { - WebInspector.console.error(errorString.value); + Common.console.error(errorString.value); } /** - * @return {!WebInspector.FrameworkEventListenersObject} + * @return {!Components.FrameworkEventListenersObject} */ function returnResult() { return listenersResult; } /** - * @param {!WebInspector.CallFunctionResult} result - * @return {!WebInspector.RemoteObject} + * @param {!SDK.CallFunctionResult} result + * @return {!SDK.RemoteObject} */ function assertCallFunctionResult(result) { if (result.wasThrown || !result.object) @@ -286,7 +286,7 @@ */ /** * @suppressReceiverCheck - * @return {!{eventListeners:!Array<!WebInspector.EventListenerObjectInInspectedPage>, internalHandlers:?Array<function()>}} + * @return {!{eventListeners:!Array<!Components.EventListenerObjectInInspectedPage>, internalHandlers:?Array<function()>}} * @this {Object} */ function frameworkEventListeners() { @@ -344,7 +344,7 @@ /** * @param {*} eventListener - * @return {?WebInspector.EventListenerObjectInInspectedPage} + * @return {?Components.EventListenerObjectInInspectedPage} */ function checkEventListener(eventListener) { try {
diff --git a/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js b/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js index 79c87d22..5cb1f80 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js +++ b/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @typedef {Array<{object: !WebInspector.RemoteObject, eventListeners: ?Array<!WebInspector.EventListener>, frameworkEventListeners: ?{eventListeners: ?Array<!WebInspector.EventListener>, internalHandlers: ?WebInspector.RemoteArray}, isInternal: ?Array<boolean>}>} + * @typedef {Array<{object: !SDK.RemoteObject, eventListeners: ?Array<!SDK.EventListener>, frameworkEventListeners: ?{eventListeners: ?Array<!SDK.EventListener>, internalHandlers: ?SDK.RemoteArray}, isInternal: ?Array<boolean>}>} */ -WebInspector.EventListenersResult; +Components.EventListenersResult; /** * @unrestricted */ -WebInspector.EventListenersView = class { +Components.EventListenersView = class { /** * @param {!Element} element * @param {function()} changeCallback @@ -21,18 +21,18 @@ this._treeOutline.hideOverflow(); this._treeOutline.registerRequiredCSS('components/objectValue.css'); this._treeOutline.registerRequiredCSS('components/eventListenersView.css'); - this._treeOutline.setComparator(WebInspector.EventListenersTreeElement.comparator); + this._treeOutline.setComparator(Components.EventListenersTreeElement.comparator); this._treeOutline.element.classList.add('monospace'); this._element.appendChild(this._treeOutline.element); this._emptyHolder = createElementWithClass('div', 'gray-info-message'); - this._emptyHolder.textContent = WebInspector.UIString('No Event Listeners'); - this._linkifier = new WebInspector.Linkifier(); - /** @type {!Map<string, !WebInspector.EventListenersTreeElement>} */ + this._emptyHolder.textContent = Common.UIString('No Event Listeners'); + this._linkifier = new Components.Linkifier(); + /** @type {!Map<string, !Components.EventListenersTreeElement>} */ this._treeItemMap = new Map(); } /** - * @param {!Array<!WebInspector.RemoteObject>} objects + * @param {!Array<!SDK.RemoteObject>} objects * @return {!Promise<undefined>} */ addObjects(objects) { @@ -46,29 +46,29 @@ } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @return {!Promise<undefined>} */ _addObject(object) { - /** @type {?Array<!WebInspector.EventListener>} */ + /** @type {?Array<!SDK.EventListener>} */ var eventListeners = null; - /** @type {?WebInspector.FrameworkEventListenersObject}*/ + /** @type {?Components.FrameworkEventListenersObject}*/ var frameworkEventListenersObject = null; var promises = []; promises.push(object.eventListeners().then(storeEventListeners)); - promises.push(WebInspector.EventListener.frameworkEventListeners(object).then(storeFrameworkEventListenersObject)); + promises.push(SDK.EventListener.frameworkEventListeners(object).then(storeFrameworkEventListenersObject)); return Promise.all(promises).then(markInternalEventListeners).then(addEventListeners.bind(this)); /** - * @param {?Array<!WebInspector.EventListener>} result + * @param {?Array<!SDK.EventListener>} result */ function storeEventListeners(result) { eventListeners = result; } /** - * @param {?WebInspector.FrameworkEventListenersObject} result + * @param {?Components.FrameworkEventListenersObject} result */ function storeFrameworkEventListenersObject(result) { frameworkEventListenersObject = result; @@ -85,11 +85,11 @@ .then(setIsInternal); /** - * @param {!WebInspector.EventListener} listener + * @param {!SDK.EventListener} listener * @return {!Protocol.Runtime.CallArgument} */ function handlerArgument(listener) { - return WebInspector.RemoteObject.toCallArgument(listener.handler()); + return SDK.RemoteObject.toCallArgument(listener.handler()); } /** @@ -117,7 +117,7 @@ } /** - * @this {WebInspector.EventListenersView} + * @this {Components.EventListenersView} */ function addEventListeners() { this._addObjectEventListeners(object, eventListeners); @@ -126,8 +126,8 @@ } /** - * @param {!WebInspector.RemoteObject} object - * @param {?Array<!WebInspector.EventListener>} eventListeners + * @param {!SDK.RemoteObject} object + * @param {?Array<!SDK.EventListener>} eventListeners */ _addObjectEventListeners(object, eventListeners) { if (!eventListeners) @@ -167,12 +167,12 @@ /** * @param {string} type - * @return {!WebInspector.EventListenersTreeElement} + * @return {!Components.EventListenersTreeElement} */ _getOrCreateTreeElementForType(type) { var treeItem = this._treeItemMap.get(type); if (!treeItem) { - treeItem = new WebInspector.EventListenersTreeElement(type, this._linkifier, this._changeCallback); + treeItem = new Components.EventListenersTreeElement(type, this._linkifier, this._changeCallback); this._treeItemMap.set(type, treeItem); treeItem.hidden = true; this._treeOutline.appendChild(treeItem); @@ -205,10 +205,10 @@ /** * @unrestricted */ -WebInspector.EventListenersTreeElement = class extends TreeElement { +Components.EventListenersTreeElement = class extends TreeElement { /** * @param {string} type - * @param {!WebInspector.Linkifier} linkifier + * @param {!Components.Linkifier} linkifier * @param {function()} changeCallback */ constructor(type, linkifier, changeCallback) { @@ -231,12 +231,12 @@ } /** - * @param {!WebInspector.EventListener} eventListener - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.EventListener} eventListener + * @param {!SDK.RemoteObject} object */ addObjectEventListener(eventListener, object) { var treeElement = - new WebInspector.ObjectEventListenerBar(eventListener, object, this._linkifier, this._changeCallback); + new Components.ObjectEventListenerBar(eventListener, object, this._linkifier, this._changeCallback); this.appendChild(/** @type {!TreeElement} */ (treeElement)); } }; @@ -245,11 +245,11 @@ /** * @unrestricted */ -WebInspector.ObjectEventListenerBar = class extends TreeElement { +Components.ObjectEventListenerBar = class extends TreeElement { /** - * @param {!WebInspector.EventListener} eventListener - * @param {!WebInspector.RemoteObject} object - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.EventListener} eventListener + * @param {!SDK.RemoteObject} object + * @param {!Components.Linkifier} linkifier * @param {function()} changeCallback */ constructor(eventListener, object, linkifier, changeCallback) { @@ -272,40 +272,40 @@ properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue('passive', eventListener.passive())); properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue('once', eventListener.once())); if (typeof eventListener.handler() !== 'undefined') - properties.push(new WebInspector.RemoteObjectProperty('handler', eventListener.handler())); - WebInspector.ObjectPropertyTreeElement.populateWithProperties(this, properties, [], true, null); + properties.push(new SDK.RemoteObjectProperty('handler', eventListener.handler())); + Components.ObjectPropertyTreeElement.populateWithProperties(this, properties, [], true, null); } /** - * @param {!WebInspector.RemoteObject} object - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.RemoteObject} object + * @param {!Components.Linkifier} linkifier */ _setTitle(object, linkifier) { var title = this.listItemElement.createChild('span'); var subtitle = this.listItemElement.createChild('span', 'event-listener-tree-subtitle'); subtitle.appendChild(linkifier.linkifyRawLocation(this._eventListener.location(), this._eventListener.sourceURL())); - title.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(object, false)); + title.appendChild(Components.ObjectPropertiesSection.createValueElement(object, false)); if (this._eventListener.removeFunction()) { var deleteButton = title.createChild('span', 'event-listener-button'); - deleteButton.textContent = WebInspector.UIString('Remove'); - deleteButton.title = WebInspector.UIString('Delete event listener'); + deleteButton.textContent = Common.UIString('Remove'); + deleteButton.title = Common.UIString('Delete event listener'); deleteButton.addEventListener('click', removeListener.bind(this), false); title.appendChild(deleteButton); } if (this._eventListener.isScrollBlockingType() && this._eventListener.isNormalListenerType()) { var passiveButton = title.createChild('span', 'event-listener-button'); - passiveButton.textContent = WebInspector.UIString('Toggle Passive'); - passiveButton.title = WebInspector.UIString('Toggle whether event listener is passive or blocking'); + passiveButton.textContent = Common.UIString('Toggle Passive'); + passiveButton.title = Common.UIString('Toggle whether event listener is passive or blocking'); passiveButton.addEventListener('click', togglePassiveListener.bind(this), false); title.appendChild(passiveButton); } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ObjectEventListenerBar} + * @param {!Common.Event} event + * @this {Components.ObjectEventListenerBar} */ function removeListener(event) { event.consume(); @@ -314,8 +314,8 @@ } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ObjectEventListenerBar} + * @param {!Common.Event} event + * @this {Components.ObjectEventListenerBar} */ function togglePassiveListener(event) { event.consume(); @@ -338,7 +338,7 @@ } /** - * @return {!WebInspector.EventListener} + * @return {!SDK.EventListener} */ eventListener() { return this._eventListener;
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js index ee2b485d..3fddc4d 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js +++ b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js
@@ -2,27 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ExecutionContextSelector = class { +Components.ExecutionContextSelector = class { /** - * @param {!WebInspector.TargetManager} targetManager - * @param {!WebInspector.Context} context + * @param {!SDK.TargetManager} targetManager + * @param {!UI.Context} context */ constructor(targetManager, context) { - targetManager.observeTargets(this, WebInspector.Target.Capability.JS); - context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this); - context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this); + targetManager.observeTargets(this, SDK.Target.Capability.JS); + context.addFlavorChangeListener(SDK.ExecutionContext, this._executionContextChanged, this); + context.addFlavorChangeListener(SDK.Target, this._targetChanged, this); targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this); targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this); targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextOrderChanged, + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextOrderChanged, this._onExecutionContextOrderChanged, this); this._targetManager = targetManager; this._context = context; @@ -30,7 +30,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { // Defer selecting default target since we need all clients to get their @@ -38,43 +38,43 @@ setImmediate(deferred.bind(this)); /** - * @this {WebInspector.ExecutionContextSelector} + * @this {Components.ExecutionContextSelector} */ function deferred() { // We always want the second context for the service worker targets. - if (!this._context.flavor(WebInspector.Target)) - this._context.setFlavor(WebInspector.Target, target); + if (!this._context.flavor(SDK.Target)) + this._context.setFlavor(SDK.Target, target); } } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var currentExecutionContext = this._context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = this._context.flavor(SDK.ExecutionContext); if (currentExecutionContext && currentExecutionContext.target() === target) this._currentExecutionContextGone(); - var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); - if (this._context.flavor(WebInspector.Target) === target && targets.length) - this._context.setFlavor(WebInspector.Target, targets[0]); + var targets = this._targetManager.targets(SDK.Target.Capability.JS); + if (this._context.flavor(SDK.Target) === target && targets.length) + this._context.setFlavor(SDK.Target, targets[0]); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _executionContextChanged(event) { - var newContext = /** @type {?WebInspector.ExecutionContext} */ (event.data); + var newContext = /** @type {?SDK.ExecutionContext} */ (event.data); if (newContext) { - this._context.setFlavor(WebInspector.Target, newContext.target()); + this._context.setFlavor(SDK.Target, newContext.target()); if (!this._ignoreContextChanged) this._lastSelectedContextId = this._contextPersistentId(newContext); } } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @return {string} */ _contextPersistentId(executionContext) { @@ -82,11 +82,11 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetChanged(event) { - var newTarget = /** @type {?WebInspector.Target} */ (event.data); - var currentContext = this._context.flavor(WebInspector.ExecutionContext); + var newTarget = /** @type {?SDK.Target} */ (event.data); + var currentContext = this._context.flavor(SDK.ExecutionContext); if (!newTarget || (currentContext && currentContext.target() === newTarget)) return; @@ -105,12 +105,12 @@ newContext = executionContexts[i]; } this._ignoreContextChanged = true; - this._context.setFlavor(WebInspector.ExecutionContext, newContext || executionContexts[0]); + this._context.setFlavor(SDK.ExecutionContext, newContext || executionContexts[0]); this._ignoreContextChanged = false; } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @return {boolean} */ _shouldSwitchToContext(executionContext) { @@ -122,7 +122,7 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @return {boolean} */ _isDefaultContext(executionContext) { @@ -130,7 +130,7 @@ return false; if (executionContext.target().parentTarget()) return false; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(executionContext.target()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(executionContext.target()); var frame = resourceTreeModel && resourceTreeModel.frameForId(executionContext.frameId); if (frame && frame.isMainFrame()) return true; @@ -138,26 +138,26 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextCreated(event) { - this._switchContextIfNecessary(/** @type {!WebInspector.ExecutionContext} */ (event.data)); + this._switchContextIfNecessary(/** @type {!SDK.ExecutionContext} */ (event.data)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextDestroyed(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext}*/ (event.data); - if (this._context.flavor(WebInspector.ExecutionContext) === executionContext) + var executionContext = /** @type {!SDK.ExecutionContext}*/ (event.data); + if (this._context.flavor(SDK.ExecutionContext) === executionContext) this._currentExecutionContextGone(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextOrderChanged(event) { - var runtimeModel = /** @type {!WebInspector.RuntimeModel} */ (event.data); + var runtimeModel = /** @type {!SDK.RuntimeModel} */ (event.data); var executionContexts = runtimeModel.executionContexts(); for (var i = 0; i < executionContexts.length; i++) { if (this._switchContextIfNecessary(executionContexts[i])) @@ -166,13 +166,13 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @return {boolean} */ _switchContextIfNecessary(executionContext) { - if (!this._context.flavor(WebInspector.ExecutionContext) || this._shouldSwitchToContext(executionContext)) { + if (!this._context.flavor(SDK.ExecutionContext) || this._shouldSwitchToContext(executionContext)) { this._ignoreContextChanged = true; - this._context.setFlavor(WebInspector.ExecutionContext, executionContext); + this._context.setFlavor(SDK.ExecutionContext, executionContext); this._ignoreContextChanged = false; return true; } @@ -180,7 +180,7 @@ } _currentExecutionContextGone() { - var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); + var targets = this._targetManager.targets(SDK.Target.Capability.JS); var newContext = null; for (var i = 0; i < targets.length && !newContext; ++i) { var executionContexts = targets[i].runtimeModel.executionContexts(); @@ -201,7 +201,7 @@ } } this._ignoreContextChanged = true; - this._context.setFlavor(WebInspector.ExecutionContext, newContext); + this._context.setFlavor(SDK.ExecutionContext, newContext); this._ignoreContextChanged = false; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js b/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js index 43ce9d8..ea4aa34 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js +++ b/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.HandlerRegistry = class extends WebInspector.Object { +Components.HandlerRegistry = class extends Common.Object { constructor(setting) { super(); this._handlers = {}; @@ -73,12 +73,12 @@ registerHandler(name, handler) { this._handlers[name] = handler; - this.dispatchEventToListeners(WebInspector.HandlerRegistry.Events.HandlersUpdated); + this.dispatchEventToListeners(Components.HandlerRegistry.Events.HandlersUpdated); } unregisterHandler(name) { delete this._handlers[name]; - this.dispatchEventToListeners(WebInspector.HandlerRegistry.Events.HandlersUpdated); + this.dispatchEventToListeners(Components.HandlerRegistry.Events.HandlersUpdated); } /** @@ -89,32 +89,32 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendContentProviderItems(contextMenu, target) { - if (!(target instanceof WebInspector.UISourceCode || target instanceof WebInspector.Resource || - target instanceof WebInspector.NetworkRequest)) + if (!(target instanceof Workspace.UISourceCode || target instanceof SDK.Resource || + target instanceof SDK.NetworkRequest)) return; - var contentProvider = /** @type {!WebInspector.ContentProvider} */ (target); + var contentProvider = /** @type {!Common.ContentProvider} */ (target); if (!contentProvider.contentURL()) return; contextMenu.appendItem( - WebInspector.openLinkExternallyLabel(), this._openInNewTab.bind(this, contentProvider.contentURL())); + UI.openLinkExternallyLabel(), this._openInNewTab.bind(this, contentProvider.contentURL())); // Skip 0th handler, as it's 'Use default panel' one. for (var i = 1; i < this.handlerNames.length; ++i) { var handler = this.handlerNames[i]; contextMenu.appendItem( - WebInspector.UIString.capitalize('Open ^using %s', handler), + Common.UIString.capitalize('Open ^using %s', handler), this.dispatchToHandler.bind(this, handler, {url: contentProvider.contentURL()})); } - if (!contentProvider.contentURL() || contentProvider instanceof WebInspector.NetworkRequest) + if (!contentProvider.contentURL() || contentProvider instanceof SDK.NetworkRequest) return; contextMenu.appendItem( - WebInspector.copyLinkAddressLabel(), + UI.copyLinkAddressLabel(), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, contentProvider.contentURL())); if (!contentProvider.contentType().isDocumentOrScriptOrStyleSheet()) @@ -126,16 +126,16 @@ */ function doSave(forceSaveAs, content) { var url = contentProvider.contentURL(); - WebInspector.fileManager.save(url, /** @type {string} */ (content), forceSaveAs); - WebInspector.fileManager.close(url); + Workspace.fileManager.save(url, /** @type {string} */ (content), forceSaveAs); + Workspace.fileManager.close(url); } /** * @param {boolean} forceSaveAs */ function save(forceSaveAs) { - if (contentProvider instanceof WebInspector.UISourceCode) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (contentProvider); + if (contentProvider instanceof Workspace.UISourceCode) { + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (contentProvider); if (forceSaveAs) uiSourceCode.saveAs(); else @@ -146,18 +146,18 @@ } contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Save'), save.bind(null, false)); + contextMenu.appendItem(Common.UIString('Save'), save.bind(null, false)); - if (contentProvider instanceof WebInspector.UISourceCode) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (contentProvider); - if (uiSourceCode.project().type() !== WebInspector.projectTypes.FileSystem && - uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets) - contextMenu.appendItem(WebInspector.UIString.capitalize('Save ^as...'), save.bind(null, true)); + if (contentProvider instanceof Workspace.UISourceCode) { + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (contentProvider); + if (uiSourceCode.project().type() !== Workspace.projectTypes.FileSystem && + uiSourceCode.project().type() !== Workspace.projectTypes.Snippets) + contextMenu.appendItem(Common.UIString.capitalize('Save ^as...'), save.bind(null, true)); } } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendHrefItems(contextMenu, target) { @@ -170,13 +170,13 @@ if (!anchorElement) return; - var uiLocation = WebInspector.Linkifier.uiLocationByAnchor(anchorElement); + var uiLocation = Components.Linkifier.uiLocationByAnchor(anchorElement); var resourceURL = uiLocation ? uiLocation.uiSourceCode.contentURL() : anchorElement.href; var uiSourceCode = uiLocation ? uiLocation.uiSourceCode : - (resourceURL ? WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL) : null); + (resourceURL ? Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL) : null); function open() { - WebInspector.Revealer.reveal(uiSourceCode); + Common.Revealer.reveal(uiSourceCode); } if (uiSourceCode) contextMenu.appendItem('Open', open); @@ -184,45 +184,45 @@ if (!resourceURL) return; // Add resource-related actions. - contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), this._openInNewTab.bind(this, resourceURL)); + contextMenu.appendItem(UI.openLinkExternallyLabel(), this._openInNewTab.bind(this, resourceURL)); /** * @param {string} resourceURL */ function openInResourcesPanel(resourceURL) { - var resource = WebInspector.resourceForURL(resourceURL); + var resource = Bindings.resourceForURL(resourceURL); if (resource) - WebInspector.Revealer.reveal(resource); + Common.Revealer.reveal(resource); else InspectorFrontendHost.openInNewTab(resourceURL); } if (!targetNode.enclosingNodeOrSelfWithClassList(['resources', 'panel']) && - WebInspector.resourceForURL(resourceURL)) + Bindings.resourceForURL(resourceURL)) contextMenu.appendItem( - WebInspector.UIString.capitalize('Open ^link in Application ^panel'), + Common.UIString.capitalize('Open ^link in Application ^panel'), openInResourcesPanel.bind(null, resourceURL)); contextMenu.appendItem( - WebInspector.copyLinkAddressLabel(), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, resourceURL)); + UI.copyLinkAddressLabel(), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, resourceURL)); } }; /** @enum {symbol} */ -WebInspector.HandlerRegistry.Events = { +Components.HandlerRegistry.Events = { HandlersUpdated: Symbol('HandlersUpdated') }; /** * @unrestricted */ -WebInspector.HandlerSelector = class { +Components.HandlerSelector = class { constructor(handlerRegistry) { this._handlerRegistry = handlerRegistry; this.element = createElementWithClass('select', 'chrome-select'); this.element.addEventListener('change', this._onChange.bind(this), false); this._update(); this._handlerRegistry.addEventListener( - WebInspector.HandlerRegistry.Events.HandlersUpdated, this._update.bind(this)); + Components.HandlerRegistry.Events.HandlersUpdated, this._update.bind(this)); } _update() { @@ -246,27 +246,27 @@ }; /** - * @implements {WebInspector.ContextMenu.Provider} + * @implements {UI.ContextMenu.Provider} * @unrestricted */ -WebInspector.HandlerRegistry.ContextMenuProvider = class { +Components.HandlerRegistry.ContextMenuProvider = class { /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { - WebInspector.openAnchorLocationRegistry._appendContentProviderItems(contextMenu, target); - WebInspector.openAnchorLocationRegistry._appendHrefItems(contextMenu, target); + Components.openAnchorLocationRegistry._appendContentProviderItems(contextMenu, target); + Components.openAnchorLocationRegistry._appendHrefItems(contextMenu, target); } }; /** - * @implements {WebInspector.Linkifier.LinkHandler} + * @implements {Components.Linkifier.LinkHandler} * @unrestricted */ -WebInspector.HandlerRegistry.LinkHandler = class { +Components.HandlerRegistry.LinkHandler = class { /** * @override * @param {string} url @@ -274,30 +274,30 @@ * @return {boolean} */ handleLink(url, lineNumber) { - return WebInspector.openAnchorLocationRegistry.dispatch({url: url, lineNumber: lineNumber}); + return Components.openAnchorLocationRegistry.dispatch({url: url, lineNumber: lineNumber}); } }; /** - * @implements {WebInspector.SettingUI} + * @implements {UI.SettingUI} * @unrestricted */ -WebInspector.HandlerRegistry.OpenAnchorLocationSettingUI = class { +Components.HandlerRegistry.OpenAnchorLocationSettingUI = class { /** * @override * @return {?Element} */ settingElement() { - if (!WebInspector.openAnchorLocationRegistry.handlerNames.length) + if (!Components.openAnchorLocationRegistry.handlerNames.length) return null; - var handlerSelector = new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry); - return WebInspector.SettingsUI.createCustomSetting( - WebInspector.UIString('Link handling:'), handlerSelector.element); + var handlerSelector = new Components.HandlerSelector(Components.openAnchorLocationRegistry); + return UI.SettingsUI.createCustomSetting( + Common.UIString('Link handling:'), handlerSelector.element); } }; /** - * @type {!WebInspector.HandlerRegistry} + * @type {!Components.HandlerRegistry} */ -WebInspector.openAnchorLocationRegistry; +Components.openAnchorLocationRegistry;
diff --git a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js index 74da452..5bea208 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js +++ b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -WebInspector.JavaScriptAutocomplete = {}; +Components.JavaScriptAutocomplete = {}; /** * @param {!Element} proxyElement @@ -10,11 +10,11 @@ * @param {boolean} force * @param {function(!Array.<string>, number=)} completionsReadyCallback */ -WebInspector.JavaScriptAutocomplete.completionsForTextPromptInCurrentContext = function(proxyElement, wordRange, force, completionsReadyCallback) { +Components.JavaScriptAutocomplete.completionsForTextPromptInCurrentContext = function(proxyElement, wordRange, force, completionsReadyCallback) { var expressionRange = wordRange.cloneRange(); expressionRange.collapse(true); expressionRange.setStartBefore(proxyElement); - WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(expressionRange.toString(), wordRange.toString(), force) + Components.JavaScriptAutocomplete.completionsForTextInCurrentContext(expressionRange.toString(), wordRange.toString(), force) .then(completionsReadyCallback); }; @@ -24,7 +24,7 @@ * @param {boolean=} force * @return {!Promise<!Array<string>>} */ -WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext = function(text, query, force) { +Components.JavaScriptAutocomplete.completionsForTextInCurrentContext = function(text, query, force) { var index; var stopChars = new Set(' =:({;,!+-*/&|^<>`'.split('')); for (index = text.length - 1; index >= 0; index--) { @@ -50,7 +50,7 @@ } clippedExpression = clippedExpression.substring(index + 1); - return WebInspector.JavaScriptAutocomplete.completionsForExpression(clippedExpression, query, force); + return Components.JavaScriptAutocomplete.completionsForExpression(clippedExpression, query, force); }; @@ -60,8 +60,8 @@ * @param {boolean=} force * @return {!Promise<!Array<string>>} */ -WebInspector.JavaScriptAutocomplete.completionsForExpression = function(expressionString, query, force) { - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); +Components.JavaScriptAutocomplete.completionsForExpression = function(expressionString, query, force) { + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (!executionContext) return Promise.resolve([]); @@ -91,7 +91,7 @@ return promise; /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ function evaluated(result, exceptionDetails) { @@ -101,20 +101,20 @@ } /** - * @param {?WebInspector.RemoteObject} object - * @return {!Promise<?WebInspector.RemoteObject>} + * @param {?SDK.RemoteObject} object + * @return {!Promise<?SDK.RemoteObject>} */ function extractTarget(object) { if (!object) - return Promise.resolve(/** @type {?WebInspector.RemoteObject} */(null)); + return Promise.resolve(/** @type {?SDK.RemoteObject} */(null)); if (object.type !== 'object' || object.subtype !== 'proxy') - return Promise.resolve(/** @type {?WebInspector.RemoteObject} */(object)); + return Promise.resolve(/** @type {?SDK.RemoteObject} */(object)); return object.getOwnPropertiesPromise().then(extractTargetFromProperties).then(extractTarget); } /** - * @param {!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>}} properties - * @return {?WebInspector.RemoteObject} + * @param {!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}} properties + * @return {?SDK.RemoteObject} */ function extractTargetFromProperties(properties) { var internalProperties = properties.internalProperties || []; @@ -159,14 +159,14 @@ } /** - * @param {?WebInspector.RemoteObject} object + * @param {?SDK.RemoteObject} object */ function completionsForObject(object) { if (!object) receivedPropertyNames(null); else if (object.type === 'object' || object.type === 'function') object.callFunctionJSON( - getCompletions, [WebInspector.RemoteObject.toCallArgument(object.subtype)], + getCompletions, [SDK.RemoteObject.toCallArgument(object.subtype)], receivedPropertyNames); else if (object.type === 'string' || object.type === 'number' || object.type === 'boolean') executionContext.evaluate( @@ -178,7 +178,7 @@ } /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ function receivedPropertyNamesFromEval(result, exceptionDetails) { @@ -225,7 +225,7 @@ for (var i = 0; i < commandLineAPI.length; ++i) propertyNames[commandLineAPI[i]] = true; } - fufill(WebInspector.JavaScriptAutocomplete._completionsForQuery( + fufill(Components.JavaScriptAutocomplete._completionsForQuery( dotNotation, bracketNotation, expressionString, query, Object.keys(propertyNames))); } }; @@ -238,7 +238,7 @@ * @param {!Array.<string>} properties * @return {!Array<string>} */ -WebInspector.JavaScriptAutocomplete._completionsForQuery = function(dotNotation, bracketNotation, expressionString, query, properties) { +Components.JavaScriptAutocomplete._completionsForQuery = function(dotNotation, bracketNotation, expressionString, query, properties) { if (bracketNotation) { if (query.length && query[0] === '\'') var quoteUsed = '\'';
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js index c04bfa9..be81f73 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js +++ b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
@@ -29,58 +29,58 @@ */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.Linkifier = class { +Components.Linkifier = class { /** * @param {number=} maxLengthForDisplayedURLs * @param {boolean=} useLinkDecorator */ constructor(maxLengthForDisplayedURLs, useLinkDecorator) { - this._maxLength = maxLengthForDisplayedURLs || WebInspector.Linkifier.MaxLengthForDisplayedURLs; - /** @type {!Map<!WebInspector.Target, !Array<!Element>>} */ + this._maxLength = maxLengthForDisplayedURLs || Components.Linkifier.MaxLengthForDisplayedURLs; + /** @type {!Map<!SDK.Target, !Array<!Element>>} */ this._anchorsByTarget = new Map(); - /** @type {!Map<!WebInspector.Target, !WebInspector.LiveLocationPool>} */ + /** @type {!Map<!SDK.Target, !Bindings.LiveLocationPool>} */ this._locationPoolByTarget = new Map(); this._useLinkDecorator = !!useLinkDecorator; - WebInspector.Linkifier._instances.add(this); - WebInspector.targetManager.observeTargets(this); + Components.Linkifier._instances.add(this); + SDK.targetManager.observeTargets(this); } /** - * @param {!WebInspector.LinkDecorator} decorator + * @param {!Components.LinkDecorator} decorator */ static setLinkDecorator(decorator) { - console.assert(!WebInspector.Linkifier._decorator, 'Cannot re-register link decorator.'); - WebInspector.Linkifier._decorator = decorator; - decorator.addEventListener(WebInspector.LinkDecorator.Events.LinkIconChanged, onLinkIconChanged); - for (var linkifier of WebInspector.Linkifier._instances) + console.assert(!Components.Linkifier._decorator, 'Cannot re-register link decorator.'); + Components.Linkifier._decorator = decorator; + decorator.addEventListener(Components.LinkDecorator.Events.LinkIconChanged, onLinkIconChanged); + for (var linkifier of Components.Linkifier._instances) linkifier._updateAllAnchorDecorations(); /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ function onLinkIconChanged(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */(event.data); - var links = uiSourceCode[WebInspector.Linkifier._sourceCodeAnchors] || []; + var uiSourceCode = /** @type {!Workspace.UISourceCode} */(event.data); + var links = uiSourceCode[Components.Linkifier._sourceCodeAnchors] || []; for (var link of links) - WebInspector.Linkifier._updateLinkDecorations(link); + Components.Linkifier._updateLinkDecorations(link); } } _updateAllAnchorDecorations() { for (var anchors of this._anchorsByTarget.values()) { for (var anchor of anchors) - WebInspector.Linkifier._updateLinkDecorations(anchor); + Components.Linkifier._updateLinkDecorations(anchor); } } /** - * @param {?WebInspector.Linkifier.LinkHandler} handler + * @param {?Components.Linkifier.LinkHandler} handler */ static setLinkHandler(handler) { - WebInspector.Linkifier._linkHandler = handler; + Components.Linkifier._linkHandler = handler; } /** @@ -89,9 +89,9 @@ * @return {boolean} */ static handleLink(url, lineNumber) { - if (!WebInspector.Linkifier._linkHandler) + if (!Components.Linkifier._linkHandler) return false; - return WebInspector.Linkifier._linkHandler.handleLink(url, lineNumber); + return Components.Linkifier._linkHandler.handleLink(url, lineNumber); } /** @@ -106,7 +106,7 @@ static linkifyUsingRevealer(revealable, text, fallbackHref, fallbackLineNumber, title, classes) { var a = createElement('a'); a.className = (classes || '') + ' webkit-html-resource-link'; - a.textContent = text.trimMiddle(WebInspector.Linkifier.MaxLengthForDisplayedURLs); + a.textContent = text.trimMiddle(Components.Linkifier.MaxLengthForDisplayedURLs); a.title = title || text; if (fallbackHref) { a.href = fallbackHref; @@ -120,10 +120,10 @@ function clickHandler(event) { event.stopImmediatePropagation(); event.preventDefault(); - if (fallbackHref && WebInspector.Linkifier.handleLink(fallbackHref, fallbackLineNumber)) + if (fallbackHref && Components.Linkifier.handleLink(fallbackHref, fallbackLineNumber)) return; - WebInspector.Revealer.reveal(this); + Common.Revealer.reveal(this); } a.addEventListener('click', clickHandler.bind(revealable), false); return a; @@ -131,25 +131,25 @@ /** * @param {!Element} anchor - * @return {?WebInspector.UILocation} uiLocation + * @return {?Workspace.UILocation} uiLocation */ static uiLocationByAnchor(anchor) { - return anchor[WebInspector.Linkifier._uiLocationSymbol]; + return anchor[Components.Linkifier._uiLocationSymbol]; } /** * @param {!Element} anchor - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation */ static _bindUILocation(anchor, uiLocation) { - anchor[WebInspector.Linkifier._uiLocationSymbol] = uiLocation; + anchor[Components.Linkifier._uiLocationSymbol] = uiLocation; if (!uiLocation) return; var uiSourceCode = uiLocation.uiSourceCode; - var sourceCodeAnchors = uiSourceCode[WebInspector.Linkifier._sourceCodeAnchors]; + var sourceCodeAnchors = uiSourceCode[Components.Linkifier._sourceCodeAnchors]; if (!sourceCodeAnchors) { sourceCodeAnchors = new Set(); - uiSourceCode[WebInspector.Linkifier._sourceCodeAnchors] = sourceCodeAnchors; + uiSourceCode[Components.Linkifier._sourceCodeAnchors] = sourceCodeAnchors; } sourceCodeAnchors.add(anchor); } @@ -158,71 +158,71 @@ * @param {!Element} anchor */ static _unbindUILocation(anchor) { - if (!anchor[WebInspector.Linkifier._uiLocationSymbol]) + if (!anchor[Components.Linkifier._uiLocationSymbol]) return; - var uiSourceCode = anchor[WebInspector.Linkifier._uiLocationSymbol].uiSourceCode; - anchor[WebInspector.Linkifier._uiLocationSymbol] = null; - var sourceCodeAnchors = uiSourceCode[WebInspector.Linkifier._sourceCodeAnchors]; + var uiSourceCode = anchor[Components.Linkifier._uiLocationSymbol].uiSourceCode; + anchor[Components.Linkifier._uiLocationSymbol] = null; + var sourceCodeAnchors = uiSourceCode[Components.Linkifier._sourceCodeAnchors]; if (sourceCodeAnchors) sourceCodeAnchors.delete(anchor); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} scriptId * @param {number} lineNumber * @param {number=} columnNumber * @return {string} */ static liveLocationText(target, scriptId, lineNumber, columnNumber) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return ''; var script = debuggerModel.scriptForId(scriptId); if (!script) return ''; - var location = /** @type {!WebInspector.DebuggerModel.Location} */ ( + var location = /** @type {!SDK.DebuggerModel.Location} */ ( debuggerModel.createRawLocation(script, lineNumber, columnNumber || 0)); - var uiLocation = /** @type {!WebInspector.UILocation} */ ( - WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location)); + var uiLocation = /** @type {!Workspace.UILocation} */ ( + Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location)); return uiLocation.linkText(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._anchorsByTarget.set(target, []); - this._locationPoolByTarget.set(target, new WebInspector.LiveLocationPool()); + this._locationPoolByTarget.set(target, new Bindings.LiveLocationPool()); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var locationPool = /** @type {!WebInspector.LiveLocationPool} */ (this._locationPoolByTarget.remove(target)); + var locationPool = /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.remove(target)); locationPool.disposeAll(); var anchors = this._anchorsByTarget.remove(target); for (var anchor of anchors) { - delete anchor[WebInspector.Linkifier._liveLocationSymbol]; - WebInspector.Linkifier._unbindUILocation(anchor); - var fallbackAnchor = anchor[WebInspector.Linkifier._fallbackAnchorSymbol]; + delete anchor[Components.Linkifier._liveLocationSymbol]; + Components.Linkifier._unbindUILocation(anchor); + var fallbackAnchor = anchor[Components.Linkifier._fallbackAnchorSymbol]; if (fallbackAnchor) { anchor.href = fallbackAnchor.href; anchor.lineNumber = fallbackAnchor.lineNumber; anchor.title = fallbackAnchor.title; anchor.className = fallbackAnchor.className; anchor.textContent = fallbackAnchor.textContent; - delete anchor[WebInspector.Linkifier._fallbackAnchorSymbol]; + delete anchor[Components.Linkifier._fallbackAnchorSymbol]; } } } /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {?string} scriptId * @param {string} sourceURL * @param {number} lineNumber @@ -232,10 +232,10 @@ */ maybeLinkifyScriptLocation(target, scriptId, sourceURL, lineNumber, columnNumber, classes) { var fallbackAnchor = - sourceURL ? WebInspector.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes) : null; + sourceURL ? Components.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes) : null; if (!target || target.isDisposed()) return fallbackAnchor; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return fallbackAnchor; @@ -246,18 +246,18 @@ return fallbackAnchor; var anchor = this._createAnchor(classes); - var liveLocation = WebInspector.debuggerWorkspaceBinding.createLiveLocation( + var liveLocation = Bindings.debuggerWorkspaceBinding.createLiveLocation( rawLocation, this._updateAnchor.bind(this, anchor), - /** @type {!WebInspector.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.target()))); + /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.target()))); var anchors = /** @type {!Array<!Element>} */ (this._anchorsByTarget.get(rawLocation.target())); anchors.push(anchor); - anchor[WebInspector.Linkifier._liveLocationSymbol] = liveLocation; - anchor[WebInspector.Linkifier._fallbackAnchorSymbol] = fallbackAnchor; + anchor[Components.Linkifier._liveLocationSymbol] = liveLocation; + anchor[Components.Linkifier._fallbackAnchorSymbol] = fallbackAnchor; return anchor; } /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {?string} scriptId * @param {string} sourceURL * @param {number} lineNumber @@ -267,11 +267,11 @@ */ linkifyScriptLocation(target, scriptId, sourceURL, lineNumber, columnNumber, classes) { return this.maybeLinkifyScriptLocation(target, scriptId, sourceURL, lineNumber, columnNumber, classes) || - WebInspector.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes); + Components.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes); } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation + * @param {!SDK.DebuggerModel.Location} rawLocation * @param {string} fallbackUrl * @param {string=} classes * @return {!Element} @@ -283,7 +283,7 @@ } /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {!Protocol.Runtime.CallFrame} callFrame * @param {string=} classes * @return {?Element} @@ -294,7 +294,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Runtime.StackTrace} stackTrace * @param {string=} classes * @return {!Element} @@ -304,53 +304,53 @@ var topFrame = stackTrace.callFrames[0]; var fallbackAnchor = - WebInspector.linkifyResourceAsNode(topFrame.url, topFrame.lineNumber, topFrame.columnNumber, classes); + Components.linkifyResourceAsNode(topFrame.url, topFrame.lineNumber, topFrame.columnNumber, classes); if (target.isDisposed()) return fallbackAnchor; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); var rawLocations = debuggerModel.createRawLocationsByStackTrace(stackTrace); if (rawLocations.length === 0) return fallbackAnchor; var anchor = this._createAnchor(classes); - var liveLocation = WebInspector.debuggerWorkspaceBinding.createStackTraceTopFrameLiveLocation( + var liveLocation = Bindings.debuggerWorkspaceBinding.createStackTraceTopFrameLiveLocation( rawLocations, this._updateAnchor.bind(this, anchor), - /** @type {!WebInspector.LiveLocationPool} */ (this._locationPoolByTarget.get(target))); + /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.get(target))); var anchors = /** @type {!Array<!Element>} */ (this._anchorsByTarget.get(target)); anchors.push(anchor); - anchor[WebInspector.Linkifier._liveLocationSymbol] = liveLocation; - anchor[WebInspector.Linkifier._fallbackAnchorSymbol] = fallbackAnchor; + anchor[Components.Linkifier._liveLocationSymbol] = liveLocation; + anchor[Components.Linkifier._fallbackAnchorSymbol] = fallbackAnchor; return anchor; } /** - * @param {!WebInspector.CSSLocation} rawLocation + * @param {!SDK.CSSLocation} rawLocation * @param {string=} classes * @return {!Element} */ linkifyCSSLocation(rawLocation, classes) { var anchor = this._createAnchor(classes); - var liveLocation = WebInspector.cssWorkspaceBinding.createLiveLocation( + var liveLocation = Bindings.cssWorkspaceBinding.createLiveLocation( rawLocation, this._updateAnchor.bind(this, anchor), - /** @type {!WebInspector.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.target()))); + /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.target()))); var anchors = /** @type {!Array<!Element>} */ (this._anchorsByTarget.get(rawLocation.target())); anchors.push(anchor); - anchor[WebInspector.Linkifier._liveLocationSymbol] = liveLocation; + anchor[Components.Linkifier._liveLocationSymbol] = liveLocation; return anchor; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Element} anchor */ disposeAnchor(target, anchor) { - WebInspector.Linkifier._unbindUILocation(anchor); - delete anchor[WebInspector.Linkifier._fallbackAnchorSymbol]; - var liveLocation = anchor[WebInspector.Linkifier._liveLocationSymbol]; + Components.Linkifier._unbindUILocation(anchor); + delete anchor[Components.Linkifier._fallbackAnchorSymbol]; + var liveLocation = anchor[Components.Linkifier._liveLocationSymbol]; if (liveLocation) liveLocation.dispose(); - delete anchor[WebInspector.Linkifier._liveLocationSymbol]; + delete anchor[Components.Linkifier._liveLocationSymbol]; } /** @@ -360,21 +360,21 @@ _createAnchor(classes) { var anchor = createElement('a'); if (this._useLinkDecorator) - anchor[WebInspector.Linkifier._enableDecoratorSymbol] = true; + anchor[Components.Linkifier._enableDecoratorSymbol] = true; anchor.className = (classes || '') + ' webkit-html-resource-link'; /** * @param {!Event} event */ function clickHandler(event) { - var uiLocation = anchor[WebInspector.Linkifier._uiLocationSymbol]; + var uiLocation = anchor[Components.Linkifier._uiLocationSymbol]; if (!uiLocation) return; event.consume(true); - if (WebInspector.Linkifier.handleLink(uiLocation.uiSourceCode.url(), uiLocation.lineNumber)) + if (Components.Linkifier.handleLink(uiLocation.uiSourceCode.url(), uiLocation.lineNumber)) return; - WebInspector.Revealer.reveal(uiLocation); + Common.Revealer.reveal(uiLocation); } anchor.addEventListener('click', clickHandler, false); return anchor; @@ -390,21 +390,21 @@ dispose() { for (var target of this._anchorsByTarget.keysArray()) this.targetRemoved(target); - WebInspector.targetManager.unobserveTargets(this); - WebInspector.Linkifier._instances.delete(this); + SDK.targetManager.unobserveTargets(this); + Components.Linkifier._instances.delete(this); } /** * @param {!Element} anchor - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!Bindings.LiveLocation} liveLocation */ _updateAnchor(anchor, liveLocation) { - WebInspector.Linkifier._unbindUILocation(anchor); + Components.Linkifier._unbindUILocation(anchor); var uiLocation = liveLocation.uiLocation(); if (!uiLocation) return; - WebInspector.Linkifier._bindUILocation(anchor, uiLocation); + Components.Linkifier._bindUILocation(anchor, uiLocation); var text = uiLocation.linkText(); text = text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, '$1\u2026'); if (this._maxLength) @@ -416,62 +416,62 @@ titleText += ':' + (uiLocation.lineNumber + 1); anchor.title = titleText; anchor.classList.toggle('webkit-html-blackbox-link', liveLocation.isBlackboxed()); - WebInspector.Linkifier._updateLinkDecorations(anchor); + Components.Linkifier._updateLinkDecorations(anchor); } /** * @param {!Element} anchor */ static _updateLinkDecorations(anchor) { - if (!anchor[WebInspector.Linkifier._enableDecoratorSymbol]) + if (!anchor[Components.Linkifier._enableDecoratorSymbol]) return; - var uiLocation = anchor[WebInspector.Linkifier._uiLocationSymbol]; - if (!WebInspector.Linkifier._decorator || !uiLocation) + var uiLocation = anchor[Components.Linkifier._uiLocationSymbol]; + if (!Components.Linkifier._decorator || !uiLocation) return; - var icon = anchor[WebInspector.Linkifier._iconSymbol]; + var icon = anchor[Components.Linkifier._iconSymbol]; if (icon) icon.remove(); - icon = WebInspector.Linkifier._decorator.linkIcon(uiLocation.uiSourceCode); + icon = Components.Linkifier._decorator.linkIcon(uiLocation.uiSourceCode); if (icon) { icon.style.setProperty('margin-right', '2px'); anchor.insertBefore(icon, anchor.firstChild); } - anchor[WebInspector.Linkifier._iconSymbol] = icon; + anchor[Components.Linkifier._iconSymbol] = icon; } }; -/** @type {!Set<!WebInspector.Linkifier>} */ -WebInspector.Linkifier._instances = new Set(); -/** @type {?WebInspector.LinkDecorator} */ -WebInspector.Linkifier._decorator = null; +/** @type {!Set<!Components.Linkifier>} */ +Components.Linkifier._instances = new Set(); +/** @type {?Components.LinkDecorator} */ +Components.Linkifier._decorator = null; -WebInspector.Linkifier._iconSymbol = Symbol('Linkifier.iconSymbol'); -WebInspector.Linkifier._enableDecoratorSymbol = Symbol('Linkifier.enableIconsSymbol'); -WebInspector.Linkifier._sourceCodeAnchors = Symbol('Linkifier.anchors'); -WebInspector.Linkifier._uiLocationSymbol = Symbol('uiLocation'); -WebInspector.Linkifier._fallbackAnchorSymbol = Symbol('fallbackAnchor'); -WebInspector.Linkifier._liveLocationSymbol = Symbol('liveLocation'); +Components.Linkifier._iconSymbol = Symbol('Linkifier.iconSymbol'); +Components.Linkifier._enableDecoratorSymbol = Symbol('Linkifier.enableIconsSymbol'); +Components.Linkifier._sourceCodeAnchors = Symbol('Linkifier.anchors'); +Components.Linkifier._uiLocationSymbol = Symbol('uiLocation'); +Components.Linkifier._fallbackAnchorSymbol = Symbol('fallbackAnchor'); +Components.Linkifier._liveLocationSymbol = Symbol('liveLocation'); /** * The maximum number of characters to display in a URL. * @const * @type {number} */ -WebInspector.Linkifier.MaxLengthForDisplayedURLs = 150; +Components.Linkifier.MaxLengthForDisplayedURLs = 150; /** * The maximum length before strings are considered too long for finding URLs. * @const * @type {number} */ -WebInspector.Linkifier.MaxLengthToIgnoreLinkifier = 10000; +Components.Linkifier.MaxLengthToIgnoreLinkifier = 10000; /** * @interface */ -WebInspector.Linkifier.LinkHandler = function() {}; +Components.Linkifier.LinkHandler = function() {}; -WebInspector.Linkifier.LinkHandler.prototype = { +Components.Linkifier.LinkHandler.prototype = { /** * @param {string} url * @param {number=} lineNumber @@ -481,20 +481,20 @@ }; /** - * @extends {WebInspector.EventTarget} + * @extends {Common.EventTarget} * @interface */ -WebInspector.LinkDecorator = function() {}; +Components.LinkDecorator = function() {}; -WebInspector.LinkDecorator.prototype = { +Components.LinkDecorator.prototype = { /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.Icon} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?UI.Icon} */ linkIcon: function(uiSourceCode) {} }; -WebInspector.LinkDecorator.Events = { +Components.LinkDecorator.Events = { LinkIconChanged: Symbol('LinkIconChanged') }; @@ -503,13 +503,13 @@ * @param {function(string,string,number=,number=):!Node} linkifier * @return {!DocumentFragment} */ -WebInspector.linkifyStringAsFragmentWithCustomLinkifier = function(string, linkifier) { +Components.linkifyStringAsFragmentWithCustomLinkifier = function(string, linkifier) { var container = createDocumentFragment(); var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|data:|www\.)[\w$\-_+*'=\|\/\\(){}[\]^%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({^%@&#~]/; var pathLineRegex = /(?:\/[\w\.-]*)+\:[\d]+/; - while (string && string.length < WebInspector.Linkifier.MaxLengthToIgnoreLinkifier) { + while (string && string.length < Components.Linkifier.MaxLengthToIgnoreLinkifier) { var linkString = linkStringRegEx.exec(string) || pathLineRegex.exec(string); if (!linkString) break; @@ -521,7 +521,7 @@ var title = linkString; var realURL = (linkString.startsWith('www.') ? 'http://' + linkString : linkString); - var splitResult = WebInspector.ParsedURL.splitLineAndColumn(realURL); + var splitResult = Common.ParsedURL.splitLineAndColumn(realURL); var linkNode; if (splitResult) linkNode = linkifier(title, splitResult.url, splitResult.lineNumber, splitResult.columnNumber); @@ -542,7 +542,7 @@ * @param {string} string * @return {!DocumentFragment} */ -WebInspector.linkifyStringAsFragment = function(string) { +Components.linkifyStringAsFragment = function(string) { /** * @param {string} title * @param {string} url @@ -552,8 +552,8 @@ */ function linkifier(title, url, lineNumber, columnNumber) { var isExternal = - !WebInspector.resourceForURL(url) && !WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url); - var urlNode = WebInspector.linkifyURLAsNode(url, title, undefined, isExternal); + !Bindings.resourceForURL(url) && !Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(url); + var urlNode = UI.linkifyURLAsNode(url, title, undefined, isExternal); if (typeof lineNumber !== 'undefined') { urlNode.lineNumber = lineNumber; if (typeof columnNumber !== 'undefined') @@ -563,7 +563,7 @@ return urlNode; } - return WebInspector.linkifyStringAsFragmentWithCustomLinkifier(string, linkifier); + return Components.linkifyStringAsFragmentWithCustomLinkifier(string, linkifier); }; /** @@ -575,27 +575,27 @@ * @param {string=} urlDisplayName * @return {!Element} */ -WebInspector.linkifyResourceAsNode = function(url, lineNumber, columnNumber, classes, tooltipText, urlDisplayName) { +Components.linkifyResourceAsNode = function(url, lineNumber, columnNumber, classes, tooltipText, urlDisplayName) { if (!url) { var element = createElementWithClass('span', classes); - element.textContent = urlDisplayName || WebInspector.UIString('(unknown)'); + element.textContent = urlDisplayName || Common.UIString('(unknown)'); return element; } - var linkText = urlDisplayName || WebInspector.displayNameForURL(url); + var linkText = urlDisplayName || Bindings.displayNameForURL(url); if (typeof lineNumber === 'number') linkText += ':' + (lineNumber + 1); - var anchor = WebInspector.linkifyURLAsNode(url, linkText, classes, false, tooltipText); + var anchor = UI.linkifyURLAsNode(url, linkText, classes, false, tooltipText); anchor.lineNumber = lineNumber; anchor.columnNumber = columnNumber; return anchor; }; /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {!Element} */ -WebInspector.linkifyRequestAsNode = function(request) { - var anchor = WebInspector.linkifyURLAsNode(request.url); +Components.linkifyRequestAsNode = function(request) { + var anchor = UI.linkifyURLAsNode(request.url); anchor.requestId = request.requestId; return anchor; };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js index f77e895..f096a83f 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js +++ b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js
@@ -4,19 +4,19 @@ /** * @unrestricted */ -WebInspector.NetworkConditionsSelector = class { +Components.NetworkConditionsSelector = class { /** - * @param {function(!Array<!WebInspector.NetworkConditionsGroup>):!Array<?WebInspector.NetworkManager.Conditions>} populateCallback + * @param {function(!Array<!Components.NetworkConditionsGroup>):!Array<?SDK.NetworkManager.Conditions>} populateCallback * @param {function(number)} selectCallback */ constructor(populateCallback, selectCallback) { this._populateCallback = populateCallback; this._selectCallback = selectCallback; - this._customSetting = WebInspector.moduleSetting('customNetworkConditions'); + this._customSetting = Common.moduleSetting('customNetworkConditions'); this._customSetting.addChangeListener(this._populateOptions, this); - this._manager = WebInspector.multitargetNetworkManager; + this._manager = SDK.multitargetNetworkManager; this._manager.addEventListener( - WebInspector.MultitargetNetworkManager.Events.ConditionsChanged, this._conditionsChanged, this); + SDK.MultitargetNetworkManager.Events.ConditionsChanged, this._conditionsChanged, this); this._populateOptions(); } @@ -31,14 +31,14 @@ var throughputInKbps = throughput / (1024 / 8); var delimiter = plainText ? '' : ' '; if (throughputInKbps < 1024) - return WebInspector.UIString('%d%skb/s', throughputInKbps, delimiter); + return Common.UIString('%d%skb/s', throughputInKbps, delimiter); if (throughputInKbps < 1024 * 10) - return WebInspector.UIString('%.1f%sMb/s', throughputInKbps / 1024, delimiter); - return WebInspector.UIString('%d%sMb/s', (throughputInKbps / 1024) | 0, delimiter); + return Common.UIString('%.1f%sMb/s', throughputInKbps / 1024, delimiter); + return Common.UIString('%d%sMb/s', (throughputInKbps / 1024) | 0, delimiter); } /** - * @param {!WebInspector.NetworkManager.Conditions} conditions + * @param {!SDK.NetworkManager.Conditions} conditions * @param {boolean=} plainText * @return {!{text: string, title: string}} */ @@ -46,17 +46,17 @@ var downloadInKbps = conditions.download / (1024 / 8); var uploadInKbps = conditions.upload / (1024 / 8); var isThrottling = (downloadInKbps >= 0) || (uploadInKbps >= 0) || (conditions.latency > 0); - var conditionTitle = WebInspector.UIString(conditions.title); + var conditionTitle = Common.UIString(conditions.title); if (!isThrottling) return {text: conditionTitle, title: conditionTitle}; - var downloadText = WebInspector.NetworkConditionsSelector._throughputText(conditions.download, plainText); - var uploadText = WebInspector.NetworkConditionsSelector._throughputText(conditions.upload, plainText); + var downloadText = Components.NetworkConditionsSelector._throughputText(conditions.download, plainText); + var uploadText = Components.NetworkConditionsSelector._throughputText(conditions.upload, plainText); var pattern = plainText ? '%s (%dms, %s, %s)' : '%s (%dms RTT, %s\u2b07, %s\u2b06)'; - var title = WebInspector.UIString(pattern, conditionTitle, conditions.latency, downloadText, uploadText); + var title = Common.UIString(pattern, conditionTitle, conditions.latency, downloadText, uploadText); return { text: title, - title: WebInspector.UIString( + title: Common.UIString( 'Maximum download throughput: %s.\r\nMaximum upload throughput: %s.\r\nMinimum round-trip time: %dms.', downloadText, uploadText, conditions.latency) }; @@ -67,12 +67,12 @@ */ static decorateSelect(selectElement) { var options = []; - var selector = new WebInspector.NetworkConditionsSelector(populate, select); + var selector = new Components.NetworkConditionsSelector(populate, select); selectElement.addEventListener('change', optionSelected, false); /** - * @param {!Array.<!WebInspector.NetworkConditionsGroup>} groups - * @return {!Array<?WebInspector.NetworkManager.Conditions>} + * @param {!Array.<!Components.NetworkConditionsGroup>} groups + * @return {!Array<?SDK.NetworkManager.Conditions>} */ function populate(groups) { selectElement.removeChildren(); @@ -82,11 +82,11 @@ var groupElement = selectElement.createChild('optgroup'); groupElement.label = group.title; if (!i) { - groupElement.appendChild(new Option(WebInspector.UIString('Add\u2026'), WebInspector.UIString('Add\u2026'))); + groupElement.appendChild(new Option(Common.UIString('Add\u2026'), Common.UIString('Add\u2026'))); options.push(null); } for (var conditions of group.items) { - var title = WebInspector.NetworkConditionsSelector._conditionsTitle(conditions, true); + var title = Components.NetworkConditionsSelector._conditionsTitle(conditions, true); var option = new Option(title.text, title.text); option.title = title.title; groupElement.appendChild(option); @@ -113,21 +113,21 @@ } /** - * @return {!WebInspector.ToolbarMenuButton} + * @return {!UI.ToolbarMenuButton} */ static createToolbarMenuButton() { - var button = new WebInspector.ToolbarMenuButton(appendItems); + var button = new UI.ToolbarMenuButton(appendItems); button.setGlyph(''); button.turnIntoSelect(); - /** @type {!Array<?WebInspector.NetworkManager.Conditions>} */ + /** @type {!Array<?SDK.NetworkManager.Conditions>} */ var options = []; var selectedIndex = -1; - var selector = new WebInspector.NetworkConditionsSelector(populate, select); + var selector = new Components.NetworkConditionsSelector(populate, select); return button; /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ function appendItems(contextMenu) { for (var index = 0; index < options.length; ++index) { @@ -136,15 +136,15 @@ contextMenu.appendSeparator(); else contextMenu.appendCheckboxItem( - WebInspector.NetworkConditionsSelector._conditionsTitle(conditions, true).text, + Components.NetworkConditionsSelector._conditionsTitle(conditions, true).text, selector.optionSelected.bind(selector, conditions), selectedIndex === index); } - contextMenu.appendItem(WebInspector.UIString('Edit\u2026'), selector.revealAndUpdate.bind(selector)); + contextMenu.appendItem(Common.UIString('Edit\u2026'), selector.revealAndUpdate.bind(selector)); } /** - * @param {!Array.<!WebInspector.NetworkConditionsGroup>} groups - * @return {!Array<?WebInspector.NetworkManager.Conditions>} + * @param {!Array.<!Components.NetworkConditionsGroup>} groups + * @return {!Array<?SDK.NetworkManager.Conditions>} */ function populate(groups) { options = []; @@ -166,52 +166,52 @@ } /** - * @return {!WebInspector.ToolbarCheckbox} + * @return {!UI.ToolbarCheckbox} */ static createOfflineToolbarCheckbox() { - var checkbox = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Offline'), WebInspector.UIString('Force disconnected from network'), undefined, + var checkbox = new UI.ToolbarCheckbox( + Common.UIString('Offline'), Common.UIString('Force disconnected from network'), undefined, forceOffline); - WebInspector.multitargetNetworkManager.addEventListener( - WebInspector.MultitargetNetworkManager.Events.ConditionsChanged, networkConditionsChanged); + SDK.multitargetNetworkManager.addEventListener( + SDK.MultitargetNetworkManager.Events.ConditionsChanged, networkConditionsChanged); checkbox.setChecked( - WebInspector.multitargetNetworkManager.networkConditions() === WebInspector.NetworkManager.OfflineConditions); + SDK.multitargetNetworkManager.networkConditions() === SDK.NetworkManager.OfflineConditions); var lastNetworkConditions; function forceOffline() { if (checkbox.checked()) { - lastNetworkConditions = WebInspector.multitargetNetworkManager.networkConditions(); - WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspector.NetworkManager.OfflineConditions); + lastNetworkConditions = SDK.multitargetNetworkManager.networkConditions(); + SDK.multitargetNetworkManager.setNetworkConditions(SDK.NetworkManager.OfflineConditions); } else { - WebInspector.multitargetNetworkManager.setNetworkConditions(lastNetworkConditions); + SDK.multitargetNetworkManager.setNetworkConditions(lastNetworkConditions); } } function networkConditionsChanged() { - var conditions = WebInspector.multitargetNetworkManager.networkConditions(); - if (conditions !== WebInspector.NetworkManager.OfflineConditions) + var conditions = SDK.multitargetNetworkManager.networkConditions(); + if (conditions !== SDK.NetworkManager.OfflineConditions) lastNetworkConditions = conditions; - checkbox.setChecked(conditions === WebInspector.NetworkManager.OfflineConditions); + checkbox.setChecked(conditions === SDK.NetworkManager.OfflineConditions); } return checkbox; } _populateOptions() { - var customGroup = {title: WebInspector.UIString('Custom'), items: this._customSetting.get()}; + var customGroup = {title: Common.UIString('Custom'), items: this._customSetting.get()}; var presetsGroup = { - title: WebInspector.UIString('Presets'), - items: WebInspector.NetworkConditionsSelector._presets + title: Common.UIString('Presets'), + items: Components.NetworkConditionsSelector._presets }; var disabledGroup = { - title: WebInspector.UIString('Disabled'), - items: [WebInspector.NetworkManager.NoThrottlingConditions] + title: Common.UIString('Disabled'), + items: [SDK.NetworkManager.NoThrottlingConditions] }; this._options = this._populateCallback([customGroup, presetsGroup, disabledGroup]); if (!this._conditionsChanged()) { for (var i = this._options.length - 1; i >= 0; i--) { if (this._options[i]) { - this.optionSelected(/** @type {!WebInspector.NetworkManager.Conditions} */ (this._options[i])); + this.optionSelected(/** @type {!SDK.NetworkManager.Conditions} */ (this._options[i])); break; } } @@ -219,12 +219,12 @@ } revealAndUpdate() { - WebInspector.Revealer.reveal(this._customSetting); + Common.Revealer.reveal(this._customSetting); this._conditionsChanged(); } /** - * @param {!WebInspector.NetworkManager.Conditions} conditions + * @param {!SDK.NetworkManager.Conditions} conditions */ optionSelected(conditions) { this._manager.setNetworkConditions(conditions); @@ -247,13 +247,13 @@ } }; -/** @typedef {!{title: string, items: !Array<!WebInspector.NetworkManager.Conditions>}} */ -WebInspector.NetworkConditionsGroup; +/** @typedef {!{title: string, items: !Array<!SDK.NetworkManager.Conditions>}} */ +Components.NetworkConditionsGroup; -/** @type {!Array.<!WebInspector.NetworkManager.Conditions>} */ -WebInspector.NetworkConditionsSelector._presets = [ - WebInspector.NetworkManager.OfflineConditions, +/** @type {!Array.<!SDK.NetworkManager.Conditions>} */ +Components.NetworkConditionsSelector._presets = [ + SDK.NetworkManager.OfflineConditions, {title: 'GPRS', download: 50 * 1024 / 8, upload: 20 * 1024 / 8, latency: 500}, {title: 'Regular 2G', download: 250 * 1024 / 8, upload: 50 * 1024 / 8, latency: 300}, {title: 'Good 2G', download: 450 * 1024 / 8, upload: 150 * 1024 / 8, latency: 150}, @@ -266,26 +266,26 @@ /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.NetworkConditionsSettingsTab = class extends WebInspector.VBox { +Components.NetworkConditionsSettingsTab = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('components/networkConditionsSettingsTab.css'); - this.contentElement.createChild('div', 'header').textContent = WebInspector.UIString('Network Throttling Profiles'); + this.contentElement.createChild('div', 'header').textContent = Common.UIString('Network Throttling Profiles'); var addButton = createTextButton( - WebInspector.UIString('Add custom profile...'), this._addButtonClicked.bind(this), 'add-conditions-button'); + Common.UIString('Add custom profile...'), this._addButtonClicked.bind(this), 'add-conditions-button'); this.contentElement.appendChild(addButton); - this._list = new WebInspector.ListWidget(this); + this._list = new UI.ListWidget(this); this._list.element.classList.add('conditions-list'); this._list.registerRequiredCSS('components/networkConditionsSettingsTab.css'); this._list.show(this.contentElement); - this._customSetting = WebInspector.moduleSetting('customNetworkConditions'); + this._customSetting = Common.moduleSetting('customNetworkConditions'); this._customSetting.addChangeListener(this._conditionsUpdated, this); this.setDefaultFocusedElement(addButton); @@ -309,7 +309,7 @@ this._list.appendSeparator(); - conditions = WebInspector.NetworkConditionsSelector._presets; + conditions = Components.NetworkConditionsSelector._presets; for (var i = 0; i < conditions.length; ++i) this._list.appendItem(conditions[i], false); } @@ -325,7 +325,7 @@ * @return {!Element} */ renderItem(item, editable) { - var conditions = /** @type {!WebInspector.NetworkManager.Conditions} */ (item); + var conditions = /** @type {!SDK.NetworkManager.Conditions} */ (item); var element = createElementWithClass('div', 'conditions-list-item'); var title = element.createChild('div', 'conditions-list-text conditions-list-title'); var titleText = title.createChild('div', 'conditions-list-title-text'); @@ -333,12 +333,12 @@ titleText.title = conditions.title; element.createChild('div', 'conditions-list-separator'); element.createChild('div', 'conditions-list-text').textContent = - WebInspector.NetworkConditionsSelector._throughputText(conditions.download); + Components.NetworkConditionsSelector._throughputText(conditions.download); element.createChild('div', 'conditions-list-separator'); element.createChild('div', 'conditions-list-text').textContent = - WebInspector.NetworkConditionsSelector._throughputText(conditions.upload); + Components.NetworkConditionsSelector._throughputText(conditions.upload); element.createChild('div', 'conditions-list-separator'); - element.createChild('div', 'conditions-list-text').textContent = WebInspector.UIString('%dms', conditions.latency); + element.createChild('div', 'conditions-list-text').textContent = Common.UIString('%dms', conditions.latency); return element; } @@ -356,11 +356,11 @@ /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { - var conditions = /** @type {?WebInspector.NetworkManager.Conditions} */ (item); + var conditions = /** @type {?SDK.NetworkManager.Conditions} */ (item); conditions.title = editor.control('title').value.trim(); var download = editor.control('download').value.trim(); conditions.download = download ? parseInt(download, 10) * (1024 / 8) : -1; @@ -378,10 +378,10 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { - var conditions = /** @type {?WebInspector.NetworkManager.Conditions} */ (item); + var conditions = /** @type {?SDK.NetworkManager.Conditions} */ (item); var editor = this._createEditor(); editor.control('title').value = conditions.title; editor.control('download').value = conditions.download <= 0 ? '' : String(conditions.download / (1024 / 8)); @@ -391,25 +391,25 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createEditor() { if (this._editor) return this._editor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._editor = editor; var content = editor.contentElement(); var titles = content.createChild('div', 'conditions-edit-row'); titles.createChild('div', 'conditions-list-text conditions-list-title').textContent = - WebInspector.UIString('Profile Name'); + Common.UIString('Profile Name'); titles.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); - titles.createChild('div', 'conditions-list-text').textContent = WebInspector.UIString('Download'); + titles.createChild('div', 'conditions-list-text').textContent = Common.UIString('Download'); titles.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); - titles.createChild('div', 'conditions-list-text').textContent = WebInspector.UIString('Upload'); + titles.createChild('div', 'conditions-list-text').textContent = Common.UIString('Upload'); titles.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); - titles.createChild('div', 'conditions-list-text').textContent = WebInspector.UIString('Latency'); + titles.createChild('div', 'conditions-list-text').textContent = Common.UIString('Latency'); var fields = content.createChild('div', 'conditions-edit-row'); fields.createChild('div', 'conditions-list-text conditions-list-title') @@ -417,18 +417,18 @@ fields.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); var cell = fields.createChild('div', 'conditions-list-text'); - cell.appendChild(editor.createInput('download', 'text', WebInspector.UIString('kb/s'), throughputValidator)); - cell.createChild('div', 'conditions-edit-optional').textContent = WebInspector.UIString('optional'); + cell.appendChild(editor.createInput('download', 'text', Common.UIString('kb/s'), throughputValidator)); + cell.createChild('div', 'conditions-edit-optional').textContent = Common.UIString('optional'); fields.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); cell = fields.createChild('div', 'conditions-list-text'); - cell.appendChild(editor.createInput('upload', 'text', WebInspector.UIString('kb/s'), throughputValidator)); - cell.createChild('div', 'conditions-edit-optional').textContent = WebInspector.UIString('optional'); + cell.appendChild(editor.createInput('upload', 'text', Common.UIString('kb/s'), throughputValidator)); + cell.createChild('div', 'conditions-edit-optional').textContent = Common.UIString('optional'); fields.createChild('div', 'conditions-list-separator conditions-list-separator-invisible'); cell = fields.createChild('div', 'conditions-list-text'); - cell.appendChild(editor.createInput('latency', 'text', WebInspector.UIString('ms'), latencyValidator)); - cell.createChild('div', 'conditions-edit-optional').textContent = WebInspector.UIString('optional'); + cell.appendChild(editor.createInput('latency', 'text', Common.UIString('ms'), latencyValidator)); + cell.createChild('div', 'conditions-edit-optional').textContent = Common.UIString('optional'); return editor; @@ -468,23 +468,23 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.NetworkConditionsActionDelegate = class { +Components.NetworkConditionsActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { if (actionId === 'components.network-online') { - WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspector.NetworkManager.NoThrottlingConditions); + SDK.multitargetNetworkManager.setNetworkConditions(SDK.NetworkManager.NoThrottlingConditions); return true; } if (actionId === 'components.network-offline') { - WebInspector.multitargetNetworkManager.setNetworkConditions(WebInspector.NetworkManager.OfflineConditions); + SDK.multitargetNetworkManager.setNetworkConditions(SDK.NetworkManager.OfflineConditions); return true; } return false; @@ -495,17 +495,17 @@ * @param {?Protocol.Network.ResourcePriority} priority * @return {string} */ -WebInspector.uiLabelForPriority = function(priority) { - var labelMap = WebInspector.uiLabelForPriority._priorityToUILabel; +Components.uiLabelForPriority = function(priority) { + var labelMap = Components.uiLabelForPriority._priorityToUILabel; if (!labelMap) { labelMap = new Map([ - [Protocol.Network.ResourcePriority.VeryLow, WebInspector.UIString('Lowest')], - [Protocol.Network.ResourcePriority.Low, WebInspector.UIString('Low')], - [Protocol.Network.ResourcePriority.Medium, WebInspector.UIString('Medium')], - [Protocol.Network.ResourcePriority.High, WebInspector.UIString('High')], - [Protocol.Network.ResourcePriority.VeryHigh, WebInspector.UIString('Highest')] + [Protocol.Network.ResourcePriority.VeryLow, Common.UIString('Lowest')], + [Protocol.Network.ResourcePriority.Low, Common.UIString('Low')], + [Protocol.Network.ResourcePriority.Medium, Common.UIString('Medium')], + [Protocol.Network.ResourcePriority.High, Common.UIString('High')], + [Protocol.Network.ResourcePriority.VeryHigh, Common.UIString('Highest')] ]); - WebInspector.uiLabelForPriority._priorityToUILabel = labelMap; + Components.uiLabelForPriority._priorityToUILabel = labelMap; } - return labelMap.get(priority) || WebInspector.UIString('Unknown'); + return labelMap.get(priority) || Common.UIString('Unknown'); };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js index 72c1fb8..d42700e 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js +++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js
@@ -31,11 +31,11 @@ /** * @unrestricted */ -WebInspector.ObjectPopoverHelper = class extends WebInspector.PopoverHelper { +Components.ObjectPopoverHelper = class extends UI.PopoverHelper { /** * @param {!Element} panelElement * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAnchor - * @param {function(!Element, function(!WebInspector.RemoteObject, boolean, !Element=):undefined, string):undefined} queryObject + * @param {function(!Element, function(!SDK.RemoteObject, boolean, !Element=):undefined, string):undefined} queryObject * @param {function()=} onHide * @param {boolean=} disableOnClick */ @@ -50,17 +50,17 @@ /** * @param {!Element} element - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showObjectPopover(element, popover) { /** - * @param {!WebInspector.RemoteObject} funcObject + * @param {!SDK.RemoteObject} funcObject * @param {!Element} popoverContentElement * @param {!Element} popoverValueElement * @param {!Element} anchorElement - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties - * @this {WebInspector.ObjectPopoverHelper} + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties + * @this {Components.ObjectPopoverHelper} */ function didGetFunctionProperties( funcObject, popoverContentElement, popoverValueElement, anchorElement, properties, internalProperties) { @@ -72,7 +72,7 @@ } } } - WebInspector.ObjectPropertiesSection.formatObjectAsFunction(funcObject, popoverValueElement, true); + Components.ObjectPropertiesSection.formatObjectAsFunction(funcObject, popoverValueElement, true); funcObject.debuggerModel() .functionDetailsPromise(funcObject) .then(didGetFunctionDetails.bind(this, popoverContentElement, anchorElement)); @@ -81,8 +81,8 @@ /** * @param {!Element} popoverContentElement * @param {!Element} anchorElement - * @param {?WebInspector.DebuggerModel.FunctionDetails} response - * @this {WebInspector.ObjectPopoverHelper} + * @param {?SDK.DebuggerModel.FunctionDetails} response + * @this {Components.ObjectPopoverHelper} */ function didGetFunctionDetails(popoverContentElement, anchorElement, response) { if (!response || popover.disposed) @@ -91,14 +91,14 @@ var container = createElementWithClass('div', 'object-popover-container'); var title = container.createChild('div', 'function-popover-title source-code'); var functionName = title.createChild('span', 'function-name'); - functionName.textContent = WebInspector.beautifyFunctionName(response.functionName); + functionName.textContent = UI.beautifyFunctionName(response.functionName); var rawLocation = response.location; var linkContainer = title.createChild('div', 'function-title-link-container'); if (rawLocation && Runtime.experiments.isEnabled('continueToFirstInvocation')) { - var sectionToolbar = new WebInspector.Toolbar('function-location-step-into', linkContainer); - var stepInto = new WebInspector.ToolbarButton( - WebInspector.UIString('Continue to first invocation'), 'largeicon-step-in'); + var sectionToolbar = new UI.Toolbar('function-location-step-into', linkContainer); + var stepInto = new UI.ToolbarButton( + Common.UIString('Continue to first invocation'), 'largeicon-step-in'); stepInto.addEventListener('click', () => rawLocation.continueToLocation()); sectionToolbar.appendToolbarItem(stepInto); } @@ -110,10 +110,10 @@ } /** - * @param {!WebInspector.RemoteObject} result + * @param {!SDK.RemoteObject} result * @param {boolean} wasThrown * @param {!Element=} anchorOverride - * @this {WebInspector.ObjectPopoverHelper} + * @this {Components.ObjectPopoverHelper} */ function didQueryObject(result, wasThrown, anchorOverride) { if (popover.disposed) @@ -124,11 +124,11 @@ } this._objectTarget = result.target(); var anchorElement = anchorOverride || element; - var description = result.description.trimEnd(WebInspector.ObjectPopoverHelper.MaxPopoverTextLength); + var description = result.description.trimEnd(Components.ObjectPopoverHelper.MaxPopoverTextLength); var popoverContentElement = null; if (result.type !== 'object') { popoverContentElement = createElement('span'); - WebInspector.appendStyle(popoverContentElement, 'components/objectValue.css'); + UI.appendStyle(popoverContentElement, 'components/objectValue.css'); var valueElement = popoverContentElement.createChild('span', 'monospace object-value-' + result.type); valueElement.style.whiteSpace = 'pre'; @@ -145,19 +145,19 @@ popover.showForAnchor(popoverContentElement, anchorElement); } else { if (result.subtype === 'node') { - WebInspector.DOMModel.highlightObjectAsDOMNode(result); + SDK.DOMModel.highlightObjectAsDOMNode(result); this._resultHighlightedAsDOM = true; } if (result.customPreview()) { - var customPreviewComponent = new WebInspector.CustomPreviewComponent(result); + var customPreviewComponent = new Components.CustomPreviewComponent(result); customPreviewComponent.expandIfPossible(); popoverContentElement = customPreviewComponent.element; } else { popoverContentElement = createElement('div'); this._titleElement = popoverContentElement.createChild('div', 'monospace'); this._titleElement.createChild('span', 'source-frame-popover-title').textContent = description; - var section = new WebInspector.ObjectPropertiesSection(result, '', this._lazyLinkifier()); + var section = new Components.ObjectPropertiesSection(result, '', this._lazyLinkifier()); section.element.classList.add('source-frame-popover-tree'); section.titleLessMode(); popoverContentElement.appendChild(section.element); @@ -172,7 +172,7 @@ _onHideObjectPopover() { if (this._resultHighlightedAsDOM) { - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); delete this._resultHighlightedAsDOM; } if (this._linkifier) { @@ -188,13 +188,13 @@ } /** - * @return {!WebInspector.Linkifier} + * @return {!Components.Linkifier} */ _lazyLinkifier() { if (!this._linkifier) - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); return this._linkifier; } }; -WebInspector.ObjectPopoverHelper.MaxPopoverTextLength = 10000; +Components.ObjectPopoverHelper.MaxPopoverTextLength = 10000;
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js index cecb7db2..4bf242ac 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js +++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
@@ -27,14 +27,14 @@ /** * @unrestricted */ -WebInspector.ObjectPropertiesSection = class extends TreeOutlineInShadow { +Components.ObjectPropertiesSection = class extends TreeOutlineInShadow { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {?string|!Element=} title - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier * @param {?string=} emptyPlaceholder * @param {boolean=} ignoreHasOwnProperty - * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties + * @param {!Array.<!SDK.RemoteObjectProperty>=} extraProperties */ constructor(object, title, linkifier, emptyPlaceholder, ignoreHasOwnProperty, extraProperties) { super(); @@ -42,7 +42,7 @@ this._editable = true; this.hideOverflow(); this.setFocusable(false); - this._objectTreeElement = new WebInspector.ObjectPropertiesSection.RootElement( + this._objectTreeElement = new Components.ObjectPropertiesSection.RootElement( object, linkifier, emptyPlaceholder, ignoreHasOwnProperty, extraProperties); this.appendChild(this._objectTreeElement); if (typeof title === 'string' || !title) { @@ -53,13 +53,13 @@ this.element.appendChild(title); } - if (object.description && WebInspector.ObjectPropertiesSection._needsAlternateTitle(object)) { + if (object.description && Components.ObjectPropertiesSection._needsAlternateTitle(object)) { this.expandedTitleElement = createElement('span'); this.expandedTitleElement.createTextChild(object.description); var note = this.expandedTitleElement.createChild('span', 'object-state-note'); note.classList.add('info-note'); - note.title = WebInspector.UIString('Value below was evaluated just now.'); + note.title = Common.UIString('Value below was evaluated just now.'); } this.element._section = this; @@ -69,19 +69,19 @@ } /** - * @param {!WebInspector.RemoteObject} object - * @param {!WebInspector.Linkifier=} linkifier + * @param {!SDK.RemoteObject} object + * @param {!Components.Linkifier=} linkifier * @param {boolean=} skipProto * @return {!Element} */ static defaultObjectPresentation(object, linkifier, skipProto) { var componentRoot = createElementWithClass('span', 'source-code'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(componentRoot, 'components/objectValue.css'); - shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(object, false)); + var shadowRoot = UI.createShadowRootWithCoreStyles(componentRoot, 'components/objectValue.css'); + shadowRoot.appendChild(Components.ObjectPropertiesSection.createValueElement(object, false)); if (!object.hasChildren) return componentRoot; - var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(object, componentRoot, linkifier); + var objectPropertiesSection = new Components.ObjectPropertiesSection(object, componentRoot, linkifier); objectPropertiesSection.editable = false; if (skipProto) objectPropertiesSection.skipProto(); @@ -90,8 +90,8 @@ } /** - * @param {!WebInspector.RemoteObjectProperty} propertyA - * @param {!WebInspector.RemoteObjectProperty} propertyB + * @param {!SDK.RemoteObjectProperty} propertyA + * @param {!SDK.RemoteObjectProperty} propertyB * @return {number} */ static CompareProperties(propertyA, propertyB) { @@ -128,7 +128,7 @@ static valueTextForFunctionDescription(description) { var text = description.replace(/^function [gs]et /, 'function '); var functionPrefixWithArguments = - new RegExp(WebInspector.ObjectPropertiesSection._functionPrefixSource.source + '([^)]*)'); + new RegExp(Components.ObjectPropertiesSection._functionPrefixSource.source + '([^)]*)'); var matches = functionPrefixWithArguments.exec(text); if (!matches) { // process shorthand methods @@ -139,26 +139,26 @@ } /** - * @param {!WebInspector.RemoteObject} value + * @param {!SDK.RemoteObject} value * @param {boolean} wasThrown * @param {!Element=} parentElement - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier * @return {!Element} */ static createValueElementWithCustomSupport(value, wasThrown, parentElement, linkifier) { if (value.customPreview()) { - var result = (new WebInspector.CustomPreviewComponent(value)).element; + var result = (new Components.CustomPreviewComponent(value)).element; result.classList.add('object-properties-section-custom-section'); return result; } - return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThrown, parentElement, linkifier); + return Components.ObjectPropertiesSection.createValueElement(value, wasThrown, parentElement, linkifier); } /** - * @param {!WebInspector.RemoteObject} value + * @param {!SDK.RemoteObject} value * @param {boolean} wasThrown * @param {!Element=} parentElement - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier * @return {!Element} */ static createValueElement(value, wasThrown, parentElement, linkifier) { @@ -179,7 +179,7 @@ valueText = description.replace(/\n/g, '\u21B5'); suffix = '"'; } else if (type === 'function') { - valueText = WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription(description); + valueText = Components.ObjectPropertiesSection.valueTextForFunctionDescription(description); } else if (type !== 'object' || subtype !== 'node') { valueText = description; } @@ -206,7 +206,7 @@ valueElement.classList.add('object-value-' + (subtype || type)); if (type === 'object' && subtype === 'node' && description) { - WebInspector.DOMPresentationUtils.createSpansForNodeTitle(valueElement, description); + Components.DOMPresentationUtils.createSpansForNodeTitle(valueElement, description); valueElement.addEventListener('click', mouseClick, false); valueElement.addEventListener('mousemove', mouseMove, false); valueElement.addEventListener('mouseleave', mouseLeave, false); @@ -223,18 +223,18 @@ } function mouseMove() { - WebInspector.DOMModel.highlightObjectAsDOMNode(value); + SDK.DOMModel.highlightObjectAsDOMNode(value); } function mouseLeave() { - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } /** * @param {!Event} event */ function mouseClick(event) { - WebInspector.Revealer.reveal(value); + Common.Revealer.reveal(value); event.consume(true); } @@ -242,7 +242,7 @@ } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @return {boolean} */ static _needsAlternateTitle(object) { @@ -251,7 +251,7 @@ } /** - * @param {!WebInspector.RemoteObject} func + * @param {!SDK.RemoteObject} func * @param {!Element} element * @param {boolean} linkify * @param {boolean=} includePreview @@ -260,16 +260,16 @@ func.debuggerModel().functionDetailsPromise(func).then(didGetDetails); /** - * @param {?WebInspector.DebuggerModel.FunctionDetails} response + * @param {?SDK.DebuggerModel.FunctionDetails} response */ function didGetDetails(response) { if (!response) { - var valueText = WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription(func.description); + var valueText = Components.ObjectPropertiesSection.valueTextForFunctionDescription(func.description); element.createTextChild(valueText); return; } - var matched = func.description.match(WebInspector.ObjectPropertiesSection._functionPrefixSource); + var matched = func.description.match(Components.ObjectPropertiesSection._functionPrefixSource); if (matched) { var prefix = createElementWithClass('span', 'object-value-function-prefix'); prefix.textContent = matched[0]; @@ -281,26 +281,26 @@ element.classList.add('linkified'); element.appendChild(anchor); element.addEventListener( - 'click', WebInspector.Revealer.reveal.bind(WebInspector.Revealer, response.location, undefined)); + 'click', Common.Revealer.reveal.bind(Common.Revealer, response.location, undefined)); element = anchor; } var text = func.description.substring(0, 200); if (includePreview) { element.createTextChild( - text.replace(WebInspector.ObjectPropertiesSection._functionPrefixSource, '') + + text.replace(Components.ObjectPropertiesSection._functionPrefixSource, '') + (func.description.length > 200 ? '\u2026' : '')); return; } // Now parse description and get the real params and title. - self.runtime.extension(WebInspector.TokenizerFactory).instance().then(processTokens); + self.runtime.extension(Common.TokenizerFactory).instance().then(processTokens); var params = null; var functionName = response ? response.functionName : ''; /** - * @param {!WebInspector.TokenizerFactory} tokenizerFactory + * @param {!Common.TokenizerFactory} tokenizerFactory */ function processTokens(tokenizerFactory) { var tokenize = tokenizerFactory.createTokenizer('text/javascript'); @@ -359,7 +359,7 @@ } _contextMenuEventFired(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(this._object); contextMenu.show(); } @@ -372,19 +372,19 @@ }; /** @const */ -WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100; +Components.ObjectPropertiesSection._arrayLoadThreshold = 100; /** * @unrestricted */ -WebInspector.ObjectPropertiesSection.RootElement = class extends TreeElement { +Components.ObjectPropertiesSection.RootElement = class extends TreeElement { /** - * @param {!WebInspector.RemoteObject} object - * @param {!WebInspector.Linkifier=} linkifier + * @param {!SDK.RemoteObject} object + * @param {!Components.Linkifier=} linkifier * @param {?string=} emptyPlaceholder * @param {boolean=} ignoreHasOwnProperty - * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties + * @param {!Array.<!SDK.RemoteObjectProperty>=} extraProperties */ constructor(object, linkifier, emptyPlaceholder, ignoreHasOwnProperty, extraProperties) { var contentElement = createElement('content'); @@ -447,7 +447,7 @@ * @override */ onpopulate() { - WebInspector.ObjectPropertyTreeElement._populate( + Components.ObjectPropertyTreeElement._populate( this, this._object, !!this.treeOutline._skipProto, this._linkifier, this._emptyPlaceholder, this._ignoreHasOwnProperty, this._extraProperties); } @@ -456,10 +456,10 @@ /** * @unrestricted */ -WebInspector.ObjectPropertyTreeElement = class extends TreeElement { +Components.ObjectPropertyTreeElement = class extends TreeElement { /** - * @param {!WebInspector.RemoteObjectProperty} property - * @param {!WebInspector.Linkifier=} linkifier + * @param {!SDK.RemoteObjectProperty} property + * @param {!Components.Linkifier=} linkifier */ constructor(property, linkifier) { // Pass an empty title, the title gets made later in onattach. @@ -475,13 +475,13 @@ /** * @param {!TreeElement} treeElement - * @param {!WebInspector.RemoteObject} value + * @param {!SDK.RemoteObject} value * @param {boolean} skipProto - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier * @param {?string=} emptyPlaceholder * @param {boolean=} flattenProtoChain - * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties - * @param {!WebInspector.RemoteObject=} targetValue + * @param {!Array.<!SDK.RemoteObjectProperty>=} extraProperties + * @param {!SDK.RemoteObject=} targetValue */ static _populate( treeElement, @@ -492,15 +492,15 @@ flattenProtoChain, extraProperties, targetValue) { - if (value.arrayLength() > WebInspector.ObjectPropertiesSection._arrayLoadThreshold) { + if (value.arrayLength() > Components.ObjectPropertiesSection._arrayLoadThreshold) { treeElement.removeChildren(); - WebInspector.ArrayGroupingTreeElement._populateArray(treeElement, value, 0, value.arrayLength() - 1, linkifier); + Components.ArrayGroupingTreeElement._populateArray(treeElement, value, 0, value.arrayLength() - 1, linkifier); return; } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties */ function callback(properties, internalProperties) { treeElement.removeChildren(); @@ -511,23 +511,23 @@ for (var i = 0; i < extraProperties.length; ++i) properties.push(extraProperties[i]); - WebInspector.ObjectPropertyTreeElement.populateWithProperties( + Components.ObjectPropertyTreeElement.populateWithProperties( treeElement, properties, internalProperties, skipProto, targetValue || value, linkifier, emptyPlaceholder); } if (flattenProtoChain) value.getAllProperties(false, callback); else - WebInspector.RemoteObject.loadFromObjectPerProto(value, callback); + SDK.RemoteObject.loadFromObjectPerProto(value, callback); } /** * @param {!TreeElement} treeNode - * @param {!Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {!Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties * @param {boolean} skipProto - * @param {?WebInspector.RemoteObject} value - * @param {!WebInspector.Linkifier=} linkifier + * @param {?SDK.RemoteObject} value + * @param {!Components.Linkifier=} linkifier * @param {?string=} emptyPlaceholder */ static populateWithProperties( @@ -538,7 +538,7 @@ value, linkifier, emptyPlaceholder) { - properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); + properties.sort(Components.ObjectPropertiesSection.CompareProperties); var tailProperties = []; var protoProperty = null; @@ -551,28 +551,28 @@ } if (property.isOwn && property.getter) { - var getterProperty = new WebInspector.RemoteObjectProperty('get ' + property.name, property.getter, false); + var getterProperty = new SDK.RemoteObjectProperty('get ' + property.name, property.getter, false); getterProperty.parentObject = value; tailProperties.push(getterProperty); } if (property.isOwn && property.setter) { - var setterProperty = new WebInspector.RemoteObjectProperty('set ' + property.name, property.setter, false); + var setterProperty = new SDK.RemoteObjectProperty('set ' + property.name, property.setter, false); setterProperty.parentObject = value; tailProperties.push(setterProperty); } var canShowProperty = property.getter || !property.isAccessorProperty(); if (canShowProperty && property.name !== '__proto__') - treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(property, linkifier)); + treeNode.appendChild(new Components.ObjectPropertyTreeElement(property, linkifier)); } for (var i = 0; i < tailProperties.length; ++i) - treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(tailProperties[i], linkifier)); + treeNode.appendChild(new Components.ObjectPropertyTreeElement(tailProperties[i], linkifier)); if (!skipProto && protoProperty) - treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(protoProperty, linkifier)); + treeNode.appendChild(new Components.ObjectPropertyTreeElement(protoProperty, linkifier)); if (internalProperties) { for (var i = 0; i < internalProperties.length; i++) { internalProperties[i].parentObject = value; - var treeElement = new WebInspector.ObjectPropertyTreeElement(internalProperties[i], linkifier); + var treeElement = new Components.ObjectPropertyTreeElement(internalProperties[i], linkifier); if (internalProperties[i].name === '[[Entries]]') { treeElement.setExpandable(true); treeElement.expand(); @@ -581,7 +581,7 @@ } } - WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeNode, emptyPlaceholder); + Components.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeNode, emptyPlaceholder); } /** @@ -592,25 +592,25 @@ if (treeNode.childCount()) return; var title = createElementWithClass('div', 'gray-info-message'); - title.textContent = emptyPlaceholder || WebInspector.UIString('No Properties'); + title.textContent = emptyPlaceholder || Common.UIString('No Properties'); var infoElement = new TreeElement(title); treeNode.appendChild(infoElement); } /** - * @param {?WebInspector.RemoteObject} object + * @param {?SDK.RemoteObject} object * @param {!Array.<string>} propertyPath - * @param {function(?WebInspector.RemoteObject, boolean=)} callback + * @param {function(?SDK.RemoteObject, boolean=)} callback * @return {!Element} */ static createRemoteObjectAccessorPropertySpan(object, propertyPath, callback) { var rootElement = createElement('span'); var element = rootElement.createChild('span'); - element.textContent = WebInspector.UIString('(...)'); + element.textContent = Common.UIString('(...)'); if (!object) return rootElement; element.classList.add('object-value-calculate-value-button'); - element.title = WebInspector.UIString('Invoke property getter'); + element.title = Common.UIString('Invoke property getter'); element.addEventListener('click', onInvokeGetterClick, false); function onInvokeGetterClick(event) { @@ -627,7 +627,7 @@ * @return {boolean} */ setSearchRegex(regex, additionalCssClassName) { - var cssClasses = WebInspector.highlightedSearchResultClassName; + var cssClasses = UI.highlightedSearchResultClassName; if (additionalCssClassName) cssClasses += ' ' + additionalCssClassName; this.revertHighlightChanges(); @@ -651,15 +651,15 @@ regex.lastIndex = 0; var match = regex.exec(content); while (match) { - ranges.push(new WebInspector.SourceRange(match.index, match[0].length)); + ranges.push(new Common.SourceRange(match.index, match[0].length)); match = regex.exec(content); } if (ranges.length) - WebInspector.highlightRangesWithStyleClass(element, ranges, cssClassName, this._highlightChanges); + UI.highlightRangesWithStyleClass(element, ranges, cssClassName, this._highlightChanges); } revertHighlightChanges() { - WebInspector.revertDomChanges(this._highlightChanges); + UI.revertDomChanges(this._highlightChanges); this._highlightChanges = []; } @@ -667,11 +667,11 @@ * @override */ onpopulate() { - var propertyValue = /** @type {!WebInspector.RemoteObject} */ (this.property.value); + var propertyValue = /** @type {!SDK.RemoteObject} */ (this.property.value); console.assert(propertyValue); var skipProto = this.treeOutline ? this.treeOutline._skipProto : true; var targetValue = this.property.name !== '__proto__' ? propertyValue : this.property.parentObject; - WebInspector.ObjectPropertyTreeElement._populate( + Components.ObjectPropertyTreeElement._populate( this, propertyValue, skipProto, this._linkifier, undefined, undefined, undefined, targetValue); } @@ -722,11 +722,11 @@ } /** - * @param {!WebInspector.RemoteObject} value + * @param {!SDK.RemoteObject} value * @return {?Element} */ _createExpandedValueElement(value) { - if (!WebInspector.ObjectPropertiesSection._needsAlternateTitle(value)) + if (!Components.ObjectPropertiesSection._needsAlternateTitle(value)) return null; var valueElement = createElementWithClass('span', 'value'); @@ -737,7 +737,7 @@ } update() { - this.nameElement = WebInspector.ObjectPropertiesSection.createNameElement(this.property.name); + this.nameElement = Components.ObjectPropertiesSection.createNameElement(this.property.name); if (!this.property.enumerable) this.nameElement.classList.add('object-properties-section-dimmed'); if (this.property.synthetic) @@ -750,16 +750,16 @@ separatorElement.textContent = ': '; if (this.property.value) { - this.valueElement = WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport( + this.valueElement = Components.ObjectPropertiesSection.createValueElementWithCustomSupport( this.property.value, this.property.wasThrown, this.listItemElement, this._linkifier); this.valueElement.addEventListener('contextmenu', this._contextMenuFired.bind(this, this.property), false); } else if (this.property.getter) { - this.valueElement = WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan( + this.valueElement = Components.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan( this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this)); } else { this.valueElement = createElementWithClass('span', 'object-value-undefined'); - this.valueElement.textContent = WebInspector.UIString('<unreadable>'); - this.valueElement.title = WebInspector.UIString('No property getter'); + this.valueElement.textContent = Common.UIString('<unreadable>'); + this.valueElement.title = Common.UIString('No property getter'); } var valueText = this.valueElement.textContent; @@ -787,18 +787,18 @@ } /** - * @param {!WebInspector.RemoteObjectProperty} property + * @param {!SDK.RemoteObjectProperty} property * @param {!Event} event */ _contextMenuFired(property, event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (property.symbol) contextMenu.appendApplicableItems(property.symbol); if (property.value) contextMenu.appendApplicableItems(property.value); var copyPathHandler = InspectorFrontendHost.copyText.bind(InspectorFrontendHost, this.nameElement.title); contextMenu.beforeShow(() => { - contextMenu.appendItem(WebInspector.UIString.capitalize('Copy ^property ^path'), copyPathHandler); + contextMenu.appendItem(Common.UIString.capitalize('Copy ^property ^path'), copyPathHandler); }); contextMenu.show(); } @@ -813,7 +813,7 @@ if (this.property.value.type === 'string' && typeof text === 'string') text = '"' + text + '"'; - this._editableDiv.setTextContentTruncatedIfNeeded(text, WebInspector.UIString('<string is too large to edit>')); + this._editableDiv.setTextContentTruncatedIfNeeded(text, Common.UIString('<string is too large to edit>')); var originalContent = this._editableDiv.textContent; // Lie about our children to prevent expanding on double click and to collapse subproperties. @@ -821,7 +821,7 @@ this.listItemElement.classList.add('editing-sub-part'); this.valueElement.classList.add('hidden'); - this._prompt = new WebInspector.ObjectPropertyPrompt(); + this._prompt = new Components.ObjectPropertyPrompt(); var proxyElement = this._prompt.attachAndStartEditing(this._editableDiv, this._editingCommitted.bind(this, originalContent)); @@ -878,7 +878,7 @@ * @param {string} expression */ _applyExpression(expression) { - var property = WebInspector.RemoteObject.toCallArgument(this.property.symbol || this.property.name); + var property = SDK.RemoteObject.toCallArgument(this.property.symbol || this.property.name); expression = expression.trim(); if (expression) this.property.parentObject.setPropertyValue(property, expression, callback.bind(this)); @@ -887,7 +887,7 @@ /** * @param {?Protocol.Error} error - * @this {WebInspector.ObjectPropertyTreeElement} + * @this {Components.ObjectPropertyTreeElement} */ function callback(error) { if (error) { @@ -908,7 +908,7 @@ } /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {boolean=} wasThrown */ _onInvokeGetterClick(result, wasThrown) { @@ -935,13 +935,13 @@ /** * @unrestricted */ -WebInspector.ArrayGroupingTreeElement = class extends TreeElement { +Components.ArrayGroupingTreeElement = class extends TreeElement { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {number} fromIndex * @param {number} toIndex * @param {number} propertyCount - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier */ constructor(object, fromIndex, toIndex, propertyCount, linkifier) { super(String.sprintf('[%d \u2026 %d]', fromIndex, toIndex), true); @@ -957,31 +957,31 @@ /** * @param {!TreeElement} treeNode - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {number} fromIndex * @param {number} toIndex - * @param {!WebInspector.Linkifier=} linkifier + * @param {!Components.Linkifier=} linkifier */ static _populateArray(treeNode, object, fromIndex, toIndex, linkifier) { - WebInspector.ArrayGroupingTreeElement._populateRanges(treeNode, object, fromIndex, toIndex, true, linkifier); + Components.ArrayGroupingTreeElement._populateRanges(treeNode, object, fromIndex, toIndex, true, linkifier); } /** * @param {!TreeElement} treeNode - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {number} fromIndex * @param {number} toIndex * @param {boolean} topLevel - * @param {!WebInspector.Linkifier=} linkifier - * @this {WebInspector.ArrayGroupingTreeElement} + * @param {!Components.Linkifier=} linkifier + * @this {Components.ArrayGroupingTreeElement} */ static _populateRanges(treeNode, object, fromIndex, toIndex, topLevel, linkifier) { object.callFunctionJSON( packRanges, [ - {value: fromIndex}, {value: toIndex}, {value: WebInspector.ArrayGroupingTreeElement._bucketThreshold}, - {value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold}, - {value: WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold} + {value: fromIndex}, {value: toIndex}, {value: Components.ArrayGroupingTreeElement._bucketThreshold}, + {value: Components.ArrayGroupingTreeElement._sparseIterationThreshold}, + {value: Components.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold} ], callback); @@ -1066,7 +1066,7 @@ return; var ranges = /** @type {!Array.<!Array.<number>>} */ (result.ranges); if (ranges.length === 1) { - WebInspector.ArrayGroupingTreeElement._populateAsFragment( + Components.ArrayGroupingTreeElement._populateAsFragment( treeNode, object, ranges[0][0], ranges[0][1], linkifier); } else { for (var i = 0; i < ranges.length; ++i) { @@ -1074,32 +1074,32 @@ var toIndex = ranges[i][1]; var count = ranges[i][2]; if (fromIndex === toIndex) - WebInspector.ArrayGroupingTreeElement._populateAsFragment(treeNode, object, fromIndex, toIndex, linkifier); + Components.ArrayGroupingTreeElement._populateAsFragment(treeNode, object, fromIndex, toIndex, linkifier); else treeNode.appendChild( - new WebInspector.ArrayGroupingTreeElement(object, fromIndex, toIndex, count, linkifier)); + new Components.ArrayGroupingTreeElement(object, fromIndex, toIndex, count, linkifier)); } } if (topLevel) - WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties( + Components.ArrayGroupingTreeElement._populateNonIndexProperties( treeNode, object, result.skipGetOwnPropertyNames, linkifier); } } /** * @param {!TreeElement} treeNode - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {number} fromIndex * @param {number} toIndex - * @param {!WebInspector.Linkifier=} linkifier - * @this {WebInspector.ArrayGroupingTreeElement} + * @param {!Components.Linkifier=} linkifier + * @this {Components.ArrayGroupingTreeElement} */ static _populateAsFragment(treeNode, object, fromIndex, toIndex, linkifier) { object.callFunction( buildArrayFragment, [ {value: fromIndex}, {value: toIndex}, - {value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold} + {value: Components.ArrayGroupingTreeElement._sparseIterationThreshold} ], processArrayFragment.bind(this)); @@ -1130,9 +1130,9 @@ } /** - * @param {?WebInspector.RemoteObject} arrayFragment + * @param {?SDK.RemoteObject} arrayFragment * @param {boolean=} wasThrown - * @this {WebInspector.ArrayGroupingTreeElement} + * @this {Components.ArrayGroupingTreeElement} */ function processArrayFragment(arrayFragment, wasThrown) { if (!arrayFragment || wasThrown) @@ -1140,15 +1140,15 @@ arrayFragment.getAllProperties(false, processProperties.bind(this)); } - /** @this {WebInspector.ArrayGroupingTreeElement} */ + /** @this {Components.ArrayGroupingTreeElement} */ function processProperties(properties, internalProperties) { if (!properties) return; - properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); + properties.sort(Components.ObjectPropertiesSection.CompareProperties); for (var i = 0; i < properties.length; ++i) { properties[i].parentObject = this._object; - var childTreeElement = new WebInspector.ObjectPropertyTreeElement(properties[i], linkifier); + var childTreeElement = new Components.ObjectPropertyTreeElement(properties[i], linkifier); childTreeElement._readOnly = true; treeNode.appendChild(childTreeElement); } @@ -1157,10 +1157,10 @@ /** * @param {!TreeElement} treeNode - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {boolean} skipGetOwnPropertyNames - * @param {!WebInspector.Linkifier=} linkifier - * @this {WebInspector.ArrayGroupingTreeElement} + * @param {!Components.Linkifier=} linkifier + * @this {Components.ArrayGroupingTreeElement} */ static _populateNonIndexProperties(treeNode, object, skipGetOwnPropertyNames, linkifier) { object.callFunction(buildObjectFragment, [{value: skipGetOwnPropertyNames}], processObjectFragment.bind(this)); @@ -1188,9 +1188,9 @@ } /** - * @param {?WebInspector.RemoteObject} arrayFragment + * @param {?SDK.RemoteObject} arrayFragment * @param {boolean=} wasThrown - * @this {WebInspector.ArrayGroupingTreeElement} + * @this {Components.ArrayGroupingTreeElement} */ function processObjectFragment(arrayFragment, wasThrown) { if (!arrayFragment || wasThrown) @@ -1199,17 +1199,17 @@ } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>=} internalProperties - * @this {WebInspector.ArrayGroupingTreeElement} + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>=} internalProperties + * @this {Components.ArrayGroupingTreeElement} */ function processProperties(properties, internalProperties) { if (!properties) return; - properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); + properties.sort(Components.ObjectPropertiesSection.CompareProperties); for (var i = 0; i < properties.length; ++i) { properties[i].parentObject = this._object; - var childTreeElement = new WebInspector.ObjectPropertyTreeElement(properties[i], linkifier); + var childTreeElement = new Components.ObjectPropertyTreeElement(properties[i], linkifier); childTreeElement._readOnly = true; treeNode.appendChild(childTreeElement); } @@ -1220,12 +1220,12 @@ * @override */ onpopulate() { - if (this._propertyCount >= WebInspector.ArrayGroupingTreeElement._bucketThreshold) { - WebInspector.ArrayGroupingTreeElement._populateRanges( + if (this._propertyCount >= Components.ArrayGroupingTreeElement._bucketThreshold) { + Components.ArrayGroupingTreeElement._populateRanges( this, this._object, this._fromIndex, this._toIndex, false, this._linkifier); return; } - WebInspector.ArrayGroupingTreeElement._populateAsFragment( + Components.ArrayGroupingTreeElement._populateAsFragment( this, this._object, this._fromIndex, this._toIndex, this._linkifier); } @@ -1237,30 +1237,30 @@ } }; -WebInspector.ArrayGroupingTreeElement._bucketThreshold = 100; -WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold = 250000; -WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold = 500000; +Components.ArrayGroupingTreeElement._bucketThreshold = 100; +Components.ArrayGroupingTreeElement._sparseIterationThreshold = 250000; +Components.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold = 500000; /** * @unrestricted */ -WebInspector.ObjectPropertyPrompt = class extends WebInspector.TextPrompt { +Components.ObjectPropertyPrompt = class extends UI.TextPrompt { constructor() { super(); - this.initialize(WebInspector.JavaScriptAutocomplete.completionsForTextPromptInCurrentContext); + this.initialize(Components.JavaScriptAutocomplete.completionsForTextPromptInCurrentContext); this.setSuggestBoxEnabled(true); } }; -WebInspector.ObjectPropertiesSection._functionPrefixSource = /^(?:async\s)?function\*?\s/; +Components.ObjectPropertiesSection._functionPrefixSource = /^(?:async\s)?function\*?\s/; /** * @unrestricted */ -WebInspector.ObjectPropertiesSectionExpandController = class { +Components.ObjectPropertiesSectionExpandController = class { constructor() { /** @type {!Set.<string>} */ this._expandedProperties = new Set(); @@ -1268,13 +1268,13 @@ /** * @param {string} id - * @param {!WebInspector.ObjectPropertiesSection} section + * @param {!Components.ObjectPropertiesSection} section */ watchSection(id, section) { section.addEventListener(TreeOutline.Events.ElementAttached, this._elementAttached, this); section.addEventListener(TreeOutline.Events.ElementExpanded, this._elementExpanded, this); section.addEventListener(TreeOutline.Events.ElementCollapsed, this._elementCollapsed, this); - section[WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId] = id; + section[Components.ObjectPropertiesSectionExpandController._treeOutlineId] = id; if (this._expandedProperties.has(id)) section.expand(); @@ -1291,7 +1291,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _elementAttached(event) { var element = /** @type {!TreeElement} */ (event.data); @@ -1300,7 +1300,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _elementExpanded(event) { var element = /** @type {!TreeElement} */ (event.data); @@ -1308,7 +1308,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _elementCollapsed(event) { var element = /** @type {!TreeElement} */ (event.data); @@ -1320,7 +1320,7 @@ * @return {string} */ _propertyPath(treeElement) { - var cachedPropertyPath = treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol]; + var cachedPropertyPath = treeElement[Components.ObjectPropertiesSectionExpandController._cachedPathSymbol]; if (cachedPropertyPath) return cachedPropertyPath; @@ -1339,12 +1339,12 @@ result = currentName + (result ? '.' + result : ''); current = current.parent; } - var treeOutlineId = treeElement.treeOutline[WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId]; + var treeOutlineId = treeElement.treeOutline[Components.ObjectPropertiesSectionExpandController._treeOutlineId]; result = treeOutlineId + (result ? ':' + result : ''); - treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol] = result; + treeElement[Components.ObjectPropertiesSectionExpandController._cachedPathSymbol] = result; return result; } }; -WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol = Symbol('cachedPath'); -WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId = Symbol('treeOutlineId'); +Components.ObjectPropertiesSectionExpandController._cachedPathSymbol = Symbol('cachedPath'); +Components.ObjectPropertiesSectionExpandController._treeOutlineId = Symbol('treeOutlineId');
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Reload.js b/third_party/WebKit/Source/devtools/front_end/components/Reload.js index 213b566..105f5c97 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/Reload.js +++ b/third_party/WebKit/Source/devtools/front_end/components/Reload.js
@@ -1,9 +1,9 @@ // Copyright 2015 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. -WebInspector.reload = function() { - if (WebInspector.dockController.canDock() && - WebInspector.dockController.dockSide() === WebInspector.DockController.State.Undocked) +Components.reload = function() { + if (Components.dockController.canDock() && + Components.dockController.dockSide() === Components.DockController.State.Undocked) InspectorFrontendHost.setIsDocked(true, function() {}); window.location.reload(); };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js index a1a30da..a3e780d 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.RemoteObjectPreviewFormatter = class { +Components.RemoteObjectPreviewFormatter = class { /** * @param {!Element} parentElement * @param {!Protocol.Runtime.ObjectPreview} preview @@ -42,7 +42,7 @@ */ _appendPropertiesPreview(parentElement, preview) { var isArray = preview.subtype === 'array' || preview.subtype === 'typedarray'; - var arrayLength = WebInspector.RemoteObject.arrayLength(preview); + var arrayLength = SDK.RemoteObject.arrayLength(preview); var properties = preview.properties; if (isArray) properties = properties.slice().stableSort(compareIndexesFirst); @@ -153,7 +153,7 @@ } if (type === 'object' && subtype === 'node' && description) { - WebInspector.DOMPresentationUtils.createSpansForNodeTitle(span, description); + Components.DOMPresentationUtils.createSpansForNodeTitle(span, description); return span; }
diff --git a/third_party/WebKit/Source/devtools/front_end/components/RequestAppBannerActionDelegate.js b/third_party/WebKit/Source/devtools/front_end/components/RequestAppBannerActionDelegate.js index 3714ba6..1221e09 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/RequestAppBannerActionDelegate.js +++ b/third_party/WebKit/Source/devtools/front_end/components/RequestAppBannerActionDelegate.js
@@ -2,21 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.RequestAppBannerActionDelegate = class { +Components.RequestAppBannerActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); if (target && target.hasBrowserCapability()) { target.pageAgent().requestAppBanner(); - WebInspector.console.show(); + Common.console.show(); } return true; }
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ShortcutsScreen.js b/third_party/WebKit/Source/devtools/front_end/components/ShortcutsScreen.js index 841eb8f..b7ec5fe 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/ShortcutsScreen.js +++ b/third_party/WebKit/Source/devtools/front_end/components/ShortcutsScreen.js
@@ -31,205 +31,205 @@ /** * @unrestricted */ -WebInspector.ShortcutsScreen = class { +Components.ShortcutsScreen = class { constructor() { - /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */ + /** @type {!Object.<string, !Components.ShortcutsSection>} */ this._sections = {}; } static registerShortcuts() { // Elements panel - var elementsSection = WebInspector.shortcutsScreen.section(WebInspector.UIString('Elements Panel')); + var elementsSection = Components.shortcutsScreen.section(Common.UIString('Elements Panel')); - var navigate = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateUp.concat( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); - elementsSection.addRelatedKeys(navigate, WebInspector.UIString('Navigate elements')); + var navigate = Components.ShortcutsScreen.ElementsPanelShortcuts.NavigateUp.concat( + Components.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); + elementsSection.addRelatedKeys(navigate, Common.UIString('Navigate elements')); - var expandCollapse = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Expand.concat( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse); - elementsSection.addRelatedKeys(expandCollapse, WebInspector.UIString('Expand/collapse')); + var expandCollapse = Components.ShortcutsScreen.ElementsPanelShortcuts.Expand.concat( + Components.ShortcutsScreen.ElementsPanelShortcuts.Collapse); + elementsSection.addRelatedKeys(expandCollapse, Common.UIString('Expand/collapse')); elementsSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute, WebInspector.UIString('Edit attribute')); + Components.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute, Common.UIString('Edit attribute')); elementsSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.HideElement, WebInspector.UIString('Hide element')); + Components.ShortcutsScreen.ElementsPanelShortcuts.HideElement, Common.UIString('Hide element')); elementsSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML, - WebInspector.UIString('Toggle edit as HTML')); + Components.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML, + Common.UIString('Toggle edit as HTML')); - var stylesPaneSection = WebInspector.shortcutsScreen.section(WebInspector.UIString('Styles Pane')); + var stylesPaneSection = Components.shortcutsScreen.section(Common.UIString('Styles Pane')); - var nextPreviousProperty = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NextProperty.concat( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty); - stylesPaneSection.addRelatedKeys(nextPreviousProperty, WebInspector.UIString('Next/previous property')); + var nextPreviousProperty = Components.ShortcutsScreen.ElementsPanelShortcuts.NextProperty.concat( + Components.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty); + stylesPaneSection.addRelatedKeys(nextPreviousProperty, Common.UIString('Next/previous property')); stylesPaneSection.addRelatedKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue, WebInspector.UIString('Increment value')); + Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue, Common.UIString('Increment value')); stylesPaneSection.addRelatedKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue, WebInspector.UIString('Decrement value')); + Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue, Common.UIString('Decrement value')); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10, - WebInspector.UIString('Increment by %f', 10)); + Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10, + Common.UIString('Increment by %f', 10)); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10, - WebInspector.UIString('Decrement by %f', 10)); + Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10, + Common.UIString('Decrement by %f', 10)); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100, - WebInspector.UIString('Increment by %f', 100)); + Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100, + Common.UIString('Increment by %f', 100)); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100, - WebInspector.UIString('Decrement by %f', 100)); + Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100, + Common.UIString('Decrement by %f', 100)); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01, - WebInspector.UIString('Increment by %f', 0.1)); + Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01, + Common.UIString('Increment by %f', 0.1)); stylesPaneSection.addAlternateKeys( - WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01, - WebInspector.UIString('Decrement by %f', 0.1)); + Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01, + Common.UIString('Decrement by %f', 0.1)); // Debugger - var section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Debugger')); + var section = Components.shortcutsScreen.section(Common.UIString('Debugger')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-pause'), - WebInspector.UIString('Pause/ Continue')); + UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-pause'), + Common.UIString('Pause/ Continue')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-over'), - WebInspector.UIString('Step over')); + UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-over'), + Common.UIString('Step over')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-into'), - WebInspector.UIString('Step into')); + UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-into'), + Common.UIString('Step into')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-out'), - WebInspector.UIString('Step out')); + UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-out'), + Common.UIString('Step out')); - var nextAndPrevFrameKeys = WebInspector.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame.concat( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame); - section.addRelatedKeys(nextAndPrevFrameKeys, WebInspector.UIString('Next/previous call frame')); + var nextAndPrevFrameKeys = Components.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame.concat( + Components.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame); + section.addRelatedKeys(nextAndPrevFrameKeys, Common.UIString('Next/previous call frame')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInConsole, - WebInspector.UIString('Evaluate selection in console')); + Components.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInConsole, + Common.UIString('Evaluate selection in console')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch, - WebInspector.UIString('Add selection to watch')); + Components.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch, + Common.UIString('Add selection to watch')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, - WebInspector.UIString('Toggle breakpoint')); + Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, + Common.UIString('Toggle breakpoint')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakpoints-active'), - WebInspector.UIString('Toggle all breakpoints')); + UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakpoints-active'), + Common.UIString('Toggle all breakpoints')); // Editing - section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Text Editor')); + section = Components.shortcutsScreen.section(Common.UIString('Text Editor')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, WebInspector.UIString('Go to member')); + Components.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, Common.UIString('Go to member')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion, - WebInspector.UIString('Autocompletion')); + Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion, + Common.UIString('Autocompletion')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, WebInspector.UIString('Go to line')); + Components.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, Common.UIString('Go to line')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, - WebInspector.UIString('Jump to previous editing location')); + Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, + Common.UIString('Jump to previous editing location')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, - WebInspector.UIString('Jump to next editing location')); + Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, + Common.UIString('Jump to next editing location')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleComment, WebInspector.UIString('Toggle comment')); + Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleComment, Common.UIString('Toggle comment')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne, - WebInspector.UIString('Increment CSS unit by 1')); + Components.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne, + Common.UIString('Increment CSS unit by 1')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne, - WebInspector.UIString('Decrement CSS unit by 1')); + Components.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne, + Common.UIString('Decrement CSS unit by 1')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen, - WebInspector.UIString('Increment CSS unit by 10')); + Components.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen, + Common.UIString('Increment CSS unit by 10')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen, - WebInspector.UIString('Decrement CSS unit by 10')); + Components.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen, + Common.UIString('Decrement CSS unit by 10')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence, - WebInspector.UIString('Select next occurrence')); + Components.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence, + Common.UIString('Select next occurrence')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SoftUndo, WebInspector.UIString('Soft undo')); + Components.ShortcutsScreen.SourcesPanelShortcuts.SoftUndo, Common.UIString('Soft undo')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket, - WebInspector.UIString('Go to matching bracket')); + Components.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket, + Common.UIString('Go to matching bracket')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, WebInspector.UIString('Close editor tab')); + Components.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, Common.UIString('Close editor tab')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('sources.switch-file'), - WebInspector.UIString('Switch between files with the same name and different extensions.')); + UI.shortcutRegistry.shortcutDescriptorsForAction('sources.switch-file'), + Common.UIString('Switch between files with the same name and different extensions.')); // Timeline panel - section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Timeline Panel')); + section = Components.shortcutsScreen.section(Common.UIString('Timeline Panel')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-recording'), - WebInspector.UIString('Start/stop recording')); + UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-recording'), + Common.UIString('Start/stop recording')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.reload'), - WebInspector.UIString('Record page reload')); + UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload'), + Common.UIString('Record page reload')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.save-to-file'), - WebInspector.UIString('Save timeline data')); + UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.save-to-file'), + Common.UIString('Save timeline data')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.load-from-file'), - WebInspector.UIString('Load timeline data')); + UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.load-from-file'), + Common.UIString('Load timeline data')); section.addRelatedKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-previous-frame') - .concat(WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-next-frame')), - WebInspector.UIString('Jump to previous/next frame')); + UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-previous-frame') + .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-next-frame')), + Common.UIString('Jump to previous/next frame')); // Profiles panel - section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Profiles Panel')); + section = Components.shortcutsScreen.section(Common.UIString('Profiles Panel')); section.addAlternateKeys( - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('profiler.toggle-recording'), - WebInspector.UIString('Start/stop recording')); + UI.shortcutRegistry.shortcutDescriptorsForAction('profiler.toggle-recording'), + Common.UIString('Start/stop recording')); // Layers panel if (Runtime.experiments.isEnabled('layersPanel')) { - section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Layers Panel')); + section = Components.shortcutsScreen.section(Common.UIString('Layers Panel')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.ResetView, WebInspector.UIString('Reset view')); + Components.ShortcutsScreen.LayersPanelShortcuts.ResetView, Common.UIString('Reset view')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.PanMode, WebInspector.UIString('Switch to pan mode')); + Components.ShortcutsScreen.LayersPanelShortcuts.PanMode, Common.UIString('Switch to pan mode')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.RotateMode, WebInspector.UIString('Switch to rotate mode')); + Components.ShortcutsScreen.LayersPanelShortcuts.RotateMode, Common.UIString('Switch to rotate mode')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate, - WebInspector.UIString('Temporarily toggle pan/rotate mode while held')); + Components.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate, + Common.UIString('Temporarily toggle pan/rotate mode while held')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, WebInspector.UIString('Zoom in')); + Components.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, Common.UIString('Zoom in')); section.addAlternateKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, WebInspector.UIString('Zoom out')); + Components.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, Common.UIString('Zoom out')); section.addRelatedKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Up.concat( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down), - WebInspector.UIString('Pan or rotate up/down')); + Components.ShortcutsScreen.LayersPanelShortcuts.Up.concat( + Components.ShortcutsScreen.LayersPanelShortcuts.Down), + Common.UIString('Pan or rotate up/down')); section.addRelatedKeys( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Left.concat( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right), - WebInspector.UIString('Pan or rotate left/right')); + Components.ShortcutsScreen.LayersPanelShortcuts.Left.concat( + Components.ShortcutsScreen.LayersPanelShortcuts.Right), + Common.UIString('Pan or rotate left/right')); } } /** * @param {string} name - * @return {!WebInspector.ShortcutsSection} + * @return {!Components.ShortcutsSection} */ section(name) { var section = this._sections[name]; if (!section) - this._sections[name] = section = new WebInspector.ShortcutsSection(name); + this._sections[name] = section = new Components.ShortcutsSection(name); return section; } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ createShortcutsTabView() { var orderedSections = []; @@ -240,10 +240,10 @@ } orderedSections.sort(compareSections); - var widget = new WebInspector.Widget(); + var widget = new UI.Widget(); widget.element.className = 'settings-tab-container'; // Override - widget.element.createChild('header').createChild('h3').createTextChild(WebInspector.UIString('Shortcuts')); + widget.element.createChild('header').createChild('h3').createTextChild(Common.UIString('Shortcuts')); var scrollPane = widget.element.createChild('div', 'help-container-wrapper'); var container = scrollPane.createChild('div'); container.className = 'help-content help-container'; @@ -251,9 +251,9 @@ orderedSections[i].renderSection(container); var note = scrollPane.createChild('p', 'help-footnote'); - note.appendChild(WebInspector.linkifyDocumentationURLAsNode( + note.appendChild(UI.linkifyDocumentationURLAsNode( 'iterate/inspect-styles/shortcuts', - WebInspector.UIString('Full list of DevTools keyboard shortcuts and gestures'))); + Common.UIString('Full list of DevTools keyboard shortcuts and gestures'))); return widget; } @@ -261,25 +261,25 @@ /** * We cannot initialize it here as localized strings are not loaded yet. - * @type {!WebInspector.ShortcutsScreen} + * @type {!Components.ShortcutsScreen} */ -WebInspector.shortcutsScreen; +Components.shortcutsScreen; /** * @unrestricted */ -WebInspector.ShortcutsSection = class { +Components.ShortcutsSection = class { /** * @param {string} name */ constructor(name) { this.name = name; this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); - this.order = ++WebInspector.ShortcutsSection._sequenceNumber; + this.order = ++Components.ShortcutsSection._sequenceNumber; } /** - * @param {!WebInspector.KeyboardShortcut.Descriptor} key + * @param {!UI.KeyboardShortcut.Descriptor} key * @param {string} description */ addKey(key, description) { @@ -287,7 +287,7 @@ } /** - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys * @param {string} description */ addRelatedKeys(keys, description) { @@ -295,11 +295,11 @@ } /** - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys * @param {string} description */ addAlternateKeys(keys, description) { - this._addLine(this._renderSequence(keys, WebInspector.UIString('or')), description); + this._addLine(this._renderSequence(keys, Common.UIString('or')), description); } /** @@ -330,7 +330,7 @@ } /** - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} sequence + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} sequence * @param {string} delimiter * @return {!Node} */ @@ -340,7 +340,7 @@ } /** - * @param {!WebInspector.KeyboardShortcut.Descriptor} key + * @param {!UI.KeyboardShortcut.Descriptor} key * @return {!Node} */ _renderKey(key) { @@ -377,156 +377,156 @@ } }; -WebInspector.ShortcutsSection._sequenceNumber = 0; +Components.ShortcutsSection._sequenceNumber = 0; -WebInspector.ShortcutsScreen.ElementsPanelShortcuts = { - NavigateUp: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up)], +Components.ShortcutsScreen.ElementsPanelShortcuts = { + NavigateUp: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up)], - NavigateDown: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down)], + NavigateDown: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Down)], - Expand: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Right)], + Expand: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right)], - Collapse: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Left)], + Collapse: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left)], - EditAttribute: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Enter)], + EditAttribute: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Enter)], - HideElement: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.H)], + HideElement: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.H)], - ToggleEditAsHTML: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F2)], + ToggleEditAsHTML: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.F2)], - NextProperty: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Tab)], + NextProperty: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Tab)], - PreviousProperty: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Tab, WebInspector.KeyboardShortcut.Modifiers.Shift)], + PreviousProperty: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Tab, UI.KeyboardShortcut.Modifiers.Shift)], - IncrementValue: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up)], + IncrementValue: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up)], - DecrementValue: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down)], + DecrementValue: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Down)], IncrementBy10: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageUp), - WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Shift) + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageUp), + UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Up, UI.KeyboardShortcut.Modifiers.Shift) ], DecrementBy10: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageDown), - WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Shift) + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageDown), + UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Down, UI.KeyboardShortcut.Modifiers.Shift) ], - IncrementBy100: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.PageUp, WebInspector.KeyboardShortcut.Modifiers.Shift)], + IncrementBy100: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.PageUp, UI.KeyboardShortcut.Modifiers.Shift)], - DecrementBy100: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.PageDown, WebInspector.KeyboardShortcut.Modifiers.Shift)], + DecrementBy100: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.PageDown, UI.KeyboardShortcut.Modifiers.Shift)], - IncrementBy01: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Alt)], + IncrementBy01: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Up, UI.KeyboardShortcut.Modifiers.Alt)], - DecrementBy01: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Alt)] + DecrementBy01: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Down, UI.KeyboardShortcut.Modifiers.Alt)] }; -WebInspector.ShortcutsScreen.SourcesPanelShortcuts = { +Components.ShortcutsScreen.SourcesPanelShortcuts = { SelectNextOccurrence: - [WebInspector.KeyboardShortcut.makeDescriptor('d', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)], + [UI.KeyboardShortcut.makeDescriptor('d', UI.KeyboardShortcut.Modifiers.CtrlOrMeta)], - SoftUndo: [WebInspector.KeyboardShortcut.makeDescriptor('u', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)], + SoftUndo: [UI.KeyboardShortcut.makeDescriptor('u', UI.KeyboardShortcut.Modifiers.CtrlOrMeta)], GotoMatchingBracket: - [WebInspector.KeyboardShortcut.makeDescriptor('m', WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + [UI.KeyboardShortcut.makeDescriptor('m', UI.KeyboardShortcut.Modifiers.Ctrl)], - ToggleAutocompletion: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Space, WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + ToggleAutocompletion: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Space, UI.KeyboardShortcut.Modifiers.Ctrl)], - IncreaseCSSUnitByOne: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Alt)], + IncreaseCSSUnitByOne: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Up, UI.KeyboardShortcut.Modifiers.Alt)], - DecreaseCSSUnitByOne: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Alt)], + DecreaseCSSUnitByOne: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Down, UI.KeyboardShortcut.Modifiers.Alt)], - IncreaseCSSUnitByTen: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.PageUp, WebInspector.KeyboardShortcut.Modifiers.Alt)], + IncreaseCSSUnitByTen: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.PageUp, UI.KeyboardShortcut.Modifiers.Alt)], - DecreaseCSSUnitByTen: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.PageDown, WebInspector.KeyboardShortcut.Modifiers.Alt)], - EvaluateSelectionInConsole: [WebInspector.KeyboardShortcut.makeDescriptor( - 'e', WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + DecreaseCSSUnitByTen: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.PageDown, UI.KeyboardShortcut.Modifiers.Alt)], + EvaluateSelectionInConsole: [UI.KeyboardShortcut.makeDescriptor( + 'e', UI.KeyboardShortcut.Modifiers.Shift | UI.KeyboardShortcut.Modifiers.Ctrl)], - AddSelectionToWatch: [WebInspector.KeyboardShortcut.makeDescriptor( - 'a', WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + AddSelectionToWatch: [UI.KeyboardShortcut.makeDescriptor( + 'a', UI.KeyboardShortcut.Modifiers.Shift | UI.KeyboardShortcut.Modifiers.Ctrl)], - GoToMember: [WebInspector.KeyboardShortcut.makeDescriptor( - 'o', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.Shift)], + GoToMember: [UI.KeyboardShortcut.makeDescriptor( + 'o', UI.KeyboardShortcut.Modifiers.CtrlOrMeta | UI.KeyboardShortcut.Modifiers.Shift)], - GoToLine: [WebInspector.KeyboardShortcut.makeDescriptor('g', WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + GoToLine: [UI.KeyboardShortcut.makeDescriptor('g', UI.KeyboardShortcut.Modifiers.Ctrl)], ToggleBreakpoint: - [WebInspector.KeyboardShortcut.makeDescriptor('b', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)], + [UI.KeyboardShortcut.makeDescriptor('b', UI.KeyboardShortcut.Modifiers.CtrlOrMeta)], - NextCallFrame: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Period, WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + NextCallFrame: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Period, UI.KeyboardShortcut.Modifiers.Ctrl)], - PrevCallFrame: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Comma, WebInspector.KeyboardShortcut.Modifiers.Ctrl)], + PrevCallFrame: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Comma, UI.KeyboardShortcut.Modifiers.Ctrl)], - ToggleComment: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Slash, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)], + ToggleComment: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Slash, UI.KeyboardShortcut.Modifiers.CtrlOrMeta)], - JumpToPreviousLocation: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Minus, WebInspector.KeyboardShortcut.Modifiers.Alt)], + JumpToPreviousLocation: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Minus, UI.KeyboardShortcut.Modifiers.Alt)], - JumpToNextLocation: [WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Plus, WebInspector.KeyboardShortcut.Modifiers.Alt)], + JumpToNextLocation: [UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Plus, UI.KeyboardShortcut.Modifiers.Alt)], - CloseEditorTab: [WebInspector.KeyboardShortcut.makeDescriptor('w', WebInspector.KeyboardShortcut.Modifiers.Alt)], + CloseEditorTab: [UI.KeyboardShortcut.makeDescriptor('w', UI.KeyboardShortcut.Modifiers.Alt)], - Save: [WebInspector.KeyboardShortcut.makeDescriptor('s', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)], + Save: [UI.KeyboardShortcut.makeDescriptor('s', UI.KeyboardShortcut.Modifiers.CtrlOrMeta)], - SaveAll: [WebInspector.KeyboardShortcut.makeDescriptor( - 's', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.ShiftOrOption)], + SaveAll: [UI.KeyboardShortcut.makeDescriptor( + 's', UI.KeyboardShortcut.Modifiers.CtrlOrMeta | UI.KeyboardShortcut.Modifiers.ShiftOrOption)], }; -WebInspector.ShortcutsScreen.LayersPanelShortcuts = { - ResetView: [WebInspector.KeyboardShortcut.makeDescriptor('0')], +Components.ShortcutsScreen.LayersPanelShortcuts = { + ResetView: [UI.KeyboardShortcut.makeDescriptor('0')], - PanMode: [WebInspector.KeyboardShortcut.makeDescriptor('x')], + PanMode: [UI.KeyboardShortcut.makeDescriptor('x')], - RotateMode: [WebInspector.KeyboardShortcut.makeDescriptor('v')], + RotateMode: [UI.KeyboardShortcut.makeDescriptor('v')], - TogglePanRotate: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Shift)], + TogglePanRotate: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Shift)], ZoomIn: [ - WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Plus, WebInspector.KeyboardShortcut.Modifiers.Shift), - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.NumpadPlus) + UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Plus, UI.KeyboardShortcut.Modifiers.Shift), + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadPlus) ], ZoomOut: [ - WebInspector.KeyboardShortcut.makeDescriptor( - WebInspector.KeyboardShortcut.Keys.Minus, WebInspector.KeyboardShortcut.Modifiers.Shift), - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.NumpadMinus) + UI.KeyboardShortcut.makeDescriptor( + UI.KeyboardShortcut.Keys.Minus, UI.KeyboardShortcut.Modifiers.Shift), + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadMinus) ], Up: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up), - WebInspector.KeyboardShortcut.makeDescriptor('w') + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up), + UI.KeyboardShortcut.makeDescriptor('w') ], Down: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down), - WebInspector.KeyboardShortcut.makeDescriptor('s') + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Down), + UI.KeyboardShortcut.makeDescriptor('s') ], Left: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Left), - WebInspector.KeyboardShortcut.makeDescriptor('a') + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left), + UI.KeyboardShortcut.makeDescriptor('a') ], Right: [ - WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Right), - WebInspector.KeyboardShortcut.makeDescriptor('d') + UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right), + UI.KeyboardShortcut.makeDescriptor('d') ] };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js b/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js index e5c5221..ee5e40b 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js +++ b/third_party/WebKit/Source/devtools/front_end/components/Spectrum.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -WebInspector.Spectrum = class extends WebInspector.VBox { +Components.Spectrum = class extends UI.VBox { constructor() { /** * @param {!Element} parentElement @@ -55,9 +55,9 @@ var contrastRatioSVG = this._colorElement.createSVGChild('svg', 'spectrum-contrast-container fill'); this._contrastRatioLine = contrastRatioSVG.createSVGChild('path', 'spectrum-contrast-line'); - var toolbar = new WebInspector.Toolbar('spectrum-eye-dropper', this.contentElement); + var toolbar = new UI.Toolbar('spectrum-eye-dropper', this.contentElement); this._colorPickerButton = - new WebInspector.ToolbarToggle(WebInspector.UIString('Toggle color picker'), 'largeicon-eyedropper'); + new UI.ToolbarToggle(Common.UIString('Toggle color picker'), 'largeicon-eyedropper'); this._colorPickerButton.setToggled(true); this._colorPickerButton.addEventListener('click', this._toggleColorPicker.bind(this, undefined)); toolbar.appendToolbarItem(this._colorPickerButton); @@ -100,48 +100,48 @@ var label = this._hexContainer.createChild('div', 'spectrum-text-label'); label.textContent = 'HEX'; - WebInspector.installDragHandle( + UI.installDragHandle( this._hueElement, dragStart.bind(this, positionHue.bind(this)), positionHue.bind(this), null, 'default'); - WebInspector.installDragHandle( + UI.installDragHandle( this._alphaElement, dragStart.bind(this, positionAlpha.bind(this)), positionAlpha.bind(this), null, 'default'); - WebInspector.installDragHandle( + UI.installDragHandle( this._colorElement, dragStart.bind(this, positionColor.bind(this)), positionColor.bind(this), null, 'default'); this.element.classList.add('palettes-enabled'); - /** @type {!Map.<string, !WebInspector.Spectrum.Palette>} */ + /** @type {!Map.<string, !Components.Spectrum.Palette>} */ this._palettes = new Map(); this._palettePanel = this.contentElement.createChild('div', 'palette-panel'); this._palettePanelShowing = false; this._paletteContainer = this.contentElement.createChild('div', 'spectrum-palette'); this._paletteContainer.addEventListener('contextmenu', this._showPaletteColorContextMenu.bind(this, -1)); this._shadesContainer = this.contentElement.createChild('div', 'palette-color-shades hidden'); - WebInspector.installDragHandle( + UI.installDragHandle( this._paletteContainer, this._paletteDragStart.bind(this), this._paletteDrag.bind(this), this._paletteDragEnd.bind(this), 'default'); var paletteSwitcher = this.contentElement.createChild('div', 'spectrum-palette-switcher spectrum-switcher'); appendSwitcherIcon(paletteSwitcher); paletteSwitcher.addEventListener('click', this._togglePalettePanel.bind(this, true)); - this._deleteIconToolbar = new WebInspector.Toolbar('delete-color-toolbar'); - this._deleteButton = new WebInspector.ToolbarButton('', 'largeicon-trash-bin'); + this._deleteIconToolbar = new UI.Toolbar('delete-color-toolbar'); + this._deleteButton = new UI.ToolbarButton('', 'largeicon-trash-bin'); this._deleteIconToolbar.appendToolbarItem(this._deleteButton); var overlay = this.contentElement.createChild('div', 'spectrum-overlay fill'); overlay.addEventListener('click', this._togglePalettePanel.bind(this, false)); - this._addColorToolbar = new WebInspector.Toolbar('add-color-toolbar'); - var addColorButton = new WebInspector.ToolbarButton(WebInspector.UIString('Add to palette'), 'largeicon-add'); + this._addColorToolbar = new UI.Toolbar('add-color-toolbar'); + var addColorButton = new UI.ToolbarButton(Common.UIString('Add to palette'), 'largeicon-add'); addColorButton.addEventListener('click', this._addColorToCustomPalette.bind(this)); this._addColorToolbar.appendToolbarItem(addColorButton); this._loadPalettes(); - new WebInspector.Spectrum.PaletteGenerator(this._generatedPaletteLoaded.bind(this)); + new Components.Spectrum.PaletteGenerator(this._generatedPaletteLoaded.bind(this)); /** * @param {function(!Event)} callback * @param {!Event} event * @return {boolean} - * @this {WebInspector.Spectrum} + * @this {Components.Spectrum} */ function dragStart(callback, event) { this._hueAlphaLeft = this._hueElement.totalOffsetLeft(); @@ -152,48 +152,48 @@ /** * @param {!Event} event - * @this {WebInspector.Spectrum} + * @this {Components.Spectrum} */ function positionHue(event) { var hsva = this._hsv.slice(); hsva[0] = Number.constrain(1 - (event.x - this._hueAlphaLeft) / this._hueAlphaWidth, 0, 1); - this._innerSetColor(hsva, '', undefined, WebInspector.Spectrum._ChangeSource.Other); + this._innerSetColor(hsva, '', undefined, Components.Spectrum._ChangeSource.Other); } /** * @param {!Event} event - * @this {WebInspector.Spectrum} + * @this {Components.Spectrum} */ function positionAlpha(event) { var newAlpha = Math.round((event.x - this._hueAlphaLeft) / this._hueAlphaWidth * 100) / 100; var hsva = this._hsv.slice(); hsva[3] = Number.constrain(newAlpha, 0, 1); var colorFormat = undefined; - if (hsva[3] !== 1 && (this._colorFormat === WebInspector.Color.Format.ShortHEX || - this._colorFormat === WebInspector.Color.Format.HEX || - this._colorFormat === WebInspector.Color.Format.Nickname)) - colorFormat = WebInspector.Color.Format.RGB; - this._innerSetColor(hsva, '', colorFormat, WebInspector.Spectrum._ChangeSource.Other); + if (hsva[3] !== 1 && (this._colorFormat === Common.Color.Format.ShortHEX || + this._colorFormat === Common.Color.Format.HEX || + this._colorFormat === Common.Color.Format.Nickname)) + colorFormat = Common.Color.Format.RGB; + this._innerSetColor(hsva, '', colorFormat, Components.Spectrum._ChangeSource.Other); } /** * @param {!Event} event - * @this {WebInspector.Spectrum} + * @this {Components.Spectrum} */ function positionColor(event) { var hsva = this._hsv.slice(); hsva[1] = Number.constrain((event.x - this._colorOffset.left) / this.dragWidth, 0, 1); hsva[2] = Number.constrain(1 - (event.y - this._colorOffset.top) / this.dragHeight, 0, 1); - this._innerSetColor(hsva, '', undefined, WebInspector.Spectrum._ChangeSource.Other); + this._innerSetColor(hsva, '', undefined, Components.Spectrum._ChangeSource.Other); } } _updatePalettePanel() { this._palettePanel.removeChildren(); var title = this._palettePanel.createChild('div', 'palette-title'); - title.textContent = WebInspector.UIString('Color Palettes'); - var toolbar = new WebInspector.Toolbar('', this._palettePanel); - var closeButton = new WebInspector.ToolbarButton('Return to color picker', 'largeicon-delete'); + title.textContent = Common.UIString('Color Palettes'); + var toolbar = new UI.Toolbar('', this._palettePanel); + var closeButton = new UI.ToolbarButton('Return to color picker', 'largeicon-delete'); closeButton.addEventListener('click', this._togglePalettePanel.bind(this, false)); toolbar.appendToolbarItem(closeButton); for (var palette of this._palettes.values()) @@ -233,7 +233,7 @@ } /** - * @param {!WebInspector.Spectrum.Palette} palette + * @param {!Components.Spectrum.Palette} palette * @param {boolean} animate * @param {!Event=} event */ @@ -249,14 +249,14 @@ colorElement.__mutable = true; colorElement.__color = palette.colors[i]; colorElement.addEventListener('contextmenu', this._showPaletteColorContextMenu.bind(this, i)); - } else if (palette === WebInspector.Spectrum.MaterialPalette) { + } else if (palette === Components.Spectrum.MaterialPalette) { colorElement.classList.add('has-material-shades'); var shadow = colorElement.createChild('div', 'spectrum-palette-color spectrum-palette-color-shadow'); shadow.style.background = palette.colors[i]; shadow = colorElement.createChild('div', 'spectrum-palette-color spectrum-palette-color-shadow'); shadow.style.background = palette.colors[i]; - colorElement.title = WebInspector.UIString(palette.colors[i] + '. Long-click to show alternate shades.'); - new WebInspector.LongClickController( + colorElement.title = Common.UIString(palette.colors[i] + '. Long-click to show alternate shades.'); + new UI.LongClickController( colorElement, this._showLightnessShades.bind(this, colorElement, palette.colors[i])); } this._paletteContainer.appendChild(colorElement); @@ -286,7 +286,7 @@ _showLightnessShades(colorElement, colorText, event) { /** * @param {!Element} element - * @this {!WebInspector.Spectrum} + * @this {!Components.Spectrum} */ function closeLightnessShades(element) { this._shadesContainer.classList.add('hidden'); @@ -307,7 +307,7 @@ this._shadesContainer.style.left = colorElement.offsetLeft + 'px'; colorElement.classList.add('spectrum-shades-shown'); - var shades = WebInspector.Spectrum.MaterialPaletteShades[colorText]; + var shades = Components.Spectrum.MaterialPaletteShades[colorText]; for (var i = shades.length - 1; i >= 0; i--) { var shadeElement = this._createPaletteColor(shades[i], i * 200 / shades.length + 100); shadeElement.addEventListener('mousedown', this._paletteColorSelected.bind(this, shades[i], false)); @@ -327,10 +327,10 @@ var localX = e.pageX - this._paletteContainer.totalOffsetLeft(); var localY = e.pageY - this._paletteContainer.totalOffsetTop(); var col = - Math.min(localX / WebInspector.Spectrum._colorChipSize | 0, WebInspector.Spectrum._itemsPerPaletteRow - 1); - var row = (localY / WebInspector.Spectrum._colorChipSize) | 0; + Math.min(localX / Components.Spectrum._colorChipSize | 0, Components.Spectrum._itemsPerPaletteRow - 1); + var row = (localY / Components.Spectrum._colorChipSize) | 0; return Math.min( - row * WebInspector.Spectrum._itemsPerPaletteRow + col, this._customPaletteSetting.get().colors.length - 1); + row * Components.Spectrum._itemsPerPaletteRow + col, this._customPaletteSetting.get().colors.length - 1); } /** @@ -353,9 +353,9 @@ var index = this._slotIndexForEvent(e); this._dragElement = element; this._dragHotSpotX = - e.pageX - (index % WebInspector.Spectrum._itemsPerPaletteRow) * WebInspector.Spectrum._colorChipSize; + e.pageX - (index % Components.Spectrum._itemsPerPaletteRow) * Components.Spectrum._colorChipSize; this._dragHotSpotY = - e.pageY - (index / WebInspector.Spectrum._itemsPerPaletteRow | 0) * WebInspector.Spectrum._colorChipSize; + e.pageY - (index / Components.Spectrum._itemsPerPaletteRow | 0) * Components.Spectrum._colorChipSize; return true; } @@ -367,9 +367,9 @@ return; var newIndex = this._slotIndexForEvent(e); var offsetX = - e.pageX - (newIndex % WebInspector.Spectrum._itemsPerPaletteRow) * WebInspector.Spectrum._colorChipSize; + e.pageX - (newIndex % Components.Spectrum._itemsPerPaletteRow) * Components.Spectrum._colorChipSize; var offsetY = - e.pageY - (newIndex / WebInspector.Spectrum._itemsPerPaletteRow | 0) * WebInspector.Spectrum._colorChipSize; + e.pageY - (newIndex / Components.Spectrum._itemsPerPaletteRow | 0) * Components.Spectrum._colorChipSize; var isDeleting = this._isDraggingToBin(e); this._deleteIconToolbar.element.classList.add('dragging'); @@ -429,21 +429,21 @@ } _loadPalettes() { - this._palettes.set(WebInspector.Spectrum.MaterialPalette.title, WebInspector.Spectrum.MaterialPalette); - /** @type {!WebInspector.Spectrum.Palette} */ + this._palettes.set(Components.Spectrum.MaterialPalette.title, Components.Spectrum.MaterialPalette); + /** @type {!Components.Spectrum.Palette} */ var defaultCustomPalette = {title: 'Custom', colors: [], mutable: true}; - this._customPaletteSetting = WebInspector.settings.createSetting('customColorPalette', defaultCustomPalette); + this._customPaletteSetting = Common.settings.createSetting('customColorPalette', defaultCustomPalette); this._palettes.set(this._customPaletteSetting.get().title, this._customPaletteSetting.get()); this._selectedColorPalette = - WebInspector.settings.createSetting('selectedColorPalette', WebInspector.Spectrum.GeneratedPaletteTitle); + Common.settings.createSetting('selectedColorPalette', Components.Spectrum.GeneratedPaletteTitle); var palette = this._palettes.get(this._selectedColorPalette.get()); if (palette) this._showPalette(palette, true); } /** - * @param {!WebInspector.Spectrum.Palette} generatedPalette + * @param {!Components.Spectrum.Palette} generatedPalette */ _generatedPaletteLoaded(generatedPalette) { if (generatedPalette.colors.length) @@ -451,14 +451,14 @@ if (this._selectedColorPalette.get() !== generatedPalette.title) { return; } else if (!generatedPalette.colors.length) { - this._paletteSelected(WebInspector.Spectrum.MaterialPalette); + this._paletteSelected(Components.Spectrum.MaterialPalette); return; } this._showPalette(generatedPalette, true); } /** - * @param {!WebInspector.Spectrum.Palette} palette + * @param {!Components.Spectrum.Palette} palette * @return {!Element} */ _createPreviewPaletteElement(palette) { @@ -475,7 +475,7 @@ } /** - * @param {!WebInspector.Spectrum.Palette} palette + * @param {!Components.Spectrum.Palette} palette */ _paletteSelected(palette) { this._selectedColorPalette.set(palette.title); @@ -489,7 +489,7 @@ var numColors = palette.colors.length; if (palette === this._customPaletteSetting.get()) numColors++; - var rowsNeeded = Math.max(1, Math.ceil(numColors / WebInspector.Spectrum._itemsPerPaletteRow)); + var rowsNeeded = Math.max(1, Math.ceil(numColors / Components.Spectrum._itemsPerPaletteRow)); if (this._numPaletteRowsShown === rowsNeeded) return; this._numPaletteRowsShown = rowsNeeded; @@ -497,7 +497,7 @@ var paletteMargin = 12; var paletteTop = 235; this.element.style.height = (paletteTop + paletteMargin + (paletteColorHeight + paletteMargin) * rowsNeeded) + 'px'; - this.dispatchEventToListeners(WebInspector.Spectrum.Events.SizeChanged); + this.dispatchEventToListeners(Components.Spectrum.Events.SizeChanged); } /** @@ -505,12 +505,12 @@ * @param {boolean} matchUserFormat */ _paletteColorSelected(colorText, matchUserFormat) { - var color = WebInspector.Color.parse(colorText); + var color = Common.Color.parse(colorText); if (!color) return; this._innerSetColor( color.hsva(), colorText, matchUserFormat ? this._colorFormat : color.format(), - WebInspector.Spectrum._ChangeSource.Other); + Components.Spectrum._ChangeSource.Other); } _addColorToCustomPalette() { @@ -527,14 +527,14 @@ _showPaletteColorContextMenu(colorIndex, event) { if (!this._paletteContainerMutable) return; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (colorIndex !== -1) { contextMenu.appendItem( - WebInspector.UIString('Remove color'), this._deletePaletteColors.bind(this, colorIndex, false)); + Common.UIString('Remove color'), this._deletePaletteColors.bind(this, colorIndex, false)); contextMenu.appendItem( - WebInspector.UIString('Remove all to the right'), this._deletePaletteColors.bind(this, colorIndex, true)); + Common.UIString('Remove all to the right'), this._deletePaletteColors.bind(this, colorIndex, true)); } - contextMenu.appendItem(WebInspector.UIString('Clear palette'), this._deletePaletteColors.bind(this, -1, true)); + contextMenu.appendItem(Common.UIString('Clear palette'), this._deletePaletteColors.bind(this, -1, true)); contextMenu.show(); } @@ -553,12 +553,12 @@ } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color * @param {string} colorFormat */ setColor(color, colorFormat) { this._originalFormat = colorFormat; - this._innerSetColor(color.hsva(), '', colorFormat, WebInspector.Spectrum._ChangeSource.Model); + this._innerSetColor(color.hsva(), '', colorFormat, Components.Spectrum._ChangeSource.Model); } /** @@ -573,25 +573,25 @@ if (colorString !== undefined) this._colorString = colorString; if (colorFormat !== undefined) { - console.assert(colorFormat !== WebInspector.Color.Format.Original, 'Spectrum\'s color format cannot be Original'); - if (colorFormat === WebInspector.Color.Format.RGBA) - colorFormat = WebInspector.Color.Format.RGB; - else if (colorFormat === WebInspector.Color.Format.HSLA) - colorFormat = WebInspector.Color.Format.HSL; + console.assert(colorFormat !== Common.Color.Format.Original, 'Spectrum\'s color format cannot be Original'); + if (colorFormat === Common.Color.Format.RGBA) + colorFormat = Common.Color.Format.RGB; + else if (colorFormat === Common.Color.Format.HSLA) + colorFormat = Common.Color.Format.HSL; this._colorFormat = colorFormat; } this._updateHelperLocations(); this._updateUI(); - if (changeSource !== WebInspector.Spectrum._ChangeSource.Input) + if (changeSource !== Components.Spectrum._ChangeSource.Input) this._updateInput(); - if (changeSource !== WebInspector.Spectrum._ChangeSource.Model) - this.dispatchEventToListeners(WebInspector.Spectrum.Events.ColorChanged, this.colorString()); + if (changeSource !== Components.Spectrum._ChangeSource.Model) + this.dispatchEventToListeners(Components.Spectrum.Events.ColorChanged, this.colorString()); } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color */ setContrastColor(color) { this._contrastColor = color; @@ -599,10 +599,10 @@ } /** - * @return {!WebInspector.Color} + * @return {!Common.Color} */ _color() { - return WebInspector.Color.fromHSVA(this._hsv); + return Common.Color.fromHSVA(this._hsv); } /** @@ -611,7 +611,7 @@ colorString() { if (this._colorString) return this._colorString; - var cf = WebInspector.Color.Format; + var cf = Common.Color.Format; var color = this._color(); var colorString = color.asString(this._colorFormat); if (colorString) @@ -655,7 +655,7 @@ } _updateInput() { - var cf = WebInspector.Color.Format; + var cf = Common.Color.Format; if (this._colorFormat === cf.HEX || this._colorFormat === cf.ShortHEX || this._colorFormat === cf.Nickname) { this._hexContainer.hidden = false; this._displayContainer.hidden = true; @@ -696,21 +696,21 @@ /** const */ var A = 3; var fgRGBA = []; - WebInspector.Color.hsva2rgba(this._hsv, fgRGBA); - var fgLuminance = WebInspector.Color.luminance(fgRGBA); + Common.Color.hsva2rgba(this._hsv, fgRGBA); + var fgLuminance = Common.Color.luminance(fgRGBA); var bgRGBA = this._contrastColor.rgba(); - var bgLuminance = WebInspector.Color.luminance(bgRGBA); + var bgLuminance = Common.Color.luminance(bgRGBA); var fgIsLighter = fgLuminance > bgLuminance; - var desiredLuminance = WebInspector.Color.desiredLuminance(bgLuminance, requiredContrast, fgIsLighter); + var desiredLuminance = Common.Color.desiredLuminance(bgLuminance, requiredContrast, fgIsLighter); var lastV = this._hsv[V]; var currentSlope = 0; var candidateHSVA = [this._hsv[H], 0, 0, this._hsv[A]]; var pathBuilder = []; var candidateRGBA = []; - WebInspector.Color.hsva2rgba(candidateHSVA, candidateRGBA); + Common.Color.hsva2rgba(candidateHSVA, candidateRGBA); var blendedRGBA = []; - WebInspector.Color.blendColors(candidateRGBA, bgRGBA, blendedRGBA); + Common.Color.blendColors(candidateRGBA, bgRGBA, blendedRGBA); /** * Approach the desired contrast ratio by modifying the given component @@ -723,9 +723,9 @@ function approach(index, x, onAxis) { while (0 <= x && x <= 1) { candidateHSVA[index] = x; - WebInspector.Color.hsva2rgba(candidateHSVA, candidateRGBA); - WebInspector.Color.blendColors(candidateRGBA, bgRGBA, blendedRGBA); - var fgLuminance = WebInspector.Color.luminance(blendedRGBA); + Common.Color.hsva2rgba(candidateHSVA, candidateRGBA); + Common.Color.blendColors(candidateRGBA, bgRGBA, blendedRGBA); + var fgLuminance = Common.Color.luminance(blendedRGBA); var dLuminance = fgLuminance - desiredLuminance; if (Math.abs(dLuminance) < (onAxis ? epsilon / 10 : epsilon)) @@ -766,31 +766,31 @@ } _updateUI() { - var h = WebInspector.Color.fromHSVA([this._hsv[0], 1, 1, 1]); - this._colorElement.style.backgroundColor = /** @type {string} */ (h.asString(WebInspector.Color.Format.RGB)); + var h = Common.Color.fromHSVA([this._hsv[0], 1, 1, 1]); + this._colorElement.style.backgroundColor = /** @type {string} */ (h.asString(Common.Color.Format.RGB)); if (Runtime.experiments.isEnabled('colorContrastRatio')) { // TODO(samli): Determine size of text and switch between AA/AAA ratings. this._drawContrastRatioLine(4.5); } this._swatchInnerElement.style.backgroundColor = - /** @type {string} */ (this._color().asString(WebInspector.Color.Format.RGBA)); + /** @type {string} */ (this._color().asString(Common.Color.Format.RGBA)); // Show border if the swatch is white. this._swatchInnerElement.classList.toggle('swatch-inner-white', this._color().hsla()[2] > 0.9); this._colorDragElement.style.backgroundColor = - /** @type {string} */ (this._color().asString(WebInspector.Color.Format.RGBA)); - var noAlpha = WebInspector.Color.fromHSVA(this._hsv.slice(0, 3).concat(1)); + /** @type {string} */ (this._color().asString(Common.Color.Format.RGBA)); + var noAlpha = Common.Color.fromHSVA(this._hsv.slice(0, 3).concat(1)); this._alphaElementBackground.style.backgroundImage = - String.sprintf('linear-gradient(to right, rgba(0,0,0,0), %s)', noAlpha.asString(WebInspector.Color.Format.RGB)); + String.sprintf('linear-gradient(to right, rgba(0,0,0,0), %s)', noAlpha.asString(Common.Color.Format.RGB)); } _formatViewSwitch() { - var cf = WebInspector.Color.Format; + var cf = Common.Color.Format; var format = cf.RGB; if (this._colorFormat === cf.RGB) format = cf.HSL; else if (this._colorFormat === cf.HSL && !this._color().hasAlpha()) format = this._originalFormat === cf.ShortHEX ? cf.ShortHEX : cf.HEX; - this._innerSetColor(undefined, '', format, WebInspector.Spectrum._ChangeSource.Other); + this._innerSetColor(undefined, '', format, Components.Spectrum._ChangeSource.Other); } /** @@ -806,7 +806,7 @@ } var inputElement = /** @type {!Element} */ (event.currentTarget); - var newValue = WebInspector.createReplacementString(inputElement.value, event); + var newValue = UI.createReplacementString(inputElement.value, event); if (newValue) { inputElement.value = newValue; inputElement.selectionStart = 0; @@ -814,7 +814,7 @@ event.consume(true); } - const cf = WebInspector.Color.Format; + const cf = Common.Color.Format; var colorString; if (this._colorFormat === cf.HEX || this._colorFormat === cf.ShortHEX) { colorString = this._hexValue.value; @@ -824,13 +824,13 @@ colorString = String.sprintf('%s(%s)', format, values); } - var color = WebInspector.Color.parse(colorString); + var color = Common.Color.parse(colorString); if (!color) return; var hsv = color.hsva(); if (this._colorFormat === cf.HEX || this._colorFormat === cf.ShortHEX) this._colorFormat = color.canBeShortHex() ? cf.ShortHEX : cf.HEX; - this._innerSetColor(hsv, colorString, undefined, WebInspector.Spectrum._ChangeSource.Input); + this._innerSetColor(hsv, colorString, undefined, Components.Spectrum._ChangeSource.Input); } /** @@ -842,10 +842,10 @@ this.dragWidth = this._colorElement.offsetWidth; this.dragHeight = this._colorElement.offsetHeight; this._colorDragElementHeight = this._colorDragElement.offsetHeight / 2; - this._innerSetColor(undefined, undefined, undefined, WebInspector.Spectrum._ChangeSource.Model); + this._innerSetColor(undefined, undefined, undefined, Components.Spectrum._ChangeSource.Model); this._toggleColorPicker(true); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); } /** @@ -853,67 +853,67 @@ */ willHide() { this._toggleColorPicker(false); - WebInspector.targetManager.removeModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); + SDK.targetManager.removeModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.ColorPicked, this._colorPicked, this); } /** * @param {boolean=} enabled - * @param {!WebInspector.Event=} event + * @param {!Common.Event=} event */ _toggleColorPicker(enabled, event) { if (enabled === undefined) enabled = !this._colorPickerButton.toggled(); this._colorPickerButton.setToggled(enabled); - for (var target of WebInspector.targetManager.targets()) + for (var target of SDK.targetManager.targets()) target.pageAgent().setColorPickerEnabled(enabled); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _colorPicked(event) { var rgbColor = /** @type {!Protocol.DOM.RGBA} */ (event.data); var rgba = [rgbColor.r, rgbColor.g, rgbColor.b, (rgbColor.a / 2.55 | 0) / 100]; - var color = WebInspector.Color.fromRGBA(rgba); - this._innerSetColor(color.hsva(), '', undefined, WebInspector.Spectrum._ChangeSource.Other); + var color = Common.Color.fromRGBA(rgba); + this._innerSetColor(color.hsva(), '', undefined, Components.Spectrum._ChangeSource.Other); InspectorFrontendHost.bringToFront(); } }; -WebInspector.Spectrum._ChangeSource = { +Components.Spectrum._ChangeSource = { Input: 'Input', Model: 'Model', Other: 'Other' }; /** @enum {symbol} */ -WebInspector.Spectrum.Events = { +Components.Spectrum.Events = { ColorChanged: Symbol('ColorChanged'), SizeChanged: Symbol('SizeChanged') }; -WebInspector.Spectrum._colorChipSize = 24; -WebInspector.Spectrum._itemsPerPaletteRow = 8; +Components.Spectrum._colorChipSize = 24; +Components.Spectrum._itemsPerPaletteRow = 8; /** @typedef {{ title: string, colors: !Array.<string>, mutable: boolean }} */ -WebInspector.Spectrum.Palette; -WebInspector.Spectrum.GeneratedPaletteTitle = 'Page colors'; +Components.Spectrum.Palette; +Components.Spectrum.GeneratedPaletteTitle = 'Page colors'; /** * @unrestricted */ -WebInspector.Spectrum.PaletteGenerator = class { +Components.Spectrum.PaletteGenerator = class { /** - * @param {function(!WebInspector.Spectrum.Palette)} callback + * @param {function(!Components.Spectrum.Palette)} callback */ constructor(callback) { this._callback = callback; /** @type {!Map.<string, number>} */ this._frequencyMap = new Map(); var stylesheetPromises = []; - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) { - var cssModel = WebInspector.CSSModel.fromTarget(target); + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) { + var cssModel = SDK.CSSModel.fromTarget(target); for (var stylesheet of cssModel.allStyleSheets()) stylesheetPromises.push(new Promise(this._processStylesheet.bind(this, stylesheet))); } @@ -956,33 +956,33 @@ var colors = this._frequencyMap.keysArray(); colors = colors.sort(this._frequencyComparator.bind(this)); - /** @type {!Map.<string, !WebInspector.Color>} */ + /** @type {!Map.<string, !Common.Color>} */ var paletteColors = new Map(); var colorsPerRow = 24; while (paletteColors.size < colorsPerRow && colors.length) { var colorText = colors.shift(); - var color = WebInspector.Color.parse(colorText); + var color = Common.Color.parse(colorText); if (!color || color.nickname() === 'white' || color.nickname() === 'black') continue; paletteColors.set(colorText, color); } this._callback({ - title: WebInspector.Spectrum.GeneratedPaletteTitle, + title: Components.Spectrum.GeneratedPaletteTitle, colors: paletteColors.keysArray().sort(hueComparator), mutable: false }); } /** - * @param {!WebInspector.CSSStyleSheetHeader} stylesheet + * @param {!SDK.CSSStyleSheetHeader} stylesheet * @param {function(?)} resolve - * @this {WebInspector.Spectrum.PaletteGenerator} + * @this {Components.Spectrum.PaletteGenerator} */ _processStylesheet(stylesheet, resolve) { /** * @param {?string} text - * @this {WebInspector.Spectrum.PaletteGenerator} + * @this {Components.Spectrum.PaletteGenerator} */ function parseContent(text) { text = text.toLowerCase(); @@ -998,7 +998,7 @@ } }; -WebInspector.Spectrum.MaterialPaletteShades = { +Components.Spectrum.MaterialPaletteShades = { '#F44336': ['#FFEBEE', '#FFCDD2', '#EF9A9A', '#E57373', '#EF5350', '#F44336', '#E53935', '#D32F2F', '#C62828', '#B71C1C'], '#E91E63': @@ -1039,9 +1039,9 @@ ['#ECEFF1', '#CFD8DC', '#B0BEC5', '#90A4AE', '#78909C', '#607D8B', '#546E7A', '#455A64', '#37474F', '#263238'] }; -WebInspector.Spectrum.MaterialPalette = { +Components.Spectrum.MaterialPalette = { title: 'Material', mutable: false, matchUserFormat: true, - colors: Object.keys(WebInspector.Spectrum.MaterialPaletteShades) + colors: Object.keys(Components.Spectrum.MaterialPaletteShades) };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/module.json b/third_party/WebKit/Source/devtools/front_end/components/module.json index c6d715a9..65fa560 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/module.json +++ b/third_party/WebKit/Source/devtools/front_end/components/module.json
@@ -9,8 +9,8 @@ "defaultValue": false }, { - "type": "@WebInspector.DOMPresentationUtils.MarkerDecorator", - "factoryName": "WebInspector.DOMPresentationUtils.GenericDecorator", + "type": "@Components.DOMPresentationUtils.MarkerDecorator", + "factoryName": "Components.DOMPresentationUtils.GenericDecorator", "marker": "breakpoint-marker", "title": "DOM Breakpoint", "color": "rgb(105, 140, 254)" @@ -22,19 +22,19 @@ "defaultValue": [] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "components.network-offline", "category": "Network", "title": "Go offline", - "className": "WebInspector.NetworkConditionsActionDelegate", + "className": "Components.NetworkConditionsActionDelegate", "tags": "device" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "components.network-online", "category": "Network", "title": "Go online", - "className": "WebInspector.NetworkConditionsActionDelegate", + "className": "Components.NetworkConditionsActionDelegate", "tags": "device" }, { @@ -43,16 +43,16 @@ "id": "network-conditions", "title": "Throttling", "order": "35", - "className": "WebInspector.NetworkConditionsSettingsTab", + "className": "Components.NetworkConditionsSettingsTab", "settings": [ "customNetworkConditions" ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Mobile", "actionId": "components.request-app-banner", - "className": "WebInspector.RequestAppBannerActionDelegate", + "className": "Components.RequestAppBannerActionDelegate", "title": "Add to homescreen" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js index c50e62e..842eee7c 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.CookiesTable = class extends WebInspector.VBox { +Components.CookiesTable = class extends UI.VBox { /** * @param {boolean} expandable * @param {function()=} refreshCallback @@ -43,63 +43,63 @@ var readOnly = expandable; this._refreshCallback = refreshCallback; - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ { id: 'name', - title: WebInspector.UIString('Name'), + title: Common.UIString('Name'), sortable: true, disclosure: expandable, - sort: WebInspector.DataGrid.Order.Ascending, + sort: UI.DataGrid.Order.Ascending, longText: true, weight: 24 }, - {id: 'value', title: WebInspector.UIString('Value'), sortable: true, longText: true, weight: 34}, - {id: 'domain', title: WebInspector.UIString('Domain'), sortable: true, weight: 7}, - {id: 'path', title: WebInspector.UIString('Path'), sortable: true, weight: 7}, - {id: 'expires', title: WebInspector.UIString('Expires / Max-Age'), sortable: true, weight: 7}, { + {id: 'value', title: Common.UIString('Value'), sortable: true, longText: true, weight: 34}, + {id: 'domain', title: Common.UIString('Domain'), sortable: true, weight: 7}, + {id: 'path', title: Common.UIString('Path'), sortable: true, weight: 7}, + {id: 'expires', title: Common.UIString('Expires / Max-Age'), sortable: true, weight: 7}, { id: 'size', - title: WebInspector.UIString('Size'), + title: Common.UIString('Size'), sortable: true, - align: WebInspector.DataGrid.Align.Right, + align: UI.DataGrid.Align.Right, weight: 7 }, { id: 'httpOnly', - title: WebInspector.UIString('HTTP'), + title: Common.UIString('HTTP'), sortable: true, - align: WebInspector.DataGrid.Align.Center, + align: UI.DataGrid.Align.Center, weight: 7 }, { id: 'secure', - title: WebInspector.UIString('Secure'), + title: Common.UIString('Secure'), sortable: true, - align: WebInspector.DataGrid.Align.Center, + align: UI.DataGrid.Align.Center, weight: 7 }, { id: 'sameSite', - title: WebInspector.UIString('SameSite'), + title: Common.UIString('SameSite'), sortable: true, - align: WebInspector.DataGrid.Align.Center, + align: UI.DataGrid.Align.Center, weight: 7 } ]); if (readOnly) { - this._dataGrid = new WebInspector.DataGrid(columns); + this._dataGrid = new UI.DataGrid(columns); } else { - this._dataGrid = new WebInspector.DataGrid(columns, undefined, this._onDeleteCookie.bind(this), refreshCallback); + this._dataGrid = new UI.DataGrid(columns, undefined, this._onDeleteCookie.bind(this), refreshCallback); this._dataGrid.setRowContextMenuCallback(this._onRowContextMenu.bind(this)); } this._dataGrid.setName('cookiesTable'); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._rebuildTable, this); if (selectedCallback) - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, selectedCallback, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, selectedCallback, this); - this._nextSelectedCookie = /** @type {?WebInspector.Cookie} */ (null); + this._nextSelectedCookie = /** @type {?SDK.Cookie} */ (null); this._dataGrid.asWidget().show(this.element); this._data = []; @@ -114,8 +114,8 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {!WebInspector.DataGridNode} node + * @param {!UI.ContextMenu} contextMenu + * @param {!UI.DataGridNode} node */ _onRowContextMenu(contextMenu, node) { if (node === this._dataGrid.creationNode) @@ -123,19 +123,19 @@ var domain = node.cookie.domain(); if (domain) contextMenu.appendItem( - WebInspector.UIString.capitalize('Clear ^all from "%s"', domain), this._clearAndRefresh.bind(this, domain)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Clear ^all'), this._clearAndRefresh.bind(this, null)); + Common.UIString.capitalize('Clear ^all from "%s"', domain), this._clearAndRefresh.bind(this, domain)); + contextMenu.appendItem(Common.UIString.capitalize('Clear ^all'), this._clearAndRefresh.bind(this, null)); } /** - * @param {!Array.<!WebInspector.Cookie>} cookies + * @param {!Array.<!SDK.Cookie>} cookies */ setCookies(cookies) { this.setCookieFolders([{cookies: cookies}]); } /** - * @param {!Array.<!{folderName: ?string, cookies: !Array.<!WebInspector.Cookie>}>} cookieFolders + * @param {!Array.<!{folderName: ?string, cookies: !Array.<!SDK.Cookie>}>} cookieFolders */ setCookieFolders(cookieFolders) { this._data = cookieFolders; @@ -143,7 +143,7 @@ } /** - * @return {?WebInspector.Cookie} + * @return {?SDK.Cookie} */ selectedCookie() { var node = this._dataGrid.selectedNode; @@ -181,7 +181,7 @@ secure: '', sameSite: '' }; - var groupNode = new WebInspector.DataGridNode(groupData); + var groupNode = new UI.DataGridNode(groupData); groupNode.selectable = true; this._dataGrid.rootNode().appendChild(groupNode); groupNode.element().classList.add('row-group'); @@ -193,9 +193,9 @@ } /** - * @param {!WebInspector.DataGridNode} parentNode - * @param {?Array.<!WebInspector.Cookie>} cookies - * @param {?WebInspector.Cookie} selectedCookie + * @param {!UI.DataGridNode} parentNode + * @param {?Array.<!SDK.Cookie>} cookies + * @param {?SDK.Cookie} selectedCookie */ _populateNode(parentNode, cookies, selectedCookie) { parentNode.removeChildren(); @@ -221,15 +221,15 @@ } /** - * @param {!Array.<!WebInspector.Cookie>} cookies + * @param {!Array.<!SDK.Cookie>} cookies */ _sortCookies(cookies) { var sortDirection = this._dataGrid.isSortOrderAscending() ? 1 : -1; /** * @param {string} property - * @param {!WebInspector.Cookie} cookie1 - * @param {!WebInspector.Cookie} cookie2 + * @param {!SDK.Cookie} cookie1 + * @param {!SDK.Cookie} cookie2 */ function compareTo(property, cookie1, cookie2) { return sortDirection * @@ -237,16 +237,16 @@ } /** - * @param {!WebInspector.Cookie} cookie1 - * @param {!WebInspector.Cookie} cookie2 + * @param {!SDK.Cookie} cookie1 + * @param {!SDK.Cookie} cookie2 */ function numberCompare(cookie1, cookie2) { return sortDirection * (cookie1.size() - cookie2.size()); } /** - * @param {!WebInspector.Cookie} cookie1 - * @param {!WebInspector.Cookie} cookie2 + * @param {!SDK.Cookie} cookie1 + * @param {!SDK.Cookie} cookie2 */ function expiresCompare(cookie1, cookie2) { if (cookie1.session() !== cookie2.session()) @@ -274,17 +274,17 @@ } /** - * @param {!WebInspector.Cookie} cookie - * @return {!WebInspector.DataGridNode} + * @param {!SDK.Cookie} cookie + * @return {!UI.DataGridNode} */ _createGridNode(cookie) { var data = {}; data.name = cookie.name(); data.value = cookie.value(); - if (cookie.type() === WebInspector.Cookie.Type.Request) { - data.domain = WebInspector.UIString('N/A'); - data.path = WebInspector.UIString('N/A'); - data.expires = WebInspector.UIString('N/A'); + if (cookie.type() === SDK.Cookie.Type.Request) { + data.domain = Common.UIString('N/A'); + data.path = Common.UIString('N/A'); + data.expires = Common.UIString('N/A'); } else { data.domain = cookie.domain() || ''; data.path = cookie.path() || ''; @@ -293,7 +293,7 @@ else if (cookie.expires()) data.expires = new Date(cookie.expires()).toISOString(); else - data.expires = WebInspector.UIString('Session'); + data.expires = Common.UIString('Session'); } data.size = cookie.size(); const checkmark = '\u2713'; @@ -301,7 +301,7 @@ data.secure = (cookie.secure() ? checkmark : ''); data.sameSite = cookie.sameSite() || ''; - var node = new WebInspector.DataGridNode(data); + var node = new UI.DataGridNode(data); node.cookie = cookie; node.selectable = true; return node;
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js index ca61e61..e397119e 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -WebInspector.CoverageProfile = class { +Components.CoverageProfile = class { constructor() { this._updateTimer = null; this.reset(); } /** - * @return {!WebInspector.CoverageProfile} + * @return {!Components.CoverageProfile} */ static instance() { - if (!WebInspector.CoverageProfile._instance) - WebInspector.CoverageProfile._instance = new WebInspector.CoverageProfile(); + if (!Components.CoverageProfile._instance) + Components.CoverageProfile._instance = new Components.CoverageProfile(); - return WebInspector.CoverageProfile._instance; + return Components.CoverageProfile._instance; } /** @@ -26,33 +26,33 @@ if (!url) return; - var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); + var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url); if (!uiSourceCode) return; for (var line = range.startLine; line <= range.endLine; ++line) - uiSourceCode.addLineDecoration(line, WebInspector.CoverageProfile.LineDecorator.type, range.startColumn); + uiSourceCode.addLineDecoration(line, Components.CoverageProfile.LineDecorator.type, range.startColumn); } reset() { - WebInspector.workspace.uiSourceCodes().forEach( - uiSourceCode => uiSourceCode.removeAllLineDecorations(WebInspector.CoverageProfile.LineDecorator.type)); + Workspace.workspace.uiSourceCodes().forEach( + uiSourceCode => uiSourceCode.removeAllLineDecorations(Components.CoverageProfile.LineDecorator.type)); } }; /** - * @implements {WebInspector.UISourceCodeFrame.LineDecorator} + * @implements {Sources.UISourceCodeFrame.LineDecorator} */ -WebInspector.CoverageProfile.LineDecorator = class { +Components.CoverageProfile.LineDecorator = class { /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!TextEditor.CodeMirrorTextEditor} textEditor */ decorate(uiSourceCode, textEditor) { var gutterType = 'CodeMirror-gutter-coverage'; - var decorations = uiSourceCode.lineDecorations(WebInspector.CoverageProfile.LineDecorator.type); + var decorations = uiSourceCode.lineDecorations(Components.CoverageProfile.LineDecorator.type); textEditor.uninstallGutter(gutterType); if (!decorations) return; @@ -66,4 +66,4 @@ } }; -WebInspector.CoverageProfile.LineDecorator.type = 'coverage'; +Components.CoverageProfile.LineDecorator.type = 'coverage';
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js index 06946a8..289e493f 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripModel.js
@@ -7,9 +7,9 @@ /** * @unrestricted */ -WebInspector.FilmStripModel = class { +Components.FilmStripModel = class { /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel * @param {number=} zeroTime */ constructor(tracingModel, zeroTime) { @@ -17,16 +17,16 @@ } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel * @param {number=} zeroTime */ reset(tracingModel, zeroTime) { this._zeroTime = zeroTime || tracingModel.minimumRecordTime(); this._spanTime = tracingModel.maximumRecordTime() - this._zeroTime; - /** @type {!Array<!WebInspector.FilmStripModel.Frame>} */ + /** @type {!Array<!Components.FilmStripModel.Frame>} */ this._frames = []; - var browserMain = WebInspector.TracingModel.browserMainThread(tracingModel); + var browserMain = SDK.TracingModel.browserMainThread(tracingModel); if (!browserMain) return; @@ -35,21 +35,21 @@ var event = events[i]; if (event.startTime < this._zeroTime) continue; - if (!event.hasCategory(WebInspector.FilmStripModel._category)) + if (!event.hasCategory(Components.FilmStripModel._category)) continue; - if (event.name === WebInspector.FilmStripModel.TraceEvents.CaptureFrame) { + if (event.name === Components.FilmStripModel.TraceEvents.CaptureFrame) { var data = event.args['data']; if (data) - this._frames.push(WebInspector.FilmStripModel.Frame._fromEvent(this, event, this._frames.length)); - } else if (event.name === WebInspector.FilmStripModel.TraceEvents.Screenshot) { - this._frames.push(WebInspector.FilmStripModel.Frame._fromSnapshot( - this, /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event), this._frames.length)); + this._frames.push(Components.FilmStripModel.Frame._fromEvent(this, event, this._frames.length)); + } else if (event.name === Components.FilmStripModel.TraceEvents.Screenshot) { + this._frames.push(Components.FilmStripModel.Frame._fromSnapshot( + this, /** @type {!SDK.TracingModel.ObjectSnapshot} */ (event), this._frames.length)); } } } /** - * @return {!Array<!WebInspector.FilmStripModel.Frame>} + * @return {!Array<!Components.FilmStripModel.Frame>} */ frames() { return this._frames; @@ -71,7 +71,7 @@ /** * @param {number} timestamp - * @return {?WebInspector.FilmStripModel.Frame} + * @return {?Components.FilmStripModel.Frame} */ frameByTimestamp(timestamp) { var index = this._frames.upperBound(timestamp, (timestamp, frame) => timestamp - frame.timestamp) - 1; @@ -79,9 +79,9 @@ } }; -WebInspector.FilmStripModel._category = 'disabled-by-default-devtools.screenshot'; +Components.FilmStripModel._category = 'disabled-by-default-devtools.screenshot'; -WebInspector.FilmStripModel.TraceEvents = { +Components.FilmStripModel.TraceEvents = { CaptureFrame: 'CaptureFrame', Screenshot: 'Screenshot' }; @@ -89,9 +89,9 @@ /** * @unrestricted */ -WebInspector.FilmStripModel.Frame = class { +Components.FilmStripModel.Frame = class { /** - * @param {!WebInspector.FilmStripModel} model + * @param {!Components.FilmStripModel} model * @param {number} timestamp * @param {number} index */ @@ -101,36 +101,36 @@ this.index = index; /** @type {?string} */ this._imageData = null; - /** @type {?WebInspector.TracingModel.ObjectSnapshot} */ + /** @type {?SDK.TracingModel.ObjectSnapshot} */ this._snapshot = null; } /** - * @param {!WebInspector.FilmStripModel} model - * @param {!WebInspector.TracingModel.Event} event + * @param {!Components.FilmStripModel} model + * @param {!SDK.TracingModel.Event} event * @param {number} index - * @return {!WebInspector.FilmStripModel.Frame} + * @return {!Components.FilmStripModel.Frame} */ static _fromEvent(model, event, index) { - var frame = new WebInspector.FilmStripModel.Frame(model, event.startTime, index); + var frame = new Components.FilmStripModel.Frame(model, event.startTime, index); frame._imageData = event.args['data']; return frame; } /** - * @param {!WebInspector.FilmStripModel} model - * @param {!WebInspector.TracingModel.ObjectSnapshot} snapshot + * @param {!Components.FilmStripModel} model + * @param {!SDK.TracingModel.ObjectSnapshot} snapshot * @param {number} index - * @return {!WebInspector.FilmStripModel.Frame} + * @return {!Components.FilmStripModel.Frame} */ static _fromSnapshot(model, snapshot, index) { - var frame = new WebInspector.FilmStripModel.Frame(model, snapshot.startTime, index); + var frame = new Components.FilmStripModel.Frame(model, snapshot.startTime, index); frame._snapshot = snapshot; return frame; } /** - * @return {!WebInspector.FilmStripModel} + * @return {!Components.FilmStripModel} */ model() { return this._model;
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripView.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripView.js index 7572567..7ed53b6 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripView.js +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/FilmStripView.js
@@ -4,14 +4,14 @@ /** * @unrestricted */ -WebInspector.FilmStripView = class extends WebInspector.HBox { +Components.FilmStripView = class extends UI.HBox { constructor() { super(true); this.registerRequiredCSS('components_lazy/filmStripView.css'); this.contentElement.classList.add('film-strip-view'); this._statusLabel = this.contentElement.createChild('div', 'label'); this.reset(); - this.setMode(WebInspector.FilmStripView.Modes.TimeBased); + this.setMode(Components.FilmStripView.Modes.TimeBased); } /** @@ -28,12 +28,12 @@ */ setMode(mode) { this._mode = mode; - this.contentElement.classList.toggle('time-based', mode === WebInspector.FilmStripView.Modes.TimeBased); + this.contentElement.classList.toggle('time-based', mode === Components.FilmStripView.Modes.TimeBased); this.update(); } /** - * @param {!WebInspector.FilmStripModel} filmStripModel + * @param {!Components.FilmStripModel} filmStripModel * @param {number} zeroTime * @param {number} spanTime */ @@ -50,25 +50,25 @@ } /** - * @param {!WebInspector.FilmStripModel.Frame} frame + * @param {!Components.FilmStripModel.Frame} frame * @return {!Promise<!Element>} */ createFrameElement(frame) { var time = frame.timestamp; var element = createElementWithClass('div', 'frame'); - element.title = WebInspector.UIString('Doubleclick to zoom image. Click to view preceding requests.'); + element.title = Common.UIString('Doubleclick to zoom image. Click to view preceding requests.'); element.createChild('div', 'time').textContent = Number.millisToString(time - this._zeroTime); var imageElement = element.createChild('div', 'thumbnail').createChild('img'); element.addEventListener( - 'mousedown', this._onMouseEvent.bind(this, WebInspector.FilmStripView.Events.FrameSelected, time), false); + 'mousedown', this._onMouseEvent.bind(this, Components.FilmStripView.Events.FrameSelected, time), false); element.addEventListener( - 'mouseenter', this._onMouseEvent.bind(this, WebInspector.FilmStripView.Events.FrameEnter, time), false); + 'mouseenter', this._onMouseEvent.bind(this, Components.FilmStripView.Events.FrameEnter, time), false); element.addEventListener( - 'mouseout', this._onMouseEvent.bind(this, WebInspector.FilmStripView.Events.FrameExit, time), false); + 'mouseout', this._onMouseEvent.bind(this, Components.FilmStripView.Events.FrameExit, time), false); element.addEventListener('dblclick', this._onDoubleClick.bind(this, frame), false); return frame.imageDataPromise() - .then(WebInspector.FilmStripView._setImageData.bind(null, imageElement)) + .then(Components.FilmStripView._setImageData.bind(null, imageElement)) .then(returnElement); /** * @return {!Element} @@ -80,12 +80,12 @@ /** * @param {number} time - * @return {!WebInspector.FilmStripModel.Frame} + * @return {!Components.FilmStripModel.Frame} */ frameByTime(time) { /** * @param {number} time - * @param {!WebInspector.FilmStripModel.Frame} frame + * @param {!Components.FilmStripModel.Frame} frame * @return {number} */ function comparator(time, frame) { @@ -105,7 +105,7 @@ if (!frames.length) return; - if (this._mode === WebInspector.FilmStripView.Modes.FrameBased) { + if (this._mode === Components.FilmStripView.Modes.FrameBased) { Promise.all(frames.map(this.createFrameElement.bind(this))).then(appendElements.bind(this)); return; } @@ -116,11 +116,11 @@ continueWhenFrameImageLoaded.bind(this)); // Calculate frame width basing on the first frame. /** - * @this {WebInspector.FilmStripView} + * @this {Components.FilmStripView} * @param {!Element} element0 */ function continueWhenFrameImageLoaded(element0) { - var frameWidth = Math.ceil(WebInspector.measurePreferredSize(element0, this.contentElement).width); + var frameWidth = Math.ceil(UI.measurePreferredSize(element0, this.contentElement).width); if (!frameWidth) return; @@ -142,7 +142,7 @@ /** * @param {!Array.<!Element>} elements - * @this {WebInspector.FilmStripView} + * @this {Components.FilmStripView} */ function appendElements(elements) { this.contentElement.removeChildren(); @@ -155,7 +155,7 @@ * @override */ onResize() { - if (this._mode === WebInspector.FilmStripView.Modes.FrameBased) + if (this._mode === Components.FilmStripView.Modes.FrameBased) return; this.update(); } @@ -169,10 +169,10 @@ } /** - * @param {!WebInspector.FilmStripModel.Frame} filmStripFrame + * @param {!Components.FilmStripModel.Frame} filmStripFrame */ _onDoubleClick(filmStripFrame) { - new WebInspector.FilmStripView.Dialog(filmStripFrame, this._zeroTime); + new Components.FilmStripView.Dialog(filmStripFrame, this._zeroTime); } reset() { @@ -190,13 +190,13 @@ }; /** @enum {symbol} */ -WebInspector.FilmStripView.Events = { +Components.FilmStripView.Events = { FrameSelected: Symbol('FrameSelected'), FrameEnter: Symbol('FrameEnter'), FrameExit: Symbol('FrameExit'), }; -WebInspector.FilmStripView.Modes = { +Components.FilmStripView.Modes = { TimeBased: 'TimeBased', FrameBased: 'FrameBased' }; @@ -205,9 +205,9 @@ /** * @unrestricted */ -WebInspector.FilmStripView.Dialog = class extends WebInspector.VBox { +Components.FilmStripView.Dialog = class extends UI.VBox { /** - * @param {!WebInspector.FilmStripModel.Frame} filmStripFrame + * @param {!Components.FilmStripModel.Frame} filmStripFrame * @param {number=} zeroTime */ constructor(filmStripFrame, zeroTime) { @@ -224,11 +224,11 @@ var footerElement = this.contentElement.createChild('div', 'filmstrip-dialog-footer'); footerElement.createChild('div', 'flex-auto'); var prevButton = - createTextButton('\u25C0', this._onPrevFrame.bind(this), undefined, WebInspector.UIString('Previous frame')); + createTextButton('\u25C0', this._onPrevFrame.bind(this), undefined, Common.UIString('Previous frame')); footerElement.appendChild(prevButton); this._timeLabel = footerElement.createChild('div', 'filmstrip-dialog-label'); var nextButton = - createTextButton('\u25B6', this._onNextFrame.bind(this), undefined, WebInspector.UIString('Next frame')); + createTextButton('\u25B6', this._onNextFrame.bind(this), undefined, Common.UIString('Next frame')); footerElement.appendChild(nextButton); footerElement.createChild('div', 'flex-auto'); @@ -239,7 +239,7 @@ _resize() { if (!this._dialog) { - this._dialog = new WebInspector.Dialog(); + this._dialog = new UI.Dialog(); this.show(this._dialog.element); this._dialog.setWrapsContent(true); this._dialog.show(); @@ -253,14 +253,14 @@ _keyDown(event) { switch (event.key) { case 'ArrowLeft': - if (WebInspector.isMac() && event.metaKey) + if (Host.isMac() && event.metaKey) this._onFirstFrame(); else this._onPrevFrame(); break; case 'ArrowRight': - if (WebInspector.isMac() && event.metaKey) + if (Host.isMac() && event.metaKey) this._onLastFrame(); else this._onNextFrame(); @@ -305,7 +305,7 @@ var frame = this._frames[this._index]; this._timeLabel.textContent = Number.millisToString(frame.timestamp - this._zeroTime); return frame.imageDataPromise() - .then(WebInspector.FilmStripView._setImageData.bind(null, this._imageElement)) + .then(Components.FilmStripView._setImageData.bind(null, this._imageElement)) .then(this._resize.bind(this)); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/LineLevelProfile.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/LineLevelProfile.js index 971bedb..e0808e0 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/LineLevelProfile.js +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/LineLevelProfile.js
@@ -4,23 +4,23 @@ /** * @unrestricted */ -WebInspector.LineLevelProfile = class { +Components.LineLevelProfile = class { constructor() { - this._locationPool = new WebInspector.LiveLocationPool(); + this._locationPool = new Bindings.LiveLocationPool(); this.reset(); } /** - * @return {!WebInspector.LineLevelProfile} + * @return {!Components.LineLevelProfile} */ static instance() { - if (!WebInspector.LineLevelProfile._instance) - WebInspector.LineLevelProfile._instance = new WebInspector.LineLevelProfile(); - return WebInspector.LineLevelProfile._instance; + if (!Components.LineLevelProfile._instance) + Components.LineLevelProfile._instance = new Components.LineLevelProfile(); + return Components.LineLevelProfile._instance; } /** - * @param {!WebInspector.CPUProfileDataModel} profile + * @param {!SDK.CPUProfileDataModel} profile */ appendCPUProfile(profile) { var nodesToGo = [profile.profileHead]; @@ -66,16 +66,16 @@ _doUpdate() { // TODO(alph): use scriptId instead of urls for the target. this._locationPool.disposeAll(); - WebInspector.workspace.uiSourceCodes().forEach( - uiSourceCode => uiSourceCode.removeAllLineDecorations(WebInspector.LineLevelProfile.LineDecorator.type)); + Workspace.workspace.uiSourceCodes().forEach( + uiSourceCode => uiSourceCode.removeAllLineDecorations(Components.LineLevelProfile.LineDecorator.type)); for (var fileInfo of this._files) { var url = /** @type {string} */ (fileInfo[0]); - var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); + var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url); if (!uiSourceCode) continue; var target = - WebInspector.NetworkProject.targetForUISourceCode(uiSourceCode) || WebInspector.targetManager.mainTarget(); - var debuggerModel = target ? WebInspector.DebuggerModel.fromTarget(target) : null; + Bindings.NetworkProject.targetForUISourceCode(uiSourceCode) || SDK.targetManager.mainTarget(); + var debuggerModel = target ? SDK.DebuggerModel.fromTarget(target) : null; if (!debuggerModel) continue; for (var lineInfo of fileInfo[1]) { @@ -83,9 +83,9 @@ var time = lineInfo[1]; var rawLocation = debuggerModel.createRawLocationByURL(url, line, 0); if (rawLocation) - new WebInspector.LineLevelProfile.Presentation(rawLocation, time, this._locationPool); + new Components.LineLevelProfile.Presentation(rawLocation, time, this._locationPool); else if (uiSourceCode) - uiSourceCode.addLineDecoration(line, WebInspector.LineLevelProfile.LineDecorator.type, time); + uiSourceCode.addLineDecoration(line, Components.LineLevelProfile.LineDecorator.type, time); } } } @@ -95,51 +95,51 @@ /** * @unrestricted */ -WebInspector.LineLevelProfile.Presentation = class { +Components.LineLevelProfile.Presentation = class { /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation + * @param {!SDK.DebuggerModel.Location} rawLocation * @param {number} time - * @param {!WebInspector.LiveLocationPool} locationPool + * @param {!Bindings.LiveLocationPool} locationPool */ constructor(rawLocation, time, locationPool) { this._time = time; - WebInspector.debuggerWorkspaceBinding.createLiveLocation(rawLocation, this.updateLocation.bind(this), locationPool); + Bindings.debuggerWorkspaceBinding.createLiveLocation(rawLocation, this.updateLocation.bind(this), locationPool); } /** - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!Bindings.LiveLocation} liveLocation */ updateLocation(liveLocation) { if (this._uiLocation) this._uiLocation.uiSourceCode.removeLineDecoration( - this._uiLocation.lineNumber, WebInspector.LineLevelProfile.LineDecorator.type); + this._uiLocation.lineNumber, Components.LineLevelProfile.LineDecorator.type); this._uiLocation = liveLocation.uiLocation(); if (this._uiLocation) this._uiLocation.uiSourceCode.addLineDecoration( - this._uiLocation.lineNumber, WebInspector.LineLevelProfile.LineDecorator.type, this._time); + this._uiLocation.lineNumber, Components.LineLevelProfile.LineDecorator.type, this._time); } }; /** - * @implements {WebInspector.UISourceCodeFrame.LineDecorator} + * @implements {Sources.UISourceCodeFrame.LineDecorator} * @unrestricted */ -WebInspector.LineLevelProfile.LineDecorator = class { +Components.LineLevelProfile.LineDecorator = class { /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!TextEditor.CodeMirrorTextEditor} textEditor */ decorate(uiSourceCode, textEditor) { var gutterType = 'CodeMirror-gutter-performance'; - var decorations = uiSourceCode.lineDecorations(WebInspector.LineLevelProfile.LineDecorator.type); + var decorations = uiSourceCode.lineDecorations(Components.LineLevelProfile.LineDecorator.type); textEditor.uninstallGutter(gutterType); if (!decorations) return; textEditor.installGutter(gutterType, false); for (var decoration of decorations.values()) { var time = /** @type {number} */ (decoration.data()); - var text = WebInspector.UIString('%.1f\xa0ms', time); + var text = Common.UIString('%.1f\xa0ms', time); var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1); var element = createElementWithClass('div', 'text-editor-line-marker-performance'); element.textContent = text; @@ -149,4 +149,4 @@ } }; -WebInspector.LineLevelProfile.LineDecorator.type = 'performance'; +Components.LineLevelProfile.LineDecorator.type = 'performance';
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/module.json b/third_party/WebKit/Source/devtools/front_end/components_lazy/module.json index 9e12c80..ae8f431 100644 --- a/third_party/WebKit/Source/devtools/front_end/components_lazy/module.json +++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/module.json
@@ -8,13 +8,13 @@ ], "extensions": [ { - "type": "@WebInspector.UISourceCodeFrame.LineDecorator", - "className": "WebInspector.LineLevelProfile.LineDecorator", + "type": "@Sources.UISourceCodeFrame.LineDecorator", + "className": "Components.LineLevelProfile.LineDecorator", "decoratorType": "performance" }, { - "type": "@WebInspector.UISourceCodeFrame.LineDecorator", - "className": "WebInspector.CoverageProfile.LineDecorator", + "type": "@Sources.UISourceCodeFrame.LineDecorator", + "className": "Components.CoverageProfile.LineDecorator", "decoratorType": "coverage" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js index 8f8bcae7..f81805e0 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleContextSelector.js
@@ -2,45 +2,45 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ConsoleContextSelector = class { +Console.ConsoleContextSelector = class { /** * @param {!Element} selectElement */ constructor(selectElement) { this._selectElement = selectElement; /** - * @type {!Map.<!WebInspector.ExecutionContext, !Element>} + * @type {!Map.<!SDK.ExecutionContext, !Element>} */ this._optionByExecutionContext = new Map(); - WebInspector.targetManager.observeTargets(this); - WebInspector.targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, + SDK.targetManager.observeTargets(this); + SDK.targetManager.addModelListener( + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this); - WebInspector.targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextChanged, + SDK.targetManager.addModelListener( + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextChanged, this._onExecutionContextChanged, this); - WebInspector.targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, + SDK.targetManager.addModelListener( + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this); this._selectElement.addEventListener('change', this._executionContextChanged.bind(this), false); - WebInspector.context.addFlavorChangeListener( - WebInspector.ExecutionContext, this._executionContextChangedExternally, this); + UI.context.addFlavorChangeListener( + SDK.ExecutionContext, this._executionContextChangedExternally, this); } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @return {string} */ _titleFor(executionContext) { var result; if (executionContext.isDefault) { if (executionContext.frameId) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(executionContext.target()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(executionContext.target()); var frame = resourceTreeModel && resourceTreeModel.frameForId(executionContext.frameId); result = frame ? frame.displayName() : executionContext.label(); } else { @@ -55,7 +55,7 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext */ _executionContextCreated(executionContext) { // FIXME(413886): We never want to show execution context for the main thread of shadow page in service/shared worker frontend. @@ -72,12 +72,12 @@ var index = contexts.lowerBound(executionContext, executionContext.runtimeModel.executionContextComparator()); this._selectElement.insertBefore(newOption, options[index]); - if (executionContext === WebInspector.context.flavor(WebInspector.ExecutionContext)) + if (executionContext === UI.context.flavor(SDK.ExecutionContext)) this._select(newOption); /** * @param {!Element} option - * @return {!WebInspector.ExecutionContext} + * @return {!SDK.ExecutionContext} */ function mapping(option) { return option.__executionContext; @@ -85,19 +85,19 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextCreated(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data); this._executionContextCreated(executionContext); this._updateSelectionWarning(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextChanged(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data); var option = this._optionByExecutionContext.get(executionContext); if (option) option.text = this._titleFor(executionContext); @@ -105,7 +105,7 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext */ _executionContextDestroyed(executionContext) { var option = this._optionByExecutionContext.remove(executionContext); @@ -113,19 +113,19 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextDestroyed(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data); this._executionContextDestroyed(executionContext); this._updateSelectionWarning(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _executionContextChangedExternally(event) { - var executionContext = /** @type {?WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {?SDK.ExecutionContext} */ (event.data); if (!executionContext) return; @@ -139,24 +139,24 @@ _executionContextChanged() { var option = this._selectedOption(); var newContext = option ? option.__executionContext : null; - WebInspector.context.setFlavor(WebInspector.ExecutionContext, newContext); + UI.context.setFlavor(SDK.ExecutionContext, newContext); this._updateSelectionWarning(); } _updateSelectionWarning() { - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); this._selectElement.parentElement.classList.toggle( 'warning', !this._isTopContext(executionContext) && this._hasTopContext()); } /** - * @param {?WebInspector.ExecutionContext} executionContext + * @param {?SDK.ExecutionContext} executionContext * @return {boolean} */ _isTopContext(executionContext) { if (!executionContext || !executionContext.isDefault) return false; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(executionContext.target()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(executionContext.target()); var frame = executionContext.frameId && resourceTreeModel && resourceTreeModel.frameForId(executionContext.frameId); if (!frame) return false; @@ -177,7 +177,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { target.runtimeModel.executionContexts().forEach(this._executionContextCreated, this); @@ -185,7 +185,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { var executionContexts = this._optionByExecutionContext.keysArray();
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js b/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js index 57e0230..a3c59f8 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js
@@ -29,17 +29,17 @@ /** * @unrestricted */ -WebInspector.ConsolePanel = class extends WebInspector.Panel { +Console.ConsolePanel = class extends UI.Panel { constructor() { super('console'); - this._view = WebInspector.ConsoleView.instance(); + this._view = Console.ConsoleView.instance(); } /** - * @return {!WebInspector.ConsolePanel} + * @return {!Console.ConsolePanel} */ static instance() { - return /** @type {!WebInspector.ConsolePanel} */ (self.runtime.sharedInstance(WebInspector.ConsolePanel)); + return /** @type {!Console.ConsolePanel} */ (self.runtime.sharedInstance(Console.ConsolePanel)); } /** @@ -47,9 +47,9 @@ */ wasShown() { super.wasShown(); - var wrapper = WebInspector.ConsolePanel.WrapperView._instance; + var wrapper = Console.ConsolePanel.WrapperView._instance; if (wrapper && wrapper.isShowing()) - WebInspector.inspectorView.setDrawerMinimized(true); + UI.inspectorView.setDrawerMinimized(true); this._view.show(this.element); } @@ -58,48 +58,48 @@ */ willHide() { super.willHide(); - if (WebInspector.ConsolePanel.WrapperView._instance) - WebInspector.ConsolePanel.WrapperView._instance._showViewInWrapper(); - WebInspector.inspectorView.setDrawerMinimized(false); + if (Console.ConsolePanel.WrapperView._instance) + Console.ConsolePanel.WrapperView._instance._showViewInWrapper(); + UI.inspectorView.setDrawerMinimized(false); } /** * @override - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ searchableView() { - return WebInspector.ConsoleView.instance().searchableView(); + return Console.ConsoleView.instance().searchableView(); } }; /** * @unrestricted */ -WebInspector.ConsolePanel.WrapperView = class extends WebInspector.VBox { +Console.ConsolePanel.WrapperView = class extends UI.VBox { constructor() { super(); this.element.classList.add('console-view-wrapper'); - WebInspector.ConsolePanel.WrapperView._instance = this; + Console.ConsolePanel.WrapperView._instance = this; - this._view = WebInspector.ConsoleView.instance(); + this._view = Console.ConsoleView.instance(); } /** * @override */ wasShown() { - if (!WebInspector.ConsolePanel.instance().isShowing()) + if (!Console.ConsolePanel.instance().isShowing()) this._showViewInWrapper(); else - WebInspector.inspectorView.setDrawerMinimized(true); + UI.inspectorView.setDrawerMinimized(true); } /** * @override */ willHide() { - WebInspector.inspectorView.setDrawerMinimized(false); + UI.inspectorView.setDrawerMinimized(false); } _showViewInWrapper() { @@ -108,22 +108,22 @@ }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.ConsolePanel.ConsoleRevealer = class { +Console.ConsolePanel.ConsoleRevealer = class { /** * @override * @param {!Object} object * @return {!Promise} */ reveal(object) { - var consoleView = WebInspector.ConsoleView.instance(); + var consoleView = Console.ConsoleView.instance(); if (consoleView.isShowing()) { consoleView.focus(); return Promise.resolve(); } - WebInspector.viewManager.showView('console-view'); + UI.viewManager.showView('console-view'); return Promise.resolve(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js index 65d93e9..5df281e 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
@@ -4,22 +4,22 @@ /** * @unrestricted */ -WebInspector.ConsolePrompt = class extends WebInspector.Widget { +Console.ConsolePrompt = class extends UI.Widget { constructor() { super(); this._addCompletionsFromHistory = true; - this._history = new WebInspector.ConsoleHistoryManager(); + this._history = new Console.ConsoleHistoryManager(); this._initialText = ''; this._editor = null; this.element.tabIndex = 0; - self.runtime.extension(WebInspector.TextEditorFactory).instance().then(gotFactory.bind(this)); + self.runtime.extension(UI.TextEditorFactory).instance().then(gotFactory.bind(this)); /** - * @param {!WebInspector.TextEditorFactory} factory - * @this {WebInspector.ConsolePrompt} + * @param {!UI.TextEditorFactory} factory + * @this {Console.ConsolePrompt} */ function gotFactory(factory) { this._editor = @@ -44,7 +44,7 @@ } /** - * @return {!WebInspector.ConsoleHistoryManager} + * @return {!Console.ConsoleHistoryManager} */ history() { return this._history; @@ -64,7 +64,7 @@ moveCaretToEndOfPrompt() { if (this._editor) - this._editor.setSelection(WebInspector.TextRange.createFromLocation(Infinity, Infinity)); + this._editor.setSelection(Common.TextRange.createFromLocation(Infinity, Infinity)); } /** @@ -100,30 +100,30 @@ var isPrevious; switch (keyboardEvent.keyCode) { - case WebInspector.KeyboardShortcut.Keys.Up.code: + case UI.KeyboardShortcut.Keys.Up.code: if (this._editor.selection().endLine > 0) break; newText = this._history.previous(this.text()); isPrevious = true; break; - case WebInspector.KeyboardShortcut.Keys.Down.code: + case UI.KeyboardShortcut.Keys.Down.code: if (this._editor.selection().endLine < this._editor.fullRange().endLine) break; newText = this._history.next(); break; - case WebInspector.KeyboardShortcut.Keys.P.code: // Ctrl+P = Previous - if (WebInspector.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey && + case UI.KeyboardShortcut.Keys.P.code: // Ctrl+P = Previous + if (Host.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey && !keyboardEvent.shiftKey) { newText = this._history.previous(this.text()); isPrevious = true; } break; - case WebInspector.KeyboardShortcut.Keys.N.code: // Ctrl+N = Next - if (WebInspector.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey && + case UI.KeyboardShortcut.Keys.N.code: // Ctrl+N = Next + if (Host.isMac() && keyboardEvent.ctrlKey && !keyboardEvent.metaKey && !keyboardEvent.altKey && !keyboardEvent.shiftKey) newText = this._history.next(); break; - case WebInspector.KeyboardShortcut.Keys.Enter.code: + case UI.KeyboardShortcut.Keys.Enter.code: this._enterKeyPressed(keyboardEvent); break; } @@ -134,7 +134,7 @@ this.setText(newText); if (isPrevious) - this._editor.setSelection(WebInspector.TextRange.createFromLocation(0, Infinity)); + this._editor.setSelection(Common.TextRange.createFromLocation(0, Infinity)); else this.moveCaretToEndOfPrompt(); } @@ -154,7 +154,7 @@ if (!str.length) return; - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (!this._isCaretAtEndOfPrompt() || !currentExecutionContext) { this._appendCommand(str, true); return; @@ -165,7 +165,7 @@ /** * @param {!Protocol.Runtime.ScriptId=} scriptId * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.ConsolePrompt} + * @this {Console.ConsolePrompt} */ function compileCallback(scriptId, exceptionDetails) { if (str !== this.text()) @@ -188,11 +188,11 @@ */ _appendCommand(text, useCommandLineAPI) { this.setText(''); - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (currentExecutionContext) { - WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionContext, text, useCommandLineAPI); - if (WebInspector.ConsolePanel.instance().isShowing()) - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.CommandEvaluatedInConsolePanel); + SDK.ConsoleModel.evaluateCommandInConsole(currentExecutionContext, text, useCommandLineAPI); + if (Console.ConsolePanel.instance().isShowing()) + Host.userMetrics.actionTaken(Host.UserMetrics.Action.CommandEvaluatedInConsolePanel); } } @@ -202,7 +202,7 @@ /** * @param {string} prefix * @param {boolean=} force - * @return {!WebInspector.SuggestBox.Suggestions} + * @return {!UI.SuggestBox.Suggestions} */ _historyCompletions(prefix, force) { if (!this._addCompletionsFromHistory || !this._isCaretAtEndOfPrompt() || (!prefix && !force)) @@ -236,7 +236,7 @@ /** * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ _substituteRange(lineNumber, columnNumber) { var lineText = this._editor.line(lineNumber); @@ -245,19 +245,19 @@ if (' =:[({;,!+-*/&|^<>.'.indexOf(lineText.charAt(index)) !== -1) break; } - return new WebInspector.TextRange(lineNumber, index + 1, lineNumber, columnNumber); + return new Common.TextRange(lineNumber, index + 1, lineNumber, columnNumber); } /** - * @param {!WebInspector.TextRange} queryRange - * @param {!WebInspector.TextRange} substituteRange + * @param {!Common.TextRange} queryRange + * @param {!Common.TextRange} substituteRange * @param {boolean=} force * @param {string=} currentTokenType - * @return {!Promise<!WebInspector.SuggestBox.Suggestions>} + * @return {!Promise<!UI.SuggestBox.Suggestions>} */ _wordsWithQuery(queryRange, substituteRange, force, currentTokenType) { var query = this._editor.text(queryRange); - var before = this._editor.text(new WebInspector.TextRange(0, 0, queryRange.startLine, queryRange.startColumn)); + var before = this._editor.text(new Common.TextRange(0, 0, queryRange.startLine, queryRange.startColumn)); var historyWords = this._historyCompletions(query, force); var excludedTokens = new Set(['js-comment', 'js-string-2']); @@ -266,11 +266,11 @@ if (excludedTokens.has(currentTokenType)) return Promise.resolve(historyWords); - return WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(before, query, force) + return Components.JavaScriptAutocomplete.completionsForTextInCurrentContext(before, query, force) .then(innerWordsWithQuery); /** * @param {!Array<string>} words - * @return {!WebInspector.SuggestBox.Suggestions} + * @return {!UI.SuggestBox.Suggestions} */ function innerWordsWithQuery(words) { return words.map(item => ({title: item})).concat(historyWords); @@ -284,7 +284,7 @@ /** * @unrestricted */ -WebInspector.ConsoleHistoryManager = class { +Console.ConsoleHistoryManager = class { constructor() { /** * @type {!Array.<string>}
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js index 62f9f080..079e1e6 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -27,53 +27,53 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} - * @implements {WebInspector.TargetManager.Observer} - * @implements {WebInspector.ViewportControl.Provider} + * @implements {UI.Searchable} + * @implements {SDK.TargetManager.Observer} + * @implements {UI.ViewportControl.Provider} * @unrestricted */ -WebInspector.ConsoleView = class extends WebInspector.VBox { +Console.ConsoleView = class extends UI.VBox { constructor() { super(); this.setMinimumSize(0, 35); this.registerRequiredCSS('console/consoleView.css'); - this._searchableView = new WebInspector.SearchableView(this); - this._searchableView.setPlaceholder(WebInspector.UIString('Find string in logs')); + this._searchableView = new UI.SearchableView(this); + this._searchableView.setPlaceholder(Common.UIString('Find string in logs')); this._searchableView.setMinimalSearchQuerySize(0); this._searchableView.show(this.element); this._contentsElement = this._searchableView.element; this._contentsElement.classList.add('console-view'); - /** @type {!Array.<!WebInspector.ConsoleViewMessage>} */ + /** @type {!Array.<!Console.ConsoleViewMessage>} */ this._visibleViewMessages = []; this._urlToMessageCount = {}; this._hiddenByFilterCount = 0; /** - * @type {!Array.<!WebInspector.ConsoleView.RegexMatchRange>} + * @type {!Array.<!Console.ConsoleView.RegexMatchRange>} */ this._regexMatchRanges = []; - this._executionContextComboBox = new WebInspector.ToolbarComboBox(null, 'console-context'); + this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-context'); this._executionContextComboBox.setMaxWidth(200); this._consoleContextSelector = - new WebInspector.ConsoleContextSelector(this._executionContextComboBox.selectElement()); + new Console.ConsoleContextSelector(this._executionContextComboBox.selectElement()); - this._filter = new WebInspector.ConsoleViewFilter(this); + this._filter = new Console.ConsoleViewFilter(this); this._filter.addEventListener( - WebInspector.ConsoleViewFilter.Events.FilterChanged, this._updateMessageList.bind(this)); + Console.ConsoleViewFilter.Events.FilterChanged, this._updateMessageList.bind(this)); - this._filterBar = new WebInspector.FilterBar('consoleView'); + this._filterBar = new UI.FilterBar('consoleView'); - this._preserveLogCheckbox = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Preserve log'), WebInspector.UIString('Do not clear log on page reload / navigation'), - WebInspector.moduleSetting('preserveConsoleLog')); - this._progressToolbarItem = new WebInspector.ToolbarItem(createElement('div')); + this._preserveLogCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Preserve log'), Common.UIString('Do not clear log on page reload / navigation'), + Common.moduleSetting('preserveConsoleLog')); + this._progressToolbarItem = new UI.ToolbarItem(createElement('div')); - var toolbar = new WebInspector.Toolbar('', this._contentsElement); - toolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton( - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('console.clear')))); + var toolbar = new UI.Toolbar('', this._contentsElement); + toolbar.appendToolbarItem(UI.Toolbar.createActionButton( + /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); toolbar.appendToolbarItem(this._filterBar.filterButton()); toolbar.appendToolbarItem(this._executionContextComboBox); toolbar.appendToolbarItem(this._preserveLogCheckbox); @@ -82,7 +82,7 @@ this._filterBar.show(this._contentsElement); this._filter.addFilters(this._filterBar); - this._viewport = new WebInspector.ViewportControl(this); + this._viewport = new UI.ViewportControl(this); this._viewport.setStickToBottom(true); this._viewport.contentElement().classList.add('console-group', 'console-group-messages'); this._contentsElement.appendChild(this._viewport.element); @@ -91,17 +91,17 @@ this._messagesElement.classList.add('monospace'); this._messagesElement.addEventListener('click', this._messagesClicked.bind(this), true); - this._viewportThrottler = new WebInspector.Throttler(50); + this._viewportThrottler = new Common.Throttler(50); this._filterStatusMessageElement = createElementWithClass('div', 'console-message'); this._messagesElement.insertBefore(this._filterStatusMessageElement, this._messagesElement.firstChild); this._filterStatusTextElement = this._filterStatusMessageElement.createChild('span', 'console-info'); this._filterStatusMessageElement.createTextChild(' '); var resetFiltersLink = this._filterStatusMessageElement.createChild('span', 'console-info link'); - resetFiltersLink.textContent = WebInspector.UIString('Show all messages.'); + resetFiltersLink.textContent = Common.UIString('Show all messages.'); resetFiltersLink.addEventListener('click', this._filter.reset.bind(this._filter), true); - this._topGroup = WebInspector.ConsoleGroup.createTopGroup(); + this._topGroup = Console.ConsoleGroup.createTopGroup(); this._currentGroup = this._topGroup; this._promptElement = this._messagesElement.createChild('div', 'source-code'); @@ -112,7 +112,7 @@ var selectAllFixer = this._messagesElement.createChild('div', 'console-view-fix-select-all'); selectAllFixer.textContent = '.'; - this._showAllMessagesCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UIString('Show all messages')); + this._showAllMessagesCheckbox = new UI.ToolbarCheckbox(Common.UIString('Show all messages')); this._showAllMessagesCheckbox.inputElement.checked = true; this._showAllMessagesCheckbox.inputElement.addEventListener('change', this._updateMessageList.bind(this), false); @@ -123,22 +123,22 @@ this._registerShortcuts(); this._messagesElement.addEventListener('contextmenu', this._handleContextMenuEvent.bind(this), false); - WebInspector.moduleSetting('monitoringXHREnabled') + Common.moduleSetting('monitoringXHREnabled') .addChangeListener(this._monitoringXHREnabledSettingChanged, this); - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); - /** @type {!Array.<!WebInspector.ConsoleViewMessage>} */ + /** @type {!Array.<!Console.ConsoleViewMessage>} */ this._consoleMessages = []; this._viewMessageSymbol = Symbol('viewMessage'); - this._consoleHistorySetting = WebInspector.settings.createLocalSetting('consoleHistory', []); + this._consoleHistorySetting = Common.settings.createLocalSetting('consoleHistory', []); - this._prompt = new WebInspector.ConsolePrompt(); + this._prompt = new Console.ConsolePrompt(); this._prompt.show(this._promptElement); this._prompt.element.addEventListener('keydown', this._promptKeyDown.bind(this), true); - this._consoleHistoryAutocompleteSetting = WebInspector.moduleSetting('consoleHistoryAutocomplete'); + this._consoleHistoryAutocompleteSetting = Common.moduleSetting('consoleHistoryAutocomplete'); this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHistoryAutocompleteChanged, this); var historyData = this._consoleHistorySetting.get(); @@ -146,15 +146,15 @@ this._consoleHistoryAutocompleteChanged(); this._updateFilterStatus(); - WebInspector.moduleSetting('consoleTimestampsEnabled') + Common.moduleSetting('consoleTimestampsEnabled') .addChangeListener(this._consoleTimestampsSettingChanged, this); this._registerWithMessageSink(); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); this._initConsoleMessages(); - WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this); + UI.context.addFlavorChangeListener(SDK.ExecutionContext, this._executionContextChanged, this); this._messagesElement.addEventListener('mousedown', this._updateStickToBottomOnMouseDown.bind(this), false); this._messagesElement.addEventListener('mouseup', this._updateStickToBottomOnMouseUp.bind(this), false); @@ -163,23 +163,23 @@ } /** - * @return {!WebInspector.ConsoleView} + * @return {!Console.ConsoleView} */ static instance() { - if (!WebInspector.ConsoleView._instance) - WebInspector.ConsoleView._instance = new WebInspector.ConsoleView(); - return WebInspector.ConsoleView._instance; + if (!Console.ConsoleView._instance) + Console.ConsoleView._instance = new Console.ConsoleView(); + return Console.ConsoleView._instance; } static clearConsole() { - for (var target of WebInspector.targetManager.targets()) { + for (var target of SDK.targetManager.targets()) { target.runtimeModel.discardConsoleEntries(); target.consoleModel.requestClearMessages(); } } /** - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -195,12 +195,12 @@ } _initConsoleMessages() { - var mainTarget = WebInspector.targetManager.mainTarget(); - var resourceTreeModel = mainTarget && WebInspector.ResourceTreeModel.fromTarget(mainTarget); + var mainTarget = SDK.targetManager.mainTarget(); + var resourceTreeModel = mainTarget && SDK.ResourceTreeModel.fromTarget(mainTarget); var resourcesLoaded = !resourceTreeModel || resourceTreeModel.cachedResourcesLoaded(); if (!mainTarget || !resourcesLoaded) { - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded, + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.CachedResourcesLoaded, this._onResourceTreeModelLoaded, this); return; } @@ -208,28 +208,28 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResourceTreeModelLoaded(event) { var resourceTreeModel = event.target; - if (resourceTreeModel.target() !== WebInspector.targetManager.mainTarget()) + if (resourceTreeModel.target() !== SDK.targetManager.mainTarget()) return; - WebInspector.targetManager.removeModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded, + SDK.targetManager.removeModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.CachedResourcesLoaded, this._onResourceTreeModelLoaded, this); this._fetchMultitargetMessages(); } _fetchMultitargetMessages() { - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageUpdated, this._onConsoleMessageUpdated, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this); - WebInspector.multitargetConsoleModel.messages().forEach(this._addConsoleMessage, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageUpdated, this._onConsoleMessageUpdated, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this); + SDK.multitargetConsoleModel.messages().forEach(this._addConsoleMessage, this); this._viewport.invalidate(); } @@ -244,7 +244,7 @@ /** * @override * @param {number} index - * @return {?WebInspector.ViewportElement} + * @return {?UI.ViewportElement} */ itemElement(index) { return this._visibleViewMessages[index]; @@ -269,7 +269,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._viewport.invalidate(); @@ -278,52 +278,52 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._updateAllMessagesCheckbox(); } _updateAllMessagesCheckbox() { - var hasMultipleCotexts = WebInspector.targetManager.targets(WebInspector.Target.Capability.JS).length > 1; + var hasMultipleCotexts = SDK.targetManager.targets(SDK.Target.Capability.JS).length > 1; this._showAllMessagesCheckbox.element.classList.toggle('hidden', !hasMultipleCotexts); } _registerWithMessageSink() { - WebInspector.console.messages().forEach(this._addSinkMessage, this); - WebInspector.console.addEventListener(WebInspector.Console.Events.MessageAdded, messageAdded, this); + Common.console.messages().forEach(this._addSinkMessage, this); + Common.console.addEventListener(Common.Console.Events.MessageAdded, messageAdded, this); /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ConsoleView} + * @param {!Common.Event} event + * @this {Console.ConsoleView} */ function messageAdded(event) { - this._addSinkMessage(/** @type {!WebInspector.Console.Message} */ (event.data)); + this._addSinkMessage(/** @type {!Common.Console.Message} */ (event.data)); } } /** - * @param {!WebInspector.Console.Message} message + * @param {!Common.Console.Message} message */ _addSinkMessage(message) { - var level = WebInspector.ConsoleMessage.MessageLevel.Debug; + var level = SDK.ConsoleMessage.MessageLevel.Debug; switch (message.level) { - case WebInspector.Console.MessageLevel.Error: - level = WebInspector.ConsoleMessage.MessageLevel.Error; + case Common.Console.MessageLevel.Error: + level = SDK.ConsoleMessage.MessageLevel.Error; break; - case WebInspector.Console.MessageLevel.Warning: - level = WebInspector.ConsoleMessage.MessageLevel.Warning; + case Common.Console.MessageLevel.Warning: + level = SDK.ConsoleMessage.MessageLevel.Warning; break; } - var consoleMessage = new WebInspector.ConsoleMessage( - null, WebInspector.ConsoleMessage.MessageSource.Other, level, message.text, undefined, undefined, undefined, + var consoleMessage = new SDK.ConsoleMessage( + null, SDK.ConsoleMessage.MessageSource.Other, level, message.text, undefined, undefined, undefined, undefined, undefined, undefined, undefined, message.timestamp); this._addConsoleMessage(consoleMessage); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _consoleTimestampsSettingChanged(event) { var enabled = /** @type {boolean} */ (event.data); @@ -393,7 +393,7 @@ _scheduleViewportRefresh() { /** - * @this {WebInspector.ConsoleView} + * @this {Console.ConsoleView} * @return {!Promise.<undefined>} */ function invalidateViewport() { @@ -433,36 +433,36 @@ } _updateFilterStatus() { - this._filterStatusTextElement.textContent = WebInspector.UIString( + this._filterStatusTextElement.textContent = Common.UIString( this._hiddenByFilterCount === 1 ? '%d message is hidden by filters.' : '%d messages are hidden by filters.', this._hiddenByFilterCount); this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none'; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onConsoleMessageAdded(event) { - var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data); + var message = /** @type {!SDK.ConsoleMessage} */ (event.data); this._addConsoleMessage(message); } /** - * @param {!WebInspector.ConsoleMessage} message + * @param {!SDK.ConsoleMessage} message */ _addConsoleMessage(message) { /** - * @param {!WebInspector.ConsoleViewMessage} viewMessage1 - * @param {!WebInspector.ConsoleViewMessage} viewMessage2 + * @param {!Console.ConsoleViewMessage} viewMessage1 + * @param {!Console.ConsoleViewMessage} viewMessage2 * @return {number} */ function compareTimestamps(viewMessage1, viewMessage2) { - return WebInspector.ConsoleMessage.timestampComparator( + return SDK.ConsoleMessage.timestampComparator( viewMessage1.consoleMessage(), viewMessage2.consoleMessage()); } - if (message.type === WebInspector.ConsoleMessage.MessageType.Command || - message.type === WebInspector.ConsoleMessage.MessageType.Result) + if (message.type === SDK.ConsoleMessage.MessageType.Command || + message.type === SDK.ConsoleMessage.MessageType.Result) message.timestamp = this._consoleMessages.length ? this._consoleMessages.peekLast().consoleMessage().timestamp : 0; var viewMessage = this._createViewMessage(message); @@ -489,10 +489,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onConsoleMessageUpdated(event) { - var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data); + var message = /** @type {!SDK.ConsoleMessage} */ (event.data); var viewMessage = message[this._viewMessageSymbol]; if (viewMessage) { viewMessage.updateMessageElement(); @@ -501,13 +501,13 @@ } /** - * @param {!WebInspector.ConsoleViewMessage} viewMessage + * @param {!Console.ConsoleViewMessage} viewMessage */ _consoleMessageAddedForTest(viewMessage) { } /** - * @param {!WebInspector.ConsoleViewMessage} viewMessage + * @param {!Console.ConsoleViewMessage} viewMessage */ _appendMessageToEnd(viewMessage) { if (!this._filter.shouldBeVisible(viewMessage)) { @@ -520,7 +520,7 @@ return; var lastMessage = this._visibleViewMessages.peekLast(); - if (viewMessage.consoleMessage().type === WebInspector.ConsoleMessage.MessageType.EndGroup) { + if (viewMessage.consoleMessage().type === SDK.ConsoleMessage.MessageType.EndGroup) { if (lastMessage && !this._currentGroup.messagesHidden()) lastMessage.incrementCloseGroupDecorationCount(); this._currentGroup = this._currentGroup.parentGroup(); @@ -536,7 +536,7 @@ } if (viewMessage.consoleMessage().isGroupStartMessage()) - this._currentGroup = new WebInspector.ConsoleGroup(this._currentGroup, viewMessage); + this._currentGroup = new Console.ConsoleGroup(this._currentGroup, viewMessage); this._messageAppendedForTests(); } @@ -546,21 +546,21 @@ } /** - * @param {!WebInspector.ConsoleMessage} message - * @return {!WebInspector.ConsoleViewMessage} + * @param {!SDK.ConsoleMessage} message + * @return {!Console.ConsoleViewMessage} */ _createViewMessage(message) { var nestingLevel = this._currentGroup.nestingLevel(); switch (message.type) { - case WebInspector.ConsoleMessage.MessageType.Command: - return new WebInspector.ConsoleCommand(message, this._linkifier, nestingLevel); - case WebInspector.ConsoleMessage.MessageType.Result: - return new WebInspector.ConsoleCommandResult(message, this._linkifier, nestingLevel); - case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed: - case WebInspector.ConsoleMessage.MessageType.StartGroup: - return new WebInspector.ConsoleGroupViewMessage(message, this._linkifier, nestingLevel); + case SDK.ConsoleMessage.MessageType.Command: + return new Console.ConsoleCommand(message, this._linkifier, nestingLevel); + case SDK.ConsoleMessage.MessageType.Result: + return new Console.ConsoleCommandResult(message, this._linkifier, nestingLevel); + case SDK.ConsoleMessage.MessageType.StartGroupCollapsed: + case SDK.ConsoleMessage.MessageType.StartGroup: + return new Console.ConsoleGroupViewMessage(message, this._linkifier, nestingLevel); default: - return new WebInspector.ConsoleViewMessage(message, this._linkifier, nestingLevel); + return new Console.ConsoleViewMessage(message, this._linkifier, nestingLevel); } } @@ -577,40 +577,40 @@ if (event.target.enclosingNodeOrSelfWithNodeName('a')) return; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (event.target.isSelfOrDescendant(this._promptElement)) { contextMenu.show(); return; } function monitoringXHRItemAction() { - WebInspector.moduleSetting('monitoringXHREnabled').set(!WebInspector.moduleSetting('monitoringXHREnabled').get()); + Common.moduleSetting('monitoringXHREnabled').set(!Common.moduleSetting('monitoringXHREnabled').get()); } contextMenu.appendCheckboxItem( - WebInspector.UIString('Log XMLHttpRequests'), monitoringXHRItemAction, - WebInspector.moduleSetting('monitoringXHREnabled').get()); + Common.UIString('Log XMLHttpRequests'), monitoringXHRItemAction, + Common.moduleSetting('monitoringXHREnabled').get()); var sourceElement = event.target.enclosingNodeOrSelfWithClass('console-message-wrapper'); var consoleMessage = sourceElement ? sourceElement.message.consoleMessage() : null; - var filterSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Filter')); + var filterSubMenu = contextMenu.appendSubMenuItem(Common.UIString('Filter')); if (consoleMessage && consoleMessage.url) { - var menuTitle = WebInspector.UIString.capitalize( - 'Hide ^messages from %s', new WebInspector.ParsedURL(consoleMessage.url).displayName); + var menuTitle = Common.UIString.capitalize( + 'Hide ^messages from %s', new Common.ParsedURL(consoleMessage.url).displayName); filterSubMenu.appendItem(menuTitle, this._filter.addMessageURLFilter.bind(this._filter, consoleMessage.url)); } filterSubMenu.appendSeparator(); var unhideAll = filterSubMenu.appendItem( - WebInspector.UIString.capitalize('Unhide ^all'), this._filter.removeMessageURLFilter.bind(this._filter)); + Common.UIString.capitalize('Unhide ^all'), this._filter.removeMessageURLFilter.bind(this._filter)); filterSubMenu.appendSeparator(); var hasFilters = false; for (var url in this._filter.messageURLFilters) { filterSubMenu.appendCheckboxItem( - String.sprintf('%s (%d)', new WebInspector.ParsedURL(url).displayName, this._urlToMessageCount[url]), + String.sprintf('%s (%d)', new Common.ParsedURL(url).displayName, this._urlToMessageCount[url]), this._filter.removeMessageURLFilter.bind(this._filter, url), true); hasFilters = true; } @@ -621,25 +621,25 @@ contextMenu.appendSeparator(); contextMenu.appendAction('console.clear'); contextMenu.appendAction('console.clear.history'); - contextMenu.appendItem(WebInspector.UIString('Save as...'), this._saveConsole.bind(this)); + contextMenu.appendItem(Common.UIString('Save as...'), this._saveConsole.bind(this)); var request = consoleMessage ? consoleMessage.request : null; - if (request && request.resourceType() === WebInspector.resourceTypes.XHR) { + if (request && request.resourceType() === Common.resourceTypes.XHR) { contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Replay XHR'), request.replayXHR.bind(request)); + contextMenu.appendItem(Common.UIString('Replay XHR'), request.replayXHR.bind(request)); } contextMenu.show(); } _saveConsole() { - var url = WebInspector.targetManager.mainTarget().inspectedURL(); + var url = SDK.targetManager.mainTarget().inspectedURL(); var parsedURL = url.asParsedURL(); var filename = String.sprintf('%s-%d.log', parsedURL ? parsedURL.host : 'console', Date.now()); - var stream = new WebInspector.FileOutputStream(); + var stream = new Bindings.FileOutputStream(); - var progressIndicator = new WebInspector.ProgressIndicator(); - progressIndicator.setTitle(WebInspector.UIString('Writing file…')); + var progressIndicator = new UI.ProgressIndicator(); + progressIndicator.setTitle(Common.UIString('Writing file…')); progressIndicator.setTotalWork(this.itemCount()); /** @const */ @@ -650,7 +650,7 @@ /** * @param {boolean} accepted - * @this {WebInspector.ConsoleView} + * @this {Console.ConsoleView} */ function openCallback(accepted) { if (!accepted) @@ -660,9 +660,9 @@ } /** - * @param {!WebInspector.OutputStream} stream + * @param {!Common.OutputStream} stream * @param {string=} error - * @this {WebInspector.ConsoleView} + * @this {Console.ConsoleView} */ function writeNextChunk(stream, error) { if (messageIndex >= this.itemCount() || error) { @@ -684,12 +684,12 @@ } /** - * @param {!WebInspector.ConsoleViewMessage} lastMessage - * @param {?WebInspector.ConsoleViewMessage=} viewMessage + * @param {!Console.ConsoleViewMessage} lastMessage + * @param {?Console.ConsoleViewMessage=} viewMessage * @return {boolean} */ _tryToCollapseMessages(lastMessage, viewMessage) { - if (!WebInspector.moduleSetting('consoleTimestampsEnabled').get() && viewMessage && + if (!Common.moduleSetting('consoleTimestampsEnabled').get() && viewMessage && !lastMessage.consoleMessage().isGroupMessage() && lastMessage.consoleMessage().isEqual(viewMessage.consoleMessage())) { viewMessage.incrementRepeatCount(); @@ -700,7 +700,7 @@ } _updateMessageList() { - this._topGroup = WebInspector.ConsoleGroup.createTopGroup(); + this._topGroup = Console.ConsoleGroup.createTopGroup(); this._currentGroup = this._topGroup; this._regexMatchRanges = []; this._hiddenByFilterCount = 0; @@ -717,11 +717,11 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _monitoringXHREnabledSettingChanged(event) { var enabled = /** @type {boolean} */ (event.data); - WebInspector.targetManager.targets().forEach(function(target) { + SDK.targetManager.targets().forEach(function(target) { target.networkAgent().setMonitoringXHREnabled(enabled); }); } @@ -744,37 +744,37 @@ _registerShortcuts() { this._shortcuts = {}; - var shortcut = WebInspector.KeyboardShortcut; - var section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Console')); + var shortcut = UI.KeyboardShortcut; + var section = Components.shortcutsScreen.section(Common.UIString('Console')); - var shortcutL = shortcut.makeDescriptor('l', WebInspector.KeyboardShortcut.Modifiers.Ctrl); + var shortcutL = shortcut.makeDescriptor('l', UI.KeyboardShortcut.Modifiers.Ctrl); var keys = [shortcutL]; - if (WebInspector.isMac()) { - var shortcutK = shortcut.makeDescriptor('k', WebInspector.KeyboardShortcut.Modifiers.Meta); + if (Host.isMac()) { + var shortcutK = shortcut.makeDescriptor('k', UI.KeyboardShortcut.Modifiers.Meta); keys.unshift(shortcutK); } - section.addAlternateKeys(keys, WebInspector.UIString('Clear console')); + section.addAlternateKeys(keys, Common.UIString('Clear console')); keys = [ shortcut.makeDescriptor(shortcut.Keys.Tab), shortcut.makeDescriptor(shortcut.Keys.Right) ]; - section.addRelatedKeys(keys, WebInspector.UIString('Accept suggestion')); + section.addRelatedKeys(keys, Common.UIString('Accept suggestion')); - var shortcutU = shortcut.makeDescriptor('u', WebInspector.KeyboardShortcut.Modifiers.Ctrl); + var shortcutU = shortcut.makeDescriptor('u', UI.KeyboardShortcut.Modifiers.Ctrl); this._shortcuts[shortcutU.key] = this._clearPromptBackwards.bind(this); - section.addAlternateKeys([shortcutU], WebInspector.UIString('Clear console prompt')); + section.addAlternateKeys([shortcutU], Common.UIString('Clear console prompt')); keys = [shortcut.makeDescriptor(shortcut.Keys.Down), shortcut.makeDescriptor(shortcut.Keys.Up)]; - section.addRelatedKeys(keys, WebInspector.UIString('Next/previous line')); + section.addRelatedKeys(keys, Common.UIString('Next/previous line')); - if (WebInspector.isMac()) { + if (Host.isMac()) { keys = [shortcut.makeDescriptor('N', shortcut.Modifiers.Alt), shortcut.makeDescriptor('P', shortcut.Modifiers.Alt)]; - section.addRelatedKeys(keys, WebInspector.UIString('Next/previous command')); + section.addRelatedKeys(keys, Common.UIString('Next/previous command')); } - section.addKey(shortcut.makeDescriptor(shortcut.Keys.Enter), WebInspector.UIString('Execute command')); + section.addKey(shortcut.makeDescriptor(shortcut.Keys.Enter), Common.UIString('Execute command')); } _clearPromptBackwards() { @@ -791,7 +791,7 @@ return; } - var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(keyboardEvent); + var shortcut = UI.KeyboardShortcut.makeKeyFromEvent(keyboardEvent); var handler = this._shortcuts[shortcut]; if (handler) { handler(); @@ -800,38 +800,38 @@ } /** - * @param {?WebInspector.RemoteObject} result - * @param {!WebInspector.ConsoleMessage} originatingConsoleMessage + * @param {?SDK.RemoteObject} result + * @param {!SDK.ConsoleMessage} originatingConsoleMessage * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ _printResult(result, originatingConsoleMessage, exceptionDetails) { if (!result) return; - var level = !!exceptionDetails ? WebInspector.ConsoleMessage.MessageLevel.Error : - WebInspector.ConsoleMessage.MessageLevel.Log; + var level = !!exceptionDetails ? SDK.ConsoleMessage.MessageLevel.Error : + SDK.ConsoleMessage.MessageLevel.Log; var message; if (!exceptionDetails) - message = new WebInspector.ConsoleMessage( - result.target(), WebInspector.ConsoleMessage.MessageSource.JS, level, '', - WebInspector.ConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]); + message = new SDK.ConsoleMessage( + result.target(), SDK.ConsoleMessage.MessageSource.JS, level, '', + SDK.ConsoleMessage.MessageType.Result, undefined, undefined, undefined, undefined, [result]); else - message = WebInspector.ConsoleMessage.fromException( - result.target(), exceptionDetails, WebInspector.ConsoleMessage.MessageType.Result, undefined, undefined); + message = SDK.ConsoleMessage.fromException( + result.target(), exceptionDetails, SDK.ConsoleMessage.MessageType.Result, undefined, undefined); message.setOriginatingMessage(originatingConsoleMessage); result.target().consoleModel.addMessage(message); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _commandEvaluated(event) { var data = - /** @type {{result: ?WebInspector.RemoteObject, text: string, commandMessage: !WebInspector.ConsoleMessage, exceptionDetails: (!Protocol.Runtime.ExceptionDetails|undefined)}} */ + /** @type {{result: ?SDK.RemoteObject, text: string, commandMessage: !SDK.ConsoleMessage, exceptionDetails: (!Protocol.Runtime.ExceptionDetails|undefined)}} */ (event.data); this._prompt.history().pushHistoryItem(data.text); this._consoleHistorySetting.set( - this._prompt.history().historyData().slice(-WebInspector.ConsoleView.persistedHistorySize)); + this._prompt.history().historyData().slice(-Console.ConsoleView.persistedHistorySize)); this._printResult(data.result, data.commandMessage, data.exceptionDetails); } @@ -860,7 +860,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -876,8 +876,8 @@ if (shouldJump) this._searchShouldJumpBackwards = !!jumpBackwards; - this._searchProgressIndicator = new WebInspector.ProgressIndicator(); - this._searchProgressIndicator.setTitle(WebInspector.UIString('Searching…')); + this._searchProgressIndicator = new UI.ProgressIndicator(); + this._searchProgressIndicator.setTitle(Common.UIString('Searching…')); this._searchProgressIndicator.setTotalWork(this._visibleViewMessages.length); this._progressToolbarItem.element.appendChild(this._searchProgressIndicator.element); @@ -983,7 +983,7 @@ matchRange = this._regexMatchRanges[this._currentMatchRangeIndex]; var message = this._visibleViewMessages[matchRange.messageIndex]; message.searchHighlightNode(matchRange.matchIndex) - .classList.remove(WebInspector.highlightedCurrentSearchResultClassName); + .classList.remove(UI.highlightedCurrentSearchResultClassName); } index = mod(index, this._regexMatchRanges.length); @@ -992,7 +992,7 @@ matchRange = this._regexMatchRanges[index]; var message = this._visibleViewMessages[matchRange.messageIndex]; var highlightNode = message.searchHighlightNode(matchRange.matchIndex); - highlightNode.classList.add(WebInspector.highlightedCurrentSearchResultClassName); + highlightNode.classList.add(UI.highlightedCurrentSearchResultClassName); this._viewport.scrollItemIntoView(matchRange.messageIndex); highlightNode.scrollIntoViewIfNeeded(); } @@ -1016,7 +1016,7 @@ this._waitForScrollTimeout = setTimeout(updateViewportState.bind(this), 200); /** - * @this {!WebInspector.ConsoleView} + * @this {!Console.ConsoleView} */ function updateViewportState() { this._muteViewportUpdates = false; @@ -1046,51 +1046,51 @@ } }; -WebInspector.ConsoleView.persistedHistorySize = 300; +Console.ConsoleView.persistedHistorySize = 300; /** * @unrestricted */ -WebInspector.ConsoleViewFilter = class extends WebInspector.Object { +Console.ConsoleViewFilter = class extends Common.Object { /** - * @param {!WebInspector.ConsoleView} view + * @param {!Console.ConsoleView} view */ constructor(view) { super(); - this._messageURLFiltersSetting = WebInspector.settings.createSetting('messageURLFilters', {}); - this._messageLevelFiltersSetting = WebInspector.settings.createSetting('messageLevelFilters', {}); + this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFilters', {}); + this._messageLevelFiltersSetting = Common.settings.createSetting('messageLevelFilters', {}); this._view = view; this._messageURLFilters = this._messageURLFiltersSetting.get(); - this._filterChanged = this.dispatchEventToListeners.bind(this, WebInspector.ConsoleViewFilter.Events.FilterChanged); + this._filterChanged = this.dispatchEventToListeners.bind(this, Console.ConsoleViewFilter.Events.FilterChanged); } addFilters(filterBar) { - this._textFilterUI = new WebInspector.TextFilterUI(true); - this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._textFilterChanged, this); + this._textFilterUI = new UI.TextFilterUI(true); + this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._textFilterChanged, this); filterBar.addFilter(this._textFilterUI); - this._hideNetworkMessagesCheckbox = new WebInspector.CheckboxFilterUI( - '', WebInspector.UIString('Hide network'), true, - WebInspector.moduleSetting('hideNetworkMessages')); - this._hideViolationMessagesCheckbox = new WebInspector.CheckboxFilterUI( - '', WebInspector.UIString('Hide violations'), false, - WebInspector.moduleSetting('hideViolationMessages')); - WebInspector.moduleSetting('hideNetworkMessages').addChangeListener(this._filterChanged, this); - WebInspector.moduleSetting('hideViolationMessages').addChangeListener(this._filterChanged, this); + this._hideNetworkMessagesCheckbox = new UI.CheckboxFilterUI( + '', Common.UIString('Hide network'), true, + Common.moduleSetting('hideNetworkMessages')); + this._hideViolationMessagesCheckbox = new UI.CheckboxFilterUI( + '', Common.UIString('Hide violations'), false, + Common.moduleSetting('hideViolationMessages')); + Common.moduleSetting('hideNetworkMessages').addChangeListener(this._filterChanged, this); + Common.moduleSetting('hideViolationMessages').addChangeListener(this._filterChanged, this); filterBar.addFilter(this._hideNetworkMessagesCheckbox); filterBar.addFilter(this._hideViolationMessagesCheckbox); var levels = [ - {name: WebInspector.ConsoleMessage.MessageLevel.Error, label: WebInspector.UIString('Errors')}, - {name: WebInspector.ConsoleMessage.MessageLevel.Warning, label: WebInspector.UIString('Warnings')}, - {name: WebInspector.ConsoleMessage.MessageLevel.Info, label: WebInspector.UIString('Info')}, - {name: WebInspector.ConsoleMessage.MessageLevel.Log, label: WebInspector.UIString('Logs')}, - {name: WebInspector.ConsoleMessage.MessageLevel.Debug, label: WebInspector.UIString('Debug')}, - {name: WebInspector.ConsoleMessage.MessageLevel.RevokedError, label: WebInspector.UIString('Handled')} + {name: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Errors')}, + {name: SDK.ConsoleMessage.MessageLevel.Warning, label: Common.UIString('Warnings')}, + {name: SDK.ConsoleMessage.MessageLevel.Info, label: Common.UIString('Info')}, + {name: SDK.ConsoleMessage.MessageLevel.Log, label: Common.UIString('Logs')}, + {name: SDK.ConsoleMessage.MessageLevel.Debug, label: Common.UIString('Debug')}, + {name: SDK.ConsoleMessage.MessageLevel.RevokedError, label: Common.UIString('Handled')} ]; - this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, this._messageLevelFiltersSetting); - this._levelFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._filterChanged, this); + this._levelFilterUI = new UI.NamedBitSetFilterUI(levels, this._messageLevelFiltersSetting); + this._levelFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._filterChanged, this); filterBar.addFilter(this._levelFilterUI); } @@ -1130,12 +1130,12 @@ } /** - * @param {!WebInspector.ConsoleViewMessage} viewMessage + * @param {!Console.ConsoleViewMessage} viewMessage * @return {boolean} */ shouldBeVisible(viewMessage) { var message = viewMessage.consoleMessage(); - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (!message.target()) return true; @@ -1147,19 +1147,19 @@ } } - if (WebInspector.moduleSetting('hideNetworkMessages').get() && - viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.MessageSource.Network) + if (Common.moduleSetting('hideNetworkMessages').get() && + viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource.Network) return false; - if (WebInspector.moduleSetting('hideViolationMessages').get() && - viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.MessageSource.Violation) + if (Common.moduleSetting('hideViolationMessages').get() && + viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource.Violation) return false; if (viewMessage.consoleMessage().isGroupMessage()) return true; - if (message.type === WebInspector.ConsoleMessage.MessageType.Result || - message.type === WebInspector.ConsoleMessage.MessageType.Command) + if (message.type === SDK.ConsoleMessage.MessageType.Result || + message.type === SDK.ConsoleMessage.MessageType.Command) return true; if (message.url && this._messageURLFilters[message.url]) @@ -1182,7 +1182,7 @@ */ shouldBeVisibleByDefault(viewMessage) { return viewMessage.consoleMessage().source !== - WebInspector.ConsoleMessage.MessageSource.Violation; + SDK.ConsoleMessage.MessageSource.Violation; } reset() { @@ -1190,25 +1190,25 @@ this._messageURLFiltersSetting.set(this._messageURLFilters); this._messageLevelFiltersSetting.set({}); this._view._showAllMessagesCheckbox.inputElement.checked = true; - WebInspector.moduleSetting('hideNetworkMessages').set(false); - WebInspector.moduleSetting('hideViolationMessages').set(true); + Common.moduleSetting('hideNetworkMessages').set(false); + Common.moduleSetting('hideViolationMessages').set(true); this._textFilterUI.setValue(''); this._filterChanged(); } }; /** @enum {symbol} */ -WebInspector.ConsoleViewFilter.Events = { +Console.ConsoleViewFilter.Events = { FilterChanged: Symbol('FilterChanged') }; /** * @unrestricted */ -WebInspector.ConsoleCommand = class extends WebInspector.ConsoleViewMessage { +Console.ConsoleCommand = class extends Console.ConsoleViewMessage { /** - * @param {!WebInspector.ConsoleMessage} message - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.ConsoleMessage} message + * @param {!Components.Linkifier} linkifier * @param {number} nestingLevel */ constructor(message, linkifier, nestingLevel) { @@ -1228,8 +1228,8 @@ this._formattedCommand.textContent = this.text.replaceControlCharacters(); this._contentElement.appendChild(this._formattedCommand); - if (this._formattedCommand.textContent.length < WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter) { - var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter('text/javascript', true); + if (this._formattedCommand.textContent.length < Console.ConsoleCommand.MaxLengthToIgnoreHighlighter) { + var javascriptSyntaxHighlighter = new UI.DOMSyntaxHighlighter('text/javascript', true); javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this)); } else { this._updateSearch(); @@ -1248,15 +1248,15 @@ * @const * @type {number} */ -WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter = 10000; +Console.ConsoleCommand.MaxLengthToIgnoreHighlighter = 10000; /** * @unrestricted */ -WebInspector.ConsoleCommandResult = class extends WebInspector.ConsoleViewMessage { +Console.ConsoleCommandResult = class extends Console.ConsoleViewMessage { /** - * @param {!WebInspector.ConsoleMessage} message - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.ConsoleMessage} message + * @param {!Components.Linkifier} linkifier * @param {number} nestingLevel */ constructor(message, linkifier, nestingLevel) { @@ -1278,10 +1278,10 @@ /** * @unrestricted */ -WebInspector.ConsoleGroup = class { +Console.ConsoleGroup = class { /** - * @param {?WebInspector.ConsoleGroup} parentGroup - * @param {?WebInspector.ConsoleViewMessage} groupMessage + * @param {?Console.ConsoleGroup} parentGroup + * @param {?Console.ConsoleViewMessage} groupMessage */ constructor(parentGroup, groupMessage) { this._parentGroup = parentGroup; @@ -1291,10 +1291,10 @@ } /** - * @return {!WebInspector.ConsoleGroup} + * @return {!Console.ConsoleGroup} */ static createTopGroup() { - return new WebInspector.ConsoleGroup(null, null); + return new Console.ConsoleGroup(null, null); } /** @@ -1312,7 +1312,7 @@ } /** - * @return {?WebInspector.ConsoleGroup} + * @return {?Console.ConsoleGroup} */ parentGroup() { return this._parentGroup || this; @@ -1321,26 +1321,26 @@ /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.ConsoleView.ActionDelegate = class { +Console.ConsoleView.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { switch (actionId) { case 'console.show': - WebInspector.console.show(); + Common.console.show(); return true; case 'console.clear': - WebInspector.ConsoleView.clearConsole(); + Console.ConsoleView.clearConsole(); return true; case 'console.clear.history': - WebInspector.ConsoleView.instance()._clearHistory(); + Console.ConsoleView.instance()._clearHistory(); return true; } return false; @@ -1350,4 +1350,4 @@ /** * @typedef {{messageIndex: number, matchIndex: number}} */ -WebInspector.ConsoleView.RegexMatchRange; +Console.ConsoleView.RegexMatchRange;
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js index 8bd7d61..567fd3aa 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -28,13 +28,13 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ViewportElement} + * @implements {UI.ViewportElement} * @unrestricted */ -WebInspector.ConsoleViewMessage = class { +Console.ConsoleViewMessage = class { /** - * @param {!WebInspector.ConsoleMessage} consoleMessage - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.ConsoleMessage} consoleMessage + * @param {!Components.Linkifier} linkifier * @param {number} nestingLevel */ constructor(consoleMessage, linkifier, nestingLevel) { @@ -44,14 +44,14 @@ this._closeGroupDecorationCount = 0; this._nestingLevel = nestingLevel; - /** @type {?WebInspector.DataGrid} */ + /** @type {?UI.DataGrid} */ this._dataGrid = null; - this._previewFormatter = new WebInspector.RemoteObjectPreviewFormatter(); + this._previewFormatter = new Components.RemoteObjectPreviewFormatter(); this._searchRegex = null; } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ _target() { return this.consoleMessage().target(); @@ -98,7 +98,7 @@ // This value reflects the 18px min-height of .console-message, plus the // 1px border of .console-message-wrapper. Keep in sync with consoleView.css. const defaultConsoleRowHeight = 19; - if (this._message.type === WebInspector.ConsoleMessage.MessageType.Table) { + if (this._message.type === SDK.ConsoleMessage.MessageType.Table) { var table = this._message.parameters[0]; if (table && table.preview) return defaultConsoleRowHeight * table.preview.properties.length; @@ -107,19 +107,19 @@ } /** - * @return {!WebInspector.ConsoleMessage} + * @return {!SDK.ConsoleMessage} */ consoleMessage() { return this._message; } /** - * @param {!WebInspector.ConsoleMessage} consoleMessage + * @param {!SDK.ConsoleMessage} consoleMessage * @return {!Element} */ _buildTableMessage(consoleMessage) { var formattedMessage = createElement('span'); - WebInspector.appendStyle(formattedMessage, 'components/objectValue.css'); + UI.appendStyle(formattedMessage, 'components/objectValue.css'); formattedMessage.className = 'source-code'; var anchorElement = this._buildMessageAnchor(consoleMessage); if (anchorElement) @@ -169,10 +169,10 @@ for (var j = 0; j < columnNames.length; ++j) flatValues.push(rowValue[columnNames[j]]); } - columnNames.unshift(WebInspector.UIString('(index)')); + columnNames.unshift(Common.UIString('(index)')); if (flatValues.length) { - this._dataGrid = WebInspector.SortableDataGrid.create(columnNames, flatValues); + this._dataGrid = UI.SortableDataGrid.create(columnNames, flatValues); var formattedResult = createElementWithClass('span', 'console-message-text'); var tableElement = formattedResult.createChild('div', 'console-message-formatted-table'); @@ -186,34 +186,34 @@ } /** - * @param {!WebInspector.ConsoleMessage} consoleMessage + * @param {!SDK.ConsoleMessage} consoleMessage * @return {!Element} */ _buildMessage(consoleMessage) { var messageElement; var messageText = consoleMessage.messageText; - if (consoleMessage.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI) { + if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.ConsoleAPI) { switch (consoleMessage.type) { - case WebInspector.ConsoleMessage.MessageType.Trace: + case SDK.ConsoleMessage.MessageType.Trace: messageElement = this._format(consoleMessage.parameters || ['console.trace']); break; - case WebInspector.ConsoleMessage.MessageType.Clear: + case SDK.ConsoleMessage.MessageType.Clear: messageElement = createElementWithClass('span', 'console-info'); - messageElement.textContent = WebInspector.UIString('Console was cleared'); + messageElement.textContent = Common.UIString('Console was cleared'); break; - case WebInspector.ConsoleMessage.MessageType.Assert: - var args = [WebInspector.UIString('Assertion failed:')]; + case SDK.ConsoleMessage.MessageType.Assert: + var args = [Common.UIString('Assertion failed:')]; if (consoleMessage.parameters) args = args.concat(consoleMessage.parameters); messageElement = this._format(args); break; - case WebInspector.ConsoleMessage.MessageType.Dir: + case SDK.ConsoleMessage.MessageType.Dir: var obj = consoleMessage.parameters ? consoleMessage.parameters[0] : undefined; var args = ['%O', obj]; messageElement = this._format(args); break; - case WebInspector.ConsoleMessage.MessageType.Profile: - case WebInspector.ConsoleMessage.MessageType.ProfileEnd: + case SDK.ConsoleMessage.MessageType.Profile: + case SDK.ConsoleMessage.MessageType.ProfileEnd: messageElement = this._format([messageText]); break; default: @@ -223,13 +223,13 @@ var args = consoleMessage.parameters || [messageText]; messageElement = messageElement || this._format(args); } - } else if (consoleMessage.source === WebInspector.ConsoleMessage.MessageSource.Network) { + } else if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Network) { if (consoleMessage.request) { messageElement = createElement('span'); - if (consoleMessage.level === WebInspector.ConsoleMessage.MessageLevel.Error || - consoleMessage.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError) { + if (consoleMessage.level === SDK.ConsoleMessage.MessageLevel.Error || + consoleMessage.level === SDK.ConsoleMessage.MessageLevel.RevokedError) { messageElement.createTextChild(consoleMessage.request.requestMethod + ' '); - messageElement.appendChild(WebInspector.Linkifier.linkifyUsingRevealer( + messageElement.appendChild(Components.Linkifier.linkifyUsingRevealer( consoleMessage.request, consoleMessage.request.url, consoleMessage.request.url)); if (consoleMessage.request.failed) messageElement.createTextChildren(' ', consoleMessage.request.localizedFailDescription); @@ -237,7 +237,7 @@ messageElement.createTextChildren( ' ', String(consoleMessage.request.statusCode), ' (', consoleMessage.request.statusText, ')'); } else { - var fragment = WebInspector.linkifyStringAsFragmentWithCustomLinkifier( + var fragment = Components.linkifyStringAsFragmentWithCustomLinkifier( messageText, linkifyRequest.bind(consoleMessage)); messageElement.appendChild(fragment); } @@ -245,15 +245,15 @@ messageElement = this._format([messageText]); } } else { - if (consoleMessage.source === WebInspector.ConsoleMessage.MessageSource.Violation) - messageText = WebInspector.UIString('[Violation] %s', messageText); + if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Violation) + messageText = Common.UIString('[Violation] %s', messageText); var args = consoleMessage.parameters || [messageText]; messageElement = this._format(args); } messageElement.classList.add('console-message-text'); var formattedMessage = createElement('span'); - WebInspector.appendStyle(formattedMessage, 'components/objectValue.css'); + UI.appendStyle(formattedMessage, 'components/objectValue.css'); formattedMessage.className = 'source-code'; var anchorElement = this._buildMessageAnchor(consoleMessage); @@ -265,21 +265,21 @@ /** * @param {string} title * @return {!Element} - * @this {WebInspector.ConsoleMessage} + * @this {SDK.ConsoleMessage} */ function linkifyRequest(title) { - return WebInspector.Linkifier.linkifyUsingRevealer( - /** @type {!WebInspector.NetworkRequest} */ (this.request), title, this.request.url); + return Components.Linkifier.linkifyUsingRevealer( + /** @type {!SDK.NetworkRequest} */ (this.request), title, this.request.url); } } /** - * @param {!WebInspector.ConsoleMessage} consoleMessage + * @param {!SDK.ConsoleMessage} consoleMessage * @return {?Element} */ _buildMessageAnchor(consoleMessage) { var anchorElement = null; - if (consoleMessage.source !== WebInspector.ConsoleMessage.MessageSource.Network || consoleMessage.request) { + if (consoleMessage.source !== SDK.ConsoleMessage.MessageSource.Network || consoleMessage.request) { if (consoleMessage.scriptId) anchorElement = this._linkifyScriptId( consoleMessage.scriptId, consoleMessage.url || '', consoleMessage.line, consoleMessage.column); @@ -290,8 +290,8 @@ } else if (consoleMessage.url) { var url = consoleMessage.url; var isExternal = - !WebInspector.resourceForURL(url) && !WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url); - anchorElement = WebInspector.linkifyURLAsNode(url, url, 'console-message-url', isExternal); + !Bindings.resourceForURL(url) && !Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(url); + anchorElement = UI.linkifyURLAsNode(url, url, 'console-message-url', isExternal); } // Append a space to prevent the anchor text from being glued to the console message when the user selects and copies the console messages. @@ -301,9 +301,9 @@ } /** - * @param {!WebInspector.ConsoleMessage} consoleMessage - * @param {!WebInspector.Target} target - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.ConsoleMessage} consoleMessage + * @param {!SDK.Target} target + * @param {!Components.Linkifier} linkifier * @return {!Element} */ _buildMessageWithStackTrace(consoleMessage, target, linkifier) { @@ -315,7 +315,7 @@ clickableElement.appendChild(messageElement); var stackTraceElement = contentElement.createChild('div'); var stackTracePreview = - WebInspector.DOMPresentationUtils.buildStackTracePreviewContents(target, linkifier, consoleMessage.stackTrace); + Components.DOMPresentationUtils.buildStackTracePreviewContents(target, linkifier, consoleMessage.stackTrace); stackTraceElement.appendChild(stackTracePreview); stackTraceElement.classList.add('hidden'); @@ -339,7 +339,7 @@ } clickableElement.addEventListener('click', toggleStackTrace, false); - if (consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace) + if (consoleMessage.type === SDK.ConsoleMessage.MessageType.Trace) expandStackTrace(true); toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); @@ -386,22 +386,22 @@ } /** - * @param {!WebInspector.RemoteObject|!Object|string} parameter - * @param {?WebInspector.Target} target - * @return {!WebInspector.RemoteObject} + * @param {!SDK.RemoteObject|!Object|string} parameter + * @param {?SDK.Target} target + * @return {!SDK.RemoteObject} */ _parameterToRemoteObject(parameter, target) { - if (parameter instanceof WebInspector.RemoteObject) + if (parameter instanceof SDK.RemoteObject) return parameter; if (!target) - return WebInspector.RemoteObject.fromLocalObject(parameter); + return SDK.RemoteObject.fromLocalObject(parameter); if (typeof parameter === 'object') return target.runtimeModel.createRemoteObject(parameter); return target.runtimeModel.createRemoteObjectFromPrimitiveValue(parameter); } /** - * @param {!Array.<!WebInspector.RemoteObject|string>} parameters + * @param {!Array.<!SDK.RemoteObject|string>} parameters * @return {!Element} */ _format(parameters) { @@ -417,11 +417,11 @@ parameters[i] = this._parameterToRemoteObject(parameters[i], this._target()); // There can be string log and string eval result. We distinguish between them based on message type. - var shouldFormatMessage = WebInspector.RemoteObject.type( - (/** @type {!Array.<!WebInspector.RemoteObject>} **/ (parameters))[0]) === 'string' && - (this._message.type !== WebInspector.ConsoleMessage.MessageType.Result || - this._message.level === WebInspector.ConsoleMessage.MessageLevel.Error || - this._message.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError); + var shouldFormatMessage = SDK.RemoteObject.type( + (/** @type {!Array.<!SDK.RemoteObject>} **/ (parameters))[0]) === 'string' && + (this._message.type !== SDK.ConsoleMessage.MessageType.Result || + this._message.level === SDK.ConsoleMessage.MessageLevel.Error || + this._message.level === SDK.ConsoleMessage.MessageLevel.RevokedError); // Multiple parameters with the first being a format string. Save unused substitutions. if (shouldFormatMessage) { @@ -436,7 +436,7 @@ for (var i = 0; i < parameters.length; ++i) { // Inline strings when formatting. if (shouldFormatMessage && parameters[i].type === 'string') - formattedResult.appendChild(WebInspector.linkifyStringAsFragment(parameters[i].description)); + formattedResult.appendChild(Components.linkifyStringAsFragment(parameters[i].description)); else formattedResult.appendChild(this._formatParameter(parameters[i], false, true)); if (i < parameters.length - 1) @@ -446,14 +446,14 @@ } /** - * @param {!WebInspector.RemoteObject} output + * @param {!SDK.RemoteObject} output * @param {boolean=} forceObjectFormat * @param {boolean=} includePreview * @return {!Element} */ _formatParameter(output, forceObjectFormat, includePreview) { if (output.customPreview()) - return (new WebInspector.CustomPreviewComponent(output)).element; + return (new Components.CustomPreviewComponent(output)).element; var type = forceObjectFormat ? 'object' : (output.subtype || output.type); var element; @@ -502,7 +502,7 @@ } /** - * @param {!WebInspector.RemoteObject} obj + * @param {!SDK.RemoteObject} obj * @return {!Element} */ _formatParameterAsValue(obj) { @@ -514,7 +514,7 @@ } /** - * @param {!WebInspector.RemoteObject} obj + * @param {!SDK.RemoteObject} obj * @param {boolean=} includePreview * @return {!Element} */ @@ -524,57 +524,57 @@ titleElement.classList.add('console-object-preview'); this._previewFormatter.appendObjectPreview(titleElement, obj.preview); } else if (obj.type === 'function') { - WebInspector.ObjectPropertiesSection.formatObjectAsFunction(obj, titleElement, false); + Components.ObjectPropertiesSection.formatObjectAsFunction(obj, titleElement, false); titleElement.classList.add('object-value-function'); } else { titleElement.createTextChild(obj.description || ''); } - var section = new WebInspector.ObjectPropertiesSection(obj, titleElement, this._linkifier); + var section = new Components.ObjectPropertiesSection(obj, titleElement, this._linkifier); section.element.classList.add('console-view-object-properties-section'); section.enableContextMenu(); return section.element; } /** - * @param {!WebInspector.RemoteObject} func + * @param {!SDK.RemoteObject} func * @param {boolean=} includePreview * @return {!Element} */ _formatParameterAsFunction(func, includePreview) { var result = createElement('span'); - WebInspector.RemoteFunction.objectAsFunction(func).targetFunction().then(formatTargetFunction.bind(this)); + SDK.RemoteFunction.objectAsFunction(func).targetFunction().then(formatTargetFunction.bind(this)); return result; /** - * @param {!WebInspector.RemoteObject} targetFunction - * @this {WebInspector.ConsoleViewMessage} + * @param {!SDK.RemoteObject} targetFunction + * @this {Console.ConsoleViewMessage} */ function formatTargetFunction(targetFunction) { var functionElement = createElement('span'); - WebInspector.ObjectPropertiesSection.formatObjectAsFunction( + Components.ObjectPropertiesSection.formatObjectAsFunction( targetFunction, functionElement, true, includePreview); result.appendChild(functionElement); if (targetFunction !== func) { var note = result.createChild('span', 'object-info-state-note'); - note.title = WebInspector.UIString('Function was resolved from bound function.'); + note.title = Common.UIString('Function was resolved from bound function.'); } result.addEventListener('contextmenu', this._contextMenuEventFired.bind(this, targetFunction), false); } } /** - * @param {!WebInspector.RemoteObject} obj + * @param {!SDK.RemoteObject} obj * @param {!Event} event */ _contextMenuEventFired(obj, event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(obj); contextMenu.show(); } /** - * @param {?WebInspector.RemoteObject} object + * @param {?SDK.RemoteObject} object * @param {!Array.<!Protocol.Runtime.PropertyPreview>} propertyPath * @return {!Element} */ @@ -587,17 +587,17 @@ } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @return {!Element} */ _formatParameterAsNode(object) { var result = createElement('span'); - WebInspector.Renderer.renderPromise(object).then(appendRenderer.bind(this), failedToRender.bind(this)); + Common.Renderer.renderPromise(object).then(appendRenderer.bind(this), failedToRender.bind(this)); return result; /** * @param {!Element} rendererElement - * @this {WebInspector.ConsoleViewMessage} + * @this {Console.ConsoleViewMessage} */ function appendRenderer(rendererElement) { result.appendChild(rendererElement); @@ -605,7 +605,7 @@ } /** - * @this {WebInspector.ConsoleViewMessage} + * @this {Console.ConsoleViewMessage} */ function failedToRender() { result.appendChild(this._formatParameterAsObject(object, false)); @@ -616,12 +616,12 @@ } /** - * @param {!WebInspector.RemoteObject} array + * @param {!SDK.RemoteObject} array * @return {!Element} */ _formatParameterAsArray(array) { - var usePrintedArrayFormat = this._message.type !== WebInspector.ConsoleMessage.MessageType.DirXML && - this._message.type !== WebInspector.ConsoleMessage.MessageType.Result; + var usePrintedArrayFormat = this._message.type !== SDK.ConsoleMessage.MessageType.DirXML && + this._message.type !== SDK.ConsoleMessage.MessageType.Result; var isLongArray = array.arrayLength() > 100; if (usePrintedArrayFormat || isLongArray) return this._formatParameterAsObject(array, usePrintedArrayFormat || !isLongArray); @@ -630,8 +630,8 @@ return result; /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @this {!WebInspector.ConsoleViewMessage} + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @this {!Console.ConsoleViewMessage} */ function printArrayResult(properties) { if (!properties) { @@ -659,7 +659,7 @@ if (index - lastNonEmptyIndex <= 1) return; var span = titleElement.createChild('span', 'object-value-undefined'); - span.textContent = WebInspector.UIString('undefined × %d', index - lastNonEmptyIndex - 1); + span.textContent = Common.UIString('undefined × %d', index - lastNonEmptyIndex - 1); } var length = array.arrayLength(); @@ -682,7 +682,7 @@ titleElement.createTextChild(']'); - var section = new WebInspector.ObjectPropertiesSection(array, titleElement, this._linkifier); + var section = new Components.ObjectPropertiesSection(array, titleElement, this._linkifier); section.element.classList.add('console-view-object-properties-section'); section.enableContextMenu(); result.appendChild(section.element); @@ -690,12 +690,12 @@ } /** - * @param {!WebInspector.RemoteObject} output + * @param {!SDK.RemoteObject} output * @return {!Element} */ _formatParameterAsString(output) { var span = createElement('span'); - span.appendChild(WebInspector.linkifyStringAsFragment(output.description || '')); + span.appendChild(Components.linkifyStringAsFragment(output.description || '')); var result = createElement('span'); result.createChild('span', 'object-value-string-quote').textContent = '"'; @@ -705,18 +705,18 @@ } /** - * @param {!WebInspector.RemoteObject} output + * @param {!SDK.RemoteObject} output * @return {!Element} */ _formatParameterAsError(output) { var result = createElement('span'); var errorSpan = this._tryFormatAsError(output.description || ''); - result.appendChild(errorSpan ? errorSpan : WebInspector.linkifyStringAsFragment(output.description || '')); + result.appendChild(errorSpan ? errorSpan : Components.linkifyStringAsFragment(output.description || '')); return result; } /** - * @param {!WebInspector.RemoteObject} output + * @param {!SDK.RemoteObject} output * @return {!Element} */ _formatAsArrayEntry(output) { @@ -724,19 +724,19 @@ } /** - * @param {?WebInspector.RemoteObject} object + * @param {?SDK.RemoteObject} object * @param {!Array.<string>} propertyPath * @param {boolean} isArrayEntry * @return {!Element} */ _formatAsAccessorProperty(object, propertyPath, isArrayEntry) { - var rootElement = WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan( + var rootElement = Components.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan( object, propertyPath, onInvokeGetterClick.bind(this)); /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {boolean=} wasThrown - * @this {WebInspector.ConsoleViewMessage} + * @this {Console.ConsoleViewMessage} */ function onInvokeGetterClick(result, wasThrown) { if (!result) @@ -744,7 +744,7 @@ rootElement.removeChildren(); if (wasThrown) { var element = rootElement.createChild('span'); - element.textContent = WebInspector.UIString('<exception>'); + element.textContent = Common.UIString('<exception>'); element.title = /** @type {string} */ (result.description); } else if (isArrayEntry) { rootElement.appendChild(this._formatAsArrayEntry(result)); @@ -769,7 +769,7 @@ /** * @param {string} format - * @param {!Array.<!WebInspector.RemoteObject>} parameters + * @param {!Array.<!SDK.RemoteObject>} parameters * @param {!Element} formattedResult */ _formatWithSubstitutionString(format, parameters, formattedResult) { @@ -777,9 +777,9 @@ /** * @param {boolean} force - * @param {!WebInspector.RemoteObject} obj + * @param {!SDK.RemoteObject} obj * @return {!Element} - * @this {WebInspector.ConsoleViewMessage} + * @this {Console.ConsoleViewMessage} */ function parameterFormatter(force, obj) { return this._formatParameter(obj, force, false); @@ -849,7 +849,7 @@ if (b instanceof Node) a.appendChild(b); else if (typeof b !== 'undefined') { - var toAppend = WebInspector.linkifyStringAsFragment(String(b)); + var toAppend = Components.linkifyStringAsFragment(String(b)); if (currentStyle) { var wrapper = createElement('span'); wrapper.appendChild(toAppend); @@ -941,28 +941,28 @@ var contentElement = createElementWithClass('div', 'console-message'); this._contentElement = contentElement; - if (this._message.type === WebInspector.ConsoleMessage.MessageType.StartGroup || - this._message.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) + if (this._message.type === SDK.ConsoleMessage.MessageType.StartGroup || + this._message.type === SDK.ConsoleMessage.MessageType.StartGroupCollapsed) contentElement.classList.add('console-group-title'); var formattedMessage; var consoleMessage = this._message; var target = consoleMessage.target(); var shouldIncludeTrace = !!consoleMessage.stackTrace && - (consoleMessage.source === WebInspector.ConsoleMessage.MessageSource.Network || - consoleMessage.level === WebInspector.ConsoleMessage.MessageLevel.Error || - consoleMessage.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError || - consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace || - consoleMessage.level === WebInspector.ConsoleMessage.MessageLevel.Warning); + (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Network || + consoleMessage.level === SDK.ConsoleMessage.MessageLevel.Error || + consoleMessage.level === SDK.ConsoleMessage.MessageLevel.RevokedError || + consoleMessage.type === SDK.ConsoleMessage.MessageType.Trace || + consoleMessage.level === SDK.ConsoleMessage.MessageLevel.Warning); if (target && shouldIncludeTrace) formattedMessage = this._buildMessageWithStackTrace(consoleMessage, target, this._linkifier); - else if (this._message.type === WebInspector.ConsoleMessage.MessageType.Table) + else if (this._message.type === SDK.ConsoleMessage.MessageType.Table) formattedMessage = this._buildTableMessage(this._message); else formattedMessage = this._buildMessage(consoleMessage); contentElement.appendChild(formattedMessage); - this.updateTimestamp(WebInspector.moduleSetting('consoleTimestampsEnabled').get()); + this.updateTimestamp(Common.moduleSetting('consoleTimestampsEnabled').get()); return this._contentElement; } @@ -992,22 +992,22 @@ this._element.message = this; switch (this._message.level) { - case WebInspector.ConsoleMessage.MessageLevel.Log: + case SDK.ConsoleMessage.MessageLevel.Log: this._element.classList.add('console-log-level'); break; - case WebInspector.ConsoleMessage.MessageLevel.Debug: + case SDK.ConsoleMessage.MessageLevel.Debug: this._element.classList.add('console-debug-level'); break; - case WebInspector.ConsoleMessage.MessageLevel.Warning: + case SDK.ConsoleMessage.MessageLevel.Warning: this._element.classList.add('console-warning-level'); break; - case WebInspector.ConsoleMessage.MessageLevel.Error: + case SDK.ConsoleMessage.MessageLevel.Error: this._element.classList.add('console-error-level'); break; - case WebInspector.ConsoleMessage.MessageLevel.RevokedError: + case SDK.ConsoleMessage.MessageLevel.RevokedError: this._element.classList.add('console-revokedError-level'); break; - case WebInspector.ConsoleMessage.MessageLevel.Info: + case SDK.ConsoleMessage.MessageLevel.Info: this._element.classList.add('console-info-level'); break; } @@ -1045,13 +1045,13 @@ if (!this._repeatCountElement) { this._repeatCountElement = createElementWithClass('label', 'console-message-repeat-count', 'dt-small-bubble'); switch (this._message.level) { - case WebInspector.ConsoleMessage.MessageLevel.Warning: + case SDK.ConsoleMessage.MessageLevel.Warning: this._repeatCountElement.type = 'warning'; break; - case WebInspector.ConsoleMessage.MessageLevel.Error: + case SDK.ConsoleMessage.MessageLevel.Error: this._repeatCountElement.type = 'error'; break; - case WebInspector.ConsoleMessage.MessageLevel.Debug: + case SDK.ConsoleMessage.MessageLevel.Debug: this._repeatCountElement.type = 'debug'; break; default: @@ -1072,7 +1072,7 @@ */ setSearchRegex(regex) { if (this._searchHiglightNodeChanges && this._searchHiglightNodeChanges.length) - WebInspector.revertDomChanges(this._searchHiglightNodeChanges); + UI.revertDomChanges(this._searchHiglightNodeChanges); this._searchRegex = regex; this._searchHighlightNodes = []; this._searchHiglightNodeChanges = []; @@ -1084,11 +1084,11 @@ this._searchRegex.lastIndex = 0; var sourceRanges = []; while ((match = this._searchRegex.exec(text)) && match[0]) - sourceRanges.push(new WebInspector.SourceRange(match.index, match[0].length)); + sourceRanges.push(new Common.SourceRange(match.index, match[0].length)); if (sourceRanges.length) this._searchHighlightNodes = - WebInspector.highlightSearchResults(this.contentElement(), sourceRanges, this._searchHiglightNodeChanges); + UI.highlightSearchResults(this.contentElement(), sourceRanges, this._searchHiglightNodeChanges); } /** @@ -1128,7 +1128,7 @@ var target = this._target(); if (!target || !errorPrefixes.some(startsWith)) return null; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return null; @@ -1155,7 +1155,7 @@ var left = hasOpenBracket ? openBracketIndex + 1 : lines[i].indexOf('at') + 3; var right = hasOpenBracket ? closeBracketIndex : lines[i].length; var linkCandidate = lines[i].substring(left, right); - var splitResult = WebInspector.ParsedURL.splitLineAndColumn(linkCandidate); + var splitResult = Common.ParsedURL.splitLineAndColumn(linkCandidate); if (!splitResult) return null; @@ -1185,14 +1185,14 @@ var formattedResult = createElement('span'); var start = 0; for (var i = 0; i < links.length; ++i) { - formattedResult.appendChild(WebInspector.linkifyStringAsFragment(string.substring(start, links[i].positionLeft))); + formattedResult.appendChild(Components.linkifyStringAsFragment(string.substring(start, links[i].positionLeft))); formattedResult.appendChild(this._linkifier.linkifyScriptLocation( target, null, links[i].url, links[i].lineNumber, links[i].columnNumber)); start = links[i].positionRight; } if (start !== string.length) - formattedResult.appendChild(WebInspector.linkifyStringAsFragment(string.substring(start))); + formattedResult.appendChild(Components.linkifyStringAsFragment(string.substring(start))); return formattedResult; } @@ -1201,16 +1201,16 @@ /** * @unrestricted */ -WebInspector.ConsoleGroupViewMessage = class extends WebInspector.ConsoleViewMessage { +Console.ConsoleGroupViewMessage = class extends Console.ConsoleViewMessage { /** - * @param {!WebInspector.ConsoleMessage} consoleMessage - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.ConsoleMessage} consoleMessage + * @param {!Components.Linkifier} linkifier * @param {number} nestingLevel */ constructor(consoleMessage, linkifier, nestingLevel) { console.assert(consoleMessage.isGroupStartMessage()); super(consoleMessage, linkifier, nestingLevel); - this.setCollapsed(consoleMessage.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed); + this.setCollapsed(consoleMessage.type === SDK.ConsoleMessage.MessageType.StartGroupCollapsed); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/console/module.json b/third_party/WebKit/Source/devtools/front_end/console/module.json index 9584a90..deac0c6 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/module.json +++ b/third_party/WebKit/Source/devtools/front_end/console/module.json
@@ -6,7 +6,7 @@ "id": "console", "title": "Console", "order": 20, - "className": "WebInspector.ConsolePanel" + "className": "Console.ConsolePanel" }, { "type": "view", @@ -15,17 +15,17 @@ "title": "Console", "persistence": "permanent", "order": 0, - "className": "WebInspector.ConsolePanel.WrapperView" + "className": "Console.ConsolePanel.WrapperView" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.Console"], - "className": "WebInspector.ConsolePanel.ConsoleRevealer" + "type": "@Common.Revealer", + "contextTypes": ["Common.Console"], + "className": "Console.ConsolePanel.ConsoleRevealer" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "console.show", - "className": "WebInspector.ConsoleView.ActionDelegate", + "className": "Console.ConsoleView.ActionDelegate", "bindings": [ { "shortcut": "Ctrl+`" @@ -33,12 +33,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Console", "actionId": "console.clear", "title": "Clear console", "iconClass": "largeicon-clear", - "className": "WebInspector.ConsoleView.ActionDelegate", + "className": "Console.ConsoleView.ActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -51,11 +51,11 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Console", "actionId": "console.clear.history", "title": "Clear console history", - "className": "WebInspector.ConsoleView.ActionDelegate" + "className": "Console.ConsoleView.ActionDelegate" }, { "type": "setting",
diff --git a/third_party/WebKit/Source/devtools/front_end/devices/DevicesView.js b/third_party/WebKit/Source/devtools/front_end/devices/DevicesView.js index ffdb29a..4c13324 100644 --- a/third_party/WebKit/Source/devtools/front_end/devices/DevicesView.js +++ b/third_party/WebKit/Source/devtools/front_end/devices/DevicesView.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.DevicesView = class extends WebInspector.VBox { +Devices.DevicesView = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('devices/devicesView.css'); @@ -12,17 +12,17 @@ var hbox = this.contentElement.createChild('div', 'hbox devices-container'); var sidebar = hbox.createChild('div', 'devices-sidebar'); - sidebar.createChild('div', 'devices-view-title').createTextChild(WebInspector.UIString('Devices')); + sidebar.createChild('div', 'devices-view-title').createTextChild(Common.UIString('Devices')); this._sidebarList = sidebar.createChild('div', 'devices-sidebar-list'); - this._discoveryView = new WebInspector.DevicesView.DiscoveryView(); + this._discoveryView = new Devices.DevicesView.DiscoveryView(); this._sidebarListSpacer = this._sidebarList.createChild('div', 'devices-sidebar-spacer'); this._discoveryListItem = this._sidebarList.createChild('div', 'devices-sidebar-item'); - this._discoveryListItem.textContent = WebInspector.UIString('Settings'); + this._discoveryListItem.textContent = Common.UIString('Settings'); this._discoveryListItem.addEventListener( 'click', this._selectSidebarListItem.bind(this, this._discoveryListItem, this._discoveryView)); - /** @type {!Map<string, !WebInspector.DevicesView.DeviceView>} */ + /** @type {!Map<string, !Devices.DevicesView.DeviceView>} */ this._viewById = new Map(); /** @type {!Array<!Adb.Device>} */ this._devices = []; @@ -33,11 +33,11 @@ var discoveryFooter = this.contentElement.createChild('div', 'devices-footer'); this._deviceCountSpan = discoveryFooter.createChild('span'); - discoveryFooter.createChild('span').textContent = WebInspector.UIString(' Read '); - discoveryFooter.appendChild(WebInspector.linkifyURLAsNode( + discoveryFooter.createChild('span').textContent = Common.UIString(' Read '); + discoveryFooter.appendChild(UI.linkifyURLAsNode( 'https://developers.google.com/chrome-developer-tools/docs/remote-debugging', - WebInspector.UIString('remote debugging documentation'), undefined, true)); - discoveryFooter.createChild('span').textContent = WebInspector.UIString(' for more information.'); + Common.UIString('remote debugging documentation'), undefined, true)); + discoveryFooter.createChild('span').textContent = Common.UIString(' for more information.'); this._updateFooter(); this._selectSidebarListItem(this._discoveryListItem, this._discoveryView); @@ -54,17 +54,17 @@ } /** - * @return {!WebInspector.DevicesView} + * @return {!Devices.DevicesView} */ static _instance() { - if (!WebInspector.DevicesView._instanceObject) - WebInspector.DevicesView._instanceObject = new WebInspector.DevicesView(); - return WebInspector.DevicesView._instanceObject; + if (!Devices.DevicesView._instanceObject) + Devices.DevicesView._instanceObject = new Devices.DevicesView(); + return Devices.DevicesView._instanceObject; } /** * @param {!Element} listItem - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ _selectSidebarListItem(listItem, view) { if (this._selectedListItem === listItem) @@ -82,14 +82,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _devicesUpdated(event) { this._devices = /** @type {!Array.<!Adb.Device>} */ (event.data).slice().filter(d => d.adbSerial.toUpperCase() !== 'WEBRTC'); for (var device of this._devices) { if (!device.adbConnected) - device.adbModel = WebInspector.UIString('Unknown'); + device.adbModel = Common.UIString('Unknown'); } var ids = new Set(); @@ -113,7 +113,7 @@ var listItem = this._listItemById.get(device.id); if (!view) { - view = new WebInspector.DevicesView.DeviceView(); + view = new Devices.DevicesView.DeviceView(); this._viewById.set(device.id, view); listItem = this._createSidebarListItem(view); this._listItemById.set(device.id, listItem); @@ -122,7 +122,7 @@ listItem._title.textContent = device.adbModel; listItem._status.textContent = - device.adbConnected ? WebInspector.UIString('Connected') : WebInspector.UIString('Pending Authorization'); + device.adbConnected ? Common.UIString('Connected') : Common.UIString('Pending Authorization'); listItem.classList.toggle('device-connected', device.adbConnected); view.update(device); } @@ -134,7 +134,7 @@ } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @return {!Element} */ _createSidebarListItem(view) { @@ -146,7 +146,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _devicesDiscoveryConfigChanged(event) { var discoverUsbDevices = /** @type {boolean} */ (event.data['discoverUsbDevices']); @@ -156,7 +156,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _devicesPortForwardingStatusChanged(event) { var status = /** @type {!Adb.PortForwardingStatus} */ (event.data); @@ -174,9 +174,9 @@ _updateFooter() { this._deviceCountSpan.textContent = !this._devices.length ? - WebInspector.UIString('No devices detected.') : - this._devices.length === 1 ? WebInspector.UIString('1 device detected.') : - WebInspector.UIString('%d devices detected.', this._devices.length); + Common.UIString('No devices detected.') : + this._devices.length === 1 ? Common.UIString('1 device detected.') : + Common.UIString('%d devices detected.', this._devices.length); } /** @@ -198,54 +198,54 @@ /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.DevicesView.DiscoveryView = class extends WebInspector.VBox { +Devices.DevicesView.DiscoveryView = class extends UI.VBox { constructor() { super(); this.setMinimumSize(100, 100); this.element.classList.add('discovery-view'); this.contentElement.createChild('div', 'hbox device-text-row').createChild('div', 'view-title').textContent = - WebInspector.UIString('Settings'); + Common.UIString('Settings'); - var discoverUsbDevicesCheckbox = createCheckboxLabel(WebInspector.UIString('Discover USB devices')); + var discoverUsbDevicesCheckbox = createCheckboxLabel(Common.UIString('Discover USB devices')); discoverUsbDevicesCheckbox.classList.add('usb-checkbox'); this.element.appendChild(discoverUsbDevicesCheckbox); this._discoverUsbDevicesCheckbox = discoverUsbDevicesCheckbox.checkboxElement; this._discoverUsbDevicesCheckbox.addEventListener('click', this._updateDiscoveryConfig.bind(this), false); var help = this.element.createChild('div', 'discovery-help'); - help.createChild('span').textContent = WebInspector.UIString('Need help? Read Chrome '); - help.appendChild(WebInspector.linkifyURLAsNode( + help.createChild('span').textContent = Common.UIString('Need help? Read Chrome '); + help.appendChild(UI.linkifyURLAsNode( 'https://developers.google.com/chrome-developer-tools/docs/remote-debugging', - WebInspector.UIString('remote debugging documentation.'), undefined, true)); + Common.UIString('remote debugging documentation.'), undefined, true)); var portForwardingHeader = this.element.createChild('div', 'port-forwarding-header'); - var portForwardingEnabledCheckbox = createCheckboxLabel(WebInspector.UIString('Port forwarding')); + var portForwardingEnabledCheckbox = createCheckboxLabel(Common.UIString('Port forwarding')); portForwardingEnabledCheckbox.classList.add('port-forwarding-checkbox'); portForwardingHeader.appendChild(portForwardingEnabledCheckbox); this._portForwardingEnabledCheckbox = portForwardingEnabledCheckbox.checkboxElement; this._portForwardingEnabledCheckbox.addEventListener('click', this._updateDiscoveryConfig.bind(this), false); var portForwardingFooter = this.element.createChild('div', 'port-forwarding-footer'); - portForwardingFooter.createChild('span').textContent = WebInspector.UIString( + portForwardingFooter.createChild('span').textContent = Common.UIString( 'Define the listening port on your device that maps to a port accessible from your development machine. '); - portForwardingFooter.appendChild(WebInspector.linkifyURLAsNode( + portForwardingFooter.appendChild(UI.linkifyURLAsNode( 'https://developer.chrome.com/devtools/docs/remote-debugging#port-forwarding', - WebInspector.UIString('Learn more'), undefined, true)); + Common.UIString('Learn more'), undefined, true)); - this._list = new WebInspector.ListWidget(this); + this._list = new UI.ListWidget(this); this._list.registerRequiredCSS('devices/devicesView.css'); this._list.element.classList.add('port-forwarding-list'); var placeholder = createElementWithClass('div', 'port-forwarding-list-empty'); - placeholder.textContent = WebInspector.UIString('No rules'); + placeholder.textContent = Common.UIString('No rules'); this._list.setEmptyPlaceholder(placeholder); this._list.show(this.element); this.element.appendChild( - createTextButton(WebInspector.UIString('Add rule'), this._addRuleButtonClicked.bind(this), 'add-rule-button')); + createTextButton(Common.UIString('Add rule'), this._addRuleButtonClicked.bind(this), 'add-rule-button')); /** @type {!Array<!Adb.PortForwardingRule>} */ this._portForwardingConfig = []; @@ -283,7 +283,7 @@ var rule = /** @type {!Adb.PortForwardingRule} */ (item); var element = createElementWithClass('div', 'port-forwarding-list-item'); var port = element.createChild('div', 'port-forwarding-value port-forwarding-port'); - port.createChild('span', 'port-localhost').textContent = WebInspector.UIString('localhost:'); + port.createChild('span', 'port-localhost').textContent = Common.UIString('localhost:'); port.createTextChild(rule.port); element.createChild('div', 'port-forwarding-separator'); element.createChild('div', 'port-forwarding-value').textContent = rule.address; @@ -304,7 +304,7 @@ /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { @@ -319,7 +319,7 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { var rule = /** @type {!Adb.PortForwardingRule} */ (item); @@ -330,13 +330,13 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createEditor() { if (this._editor) return this._editor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._editor = editor; var content = editor.contentElement(); var fields = content.createChild('div', 'port-forwarding-edit-row'); @@ -351,7 +351,7 @@ * @param {*} item * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input - * @this {WebInspector.DevicesView.DiscoveryView} + * @this {Devices.DevicesView.DiscoveryView} * @return {boolean} */ function portValidator(item, index, input) { @@ -396,7 +396,7 @@ /** * @unrestricted */ -WebInspector.DevicesView.DeviceView = class extends WebInspector.VBox { +Devices.DevicesView.DeviceView = class extends UI.VBox { constructor() { super(); this.setMinimumSize(100, 100); @@ -409,14 +409,14 @@ this._deviceOffline = this.contentElement.createChild('div'); this._deviceOffline.textContent = - WebInspector.UIString('Pending authentication: please accept debugging session on the device.'); + Common.UIString('Pending authentication: please accept debugging session on the device.'); this._noBrowsers = this.contentElement.createChild('div'); - this._noBrowsers.textContent = WebInspector.UIString('No browsers detected.'); + this._noBrowsers.textContent = Common.UIString('No browsers detected.'); this._browsers = this.contentElement.createChild('div', 'device-browser-list vbox'); - /** @type {!Map<string, !WebInspector.DevicesView.BrowserSection>} */ + /** @type {!Map<string, !Devices.DevicesView.BrowserSection>} */ this._browserById = new Map(); this._device = null; @@ -461,7 +461,7 @@ } /** - * @return {!WebInspector.DevicesView.BrowserSection} + * @return {!Devices.DevicesView.BrowserSection} */ _createBrowserSection() { var element = createElementWithClass('div', 'vbox flex-none'); @@ -469,12 +469,12 @@ var title = topRow.createChild('div', 'device-browser-title'); var newTabRow = element.createChild('div', 'device-browser-new-tab'); - newTabRow.createChild('div', '').textContent = WebInspector.UIString('New tab:'); + newTabRow.createChild('div', '').textContent = Common.UIString('New tab:'); var newTabInput = newTabRow.createChild('input', ''); newTabInput.type = 'text'; - newTabInput.placeholder = WebInspector.UIString('Enter URL'); + newTabInput.placeholder = Common.UIString('Enter URL'); newTabInput.addEventListener('keydown', newTabKeyDown, false); - var newTabButton = createTextButton(WebInspector.UIString('Open'), openNewTab); + var newTabButton = createTextButton(Common.UIString('Open'), openNewTab); newTabRow.appendChild(newTabButton); var pages = element.createChild('div', 'device-page-list vbox'); @@ -501,8 +501,8 @@ function updateViewMoreTitle() { viewMore.textContent = pages.classList.contains('device-view-more-toggled') ? - WebInspector.UIString('View less tabs\u2026') : - WebInspector.UIString('View more tabs\u2026'); + Common.UIString('View less tabs\u2026') : + Common.UIString('View more tabs\u2026'); } /** @@ -524,7 +524,7 @@ } /** - * @param {!WebInspector.DevicesView.BrowserSection} section + * @param {!Devices.DevicesView.BrowserSection} section * @param {!Adb.Browser} browser */ _updateBrowserSection(section, browser) { @@ -569,7 +569,7 @@ } /** - * @return {!WebInspector.DevicesView.PageSection} + * @return {!Devices.DevicesView.PageSection} */ _createPageSection() { var element = createElementWithClass('div', 'vbox'); @@ -577,11 +577,11 @@ var titleRow = element.createChild('div', 'device-page-title-row'); var title = titleRow.createChild('div', 'device-page-title'); var inspect = - createTextButton(WebInspector.UIString('Inspect'), doAction.bind(null, 'inspect'), 'device-inspect-button'); + createTextButton(Common.UIString('Inspect'), doAction.bind(null, 'inspect'), 'device-inspect-button'); titleRow.appendChild(inspect); - var toolbar = new WebInspector.Toolbar(''); - toolbar.appendToolbarItem(new WebInspector.ToolbarMenuButton(appendActions)); + var toolbar = new UI.Toolbar(''); + toolbar.appendToolbarItem(new UI.ToolbarMenuButton(appendActions)); titleRow.appendChild(toolbar.element); var url = element.createChild('div', 'device-page-url'); @@ -589,12 +589,12 @@ return section; /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ function appendActions(contextMenu) { - contextMenu.appendItem(WebInspector.UIString('Reload'), doAction.bind(null, 'reload')); - contextMenu.appendItem(WebInspector.UIString('Focus'), doAction.bind(null, 'activate')); - contextMenu.appendItem(WebInspector.UIString('Close'), doAction.bind(null, 'close')); + contextMenu.appendItem(Common.UIString('Reload'), doAction.bind(null, 'reload')); + contextMenu.appendItem(Common.UIString('Focus'), doAction.bind(null, 'activate')); + contextMenu.appendItem(Common.UIString('Close'), doAction.bind(null, 'close')); } /** @@ -607,7 +607,7 @@ } /** - * @param {!WebInspector.DevicesView.PageSection} section + * @param {!Devices.DevicesView.PageSection} section * @param {!Adb.Page} page */ _updatePageSection(section, page) { @@ -617,7 +617,7 @@ } if (!section.page || section.page.url !== page.url) { section.url.textContent = ''; - section.url.appendChild(WebInspector.linkifyURLAsNode(page.url, undefined, undefined, true)); + section.url.appendChild(UI.linkifyURLAsNode(page.url, undefined, undefined, true)); } section.inspect.disabled = page.attached; @@ -635,7 +635,7 @@ this._portStatus.removeChildren(); this._portStatus.createChild('div', 'device-port-status-text').textContent = - WebInspector.UIString('Port Forwarding:'); + Common.UIString('Port Forwarding:'); var connected = []; var transient = []; var error = []; @@ -668,18 +668,18 @@ var title = []; if (connected.length) - title.push(WebInspector.UIString('Connected: %s', connected.join(', '))); + title.push(Common.UIString('Connected: %s', connected.join(', '))); if (transient.length) - title.push(WebInspector.UIString('Transient: %s', transient.join(', '))); + title.push(Common.UIString('Transient: %s', transient.join(', '))); if (error.length) - title.push(WebInspector.UIString('Error: %s', error.join(', '))); + title.push(Common.UIString('Error: %s', error.join(', '))); this._portStatus.title = title.join('; '); this._portStatus.classList.toggle('hidden', empty); } }; -/** @typedef {!{browser: ?Adb.Browser, element: !Element, title: !Element, pages: !Element, viewMore: !Element, newTab: !Element, pageSections: !Map<string, !WebInspector.DevicesView.PageSection>}} */ -WebInspector.DevicesView.BrowserSection; +/** @typedef {!{browser: ?Adb.Browser, element: !Element, title: !Element, pages: !Element, viewMore: !Element, newTab: !Element, pageSections: !Map<string, !Devices.DevicesView.PageSection>}} */ +Devices.DevicesView.BrowserSection; /** @typedef {!{page: ?Adb.Page, element: !Element, title: !Element, url: !Element, inspect: !Element}} */ -WebInspector.DevicesView.PageSection; +Devices.DevicesView.PageSection;
diff --git a/third_party/WebKit/Source/devtools/front_end/devices/module.json b/third_party/WebKit/Source/devtools/front_end/devices/module.json index 34ce99a..4231f0a 100644 --- a/third_party/WebKit/Source/devtools/front_end/devices/module.json +++ b/third_party/WebKit/Source/devtools/front_end/devices/module.json
@@ -7,7 +7,7 @@ "title": "Remote devices", "persistence": "closeable", "order": 50, - "className": "WebInspector.DevicesView", + "className": "Devices.DevicesView", "tags": "usb, android, mobile" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js b/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js index 304eef3..f639083 100644 --- a/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js +++ b/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js
@@ -64,7 +64,7 @@ */ addExtensions(extensions) { // Support for legacy front-ends (<M41). - if (window['WebInspector']['addExtensions']) + if (window['WebInspector'] && window['WebInspector']['addExtensions']) window['WebInspector']['addExtensions'](extensions); else this._dispatchOnInspectorFrontendAPI('addExtensions', [extensions]); @@ -252,7 +252,7 @@ */ setInspectedTabId(tabId) { // Support for legacy front-ends (<M41). - if (window['WebInspector']['setInspectedTabId']) + if (window['WebInspector'] && window['WebInspector']['setInspectedTabId']) window['WebInspector']['setInspectedTabId'](tabId); else this._dispatchOnInspectorFrontendAPI('setInspectedTabId', [tabId]);
diff --git a/third_party/WebKit/Source/devtools/front_end/diff/Diff.js b/third_party/WebKit/Source/devtools/front_end/diff/Diff.js index 5173322..91fafabd 100644 --- a/third_party/WebKit/Source/devtools/front_end/diff/Diff.js +++ b/third_party/WebKit/Source/devtools/front_end/diff/Diff.js
@@ -1,7 +1,7 @@ // Copyright 2015 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. -WebInspector.Diff = { +Diff.Diff = { /** * @param {string} text1 * @param {string} text2 @@ -18,12 +18,12 @@ * @return {!Array.<!{0: number, 1: !Array.<string>}>} */ lineDiff: function(lines1, lines2) { - /** @type {!WebInspector.CharacterIdMap<string>} */ - var idMap = new WebInspector.CharacterIdMap(); + /** @type {!Common.CharacterIdMap<string>} */ + var idMap = new Common.CharacterIdMap(); var text1 = lines1.map(line => idMap.toChar(line)).join(''); var text2 = lines2.map(line => idMap.toChar(line)).join(''); - var diff = WebInspector.Diff.charDiff(text1, text2); + var diff = Diff.Diff.charDiff(text1, text2); var lineDiff = []; for (var i = 0; i < diff.length; i++) { var lines = []; @@ -45,10 +45,10 @@ var removed = 0; for (var i = 0; i < diff.length; ++i) { var token = diff[i]; - if (token[0] === WebInspector.Diff.Operation.Equal) { + if (token[0] === Diff.Diff.Operation.Equal) { flush(); - normalized.push([WebInspector.Diff.Operation.Equal, token[1].length]); - } else if (token[0] === WebInspector.Diff.Operation.Delete) { + normalized.push([Diff.Diff.Operation.Equal, token[1].length]); + } else if (token[0] === Diff.Diff.Operation.Delete) { removed += token[1].length; } else { added += token[1].length; @@ -60,13 +60,13 @@ function flush() { if (added && removed) { var min = Math.min(added, removed); - normalized.push([WebInspector.Diff.Operation.Edit, min]); + normalized.push([Diff.Diff.Operation.Edit, min]); added -= min; removed -= min; } if (added || removed) { var balance = added - removed; - var type = balance < 0 ? WebInspector.Diff.Operation.Delete : WebInspector.Diff.Operation.Insert; + var type = balance < 0 ? Diff.Diff.Operation.Delete : Diff.Diff.Operation.Insert; normalized.push([type, Math.abs(balance)]); added = 0; removed = 0; @@ -76,7 +76,7 @@ }; -WebInspector.Diff.Operation = { +Diff.Diff.Operation = { Equal: 0, Insert: 1, Delete: -1,
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js index b7836c0..819e4cd 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js
@@ -4,28 +4,28 @@ /** * @unrestricted */ -WebInspector.ClassesPaneWidget = class extends WebInspector.Widget { +Elements.ClassesPaneWidget = class extends UI.Widget { constructor() { super(); this.element.className = 'styles-element-classes-pane'; var container = this.element.createChild('div', 'title-container'); this._input = container.createChild('div', 'new-class-input monospace'); - this._input.setAttribute('placeholder', WebInspector.UIString('Add new class')); + this._input.setAttribute('placeholder', Common.UIString('Add new class')); this.setDefaultFocusedElement(this._input); this._classesContainer = this.element.createChild('div', 'source-code'); this._classesContainer.classList.add('styles-element-classes-container'); - this._prompt = new WebInspector.ClassesPaneWidget.ClassNamePrompt(); + this._prompt = new Elements.ClassesPaneWidget.ClassNamePrompt(); this._prompt.setAutocompletionTimeout(0); this._prompt.renderAsBlock(); var proxyElement = this._prompt.attach(this._input); proxyElement.addEventListener('keydown', this._onKeyDown.bind(this), false); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.DOMMutated, this._onDOMMutated, this); - /** @type {!Set<!WebInspector.DOMNode>} */ + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.DOMMutated, this._onDOMMutated, this); + /** @type {!Set<!SDK.DOMNode>} */ this._mutatingNodes = new Set(); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._update, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._update, this); } /** @@ -42,7 +42,7 @@ if (!isEnterKey(event)) return; - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (!node) return; @@ -61,13 +61,13 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onDOMMutated(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); if (this._mutatingNodes.has(node)) return; - delete node[WebInspector.ClassesPaneWidget._classesSymbol]; + delete node[Elements.ClassesPaneWidget._classesSymbol]; this._update(); } @@ -82,7 +82,7 @@ if (!this.isShowing()) return; - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (node) node = node.enclosingElementOrSelf(); @@ -110,7 +110,7 @@ * @param {!Event} event */ _onClick(className, event) { - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (!node) return; var enabled = event.target.checked; @@ -119,11 +119,11 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {!Map<string, boolean>} */ _nodeClasses(node) { - var result = node[WebInspector.ClassesPaneWidget._classesSymbol]; + var result = node[Elements.ClassesPaneWidget._classesSymbol]; if (!result) { var classAttribute = node.getAttribute('class') || ''; var classes = classAttribute.split(/\s/); @@ -134,13 +134,13 @@ continue; result.set(className, true); } - node[WebInspector.ClassesPaneWidget._classesSymbol] = result; + node[Elements.ClassesPaneWidget._classesSymbol] = result; } return result; } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {string} className * @param {boolean} enabled */ @@ -150,7 +150,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _installNodeClasses(node) { var classes = this._nodeClasses(node); @@ -166,7 +166,7 @@ node.setAttributeValue('class', newClasses.join(' '), onClassNameUpdated.bind(this)); /** - * @this {WebInspector.ClassesPaneWidget} + * @this {Elements.ClassesPaneWidget} */ function onClassNameUpdated() { this._mutatingNodes.delete(node); @@ -174,28 +174,28 @@ } }; -WebInspector.ClassesPaneWidget._classesSymbol = Symbol('WebInspector.ClassesPaneWidget._classesSymbol'); +Elements.ClassesPaneWidget._classesSymbol = Symbol('Elements.ClassesPaneWidget._classesSymbol'); /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.ClassesPaneWidget.ButtonProvider = class { +Elements.ClassesPaneWidget.ButtonProvider = class { constructor() { - this._button = new WebInspector.ToolbarToggle(WebInspector.UIString('Element Classes'), ''); + this._button = new UI.ToolbarToggle(Common.UIString('Element Classes'), ''); this._button.setText('.cls'); this._button.element.classList.add('monospace'); this._button.addEventListener('click', this._clicked, this); - this._view = new WebInspector.ClassesPaneWidget(); + this._view = new Elements.ClassesPaneWidget(); } _clicked() { - WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ? this._view : null, this._button); + Elements.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ? this._view : null, this._button); } /** * @override - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ item() { return this._button; @@ -205,7 +205,7 @@ /** * @unrestricted */ -WebInspector.ClassesPaneWidget.ClassNamePrompt = class extends WebInspector.TextPrompt { +Elements.ClassesPaneWidget.ClassNamePrompt = class extends UI.TextPrompt { constructor() { super(); this.initialize(this._buildClassNameCompletions.bind(this), ' '); @@ -216,7 +216,7 @@ } /** - * @param {!WebInspector.DOMNode} selectedNode + * @param {!SDK.DOMNode} selectedNode * @return {!Promise.<!Array.<string>>} */ _getClassNames(selectedNode) { @@ -224,7 +224,7 @@ var completions = new Set(); this._selectedFrameId = selectedNode.frameId(); - var cssModel = WebInspector.CSSModel.fromTarget(selectedNode.target()); + var cssModel = SDK.CSSModel.fromTarget(selectedNode.target()); var allStyleSheets = cssModel.allStyleSheets(); for (var stylesheet of allStyleSheets) { if (stylesheet.frameId !== this._selectedFrameId) @@ -251,7 +251,7 @@ if (!prefix || force) this._classNamesPromise = null; - var selectedNode = WebInspector.context.flavor(WebInspector.DOMNode); + var selectedNode = UI.context.flavor(SDK.DOMNode); if (!selectedNode || (!prefix && !force && !proxyElement.textContent.length)) { completionsReadyCallback([]); return;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js index dad66fe..c5443c50 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
@@ -4,18 +4,18 @@ /** * @unrestricted */ -WebInspector.BezierPopoverIcon = class { +Elements.BezierPopoverIcon = class { /** - * @param {!WebInspector.StylePropertyTreeElement} treeElement - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper - * @param {!WebInspector.BezierSwatch} swatch + * @param {!Elements.StylePropertyTreeElement} treeElement + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper + * @param {!UI.BezierSwatch} swatch */ constructor(treeElement, swatchPopoverHelper, swatch) { this._treeElement = treeElement; this._swatchPopoverHelper = swatchPopoverHelper; this._swatch = swatch; - this._swatch.iconElement().title = WebInspector.UIString('Open cubic bezier editor.'); + this._swatch.iconElement().title = Common.UIString('Open cubic bezier editor.'); this._swatch.iconElement().addEventListener('click', this._iconClick.bind(this), false); this._boundBezierChanged = this._bezierChanged.bind(this); @@ -32,13 +32,13 @@ return; } - this._bezierEditor = new WebInspector.BezierEditor(); - var cubicBezier = WebInspector.Geometry.CubicBezier.parse(this._swatch.bezierText()); + this._bezierEditor = new UI.BezierEditor(); + var cubicBezier = Common.Geometry.CubicBezier.parse(this._swatch.bezierText()); if (!cubicBezier) cubicBezier = - /** @type {!WebInspector.Geometry.CubicBezier} */ (WebInspector.Geometry.CubicBezier.parse('linear')); + /** @type {!Common.Geometry.CubicBezier} */ (Common.Geometry.CubicBezier.parse('linear')); this._bezierEditor.setBezier(cubicBezier); - this._bezierEditor.addEventListener(WebInspector.BezierEditor.Events.BezierChanged, this._boundBezierChanged); + this._bezierEditor.addEventListener(UI.BezierEditor.Events.BezierChanged, this._boundBezierChanged); this._swatchPopoverHelper.show(this._bezierEditor, this._swatch.iconElement(), this._onPopoverHidden.bind(this)); this._scrollerElement = this._swatch.enclosingNodeOrSelfWithClass('style-panes-wrapper'); if (this._scrollerElement) @@ -47,13 +47,13 @@ this._originalPropertyText = this._treeElement.property.propertyText; this._treeElement.parentPane().setEditingStyle(true); var uiLocation = - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */); + Common.Revealer.reveal(uiLocation, true /* omitFocus */); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _bezierChanged(event) { this._swatch.setBezierText(/** @type {string} */ (event.data)); @@ -74,7 +74,7 @@ if (this._scrollerElement) this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false); - this._bezierEditor.removeEventListener(WebInspector.BezierEditor.Events.BezierChanged, this._boundBezierChanged); + this._bezierEditor.removeEventListener(UI.BezierEditor.Events.BezierChanged, this._boundBezierChanged); delete this._bezierEditor; var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText; @@ -87,20 +87,20 @@ /** * @unrestricted */ -WebInspector.ColorSwatchPopoverIcon = class { +Elements.ColorSwatchPopoverIcon = class { /** - * @param {!WebInspector.StylePropertyTreeElement} treeElement - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper - * @param {!WebInspector.ColorSwatch} swatch + * @param {!Elements.StylePropertyTreeElement} treeElement + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper + * @param {!UI.ColorSwatch} swatch */ constructor(treeElement, swatchPopoverHelper, swatch) { this._treeElement = treeElement; - this._treeElement[WebInspector.ColorSwatchPopoverIcon._treeElementSymbol] = this; + this._treeElement[Elements.ColorSwatchPopoverIcon._treeElementSymbol] = this; this._swatchPopoverHelper = swatchPopoverHelper; this._swatch = swatch; - var shiftClickMessage = WebInspector.UIString('Shift + Click to change color format.'); - this._swatch.iconElement().title = WebInspector.UIString('Open color picker. %s', shiftClickMessage); + var shiftClickMessage = Common.UIString('Shift + Click to change color format.'); + this._swatch.iconElement().title = Common.UIString('Open color picker. %s', shiftClickMessage); this._swatch.iconElement().addEventListener('click', this._iconClick.bind(this)); this._contrastColor = null; @@ -109,15 +109,15 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement} treeElement - * @return {?WebInspector.ColorSwatchPopoverIcon} + * @param {!Elements.StylePropertyTreeElement} treeElement + * @return {?Elements.ColorSwatchPopoverIcon} */ static forTreeElement(treeElement) { - return treeElement[WebInspector.ColorSwatchPopoverIcon._treeElementSymbol] || null; + return treeElement[Elements.ColorSwatchPopoverIcon._treeElementSymbol] || null; } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color */ setContrastColor(color) { this._contrastColor = color; @@ -141,15 +141,15 @@ var color = this._swatch.color(); var format = this._swatch.format(); - if (format === WebInspector.Color.Format.Original) + if (format === Common.Color.Format.Original) format = color.format(); - this._spectrum = new WebInspector.Spectrum(); + this._spectrum = new Components.Spectrum(); this._spectrum.setColor(color, format); if (this._contrastColor) this._spectrum.setContrastColor(this._contrastColor); - this._spectrum.addEventListener(WebInspector.Spectrum.Events.SizeChanged, this._spectrumResized, this); - this._spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, this._boundSpectrumChanged); + this._spectrum.addEventListener(Components.Spectrum.Events.SizeChanged, this._spectrumResized, this); + this._spectrum.addEventListener(Components.Spectrum.Events.ColorChanged, this._boundSpectrumChanged); this._swatchPopoverHelper.show(this._spectrum, this._swatch.iconElement(), this._onPopoverHidden.bind(this)); this._scrollerElement = this._swatch.enclosingNodeOrSelfWithClass('style-panes-wrapper'); if (this._scrollerElement) @@ -158,23 +158,23 @@ this._originalPropertyText = this._treeElement.property.propertyText; this._treeElement.parentPane().setEditingStyle(true); var uiLocation = - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */); + Common.Revealer.reveal(uiLocation, true /* omitFocus */); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _spectrumResized(event) { this._swatchPopoverHelper.reposition(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _spectrumChanged(event) { - var color = WebInspector.Color.parse(/** @type {string} */ (event.data)); + var color = Common.Color.parse(/** @type {string} */ (event.data)); if (!color) return; this._swatch.setColor(color); @@ -195,7 +195,7 @@ if (this._scrollerElement) this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false); - this._spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorChanged, this._boundSpectrumChanged); + this._spectrum.removeEventListener(Components.Spectrum.Events.ColorChanged, this._boundSpectrumChanged); delete this._spectrum; var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText; @@ -205,27 +205,27 @@ } }; -WebInspector.ColorSwatchPopoverIcon._treeElementSymbol = - Symbol('WebInspector.ColorSwatchPopoverIcon._treeElementSymbol'); +Elements.ColorSwatchPopoverIcon._treeElementSymbol = + Symbol('Elements.ColorSwatchPopoverIcon._treeElementSymbol'); /** * @unrestricted */ -WebInspector.ShadowSwatchPopoverHelper = class { +Elements.ShadowSwatchPopoverHelper = class { /** - * @param {!WebInspector.StylePropertyTreeElement} treeElement - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper - * @param {!WebInspector.CSSShadowSwatch} shadowSwatch + * @param {!Elements.StylePropertyTreeElement} treeElement + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper + * @param {!UI.CSSShadowSwatch} shadowSwatch */ constructor(treeElement, swatchPopoverHelper, shadowSwatch) { this._treeElement = treeElement; - this._treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] = this; + this._treeElement[Elements.ShadowSwatchPopoverHelper._treeElementSymbol] = this; this._swatchPopoverHelper = swatchPopoverHelper; this._shadowSwatch = shadowSwatch; this._iconElement = shadowSwatch.iconElement(); - this._iconElement.title = WebInspector.UIString('Open shadow editor.'); + this._iconElement.title = Common.UIString('Open shadow editor.'); this._iconElement.addEventListener('click', this._iconClick.bind(this), false); this._boundShadowChanged = this._shadowChanged.bind(this); @@ -233,11 +233,11 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement} treeElement - * @return {?WebInspector.ShadowSwatchPopoverHelper} + * @param {!Elements.StylePropertyTreeElement} treeElement + * @return {?Elements.ShadowSwatchPopoverHelper} */ static forTreeElement(treeElement) { - return treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] || null; + return treeElement[Elements.ShadowSwatchPopoverHelper._treeElementSymbol] || null; } /** @@ -254,9 +254,9 @@ return; } - this._cssShadowEditor = new WebInspector.CSSShadowEditor(); + this._cssShadowEditor = new UI.CSSShadowEditor(); this._cssShadowEditor.setModel(this._shadowSwatch.model()); - this._cssShadowEditor.addEventListener(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged); + this._cssShadowEditor.addEventListener(UI.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged); this._swatchPopoverHelper.show(this._cssShadowEditor, this._iconElement, this._onPopoverHidden.bind(this)); this._scrollerElement = this._iconElement.enclosingNodeOrSelfWithClass('style-panes-wrapper'); if (this._scrollerElement) @@ -265,16 +265,16 @@ this._originalPropertyText = this._treeElement.property.propertyText; this._treeElement.parentPane().setEditingStyle(true); var uiLocation = - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */); + Common.Revealer.reveal(uiLocation, true /* omitFocus */); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _shadowChanged(event) { - this._shadowSwatch.setCSSShadow(/** @type {!WebInspector.CSSShadowModel} */ (event.data)); + this._shadowSwatch.setCSSShadow(/** @type {!Common.CSSShadowModel} */ (event.data)); this._treeElement.applyStyleText(this._treeElement.renderedPropertyText(), false); } @@ -293,7 +293,7 @@ this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false); this._cssShadowEditor.removeEventListener( - WebInspector.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged); + UI.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged); delete this._cssShadowEditor; var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText; @@ -303,5 +303,5 @@ } }; -WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol = - Symbol('WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol'); +Elements.ShadowSwatchPopoverHelper._treeElementSymbol = + Symbol('Elements.ShadowSwatchPopoverHelper._treeElementSymbol');
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js index 9e51d54..969bb99 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js
@@ -4,102 +4,102 @@ /** * @unrestricted */ -WebInspector.ComputedStyleModel = class extends WebInspector.Object { +Elements.ComputedStyleModel = class extends Common.Object { constructor() { super(); - this._node = WebInspector.context.flavor(WebInspector.DOMNode); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._onNodeChanged, this); + this._node = UI.context.flavor(SDK.DOMNode); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._onNodeChanged, this); } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._node; } /** - * @return {?WebInspector.CSSModel} + * @return {?SDK.CSSModel} */ cssModel() { return this._cssModel && this._cssModel.isEnabled() ? this._cssModel : null; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onNodeChanged(event) { - this._node = /** @type {?WebInspector.DOMNode} */ (event.data); + this._node = /** @type {?SDK.DOMNode} */ (event.data); this._updateTarget(this._node ? this._node.target() : null); this._onComputedStyleChanged(null); } /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ _updateTarget(target) { if (this._target === target) return; if (this._targetEvents) - WebInspector.EventTarget.removeEventListeners(this._targetEvents); + Common.EventTarget.removeEventListeners(this._targetEvents); this._target = target; var domModel = null; var resourceTreeModel = null; if (target) { - this._cssModel = WebInspector.CSSModel.fromTarget(target); - domModel = WebInspector.DOMModel.fromTarget(target); - resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + this._cssModel = SDK.CSSModel.fromTarget(target); + domModel = SDK.DOMModel.fromTarget(target); + resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); } if (this._cssModel && domModel && resourceTreeModel) { this._targetEvents = [ this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetAdded, this._onComputedStyleChanged, this), + SDK.CSSModel.Events.StyleSheetAdded, this._onComputedStyleChanged, this), this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetRemoved, this._onComputedStyleChanged, this), + SDK.CSSModel.Events.StyleSheetRemoved, this._onComputedStyleChanged, this), this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetChanged, this._onComputedStyleChanged, this), - this._cssModel.addEventListener(WebInspector.CSSModel.Events.FontsUpdated, this._onComputedStyleChanged, this), + SDK.CSSModel.Events.StyleSheetChanged, this._onComputedStyleChanged, this), + this._cssModel.addEventListener(SDK.CSSModel.Events.FontsUpdated, this._onComputedStyleChanged, this), this._cssModel.addEventListener( - WebInspector.CSSModel.Events.MediaQueryResultChanged, this._onComputedStyleChanged, this), + SDK.CSSModel.Events.MediaQueryResultChanged, this._onComputedStyleChanged, this), this._cssModel.addEventListener( - WebInspector.CSSModel.Events.PseudoStateForced, this._onComputedStyleChanged, this), + SDK.CSSModel.Events.PseudoStateForced, this._onComputedStyleChanged, this), this._cssModel.addEventListener( - WebInspector.CSSModel.Events.ModelWasEnabled, this._onComputedStyleChanged, this), - domModel.addEventListener(WebInspector.DOMModel.Events.DOMMutated, this._onDOMModelChanged, this), + SDK.CSSModel.Events.ModelWasEnabled, this._onComputedStyleChanged, this), + domModel.addEventListener(SDK.DOMModel.Events.DOMMutated, this._onDOMModelChanged, this), resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.FrameResized, this._onFrameResized, this), + SDK.ResourceTreeModel.Events.FrameResized, this._onFrameResized, this), ]; } } /** - * @param {?WebInspector.Event} event + * @param {?Common.Event} event */ _onComputedStyleChanged(event) { delete this._computedStylePromise; this.dispatchEventToListeners( - WebInspector.ComputedStyleModel.Events.ComputedStyleChanged, event ? event.data : null); + Elements.ComputedStyleModel.Events.ComputedStyleChanged, event ? event.data : null); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onDOMModelChanged(event) { // Any attribute removal or modification can affect the styles of "related" nodes. - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); if (!this._node || this._node !== node && node.parentNode !== this._node.parentNode && !node.isAncestor(this._node)) return; this._onComputedStyleChanged(null); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFrameResized(event) { /** - * @this {WebInspector.ComputedStyleModel} + * @this {Elements.ComputedStyleModel} */ function refreshContents() { this._onComputedStyleChanged(null); @@ -113,20 +113,20 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ _elementNode() { return this.node() ? this.node().enclosingElementOrSelf() : null; } /** - * @return {!Promise.<?WebInspector.ComputedStyleModel.ComputedStyle>} + * @return {!Promise.<?Elements.ComputedStyleModel.ComputedStyle>} */ fetchComputedStyle() { var elementNode = this._elementNode(); var cssModel = this.cssModel(); if (!elementNode || !cssModel) - return Promise.resolve(/** @type {?WebInspector.ComputedStyleModel.ComputedStyle} */ (null)); + return Promise.resolve(/** @type {?Elements.ComputedStyleModel.ComputedStyle} */ (null)); if (!this._computedStylePromise) this._computedStylePromise = @@ -135,30 +135,30 @@ return this._computedStylePromise; /** - * @param {!WebInspector.DOMNode} elementNode + * @param {!SDK.DOMNode} elementNode * @param {?Map.<string, string>} style - * @return {?WebInspector.ComputedStyleModel.ComputedStyle} - * @this {WebInspector.ComputedStyleModel} + * @return {?Elements.ComputedStyleModel.ComputedStyle} + * @this {Elements.ComputedStyleModel} */ function verifyOutdated(elementNode, style) { return elementNode === this._elementNode() && style ? - new WebInspector.ComputedStyleModel.ComputedStyle(elementNode, style) : - /** @type {?WebInspector.ComputedStyleModel.ComputedStyle} */ (null); + new Elements.ComputedStyleModel.ComputedStyle(elementNode, style) : + /** @type {?Elements.ComputedStyleModel.ComputedStyle} */ (null); } } }; /** @enum {symbol} */ -WebInspector.ComputedStyleModel.Events = { +Elements.ComputedStyleModel.Events = { ComputedStyleChanged: Symbol('ComputedStyleChanged') }; /** * @unrestricted */ -WebInspector.ComputedStyleModel.ComputedStyle = class { +Elements.ComputedStyleModel.ComputedStyle = class { /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {!Map.<string, string>} computedStyle */ constructor(node, computedStyle) {
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js index 2a616ba6..d9446b7 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js
@@ -30,7 +30,7 @@ /** * @unrestricted */ -WebInspector.ComputedStyleWidget = class extends WebInspector.ThrottledWidget { +Elements.ComputedStyleWidget = class extends UI.ThrottledWidget { constructor() { super(); this.element.classList.add('computed-style-sidebar-pane'); @@ -38,24 +38,24 @@ this.registerRequiredCSS('elements/computedStyleSidebarPane.css'); this._alwaysShowComputedProperties = {'display': true, 'height': true, 'width': true}; - this._computedStyleModel = new WebInspector.ComputedStyleModel(); + this._computedStyleModel = new Elements.ComputedStyleModel(); this._computedStyleModel.addEventListener( - WebInspector.ComputedStyleModel.Events.ComputedStyleChanged, this.update, this); + Elements.ComputedStyleModel.Events.ComputedStyleChanged, this.update, this); this._showInheritedComputedStylePropertiesSetting = - WebInspector.settings.createSetting('showInheritedComputedStyleProperties', false); + Common.settings.createSetting('showInheritedComputedStyleProperties', false); this._showInheritedComputedStylePropertiesSetting.addChangeListener( this._showInheritedComputedStyleChanged.bind(this)); var hbox = this.element.createChild('div', 'hbox styles-sidebar-pane-toolbar'); var filterContainerElement = hbox.createChild('div', 'styles-sidebar-pane-filter-box'); - var filterInput = WebInspector.StylesSidebarPane.createPropertyFilterElement( - WebInspector.UIString('Filter'), hbox, filterCallback.bind(this)); + var filterInput = Elements.StylesSidebarPane.createPropertyFilterElement( + Common.UIString('Filter'), hbox, filterCallback.bind(this)); filterContainerElement.appendChild(filterInput); - var toolbar = new WebInspector.Toolbar('styles-pane-toolbar', hbox); - toolbar.appendToolbarItem(new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Show all'), undefined, this._showInheritedComputedStylePropertiesSetting)); + var toolbar = new UI.Toolbar('styles-pane-toolbar', hbox); + toolbar.appendToolbarItem(new UI.ToolbarCheckbox( + Common.UIString('Show all'), undefined, this._showInheritedComputedStylePropertiesSetting)); this._propertiesOutline = new TreeOutlineInShadow(); this._propertiesOutline.hideOverflow(); @@ -63,18 +63,18 @@ this._propertiesOutline.element.classList.add('monospace', 'computed-properties'); this.element.appendChild(this._propertiesOutline.element); - this._linkifier = new WebInspector.Linkifier(WebInspector.ComputedStyleWidget._maxLinkLength); + this._linkifier = new Components.Linkifier(Elements.ComputedStyleWidget._maxLinkLength); /** * @param {?RegExp} regex - * @this {WebInspector.ComputedStyleWidget} + * @this {Elements.ComputedStyleWidget} */ function filterCallback(regex) { this._filterRegex = regex; this._updateFilter(regex); } - var fontsWidget = new WebInspector.PlatformFontsWidget(this._computedStyleModel); + var fontsWidget = new Elements.PlatformFontsWidget(this._computedStyleModel); fontsWidget.show(this.element); } @@ -92,19 +92,19 @@ } /** - * @return {!Promise.<?WebInspector.CSSMatchedStyles>} + * @return {!Promise.<?SDK.CSSMatchedStyles>} */ _fetchMatchedCascade() { var node = this._computedStyleModel.node(); if (!node || !this._computedStyleModel.cssModel()) - return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */ (null)); + return Promise.resolve(/** @type {?SDK.CSSMatchedStyles} */ (null)); return this._computedStyleModel.cssModel().cachedMatchedCascadeForNode(node).then(validateStyles.bind(this)); /** - * @param {?WebInspector.CSSMatchedStyles} matchedStyles - * @return {?WebInspector.CSSMatchedStyles} - * @this {WebInspector.ComputedStyleWidget} + * @param {?SDK.CSSMatchedStyles} matchedStyles + * @return {?SDK.CSSMatchedStyles} + * @this {Elements.ComputedStyleWidget} */ function validateStyles(matchedStyles) { return matchedStyles && matchedStyles.node() === this._computedStyleModel.node() ? matchedStyles : null; @@ -116,18 +116,18 @@ * @return {!Node} */ _processColor(text) { - var color = WebInspector.Color.parse(text); + var color = Common.Color.parse(text); if (!color) return createTextNode(text); - var swatch = WebInspector.ColorSwatch.create(); + var swatch = UI.ColorSwatch.create(); swatch.setColor(color); - swatch.setFormat(WebInspector.Color.detectColorFormat(color)); + swatch.setFormat(Common.Color.detectColorFormat(color)); return swatch; } /** - * @param {?WebInspector.ComputedStyleModel.ComputedStyle} nodeStyle - * @param {?WebInspector.CSSMatchedStyles} matchedStyles + * @param {?Elements.ComputedStyleModel.ComputedStyle} nodeStyle + * @param {?SDK.CSSMatchedStyles} matchedStyles */ _innerRebuildUpdate(nodeStyle, matchedStyles) { /** @type {!Set<string>} */ @@ -135,7 +135,7 @@ for (var treeElement of this._propertiesOutline.rootElement().children()) { if (!treeElement.expanded) continue; - var propertyName = treeElement[WebInspector.ComputedStyleWidget._propertySymbol].name; + var propertyName = treeElement[Elements.ComputedStyleWidget._propertySymbol].name; expandedProperties.add(propertyName); } this._propertiesOutline.removeChildren(); @@ -153,7 +153,7 @@ for (var i = 0; i < uniqueProperties.length; ++i) { var propertyName = uniqueProperties[i]; var propertyValue = nodeStyle.computedStyle.get(propertyName); - var canonicalName = WebInspector.cssMetadata().canonicalPropertyName(propertyName); + var canonicalName = SDK.cssMetadata().canonicalPropertyName(propertyName); var inherited = !inhertiedProperties.has(canonicalName); if (!showInherited && inherited && !(propertyName in this._alwaysShowComputedProperties)) continue; @@ -163,7 +163,7 @@ var propertyElement = createElement('div'); propertyElement.classList.add('computed-style-property'); propertyElement.classList.toggle('computed-style-property-inherited', inherited); - var renderer = new WebInspector.StylesSidebarPropertyRenderer( + var renderer = new Elements.StylesSidebarPropertyRenderer( null, nodeStyle.node, propertyName, /** @type {string} */ (propertyValue)); renderer.setColorHandler(this._processColor.bind(this)); var propertyNameElement = renderer.renderName(); @@ -187,7 +187,7 @@ var treeElement = new TreeElement(); treeElement.selectable = false; treeElement.title = propertyElement; - treeElement[WebInspector.ComputedStyleWidget._propertySymbol] = {name: propertyName, value: propertyValue}; + treeElement[Elements.ComputedStyleWidget._propertySymbol] = {name: propertyName, value: propertyValue}; var isOdd = this._propertiesOutline.rootElement().children().length % 2 === 0; treeElement.listItemElement.classList.toggle('odd-row', isOdd); this._propertiesOutline.appendChild(treeElement); @@ -215,8 +215,8 @@ function propertySorter(a, b) { if (a.startsWith('-webkit') ^ b.startsWith('-webkit')) return a.startsWith('-webkit') ? 1 : -1; - var canonical1 = WebInspector.cssMetadata().canonicalPropertyName(a); - var canonical2 = WebInspector.cssMetadata().canonicalPropertyName(b); + var canonical1 = SDK.cssMetadata().canonicalPropertyName(a); + var canonical2 = SDK.cssMetadata().canonicalPropertyName(b); return canonical1.compareTo(canonical2); } @@ -234,33 +234,33 @@ } /** - * @param {!WebInspector.CSSProperty} cssProperty + * @param {!SDK.CSSProperty} cssProperty * @param {!Event} event */ _navigateToSource(cssProperty, event) { - WebInspector.Revealer.reveal(cssProperty); + Common.Revealer.reveal(cssProperty); event.consume(true); } /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @param {!WebInspector.DOMNode} node + * @param {!SDK.CSSModel} cssModel + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @param {!SDK.DOMNode} node * @param {!TreeElement} rootTreeElement - * @param {!Array<!WebInspector.CSSProperty>} tracedProperties - * @return {!WebInspector.CSSProperty} + * @param {!Array<!SDK.CSSProperty>} tracedProperties + * @return {!SDK.CSSProperty} */ _renderPropertyTrace(cssModel, matchedStyles, node, rootTreeElement, tracedProperties) { var activeProperty = null; for (var property of tracedProperties) { var trace = createElement('div'); trace.classList.add('property-trace'); - if (matchedStyles.propertyState(property) === WebInspector.CSSMatchedStyles.PropertyState.Overloaded) + if (matchedStyles.propertyState(property) === SDK.CSSMatchedStyles.PropertyState.Overloaded) trace.classList.add('property-trace-inactive'); else activeProperty = property; - var renderer = new WebInspector.StylesSidebarPropertyRenderer( + var renderer = new Elements.StylesSidebarPropertyRenderer( null, node, property.name, /** @type {string} */ (property.value)); renderer.setColorHandler(this._processColor.bind(this)); var valueElement = renderer.renderValue(); @@ -277,7 +277,7 @@ if (rule) { var linkSpan = trace.createChild('span', 'trace-link'); linkSpan.appendChild( - WebInspector.StylePropertiesSection.createRuleOriginNode(matchedStyles, this._linkifier, rule)); + Elements.StylePropertiesSection.createRuleOriginNode(matchedStyles, this._linkifier, rule)); } var selectorElement = trace.createChild('span', 'property-trace-selector'); @@ -289,12 +289,12 @@ traceTreeElement.selectable = false; rootTreeElement.appendChild(traceTreeElement); } - return /** @type {!WebInspector.CSSProperty} */ (activeProperty); + return /** @type {!SDK.CSSProperty} */ (activeProperty); } /** - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @return {!Map<string, !Array<!WebInspector.CSSProperty>>} + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @return {!Map<string, !Array<!SDK.CSSProperty>>} */ _computePropertyTraces(matchedStyles) { var result = new Map(); @@ -312,7 +312,7 @@ } /** - * @param {!WebInspector.CSSMatchedStyles} matchedStyles + * @param {!SDK.CSSMatchedStyles} matchedStyles * @return {!Set<string>} */ _computeInheritedProperties(matchedStyles) { @@ -321,7 +321,7 @@ for (var property of style.allProperties) { if (!matchedStyles.propertyState(property)) continue; - result.add(WebInspector.cssMetadata().canonicalPropertyName(property.name)); + result.add(SDK.cssMetadata().canonicalPropertyName(property.name)); } } return result; @@ -333,13 +333,13 @@ _updateFilter(regex) { var children = this._propertiesOutline.rootElement().children(); for (var child of children) { - var property = child[WebInspector.ComputedStyleWidget._propertySymbol]; + var property = child[Elements.ComputedStyleWidget._propertySymbol]; var matched = !regex || regex.test(property.name) || regex.test(property.value); child.hidden = !matched; } } }; -WebInspector.ComputedStyleWidget._maxLinkLength = 30; +Elements.ComputedStyleWidget._maxLinkLength = 30; -WebInspector.ComputedStyleWidget._propertySymbol = Symbol('property'); +Elements.ComputedStyleWidget._propertySymbol = Symbol('property');
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js index 8b3d3ee..456799f1 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.ElementStatePaneWidget = class extends WebInspector.Widget { +Elements.ElementStatePaneWidget = class extends UI.Widget { constructor() { super(); this.element.className = 'styles-element-state-pane'; - this.element.createChild('div').createTextChild(WebInspector.UIString('Force element state')); + this.element.createChild('div').createTextChild(Common.UIString('Force element state')); var table = createElementWithClass('table', 'source-code'); var inputs = []; @@ -18,10 +18,10 @@ * @param {!Event} event */ function clickListener(event) { - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (!node) return; - WebInspector.CSSModel.fromNode(node).forcePseudoState(node, event.target.state, event.target.checked); + SDK.CSSModel.fromNode(node).forcePseudoState(node, event.target.state, event.target.checked); } /** @@ -48,24 +48,24 @@ tr.appendChild(createCheckbox.call(null, 'visited')); this.element.appendChild(table); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._update, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._update, this); } /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ _updateTarget(target) { if (this._target === target) return; if (this._target) { - var cssModel = WebInspector.CSSModel.fromTarget(this._target); - cssModel.removeEventListener(WebInspector.CSSModel.Events.PseudoStateForced, this._update, this); + var cssModel = SDK.CSSModel.fromTarget(this._target); + cssModel.removeEventListener(SDK.CSSModel.Events.PseudoStateForced, this._update, this); } this._target = target; if (target) { - var cssModel = WebInspector.CSSModel.fromTarget(target); - cssModel.addEventListener(WebInspector.CSSModel.Events.PseudoStateForced, this._update, this); + var cssModel = SDK.CSSModel.fromTarget(target); + cssModel.addEventListener(SDK.CSSModel.Events.PseudoStateForced, this._update, this); } } @@ -80,13 +80,13 @@ if (!this.isShowing()) return; - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (node) node = node.enclosingElementOrSelf(); this._updateTarget(node ? node.target() : null); if (node) { - var nodePseudoState = WebInspector.CSSModel.fromNode(node).pseudoState(node); + var nodePseudoState = SDK.CSSModel.fromNode(node).pseudoState(node); for (var input of this._inputs) { input.disabled = !!node.pseudoType(); input.checked = nodePseudoState.indexOf(input.state) >= 0; @@ -101,26 +101,26 @@ }; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.ElementStatePaneWidget.ButtonProvider = class { +Elements.ElementStatePaneWidget.ButtonProvider = class { constructor() { - this._button = new WebInspector.ToolbarToggle( - WebInspector.UIString('Toggle Element State'), ''); - this._button.setText(WebInspector.UIString(':hov')); + this._button = new UI.ToolbarToggle( + Common.UIString('Toggle Element State'), ''); + this._button.setText(Common.UIString(':hov')); this._button.addEventListener('click', this._clicked, this); this._button.element.classList.add('monospace'); - this._view = new WebInspector.ElementStatePaneWidget(); + this._view = new Elements.ElementStatePaneWidget(); } _clicked() { - WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ? this._view : null, this._button); + Elements.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ? this._view : null, this._button); } /** * @override - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ item() { return this._button;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsBreadcrumbs.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsBreadcrumbs.js index 9cf8e290..5bc9f28 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsBreadcrumbs.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsBreadcrumbs.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ElementsBreadcrumbs = class extends WebInspector.HBox { +Elements.ElementsBreadcrumbs = class extends UI.HBox { constructor() { super(true); this.registerRequiredCSS('elements/breadcrumbs.css'); @@ -23,7 +23,7 @@ } /** - * @param {!Array.<!WebInspector.DOMNode>} nodes + * @param {!Array.<!SDK.DOMNode>} nodes */ updateNodes(nodes) { if (!nodes.length) @@ -39,7 +39,7 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ setSelectedNode(node) { this._currentDOMNode = node; @@ -49,14 +49,14 @@ _mouseMovedInCrumbs(event) { var nodeUnderMouse = event.target; var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass('crumb'); - var node = /** @type {?WebInspector.DOMNode} */ (crumbElement ? crumbElement[this._nodeSymbol] : null); + var node = /** @type {?SDK.DOMNode} */ (crumbElement ? crumbElement[this._nodeSymbol] : null); if (node) node.highlight(); } _mouseMovedOutOfCrumbs(event) { if (this._currentDOMNode) - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } /** @@ -95,13 +95,13 @@ /** * @param {!Event} event - * @this {WebInspector.ElementsBreadcrumbs} + * @this {Elements.ElementsBreadcrumbs} */ function selectCrumb(event) { event.preventDefault(); var crumb = /** @type {!Element} */ (event.currentTarget); if (!crumb.classList.contains('collapsed')) { - this.dispatchEventToListeners(WebInspector.ElementsBreadcrumbs.Events.NodeSelected, crumb[this._nodeSymbol]); + this.dispatchEventToListeners(Elements.ElementsBreadcrumbs.Events.NodeSelected, crumb[this._nodeSymbol]); return; } @@ -138,11 +138,11 @@ if (current.pseudoType()) crumbTitle = '::' + current.pseudoType(); else - WebInspector.DOMPresentationUtils.decorateNodeLabel(current, crumb); + Components.DOMPresentationUtils.decorateNodeLabel(current, crumb); break; case Node.TEXT_NODE: - crumbTitle = WebInspector.UIString('(text)'); + crumbTitle = Common.UIString('(text)'); break; case Node.COMMENT_NODE: @@ -415,6 +415,6 @@ }; /** @enum {symbol} */ -WebInspector.ElementsBreadcrumbs.Events = { +Elements.ElementsBreadcrumbs.Events = { NodeSelected: Symbol('NodeSelected') };
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js index 86f72bd..355f3e20 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -28,24 +28,24 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} - * @implements {WebInspector.TargetManager.Observer} - * @implements {WebInspector.ViewLocationResolver} + * @implements {UI.Searchable} + * @implements {SDK.TargetManager.Observer} + * @implements {UI.ViewLocationResolver} * @unrestricted */ -WebInspector.ElementsPanel = class extends WebInspector.Panel { +Elements.ElementsPanel = class extends UI.Panel { constructor() { super('elements'); this.registerRequiredCSS('elements/elementsPanel.css'); - this._splitWidget = new WebInspector.SplitWidget(true, true, 'elementsPanelSplitViewState', 325, 325); + this._splitWidget = new UI.SplitWidget(true, true, 'elementsPanelSplitViewState', 325, 325); this._splitWidget.addEventListener( - WebInspector.SplitWidget.Events.SidebarSizeChanged, this._updateTreeOutlineVisibleWidth.bind(this)); + UI.SplitWidget.Events.SidebarSizeChanged, this._updateTreeOutlineVisibleWidth.bind(this)); this._splitWidget.show(this.element); - this._searchableView = new WebInspector.SearchableView(this); + this._searchableView = new UI.SearchableView(this); this._searchableView.setMinimumSize(25, 28); - this._searchableView.setPlaceholder(WebInspector.UIString('Find by string, selector, or XPath')); + this._searchableView.setPlaceholder(Common.UIString('Find by string, selector, or XPath')); var stackElement = this._searchableView.element; this._contentElement = createElement('div'); @@ -57,50 +57,50 @@ this._contentElement.id = 'elements-content'; // FIXME: crbug.com/425984 - if (WebInspector.moduleSetting('domWordWrap').get()) + if (Common.moduleSetting('domWordWrap').get()) this._contentElement.classList.add('elements-wrap'); - WebInspector.moduleSetting('domWordWrap').addChangeListener(this._domWordWrapSettingChanged.bind(this)); + Common.moduleSetting('domWordWrap').addChangeListener(this._domWordWrapSettingChanged.bind(this)); crumbsContainer.id = 'elements-crumbs'; - this._breadcrumbs = new WebInspector.ElementsBreadcrumbs(); + this._breadcrumbs = new Elements.ElementsBreadcrumbs(); this._breadcrumbs.show(crumbsContainer); this._breadcrumbs.addEventListener( - WebInspector.ElementsBreadcrumbs.Events.NodeSelected, this._crumbNodeSelected, this); + Elements.ElementsBreadcrumbs.Events.NodeSelected, this._crumbNodeSelected, this); this._currentToolbarPane = null; - this._stylesWidget = new WebInspector.StylesSidebarPane(); - this._computedStyleWidget = new WebInspector.ComputedStyleWidget(); - this._metricsWidget = new WebInspector.MetricsSidebarPane(); + this._stylesWidget = new Elements.StylesSidebarPane(); + this._computedStyleWidget = new Elements.ComputedStyleWidget(); + this._metricsWidget = new Elements.MetricsSidebarPane(); this._stylesSidebarToolbar = this._createStylesSidebarToolbar(); - WebInspector.moduleSetting('sidebarPosition').addChangeListener(this._updateSidebarPosition.bind(this)); + Common.moduleSetting('sidebarPosition').addChangeListener(this._updateSidebarPosition.bind(this)); this._updateSidebarPosition(); - /** @type {!Array.<!WebInspector.ElementsTreeOutline>} */ + /** @type {!Array.<!Elements.ElementsTreeOutline>} */ this._treeOutlines = []; - WebInspector.targetManager.observeTargets(this); - WebInspector.moduleSetting('showUAShadowDOM').addChangeListener(this._showUAShadowDOMChanged.bind(this)); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this); - WebInspector.extensionServer.addEventListener( - WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); + SDK.targetManager.observeTargets(this); + Common.moduleSetting('showUAShadowDOM').addChangeListener(this._showUAShadowDOMChanged.bind(this)); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this); + Extensions.extensionServer.addEventListener( + Extensions.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); } /** - * @return {!WebInspector.ElementsPanel} + * @return {!Elements.ElementsPanel} */ static instance() { - return /** @type {!WebInspector.ElementsPanel} */ (self.runtime.sharedInstance(WebInspector.ElementsPanel)); + return /** @type {!Elements.ElementsPanel} */ (self.runtime.sharedInstance(Elements.ElementsPanel)); } /** - * @param {!WebInspector.CSSProperty} cssProperty + * @param {!SDK.CSSProperty} cssProperty */ _revealProperty(cssProperty) { return this.sidebarPaneView.showView(this._stylesViewToReveal).then(() => { - this._stylesWidget.revealProperty(/** @type {!WebInspector.CSSProperty} */ (cssProperty)); + this._stylesWidget.revealProperty(/** @type {!SDK.CSSProperty} */ (cssProperty)); }); } @@ -111,10 +111,10 @@ var container = createElementWithClass('div', 'styles-sidebar-pane-toolbar-container'); var hbox = container.createChild('div', 'hbox styles-sidebar-pane-toolbar'); var filterContainerElement = hbox.createChild('div', 'styles-sidebar-pane-filter-box'); - var filterInput = WebInspector.StylesSidebarPane.createPropertyFilterElement( - WebInspector.UIString('Filter'), hbox, this._stylesWidget.onFilterChanged.bind(this._stylesWidget)); + var filterInput = Elements.StylesSidebarPane.createPropertyFilterElement( + Common.UIString('Filter'), hbox, this._stylesWidget.onFilterChanged.bind(this._stylesWidget)); filterContainerElement.appendChild(filterInput); - var toolbar = new WebInspector.Toolbar('styles-pane-toolbar', hbox); + var toolbar = new UI.Toolbar('styles-pane-toolbar', hbox); toolbar.makeToggledGray(); toolbar.appendLocationItems('styles-sidebarpane-toolbar'); var toolbarPaneContainer = container.createChild('div', 'styles-sidebar-toolbar-pane-container'); @@ -126,15 +126,15 @@ /** * @override * @param {string} locationName - * @return {?WebInspector.ViewLocation} + * @return {?UI.ViewLocation} */ resolveLocation(locationName) { return this.sidebarPaneView; } /** - * @param {?WebInspector.Widget} widget - * @param {!WebInspector.ToolbarToggle=} toggle + * @param {?UI.Widget} widget + * @param {!UI.ToolbarToggle=} toggle */ showToolbarPane(widget, toggle) { if (this._pendingWidgetToggle) @@ -151,7 +151,7 @@ } /** - * @param {?WebInspector.Widget} widget + * @param {?UI.Widget} widget */ _startToolbarPaneAnimation(widget) { if (widget === this._currentToolbarPane) @@ -179,7 +179,7 @@ this._toolbarPaneElement.addEventListener('animationend', listener, false); /** - * @this {WebInspector.ElementsPanel} + * @this {Elements.ElementsPanel} */ function onAnimationEnd() { this._toolbarPaneElement.style.removeProperty('animation-name'); @@ -202,20 +202,20 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (!domModel) return; - var treeOutline = new WebInspector.ElementsTreeOutline(domModel, true, true); - treeOutline.setWordWrap(WebInspector.moduleSetting('domWordWrap').get()); + var treeOutline = new Elements.ElementsTreeOutline(domModel, true, true); + treeOutline.setWordWrap(Common.moduleSetting('domWordWrap').get()); treeOutline.wireToDOMModel(); treeOutline.addEventListener( - WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedNodeChanged, this); + Elements.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedNodeChanged, this); treeOutline.addEventListener( - WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, this._updateBreadcrumbIfNeeded, this); - new WebInspector.ElementsTreeElementHighlighter(treeOutline); + Elements.ElementsTreeOutline.Events.ElementsTreeUpdated, this._updateBreadcrumbIfNeeded, this); + new Elements.ElementsTreeElementHighlighter(treeOutline); this._treeOutlines.push(treeOutline); // Perform attach if necessary. @@ -225,13 +225,13 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (!domModel) return; - var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(domModel); + var treeOutline = Elements.ElementsTreeOutline.forDOMModel(domModel); treeOutline.unwireFromDOMModel(); this._treeOutlines.remove(treeOutline); treeOutline.element.remove(); @@ -260,7 +260,7 @@ /** * @override - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -270,7 +270,7 @@ * @override */ wasShown() { - WebInspector.context.setFlavor(WebInspector.ElementsPanel, this); + UI.context.setFlavor(Elements.ElementsPanel, this); for (var i = 0; i < this._treeOutlines.length; ++i) { var treeOutline = this._treeOutlines[i]; @@ -298,9 +298,9 @@ * @override */ willHide() { - WebInspector.context.setFlavor(WebInspector.ElementsPanel, null); + UI.context.setFlavor(Elements.ElementsPanel, null); - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); for (var i = 0; i < this._treeOutlines.length; ++i) { var treeOutline = this._treeOutlines[i]; treeOutline.setVisible(false); @@ -316,16 +316,16 @@ * @override */ onResize() { - if (WebInspector.moduleSetting('sidebarPosition').get() === 'auto') + if (Common.moduleSetting('sidebarPosition').get() === 'auto') this.element.window().requestAnimationFrame(this._updateSidebarPosition.bind(this)); // Do not force layout. this._updateTreeOutlineVisibleWidth(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _selectedNodeChanged(event) { - var selectedNode = /** @type {?WebInspector.DOMNode} */ (event.data.node); + var selectedNode = /** @type {?SDK.DOMNode} */ (event.data.node); var focus = /** @type {boolean} */ (event.data.focus); for (var i = 0; i < this._treeOutlines.length; ++i) { if (!selectedNode || selectedNode.domModel() !== this._treeOutlines[i].domModel()) @@ -334,7 +334,7 @@ this._breadcrumbs.setSelectedNode(selectedNode); - WebInspector.context.setFlavor(WebInspector.DOMNode, selectedNode); + UI.context.setFlavor(SDK.DOMNode, selectedNode); if (!selectedNode) return; @@ -348,7 +348,7 @@ var nodeFrameId = selectedNode.frameId(); for (var context of executionContexts) { if (context.frameId === nodeFrameId) { - WebInspector.context.setFlavor(WebInspector.ExecutionContext, context); + UI.context.setFlavor(SDK.ExecutionContext, context); break; } } @@ -359,22 +359,22 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _documentUpdatedEvent(event) { this._documentUpdated( - /** @type {!WebInspector.DOMModel} */ (event.target), /** @type {?WebInspector.DOMDocument} */ (event.data)); + /** @type {!SDK.DOMModel} */ (event.target), /** @type {?SDK.DOMDocument} */ (event.data)); } /** - * @param {!WebInspector.DOMModel} domModel - * @param {?WebInspector.DOMDocument} inspectedRootDocument + * @param {!SDK.DOMModel} domModel + * @param {?SDK.DOMDocument} inspectedRootDocument */ _documentUpdated(domModel, inspectedRootDocument) { this._reset(); this.searchCanceled(); - var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(domModel); + var treeOutline = Elements.ElementsTreeOutline.forDOMModel(domModel); treeOutline.rootDOMNode = inspectedRootDocument; if (!inspectedRootDocument) { @@ -384,7 +384,7 @@ } this._hasNonDefaultSelectedNode = false; - WebInspector.domBreakpointsSidebarPane.restoreBreakpoints(inspectedRootDocument); + Components.domBreakpointsSidebarPane.restoreBreakpoints(inspectedRootDocument); if (this._omitDefaultSelection) return; @@ -393,9 +393,9 @@ restoreNode.call(this, domModel, this._selectedNodeOnReset); /** - * @param {!WebInspector.DOMModel} domModel - * @param {?WebInspector.DOMNode} staleNode - * @this {WebInspector.ElementsPanel} + * @param {!SDK.DOMModel} domModel + * @param {?SDK.DOMNode} staleNode + * @this {Elements.ElementsPanel} */ function restoreNode(domModel, staleNode) { var nodePath = staleNode ? staleNode.path() : null; @@ -408,7 +408,7 @@ /** * @param {?Protocol.DOM.NodeId} restoredNodeId - * @this {WebInspector.ElementsPanel} + * @this {Elements.ElementsPanel} */ function onNodeRestored(restoredNodeId) { if (savedSelectedNodeOnReset !== this._selectedNodeOnReset) @@ -427,12 +427,12 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ _setDefaultSelectedNode(node) { if (!node || this._hasNonDefaultSelectedNode || this._pendingNodeReveal) return; - var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(node.domModel()); + var treeOutline = Elements.ElementsTreeOutline.forDOMModel(node.domModel()); if (!treeOutline) return; this.selectDOMNode(node); @@ -452,12 +452,12 @@ delete this._currentSearchResultIndex; delete this._searchResults; - WebInspector.DOMModel.cancelSearch(); + SDK.DOMModel.cancelSearch(); } /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -473,19 +473,19 @@ this._searchQuery = query; var promises = []; - var domModels = WebInspector.DOMModel.instances(); + var domModels = SDK.DOMModel.instances(); for (var domModel of domModels) promises.push( - domModel.performSearchPromise(whitespaceTrimmedQuery, WebInspector.moduleSetting('showUAShadowDOM').get())); + domModel.performSearchPromise(whitespaceTrimmedQuery, Common.moduleSetting('showUAShadowDOM').get())); Promise.all(promises).then(resultCountCallback.bind(this)); /** * @param {!Array.<number>} resultCounts - * @this {WebInspector.ElementsPanel} + * @this {Elements.ElementsPanel} */ function resultCountCallback(resultCounts) { /** - * @type {!Array.<{domModel: !WebInspector.DOMModel, index: number, node: (?WebInspector.DOMNode|undefined)}>} + * @type {!Array.<{domModel: !SDK.DOMModel, index: number, node: (?SDK.DOMNode|undefined)}>} */ this._searchResults = []; for (var i = 0; i < resultCounts.length; ++i) { @@ -513,7 +513,7 @@ switchToAndFocus(node) { // Reset search restore. this._searchableView.cancelSearch(); - WebInspector.viewManager.showView('elements').then(() => this.selectDOMNode(node, true)); + UI.viewManager.showView('elements').then(() => this.selectDOMNode(node, true)); } /** @@ -531,12 +531,12 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { var node = this.selectedDOMNode(); if (node) - WebInspector.DOMPresentationUtils.buildImagePreviewContents(node.target(), anchor.href, true, showPopover); + Components.DOMPresentationUtils.buildImagePreviewContents(node.target(), anchor.href, true, showPopover); /** * @param {!Element=} contents @@ -600,8 +600,8 @@ } /** - * @param {?WebInspector.DOMNode} node - * @this {WebInspector.ElementsPanel} + * @param {?SDK.DOMNode} node + * @this {Elements.ElementsPanel} */ function searchCallback(node) { searchResult.node = node; @@ -620,7 +620,7 @@ if (treeElement) { treeElement.highlightSearchResults(this._searchQuery); treeElement.reveal(); - var matches = treeElement.listItemElement.getElementsByClassName(WebInspector.highlightedSearchResultClassName); + var matches = treeElement.listItemElement.getElementsByClassName(UI.highlightedSearchResultClassName); if (matches.length) matches[0].scrollIntoViewIfNeeded(false); } @@ -632,14 +632,14 @@ var searchResult = this._searchResults[this._currentSearchResultIndex]; if (!searchResult.node) return; - var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(searchResult.node.domModel()); + var treeOutline = Elements.ElementsTreeOutline.forDOMModel(searchResult.node.domModel()); var treeElement = treeOutline.findTreeElement(searchResult.node); if (treeElement) treeElement.hideSearchHighlights(); } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ selectedDOMNode() { for (var i = 0; i < this._treeOutlines.length; ++i) { @@ -651,7 +651,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} focus */ selectDOMNode(node, focus) { @@ -665,18 +665,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _updateBreadcrumbIfNeeded(event) { - var nodes = /** @type {!Array.<!WebInspector.DOMNode>} */ (event.data); + var nodes = /** @type {!Array.<!SDK.DOMNode>} */ (event.data); this._breadcrumbs.updateNodes(nodes); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _crumbNodeSelected(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); this.selectDOMNode(node, true); } @@ -686,17 +686,17 @@ */ handleShortcut(event) { /** - * @param {!WebInspector.ElementsTreeOutline} treeOutline + * @param {!Elements.ElementsTreeOutline} treeOutline */ function handleUndoRedo(treeOutline) { - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.shiftKey && (event.key === 'Z' || event.key === 'z')) { // Z key treeOutline.domModel().undo(); event.handled = true; return; } - var isRedoKey = WebInspector.isMac() ? + var isRedoKey = Host.isMac() ? event.metaKey && event.shiftKey && (event.key === 'Z' || event.key === 'z') : // Z key event.ctrlKey && (event.key === 'Y' || event.key === 'y'); // Y key if (isRedoKey) { @@ -705,7 +705,7 @@ } } - if (WebInspector.isEditing() && event.keyCode !== WebInspector.KeyboardShortcut.Keys.F2.code) + if (UI.isEditing() && event.keyCode !== UI.KeyboardShortcut.Keys.F2.code) return; var treeOutline = null; @@ -732,27 +732,27 @@ } /** - * @param {?WebInspector.DOMNode} node - * @return {?WebInspector.ElementsTreeOutline} + * @param {?SDK.DOMNode} node + * @return {?Elements.ElementsTreeOutline} */ _treeOutlineForNode(node) { if (!node) return null; - return WebInspector.ElementsTreeOutline.forDOMModel(node.domModel()); + return Elements.ElementsTreeOutline.forDOMModel(node.domModel()); } /** - * @param {!WebInspector.DOMNode} node - * @return {?WebInspector.ElementsTreeElement} + * @param {!SDK.DOMNode} node + * @return {?Elements.ElementsTreeElement} */ _treeElementForNode(node) { var treeOutline = this._treeOutlineForNode(node); - return /** @type {?WebInspector.ElementsTreeElement} */ (treeOutline.findTreeElement(node)); + return /** @type {?Elements.ElementsTreeElement} */ (treeOutline.findTreeElement(node)); } /** - * @param {!WebInspector.DOMNode} node - * @return {!WebInspector.DOMNode} + * @param {!SDK.DOMNode} node + * @return {!SDK.DOMNode} */ _leaveUserAgentShadowDOM(node) { var userAgentShadowRoot; @@ -762,19 +762,19 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {!Promise} */ revealAndSelectNode(node) { - if (WebInspector.inspectElementModeController && WebInspector.inspectElementModeController.isInInspectElementMode()) - WebInspector.inspectElementModeController.stopInspection(); + if (Elements.inspectElementModeController && Elements.inspectElementModeController.isInInspectElementMode()) + Elements.inspectElementModeController.stopInspection(); this._omitDefaultSelection = true; - node = WebInspector.moduleSetting('showUAShadowDOM').get() ? node : this._leaveUserAgentShadowDOM(node); + node = Common.moduleSetting('showUAShadowDOM').get() ? node : this._leaveUserAgentShadowDOM(node); node.highlightForTwoSeconds(); - return WebInspector.viewManager.showView('elements').then(() => { + return UI.viewManager.showView('elements').then(() => { this.selectDOMNode(node, true); delete this._omitDefaultSelection; @@ -785,7 +785,7 @@ } _sidebarContextMenuEventFired(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(/** @type {!Object} */ (event.deepElementFromPoint())); contextMenu.show(); } @@ -797,13 +797,13 @@ _updateSidebarPosition() { var horizontally; - var position = WebInspector.moduleSetting('sidebarPosition').get(); + var position = Common.moduleSetting('sidebarPosition').get(); if (position === 'right') horizontally = false; else if (position === 'bottom') horizontally = true; else - horizontally = WebInspector.inspectorView.element.offsetWidth < 680; + horizontally = UI.inspectorView.element.offsetWidth < 680; if (this.sidebarPaneView && horizontally === !this._splitWidget.isVertical()) return; @@ -811,7 +811,7 @@ if (this.sidebarPaneView && this.sidebarPaneView.tabbedPane().shouldHideOnDetach()) return; // We can't reparent extension iframes. - var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); + var extensionSidebarPanes = Extensions.extensionServer.sidebarPanes(); if (this.sidebarPaneView) { this.sidebarPaneView.tabbedPane().detach(); this._splitWidget.uninstallResizer(this.sidebarPaneView.tabbedPane().headerElement()); @@ -820,20 +820,20 @@ this._splitWidget.setVertical(!horizontally); this.showToolbarPane(null); - var matchedStylesContainer = new WebInspector.VBox(); + var matchedStylesContainer = new UI.VBox(); matchedStylesContainer.element.appendChild(this._stylesSidebarToolbar); - var matchedStylePanesWrapper = new WebInspector.VBox(); + var matchedStylePanesWrapper = new UI.VBox(); matchedStylePanesWrapper.element.classList.add('style-panes-wrapper'); matchedStylePanesWrapper.show(matchedStylesContainer.element); this._stylesWidget.show(matchedStylePanesWrapper.element); - var computedStylePanesWrapper = new WebInspector.VBox(); + var computedStylePanesWrapper = new UI.VBox(); computedStylePanesWrapper.element.classList.add('style-panes-wrapper'); this._computedStyleWidget.show(computedStylePanesWrapper.element); /** * @param {boolean} inComputedStyle - * @this {WebInspector.ElementsPanel} + * @this {Elements.ElementsPanel} */ function showMetrics(inComputedStyle) { if (inComputedStyle) @@ -843,24 +843,24 @@ } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ElementsPanel} + * @param {!Common.Event} event + * @this {Elements.ElementsPanel} */ function tabSelected(event) { var tabId = /** @type {string} */ (event.data.tabId); - if (tabId === WebInspector.UIString('Computed')) + if (tabId === Common.UIString('Computed')) showMetrics.call(this, true); - else if (tabId === WebInspector.UIString('Styles')) + else if (tabId === Common.UIString('Styles')) showMetrics.call(this, false); } this.sidebarPaneView = - WebInspector.viewManager.createTabbedLocation(() => WebInspector.viewManager.showView('elements')); + UI.viewManager.createTabbedLocation(() => UI.viewManager.showView('elements')); var tabbedPane = this.sidebarPaneView.tabbedPane(); tabbedPane.element.addEventListener('contextmenu', this._sidebarContextMenuEventFired.bind(this), false); if (this._popoverHelper) this._popoverHelper.hidePopover(); - this._popoverHelper = new WebInspector.PopoverHelper(tabbedPane.element); + this._popoverHelper = new UI.PopoverHelper(tabbedPane.element); this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), this._showPopover.bind(this)); this._popoverHelper.setTimeout(0); @@ -868,10 +868,10 @@ // Styles and computed are merged into a single tab. this._splitWidget.installResizer(tabbedPane.headerElement()); - var stylesView = new WebInspector.SimpleView(WebInspector.UIString('Styles')); + var stylesView = new UI.SimpleView(Common.UIString('Styles')); stylesView.element.classList.add('flex-auto'); - var splitWidget = new WebInspector.SplitWidget(true, true, 'stylesPaneSplitViewState', 215); + var splitWidget = new UI.SplitWidget(true, true, 'stylesPaneSplitViewState', 215); splitWidget.show(stylesView.element); splitWidget.setMainWidget(matchedStylesContainer); @@ -881,15 +881,15 @@ this._stylesViewToReveal = stylesView; } else { // Styles and computed are in separate tabs. - var stylesView = new WebInspector.SimpleView(WebInspector.UIString('Styles')); + var stylesView = new UI.SimpleView(Common.UIString('Styles')); stylesView.element.classList.add('flex-auto', 'metrics-and-styles'); matchedStylesContainer.show(stylesView.element); - var computedView = new WebInspector.SimpleView(WebInspector.UIString('Computed')); + var computedView = new UI.SimpleView(Common.UIString('Computed')); computedView.element.classList.add('composite', 'fill', 'metrics-and-computed'); computedStylePanesWrapper.show(computedView.element); - tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, tabSelected, this); + tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, tabSelected, this); this.sidebarPaneView.appendView(stylesView); this.sidebarPaneView.appendView(computedView); this._stylesViewToReveal = stylesView; @@ -905,15 +905,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _extensionSidebarPaneAdded(event) { - var pane = /** @type {!WebInspector.ExtensionSidebarPane} */ (event.data); + var pane = /** @type {!Extensions.ExtensionSidebarPane} */ (event.data); this._addExtensionSidebarPane(pane); } /** - * @param {!WebInspector.ExtensionSidebarPane} pane + * @param {!Extensions.ExtensionSidebarPane} pane */ _addExtensionSidebarPane(pane) { if (pane.panelName() === this.name) @@ -921,52 +921,52 @@ } }; -WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol('title'); +Elements.ElementsPanel._elementsSidebarViewTitleSymbol = Symbol('title'); /** - * @implements {WebInspector.ContextMenu.Provider} + * @implements {UI.ContextMenu.Provider} * @unrestricted */ -WebInspector.ElementsPanel.ContextMenuProvider = class { +Elements.ElementsPanel.ContextMenuProvider = class { /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} object */ appendApplicableItems(event, contextMenu, object) { - if (!(object instanceof WebInspector.RemoteObject && - (/** @type {!WebInspector.RemoteObject} */ (object)).isNode()) && - !(object instanceof WebInspector.DOMNode) && !(object instanceof WebInspector.DeferredDOMNode)) { + if (!(object instanceof SDK.RemoteObject && + (/** @type {!SDK.RemoteObject} */ (object)).isNode()) && + !(object instanceof SDK.DOMNode) && !(object instanceof SDK.DeferredDOMNode)) { return; } // Add debbuging-related actions - if (object instanceof WebInspector.DOMNode) { + if (object instanceof SDK.DOMNode) { contextMenu.appendSeparator(); - WebInspector.domBreakpointsSidebarPane.populateNodeContextMenu(object, contextMenu, true); + Components.domBreakpointsSidebarPane.populateNodeContextMenu(object, contextMenu, true); } // Skip adding "Reveal..." menu item for our own tree outline. - if (WebInspector.ElementsPanel.instance().element.isAncestor(/** @type {!Node} */ (event.target))) + if (Elements.ElementsPanel.instance().element.isAncestor(/** @type {!Node} */ (event.target))) return; - var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Revealer, object); - contextMenu.appendItem(WebInspector.UIString.capitalize('Reveal in Elements ^panel'), commandCallback); + var commandCallback = Common.Revealer.reveal.bind(Common.Revealer, object); + contextMenu.appendItem(Common.UIString.capitalize('Reveal in Elements ^panel'), commandCallback); } }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.ElementsPanel.DOMNodeRevealer = class { +Elements.ElementsPanel.DOMNodeRevealer = class { /** * @override * @param {!Object} node * @return {!Promise} */ reveal(node) { - var panel = WebInspector.ElementsPanel.instance(); + var panel = Elements.ElementsPanel.instance(); panel._pendingNodeReveal = true; return new Promise(revealPromise); @@ -976,12 +976,12 @@ * @param {function(!Error)} reject */ function revealPromise(resolve, reject) { - if (node instanceof WebInspector.DOMNode) { - onNodeResolved(/** @type {!WebInspector.DOMNode} */ (node)); - } else if (node instanceof WebInspector.DeferredDOMNode) { - (/** @type {!WebInspector.DeferredDOMNode} */ (node)).resolve(onNodeResolved); - } else if (node instanceof WebInspector.RemoteObject) { - var domModel = WebInspector.DOMModel.fromTarget(/** @type {!WebInspector.RemoteObject} */ (node).target()); + if (node instanceof SDK.DOMNode) { + onNodeResolved(/** @type {!SDK.DOMNode} */ (node)); + } else if (node instanceof SDK.DeferredDOMNode) { + (/** @type {!SDK.DeferredDOMNode} */ (node)).resolve(onNodeResolved); + } else if (node instanceof SDK.RemoteObject) { + var domModel = SDK.DOMModel.fromTarget(/** @type {!SDK.RemoteObject} */ (node).target()); if (domModel) domModel.pushObjectAsNodeToFrontend(node, onNodeResolved); else @@ -992,7 +992,7 @@ } /** - * @param {?WebInspector.DOMNode} resolvedNode + * @param {?SDK.DOMNode} resolvedNode */ function onNodeResolved(resolvedNode) { panel._pendingNodeReveal = false; @@ -1008,38 +1008,38 @@ }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.ElementsPanel.CSSPropertyRevealer = class { +Elements.ElementsPanel.CSSPropertyRevealer = class { /** * @override * @param {!Object} property * @return {!Promise} */ reveal(property) { - var panel = WebInspector.ElementsPanel.instance(); - return panel._revealProperty(/** @type {!WebInspector.CSSProperty} */ (property)); + var panel = Elements.ElementsPanel.instance(); + return panel._revealProperty(/** @type {!SDK.CSSProperty} */ (property)); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.ElementsActionDelegate = class { +Elements.ElementsActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (!node) return true; - var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(node.domModel()); + var treeOutline = Elements.ElementsTreeOutline.forDOMModel(node.domModel()); if (!treeOutline) return true; @@ -1056,20 +1056,20 @@ }; /** - * @implements {WebInspector.DOMPresentationUtils.MarkerDecorator} + * @implements {Components.DOMPresentationUtils.MarkerDecorator} * @unrestricted */ -WebInspector.ElementsPanel.PseudoStateMarkerDecorator = class { +Elements.ElementsPanel.PseudoStateMarkerDecorator = class { /** * @override - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {?{title: string, color: string}} */ decorate(node) { return { color: 'orange', - title: WebInspector.UIString( - 'Element state: %s', ':' + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(', :')) + title: Common.UIString( + 'Element state: %s', ':' + SDK.CSSModel.fromNode(node).pseudoState(node).join(', :')) }; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsSidebarPane.js index 2648624..0344456 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsSidebarPane.js
@@ -4,27 +4,27 @@ /** * @unrestricted */ -WebInspector.ElementsSidebarPane = class extends WebInspector.VBox { +Elements.ElementsSidebarPane = class extends UI.VBox { constructor() { super(); this.element.classList.add('flex-none'); - this._computedStyleModel = new WebInspector.ComputedStyleModel(); + this._computedStyleModel = new Elements.ComputedStyleModel(); this._computedStyleModel.addEventListener( - WebInspector.ComputedStyleModel.Events.ComputedStyleChanged, this.onCSSModelChanged, this); + Elements.ComputedStyleModel.Events.ComputedStyleChanged, this.onCSSModelChanged, this); - this._updateThrottler = new WebInspector.Throttler(100); + this._updateThrottler = new Common.Throttler(100); this._updateWhenVisible = false; } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._computedStyleModel.node(); } /** - * @return {?WebInspector.CSSModel} + * @return {?SDK.CSSModel} */ cssModel() { return this._computedStyleModel.cssModel(); @@ -46,7 +46,7 @@ /** * @return {!Promise.<?>} - * @this {WebInspector.ElementsSidebarPane} + * @this {Elements.ElementsSidebarPane} */ function innerUpdate() { return this.isShowing() ? this.doUpdate() : Promise.resolve(); @@ -63,7 +63,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ onCSSModelChanged(event) { }
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js index 7b2b645..a18fc198 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.ElementsTreeElement = class extends TreeElement { +Elements.ElementsTreeElement = class extends TreeElement { /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} elementCloseTag */ constructor(node, elementCloseTag) { @@ -50,42 +50,42 @@ if (this._node.nodeType() === Node.ELEMENT_NODE && !elementCloseTag) this._canAddAttributes = true; this._searchQuery = null; - this._expandedChildrenLimit = WebInspector.ElementsTreeElement.InitialChildrenLimit; + this._expandedChildrenLimit = Elements.ElementsTreeElement.InitialChildrenLimit; } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement */ static animateOnDOMUpdate(treeElement) { var tagName = treeElement.listItemElement.querySelector('.webkit-html-tag-name'); - WebInspector.runCSSAnimationOnce(tagName || treeElement.listItemElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(tagName || treeElement.listItemElement, 'dom-update-highlight'); } /** - * @param {!WebInspector.DOMNode} node - * @return {!Array<!WebInspector.DOMNode>} + * @param {!SDK.DOMNode} node + * @return {!Array<!SDK.DOMNode>} */ static visibleShadowRoots(node) { var roots = node.shadowRoots(); - if (roots.length && !WebInspector.moduleSetting('showUAShadowDOM').get()) + if (roots.length && !Common.moduleSetting('showUAShadowDOM').get()) roots = roots.filter(filter); /** - * @param {!WebInspector.DOMNode} root + * @param {!SDK.DOMNode} root */ function filter(root) { - return root.shadowRootType() !== WebInspector.DOMNode.ShadowRootTypes.UserAgent; + return root.shadowRootType() !== SDK.DOMNode.ShadowRootTypes.UserAgent; } return roots; } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {boolean} */ static canShowInlineText(node) { if (node.importedDocument() || node.templateContent() || - WebInspector.ElementsTreeElement.visibleShadowRoots(node).length || node.hasPseudoElements()) + Elements.ElementsTreeElement.visibleShadowRoots(node).length || node.hasPseudoElements()) return false; if (node.nodeType() !== Node.ELEMENT_NODE) return false; @@ -99,12 +99,12 @@ } /** - * @param {!WebInspector.ContextSubMenuItem} subMenu - * @param {!WebInspector.DOMNode} node + * @param {!UI.ContextSubMenuItem} subMenu + * @param {!SDK.DOMNode} node */ static populateForcedPseudoStateItems(subMenu, node) { const pseudoClasses = ['active', 'hover', 'focus', 'visited']; - var forcedPseudoState = WebInspector.CSSModel.fromNode(node).pseudoState(node); + var forcedPseudoState = SDK.CSSModel.fromNode(node).pseudoState(node); for (var i = 0; i < pseudoClasses.length; ++i) { var pseudoClassForced = forcedPseudoState.indexOf(pseudoClasses[i]) >= 0; subMenu.appendCheckboxItem( @@ -117,7 +117,7 @@ * @param {boolean} enabled */ function setPseudoStateCallback(pseudoState, enabled) { - WebInspector.CSSModel.fromNode(node).forcePseudoState(node, pseudoState, enabled); + SDK.CSSModel.fromNode(node).forcePseudoState(node, pseudoState, enabled); } } @@ -129,7 +129,7 @@ } /** - * @return {!WebInspector.DOMNode} + * @return {!SDK.DOMNode} */ node() { return this._node; @@ -452,38 +452,38 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Event} event */ populateTagContextMenu(contextMenu, event) { // Add attribute-related actions. var treeElement = this._elementCloseTag ? this.treeOutline.findTreeElement(this._node) : this; contextMenu.appendItem( - WebInspector.UIString.capitalize('Add ^attribute'), treeElement._addNewAttribute.bind(treeElement)); + Common.UIString.capitalize('Add ^attribute'), treeElement._addNewAttribute.bind(treeElement)); var attribute = event.target.enclosingNodeOrSelfWithClass('webkit-html-attribute'); var newAttribute = event.target.enclosingNodeOrSelfWithClass('add-attribute'); if (attribute && !newAttribute) contextMenu.appendItem( - WebInspector.UIString.capitalize('Edit ^attribute'), + Common.UIString.capitalize('Edit ^attribute'), this._startEditingAttribute.bind(this, attribute, event.target)); this.populateNodeContextMenu(contextMenu); - WebInspector.ElementsTreeElement.populateForcedPseudoStateItems(contextMenu, treeElement.node()); + Elements.ElementsTreeElement.populateForcedPseudoStateItems(contextMenu, treeElement.node()); contextMenu.appendSeparator(); this.populateScrollIntoView(contextMenu); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ populateScrollIntoView(contextMenu) { - contextMenu.appendItem(WebInspector.UIString.capitalize('Scroll into ^view'), this._scrollIntoView.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Scroll into ^view'), this._scrollIntoView.bind(this)); } populateTextContextMenu(contextMenu, textNode) { if (!this._editing) contextMenu.appendItem( - WebInspector.UIString.capitalize('Edit ^text'), this._startEditingTextNode.bind(this, textNode)); + Common.UIString.capitalize('Edit ^text'), this._startEditingTextNode.bind(this, textNode)); this.populateNodeContextMenu(contextMenu); } @@ -492,50 +492,50 @@ var openTagElement = this._node[this.treeOutline.treeElementSymbol()] || this; var isEditable = this.hasEditableNode(); if (isEditable && !this._editing) - contextMenu.appendItem(WebInspector.UIString('Edit as HTML'), this._editAsHTML.bind(this)); + contextMenu.appendItem(Common.UIString('Edit as HTML'), this._editAsHTML.bind(this)); var isShadowRoot = this._node.isShadowRoot(); // Place it here so that all "Copy"-ing items stick together. - var copyMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Copy')); - var createShortcut = WebInspector.KeyboardShortcut.shortcutToString; - var modifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta; + var copyMenu = contextMenu.appendSubMenuItem(Common.UIString('Copy')); + var createShortcut = UI.KeyboardShortcut.shortcutToString; + var modifier = UI.KeyboardShortcut.Modifiers.CtrlOrMeta; var treeOutline = this.treeOutline; var menuItem; if (!isShadowRoot) { menuItem = copyMenu.appendItem( - WebInspector.UIString('Copy outerHTML'), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node)); + Common.UIString('Copy outerHTML'), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node)); menuItem.setShortcut(createShortcut('V', modifier)); } if (this._node.nodeType() === Node.ELEMENT_NODE) - copyMenu.appendItem(WebInspector.UIString.capitalize('Copy selector'), this._copyCSSPath.bind(this)); + copyMenu.appendItem(Common.UIString.capitalize('Copy selector'), this._copyCSSPath.bind(this)); if (!isShadowRoot) - copyMenu.appendItem(WebInspector.UIString('Copy XPath'), this._copyXPath.bind(this)); + copyMenu.appendItem(Common.UIString('Copy XPath'), this._copyXPath.bind(this)); if (!isShadowRoot) { menuItem = copyMenu.appendItem( - WebInspector.UIString('Cut element'), treeOutline.performCopyOrCut.bind(treeOutline, true, this._node), + Common.UIString('Cut element'), treeOutline.performCopyOrCut.bind(treeOutline, true, this._node), !this.hasEditableNode()); menuItem.setShortcut(createShortcut('X', modifier)); menuItem = copyMenu.appendItem( - WebInspector.UIString('Copy element'), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node)); + Common.UIString('Copy element'), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node)); menuItem.setShortcut(createShortcut('C', modifier)); menuItem = copyMenu.appendItem( - WebInspector.UIString('Paste element'), treeOutline.pasteNode.bind(treeOutline, this._node), + Common.UIString('Paste element'), treeOutline.pasteNode.bind(treeOutline, this._node), !treeOutline.canPaste(this._node)); menuItem.setShortcut(createShortcut('V', modifier)); } contextMenu.appendSeparator(); menuItem = contextMenu.appendCheckboxItem( - WebInspector.UIString('Hide element'), treeOutline.toggleHideElement.bind(treeOutline, this._node), + Common.UIString('Hide element'), treeOutline.toggleHideElement.bind(treeOutline, this._node), treeOutline.isToggledToHidden(this._node)); - menuItem.setShortcut(WebInspector.shortcutRegistry.shortcutTitleForAction('elements.hide-element')); + menuItem.setShortcut(UI.shortcutRegistry.shortcutTitleForAction('elements.hide-element')); if (isEditable) - contextMenu.appendItem(WebInspector.UIString('Delete element'), this.remove.bind(this)); + contextMenu.appendItem(Common.UIString('Delete element'), this.remove.bind(this)); contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Expand all'), this.expandRecursively.bind(this)); - contextMenu.appendItem(WebInspector.UIString('Collapse all'), this.collapseRecursively.bind(this)); + contextMenu.appendItem(Common.UIString('Expand all'), this.expandRecursively.bind(this)); + contextMenu.appendItem(Common.UIString('Collapse all'), this.collapseRecursively.bind(this)); contextMenu.appendSeparator(); } @@ -595,7 +595,7 @@ _startEditingAttribute(attribute, elementForSelection) { console.assert(this.listItemElement.isAncestor(attribute)); - if (WebInspector.isBeingEdited(attribute)) + if (UI.isBeingEdited(attribute)) return true; var attributeNameElement = attribute.getElementsByClassName('webkit-html-attribute-name')[0]; @@ -625,12 +625,12 @@ var attributeValue = attributeName && attributeValueElement ? this._node.getAttribute(attributeName) : undefined; if (attributeValue !== undefined) attributeValueElement.setTextContentTruncatedIfNeeded( - attributeValue, WebInspector.UIString('<value is too large to edit>')); + attributeValue, Common.UIString('<value is too large to edit>')); // Remove zero-width spaces that were added by nodeTitleInfo. removeZeroWidthSpaceRecursive(attribute); - var config = new WebInspector.InplaceEditor.Config( + var config = new UI.InplaceEditor.Config( this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName); /** @@ -638,14 +638,14 @@ * @return {string} */ function postKeyDownFinishHandler(event) { - WebInspector.handleElementValueModifications(event, attribute); + UI.handleElementValueModifications(event, attribute); return ''; } if (!attributeValueElement.textContent.asParsedURL()) config.setPostKeydownFinishHandler(postKeyDownFinishHandler); - this._editing = WebInspector.InplaceEditor.startEditing(attribute, config); + this._editing = UI.InplaceEditor.startEditing(attribute, config); this.listItemElement.getComponentSelection().setBaseAndExtent(elementForSelection, 0, elementForSelection, 1); @@ -656,7 +656,7 @@ * @param {!Element} textNodeElement */ _startEditingTextNode(textNodeElement) { - if (WebInspector.isBeingEdited(textNodeElement)) + if (UI.isBeingEdited(textNodeElement)) return true; var textNode = this._node; @@ -668,9 +668,9 @@ var container = textNodeElement.enclosingNodeOrSelfWithClass('webkit-html-text-node'); if (container) container.textContent = textNode.nodeValue(); // Strip the CSS or JS highlighting if present. - var config = new WebInspector.InplaceEditor.Config( + var config = new UI.InplaceEditor.Config( this._textNodeEditingCommitted.bind(this, textNode), this._editingCancelled.bind(this)); - this._editing = WebInspector.InplaceEditor.startEditing(textNodeElement, config); + this._editing = UI.InplaceEditor.startEditing(textNodeElement, config); this.listItemElement.getComponentSelection().setBaseAndExtent(textNodeElement, 0, textNodeElement, 1); return true; @@ -687,10 +687,10 @@ } var tagName = tagNameElement.textContent; - if (WebInspector.ElementsTreeElement.EditTagBlacklist.has(tagName.toLowerCase())) + if (Elements.ElementsTreeElement.EditTagBlacklist.has(tagName.toLowerCase())) return false; - if (WebInspector.isBeingEdited(tagNameElement)) + if (UI.isBeingEdited(tagNameElement)) return true; var closingTagElement = this._distinctClosingTagElement(); @@ -706,7 +706,7 @@ /** * @param {!Element} element * @param {string} newTagName - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function editingComitted(element, newTagName) { tagNameElement.removeEventListener('keyup', keyupListener, false); @@ -714,7 +714,7 @@ } /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function editingCancelled() { tagNameElement.removeEventListener('keyup', keyupListener, false); @@ -724,8 +724,8 @@ tagNameElement.addEventListener('keyup', keyupListener, false); var config = - new WebInspector.InplaceEditor.Config(editingComitted.bind(this), editingCancelled.bind(this), tagName); - this._editing = WebInspector.InplaceEditor.startEditing(tagNameElement, config); + new UI.InplaceEditor.Config(editingComitted.bind(this), editingCancelled.bind(this), tagName); + this._editing = UI.InplaceEditor.startEditing(tagNameElement, config); this.listItemElement.getComponentSelection().setBaseAndExtent(tagNameElement, 0, tagNameElement, 1); return true; } @@ -769,7 +769,7 @@ /** * @param {!Element} element * @param {string} newValue - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function commit(element, newValue) { commitCallback(initialValue, newValue); @@ -777,7 +777,7 @@ } /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function dispose() { disposeCallback(); @@ -802,18 +802,18 @@ this.treeOutline.focus(); } - var config = new WebInspector.InplaceEditor.Config(commit.bind(this), dispose.bind(this)); + var config = new UI.InplaceEditor.Config(commit.bind(this), dispose.bind(this)); config.setMultilineOptions( initialValue, {name: 'xml', htmlMode: true}, 'web-inspector-html', - WebInspector.moduleSetting('domWordWrap').get(), true); - WebInspector.InplaceEditor.startMultilineEditing(this._htmlEditElement, config).then(markAsBeingEdited.bind(this)); + Common.moduleSetting('domWordWrap').get(), true); + UI.InplaceEditor.startMultilineEditing(this._htmlEditElement, config).then(markAsBeingEdited.bind(this)); /** * @param {!Object} controller - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function markAsBeingEdited(controller) { - this._editing = /** @type {!WebInspector.InplaceEditor.Controller} */ (controller); + this._editing = /** @type {!UI.InplaceEditor.Controller} */ (controller); this._editing.setWidth(this.treeOutline.visibleWidth() - this._computeLeftIndent()); this.treeOutline.setMultilineEditing(this._editing); } @@ -826,7 +826,7 @@ /** * @param {?Protocol.Error=} error - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function moveToNextAttributeIfNeeded(error) { if (error) @@ -899,7 +899,7 @@ } /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function moveToNextAttributeIfNeeded() { if (moveDirection !== 'forward') { @@ -935,7 +935,7 @@ } /** - * @param {!WebInspector.DOMNode} textNode + * @param {!SDK.DOMNode} textNode * @param {!Element} element * @param {string} newText */ @@ -943,7 +943,7 @@ delete this._editing; /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function callback() { this.updateTitle(); @@ -983,7 +983,7 @@ } /** - * @param {?WebInspector.ElementsTreeOutline.UpdateRecord=} updateRecord + * @param {?Elements.ElementsTreeOutline.UpdateRecord=} updateRecord * @param {boolean=} onlySearchQueryChanged */ updateTitle(updateRecord, onlySearchQueryChanged) { @@ -1052,7 +1052,7 @@ if (!this.treeOutline._decoratorExtensions) /** @type {!Array.<!Runtime.Extension>} */ - this.treeOutline._decoratorExtensions = runtime.extensions(WebInspector.DOMPresentationUtils.MarkerDecorator); + this.treeOutline._decoratorExtensions = runtime.extensions(Components.DOMPresentationUtils.MarkerDecorator); var markerToExtension = new Map(); for (var i = 0; i < this.treeOutline._decoratorExtensions.length; ++i) @@ -1065,7 +1065,7 @@ node.traverseMarkers(visitor); /** - * @param {!WebInspector.DOMNode} n + * @param {!SDK.DOMNode} n * @param {string} marker */ function visitor(n, marker) { @@ -1076,8 +1076,8 @@ } /** - * @param {!WebInspector.DOMNode} n - * @param {!WebInspector.DOMPresentationUtils.MarkerDecorator} decorator + * @param {!SDK.DOMNode} n + * @param {!Components.DOMPresentationUtils.MarkerDecorator} decorator */ function collectDecoration(n, decorator) { var decoration = decorator.decorate(n); @@ -1089,7 +1089,7 @@ Promise.all(promises).then(updateDecorationsUI.bind(this)); /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function updateDecorationsUI() { this._decorationsElement.removeChildren(); @@ -1113,7 +1113,7 @@ var descendantColors = new Set(); if (descendantDecorations.length) { var element = titles.createChild('div'); - element.textContent = WebInspector.UIString('Children:'); + element.textContent = Common.UIString('Children:'); for (var decoration of descendantDecorations) { element = titles.createChild('div'); element.style.marginLeft = '15px'; @@ -1126,12 +1126,12 @@ processColors.call(this, colors, 'elements-gutter-decoration'); if (!this.expanded) processColors.call(this, descendantColors, 'elements-gutter-decoration elements-has-decorated-children'); - WebInspector.Tooltip.install(this._decorationsElement, titles); + UI.Tooltip.install(this._decorationsElement, titles); /** * @param {!Set<string>} colors * @param {string} className - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function processColors(colors, className) { for (var color of colors) { @@ -1151,9 +1151,9 @@ * @param {!Node} parentElement * @param {string} name * @param {string} value - * @param {?WebInspector.ElementsTreeOutline.UpdateRecord} updateRecord + * @param {?Elements.ElementsTreeOutline.UpdateRecord} updateRecord * @param {boolean=} forceValue - * @param {!WebInspector.DOMNode=} node + * @param {!SDK.DOMNode=} node */ _buildAttributeDOM(parentElement, name, value, updateRecord, forceValue, node) { var closingPunctuationRegex = /[\/;:\)\]\}]/g; @@ -1179,7 +1179,7 @@ /** * @param {!Element} element * @param {string} value - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function setValueWithEntities(element, value) { result = this._convertWhitespaceToEntities(value); @@ -1190,7 +1190,7 @@ ++highlightIndex; } element.setTextContentTruncatedIfNeeded(value); - WebInspector.highlightRangesWithStyleClass(element, result.entityRanges, 'webkit-html-entity-value'); + UI.highlightRangesWithStyleClass(element, result.entityRanges, 'webkit-html-entity-value'); } var hasText = (forceValue || value.length > 0); @@ -1204,10 +1204,10 @@ var attrValueElement = attrSpanElement.createChild('span', 'webkit-html-attribute-value'); if (updateRecord && updateRecord.isAttributeModified(name)) - WebInspector.runCSSAnimationOnce(hasText ? attrValueElement : attrNameElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(hasText ? attrValueElement : attrNameElement, 'dom-update-highlight'); /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} * @param {string} value * @return {!Element} */ @@ -1221,7 +1221,7 @@ value = value.replace(closingPunctuationRegex, '$&\u200B'); if (value.startsWith('data:')) value = value.trimMiddle(60); - var anchor = WebInspector.linkifyURLAsNode(rewrittenHref, value, '', node.nodeName().toLowerCase() === 'a'); + var anchor = UI.linkifyURLAsNode(rewrittenHref, value, '', node.nodeName().toLowerCase() === 'a'); anchor.preventFollow = true; return anchor; } @@ -1274,7 +1274,7 @@ * @param {string} tagName * @param {boolean} isClosingTag * @param {boolean} isDistinctTreeElement - * @param {?WebInspector.ElementsTreeOutline.UpdateRecord} updateRecord + * @param {?Elements.ElementsTreeOutline.UpdateRecord} updateRecord */ _buildTagDOM(parentElement, tagName, isClosingTag, isDistinctTreeElement, updateRecord) { var node = this._node; @@ -1299,7 +1299,7 @@ var hasUpdates = updateRecord.hasRemovedAttributes() || updateRecord.hasRemovedChildren(); hasUpdates |= !this.expanded && updateRecord.hasChangedChildren(); if (hasUpdates) - WebInspector.runCSSAnimationOnce(tagNameElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(tagNameElement, 'dom-update-highlight'); } } @@ -1309,13 +1309,13 @@ /** * @param {string} text - * @return {!{text: string, entityRanges: !Array.<!WebInspector.SourceRange>}} + * @return {!{text: string, entityRanges: !Array.<!Common.SourceRange>}} */ _convertWhitespaceToEntities(text) { var result = ''; var lastIndexAfterEntity = 0; var entityRanges = []; - var charToEntity = WebInspector.ElementsTreeOutline.MappedCharToEntity; + var charToEntity = Elements.ElementsTreeOutline.MappedCharToEntity; for (var i = 0, size = text.length; i < size; ++i) { var char = text.charAt(i); if (charToEntity[char]) { @@ -1332,7 +1332,7 @@ } /** - * @param {?WebInspector.ElementsTreeOutline.UpdateRecord} updateRecord + * @param {?Elements.ElementsTreeOutline.UpdateRecord} updateRecord * @return {!DocumentFragment} result */ _nodeTitleInfo(updateRecord) { @@ -1370,22 +1370,22 @@ break; } - if (WebInspector.ElementsTreeElement.canShowInlineText(node)) { + if (Elements.ElementsTreeElement.canShowInlineText(node)) { var textNodeElement = titleDOM.createChild('span', 'webkit-html-text-node'); var result = this._convertWhitespaceToEntities(node.firstChild.nodeValue()); textNodeElement.textContent = result.text; - WebInspector.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value'); + UI.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value'); titleDOM.createTextChild('\u200B'); this._buildTagDOM(titleDOM, tagName, true, false, updateRecord); if (updateRecord && updateRecord.hasChangedChildren()) - WebInspector.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); if (updateRecord && updateRecord.isCharDataModified()) - WebInspector.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); break; } if (this.treeOutline.isXMLMimeType || - !WebInspector.ElementsTreeElement.ForbiddenClosingTagElements.has(tagName)) + !Elements.ElementsTreeElement.ForbiddenClosingTagElements.has(tagName)) this._buildTagDOM(titleDOM, tagName, true, false, updateRecord); break; @@ -1395,24 +1395,24 @@ var text = node.nodeValue(); newNode.textContent = text.startsWith('\n') ? text.substring(1) : text; - var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter('text/javascript', true); + var javascriptSyntaxHighlighter = new UI.DOMSyntaxHighlighter('text/javascript', true); javascriptSyntaxHighlighter.syntaxHighlightNode(newNode).then(updateSearchHighlight.bind(this)); } else if (node.parentNode && node.parentNode.nodeName().toLowerCase() === 'style') { var newNode = titleDOM.createChild('span', 'webkit-html-text-node webkit-html-css-node'); var text = node.nodeValue(); newNode.textContent = text.startsWith('\n') ? text.substring(1) : text; - var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter('text/css', true); + var cssSyntaxHighlighter = new UI.DOMSyntaxHighlighter('text/css', true); cssSyntaxHighlighter.syntaxHighlightNode(newNode).then(updateSearchHighlight.bind(this)); } else { titleDOM.createTextChild('"'); var textNodeElement = titleDOM.createChild('span', 'webkit-html-text-node'); var result = this._convertWhitespaceToEntities(node.nodeValue()); textNodeElement.textContent = result.text; - WebInspector.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value'); + UI.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value'); titleDOM.createTextChild('"'); if (updateRecord && updateRecord.isCharDataModified()) - WebInspector.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); + UI.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight'); } break; @@ -1451,7 +1451,7 @@ } /** - * @this {WebInspector.ElementsTreeElement} + * @this {Elements.ElementsTreeElement} */ function updateSearchHighlight() { delete this._highlightResult; @@ -1478,7 +1478,7 @@ * @param {boolean=} startEditing */ toggleEditAsHTML(callback, startEditing) { - if (this._editing && this._htmlEditElement && WebInspector.isBeingEdited(this._htmlEditElement)) { + if (this._editing && this._htmlEditElement && UI.isBeingEdited(this._htmlEditElement)) { this._editing.commit(); return; } @@ -1513,11 +1513,11 @@ } _copyCSSPath() { - InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.cssPath(this._node, true)); + InspectorFrontendHost.copyText(Components.DOMPresentationUtils.cssPath(this._node, true)); } _copyXPath() { - InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.xPath(this._node, true)); + InspectorFrontendHost.copyText(Components.DOMPresentationUtils.xPath(this._node, true)); } _highlightSearchResults() { @@ -1531,16 +1531,16 @@ var match = regexObject.exec(text); var matchRanges = []; while (match) { - matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length)); + matchRanges.push(new Common.SourceRange(match.index, match[0].length)); match = regexObject.exec(text); } // Fall back for XPath, etc. matches. if (!matchRanges.length) - matchRanges.push(new WebInspector.SourceRange(0, text.length)); + matchRanges.push(new Common.SourceRange(0, text.length)); this._highlightResult = []; - WebInspector.highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult); + UI.highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult); } _scrollIntoView() { @@ -1561,19 +1561,19 @@ } _editAsHTML() { - var promise = WebInspector.Revealer.revealPromise(this.node()); - promise.then(() => WebInspector.actionRegistry.action('elements.edit-as-html').execute()); + var promise = Common.Revealer.revealPromise(this.node()); + promise.then(() => UI.actionRegistry.action('elements.edit-as-html').execute()); } }; -WebInspector.ElementsTreeElement.InitialChildrenLimit = 500; +Elements.ElementsTreeElement.InitialChildrenLimit = 500; // A union of HTML4 and HTML5-Draft elements that explicitly // or implicitly (for HTML5) forbid the closing tag. -WebInspector.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ +Elements.ElementsTreeElement.ForbiddenClosingTagElements = new Set([ 'area', 'base', 'basefont', 'br', 'canvas', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr' ]); // These tags we do not allow editing their tag name. -WebInspector.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']); +Elements.ElementsTreeElement.EditTagBlacklist = new Set(['html', 'head', 'body']);
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElementHighlighter.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElementHighlighter.js index 307d334..69135b7 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElementHighlighter.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElementHighlighter.js
@@ -4,37 +4,37 @@ /** * @unrestricted */ -WebInspector.ElementsTreeElementHighlighter = class { +Elements.ElementsTreeElementHighlighter = class { /** - * @param {!WebInspector.ElementsTreeOutline} treeOutline + * @param {!Elements.ElementsTreeOutline} treeOutline */ constructor(treeOutline) { - this._throttler = new WebInspector.Throttler(100); + this._throttler = new Common.Throttler(100); this._treeOutline = treeOutline; this._treeOutline.addEventListener(TreeOutline.Events.ElementExpanded, this._clearState, this); this._treeOutline.addEventListener(TreeOutline.Events.ElementCollapsed, this._clearState, this); this._treeOutline.addEventListener( - WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._clearState, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this); + Elements.ElementsTreeOutline.Events.SelectedNodeChanged, this._clearState, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this); this._treeOutline.domModel().addEventListener( - WebInspector.DOMModel.Events.InspectModeWillBeToggled, this._clearState, this); + SDK.DOMModel.Events.InspectModeWillBeToggled, this._clearState, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _highlightNode(event) { - if (!WebInspector.moduleSetting('highlightNodeOnHoverInOverlay').get()) + if (!Common.moduleSetting('highlightNodeOnHoverInOverlay').get()) return; - var domNode = /** @type {!WebInspector.DOMNode} */ (event.data); + var domNode = /** @type {!SDK.DOMNode} */ (event.data); this._throttler.schedule(callback.bind(this)); this._pendingHighlightNode = this._treeOutline.domModel() === domNode.domModel() ? domNode : null; /** - * @this {WebInspector.ElementsTreeElementHighlighter} + * @this {Elements.ElementsTreeElementHighlighter} */ function callback() { this._highlightNodeInternal(this._pendingHighlightNode); @@ -44,7 +44,7 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ _highlightNodeInternal(node) { this._isModifyingTreeOutline = true;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js index b0fa8e08..28f8897d 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.ElementsTreeOutline = class extends TreeOutline { +Elements.ElementsTreeOutline = class extends TreeOutline { /** - * @param {!WebInspector.DOMModel} domModel + * @param {!SDK.DOMModel} domModel * @param {boolean=} omitRootDOMNode * @param {boolean=} selectEnabled */ @@ -43,7 +43,7 @@ this._domModel = domModel; this._treeElementSymbol = Symbol('treeElement'); var shadowContainer = createElement('div'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(shadowContainer, 'elements/elementsTreeOutline.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(shadowContainer, 'elements/elementsTreeOutline.css'); var outlineDisclosureElement = this._shadowRoot.createChild('div', 'elements-disclosure'); this._element = this.element; @@ -67,33 +67,33 @@ this._includeRootDOMNode = !omitRootDOMNode; this._selectEnabled = selectEnabled; - /** @type {?WebInspector.DOMNode} */ + /** @type {?SDK.DOMNode} */ this._rootDOMNode = null; - /** @type {?WebInspector.DOMNode} */ + /** @type {?SDK.DOMNode} */ this._selectedDOMNode = null; this._visible = false; - this._popoverHelper = new WebInspector.PopoverHelper(this._element); + this._popoverHelper = new UI.PopoverHelper(this._element); this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), this._showPopover.bind(this)); this._popoverHelper.setTimeout(0, 100); - /** @type {!Map<!WebInspector.DOMNode, !WebInspector.ElementsTreeOutline.UpdateRecord>} */ + /** @type {!Map<!SDK.DOMNode, !Elements.ElementsTreeOutline.UpdateRecord>} */ this._updateRecords = new Map(); - /** @type {!Set<!WebInspector.ElementsTreeElement>} */ + /** @type {!Set<!Elements.ElementsTreeElement>} */ this._treeElementsBeingUpdated = new Set(); - this._domModel.addEventListener(WebInspector.DOMModel.Events.MarkersChanged, this._markersChanged, this); - this._showHTMLCommentsSetting = WebInspector.moduleSetting('showHTMLComments'); + this._domModel.addEventListener(SDK.DOMModel.Events.MarkersChanged, this._markersChanged, this); + this._showHTMLCommentsSetting = Common.moduleSetting('showHTMLComments'); this._showHTMLCommentsSetting.addChangeListener(this._onShowHTMLCommentsChange.bind(this)); } /** - * @param {!WebInspector.DOMModel} domModel - * @return {?WebInspector.ElementsTreeOutline} + * @param {!SDK.DOMModel} domModel + * @return {?Elements.ElementsTreeOutline} */ static forDOMModel(domModel) { - return domModel[WebInspector.ElementsTreeOutline._treeOutlineSymbol] || null; + return domModel[Elements.ElementsTreeOutline._treeOutlineSymbol] || null; } _onShowHTMLCommentsChange() { @@ -125,14 +125,14 @@ } /** - * @return {!WebInspector.DOMModel} + * @return {!SDK.DOMModel} */ domModel() { return this._domModel; } /** - * @param {?WebInspector.InplaceEditor.Controller} multilineEditing + * @param {?UI.InplaceEditor.Controller} multilineEditing */ setMultilineEditing(multilineEditing) { this._multilineEditing = multilineEditing; @@ -155,7 +155,7 @@ } /** - * @param {?WebInspector.ElementsTreeOutline.ClipboardData} data + * @param {?Elements.ElementsTreeOutline.ClipboardData} data */ _setClipboardData(data) { if (this._clipboardNodeData) { @@ -174,7 +174,7 @@ } /** - * @param {!WebInspector.DOMNode} removedNode + * @param {!SDK.DOMNode} removedNode */ resetClipboardIfNeeded(removedNode) { if (this._clipboardNodeData && this._clipboardNodeData.node === removedNode) @@ -201,7 +201,7 @@ return; // Do not interfere with text editing. - if (WebInspector.isEditing()) + if (UI.isEditing()) return; var targetNode = this.selectedDOMNode(); @@ -216,7 +216,7 @@ /** * @param {boolean} isCut - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ performCopyOrCut(isCut, node) { if (isCut && (node.isShadowRoot() || node.ancestorUserAgentShadowRoot())) @@ -227,7 +227,7 @@ } /** - * @param {!WebInspector.DOMNode} targetNode + * @param {!SDK.DOMNode} targetNode * @return {boolean} */ canPaste(targetNode) { @@ -247,7 +247,7 @@ } /** - * @param {!WebInspector.DOMNode} targetNode + * @param {!SDK.DOMNode} targetNode */ pasteNode(targetNode) { if (this.canPaste(targetNode)) @@ -259,7 +259,7 @@ */ _onPaste(event) { // Do not interfere with text editing. - if (WebInspector.isEditing()) + if (UI.isEditing()) return; var targetNode = this.selectedDOMNode(); @@ -271,7 +271,7 @@ } /** - * @param {!WebInspector.DOMNode} targetNode + * @param {!SDK.DOMNode} targetNode */ _performPaste(targetNode) { if (this._clipboardNodeData.isCut) { @@ -284,7 +284,7 @@ /** * @param {?Protocol.Error} error * @param {!Protocol.DOM.NodeId} nodeId - * @this {WebInspector.ElementsTreeOutline} + * @this {Elements.ElementsTreeOutline} */ function expandCallback(error, nodeId) { if (error) @@ -333,14 +333,14 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ selectedDOMNode() { return this._selectedDOMNode; } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {boolean=} focus */ selectDOMNode(node, focus) { @@ -400,19 +400,19 @@ */ _selectedNodeChanged(focus) { this.dispatchEventToListeners( - WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, {node: this._selectedDOMNode, focus: focus}); + Elements.ElementsTreeOutline.Events.SelectedNodeChanged, {node: this._selectedDOMNode, focus: focus}); } /** - * @param {!Array.<!WebInspector.DOMNode>} nodes + * @param {!Array.<!SDK.DOMNode>} nodes */ _fireElementsTreeUpdated(nodes) { - this.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated, nodes); + this.dispatchEventToListeners(Elements.ElementsTreeOutline.Events.ElementsTreeUpdated, nodes); } /** - * @param {!WebInspector.DOMNode} node - * @return {?WebInspector.ElementsTreeElement} + * @param {!SDK.DOMNode} node + * @return {?Elements.ElementsTreeElement} */ findTreeElement(node) { var treeElement = this._lookUpTreeElement(node); @@ -421,11 +421,11 @@ treeElement = this._lookUpTreeElement(node.parentNode); } - return /** @type {?WebInspector.ElementsTreeElement} */ (treeElement); + return /** @type {?Elements.ElementsTreeElement} */ (treeElement); } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @return {?TreeElement} */ _lookUpTreeElement(node) { @@ -458,8 +458,8 @@ } /** - * @param {!WebInspector.DOMNode} node - * @return {?WebInspector.ElementsTreeElement} + * @param {!SDK.DOMNode} node + * @return {?Elements.ElementsTreeElement} */ createTreeElementFor(node) { var treeElement = this.findTreeElement(node); @@ -479,7 +479,7 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {boolean} omitFocus */ _revealAndSelectNode(node, omitFocus) { @@ -539,7 +539,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {function()} callback */ _loadDimensionsForNode(node, callback) { @@ -578,14 +578,14 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { var listItem = anchor.enclosingNodeOrSelfWithNodeName('li'); - var node = /** @type {!WebInspector.ElementsTreeElement} */ (listItem.treeElement).node(); + var node = /** @type {!Elements.ElementsTreeElement} */ (listItem.treeElement).node(); this._loadDimensionsForNode( - node, WebInspector.DOMPresentationUtils.buildImagePreviewContents.bind( - WebInspector.DOMPresentationUtils, node.target(), anchor.href, true, showPopover)); + node, Components.DOMPresentationUtils.buildImagePreviewContents.bind( + Components.DOMPresentationUtils, node.target(), anchor.href, true, showPopover)); /** * @param {!Element=} contents @@ -632,21 +632,21 @@ this.setHoverEffect(element); - if (element instanceof WebInspector.ElementsTreeElement) { + if (element instanceof Elements.ElementsTreeElement) { this._domModel.highlightDOMNodeWithConfig( - element.node().id, {mode: 'all', showInfo: !WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)}); + element.node().id, {mode: 'all', showInfo: !UI.KeyboardShortcut.eventHasCtrlOrMeta(event)}); return; } - if (element instanceof WebInspector.ElementsTreeOutline.ShortcutTreeElement) + if (element instanceof Elements.ElementsTreeOutline.ShortcutTreeElement) this._domModel.highlightDOMNodeWithConfig( - undefined, {mode: 'all', showInfo: !WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)}, + undefined, {mode: 'all', showInfo: !UI.KeyboardShortcut.eventHasCtrlOrMeta(event)}, element.backendNodeId()); } _onmouseleave(event) { this.setHoverEffect(null); - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } _ondragstart(event) { @@ -666,7 +666,7 @@ event.dataTransfer.effectAllowed = 'copyMove'; this._treeElementBeingDragged = treeElement; - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); return true; } @@ -707,9 +707,9 @@ if (!treeElement) return false; - if (!(treeElement instanceof WebInspector.ElementsTreeElement)) + if (!(treeElement instanceof Elements.ElementsTreeElement)) return false; - var elementsTreeElement = /** @type {!WebInspector.ElementsTreeElement} */ (treeElement); + var elementsTreeElement = /** @type {!Elements.ElementsTreeElement} */ (treeElement); var node = elementsTreeElement.node(); if (!node.parentNode || node.parentNode.nodeType() !== Node.ELEMENT_NODE) @@ -766,19 +766,19 @@ _contextMenuEventFired(event) { var treeElement = this._treeElementFromEvent(event); - if (treeElement instanceof WebInspector.ElementsTreeElement) + if (treeElement instanceof Elements.ElementsTreeElement) this.showContextMenu(treeElement, event); } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement * @param {!Event} event */ showContextMenu(treeElement, event) { - if (WebInspector.isEditing()) + if (UI.isEditing()) return; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); var isPseudoElement = !!treeElement.node().pseudoType(); var isTag = treeElement.node().nodeType() === Node.ELEMENT_NODE && !isPseudoElement; var textNode = event.target.enclosingNodeOrSelfWithClass('webkit-html-text-node'); @@ -815,7 +815,7 @@ if (!treeElement) return; - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && node.parentNode) { + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(event) && node.parentNode) { if (event.key === 'ArrowUp' && node.previousSibling) { node.moveTo(node.parentNode, node.previousSibling, this.selectNodeAfterEdit.bind(this, treeElement.expanded)); event.handled = true; @@ -831,7 +831,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} startEditing * @param {function()=} callback */ @@ -850,7 +850,7 @@ treeElement.toggleEditAsHTML(editingFinished.bind(this), startEditing); /** - * @this {WebInspector.ElementsTreeOutline} + * @this {Elements.ElementsTreeOutline} * @param {boolean} success */ function editingFinished(success) { @@ -880,7 +880,7 @@ * @param {boolean} wasExpanded * @param {?Protocol.Error} error * @param {!Protocol.DOM.NodeId=} nodeId - * @return {?WebInspector.ElementsTreeElement} nodeId + * @return {?Elements.ElementsTreeElement} nodeId */ selectNodeAfterEdit(wasExpanded, error, nodeId) { if (error) @@ -909,8 +909,8 @@ * containing a rule to set "visibility: hidden" on the class and all it's * ancestors. * - * @param {!WebInspector.DOMNode} node - * @param {function(?WebInspector.RemoteObject, boolean=)=} userCallback + * @param {!SDK.DOMNode} node + * @param {function(?SDK.RemoteObject, boolean=)=} userCallback */ toggleHideElement(node, userCallback) { var pseudoType = node.pseudoType(); @@ -973,7 +973,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {boolean} */ isToggledToHidden(node) { @@ -985,56 +985,56 @@ this.selectDOMNode(null, false); this._popoverHelper.hidePopover(); delete this._clipboardNodeData; - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); this._updateRecords.clear(); } wireToDOMModel() { - this._domModel[WebInspector.ElementsTreeOutline._treeOutlineSymbol] = this; - this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeInserted, this._nodeInserted, this); - this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); - this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, this._attributeModified, this); - this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved, this._attributeRemoved, this); + this._domModel[Elements.ElementsTreeOutline._treeOutlineSymbol] = this; + this._domModel.addEventListener(SDK.DOMModel.Events.NodeInserted, this._nodeInserted, this); + this._domModel.addEventListener(SDK.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); + this._domModel.addEventListener(SDK.DOMModel.Events.AttrModified, this._attributeModified, this); + this._domModel.addEventListener(SDK.DOMModel.Events.AttrRemoved, this._attributeRemoved, this); this._domModel.addEventListener( - WebInspector.DOMModel.Events.CharacterDataModified, this._characterDataModified, this); - this._domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdated, this._documentUpdated, this); + SDK.DOMModel.Events.CharacterDataModified, this._characterDataModified, this); + this._domModel.addEventListener(SDK.DOMModel.Events.DocumentUpdated, this._documentUpdated, this); this._domModel.addEventListener( - WebInspector.DOMModel.Events.ChildNodeCountUpdated, this._childNodeCountUpdated, this); + SDK.DOMModel.Events.ChildNodeCountUpdated, this._childNodeCountUpdated, this); this._domModel.addEventListener( - WebInspector.DOMModel.Events.DistributedNodesChanged, this._distributedNodesChanged, this); + SDK.DOMModel.Events.DistributedNodesChanged, this._distributedNodesChanged, this); } unwireFromDOMModel() { - this._domModel.removeEventListener(WebInspector.DOMModel.Events.NodeInserted, this._nodeInserted, this); - this._domModel.removeEventListener(WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); - this._domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified, this._attributeModified, this); - this._domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved, this._attributeRemoved, this); + this._domModel.removeEventListener(SDK.DOMModel.Events.NodeInserted, this._nodeInserted, this); + this._domModel.removeEventListener(SDK.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); + this._domModel.removeEventListener(SDK.DOMModel.Events.AttrModified, this._attributeModified, this); + this._domModel.removeEventListener(SDK.DOMModel.Events.AttrRemoved, this._attributeRemoved, this); this._domModel.removeEventListener( - WebInspector.DOMModel.Events.CharacterDataModified, this._characterDataModified, this); - this._domModel.removeEventListener(WebInspector.DOMModel.Events.DocumentUpdated, this._documentUpdated, this); + SDK.DOMModel.Events.CharacterDataModified, this._characterDataModified, this); + this._domModel.removeEventListener(SDK.DOMModel.Events.DocumentUpdated, this._documentUpdated, this); this._domModel.removeEventListener( - WebInspector.DOMModel.Events.ChildNodeCountUpdated, this._childNodeCountUpdated, this); + SDK.DOMModel.Events.ChildNodeCountUpdated, this._childNodeCountUpdated, this); this._domModel.removeEventListener( - WebInspector.DOMModel.Events.DistributedNodesChanged, this._distributedNodesChanged, this); - delete this._domModel[WebInspector.ElementsTreeOutline._treeOutlineSymbol]; + SDK.DOMModel.Events.DistributedNodesChanged, this._distributedNodesChanged, this); + delete this._domModel[Elements.ElementsTreeOutline._treeOutlineSymbol]; } /** - * @param {!WebInspector.DOMNode} node - * @return {!WebInspector.ElementsTreeOutline.UpdateRecord} + * @param {!SDK.DOMNode} node + * @return {!Elements.ElementsTreeOutline.UpdateRecord} */ _addUpdateRecord(node) { var record = this._updateRecords.get(node); if (!record) { - record = new WebInspector.ElementsTreeOutline.UpdateRecord(); + record = new Elements.ElementsTreeOutline.UpdateRecord(); this._updateRecords.set(node, record); } return record; } /** - * @param {!WebInspector.DOMNode} node - * @return {?WebInspector.ElementsTreeOutline.UpdateRecord} + * @param {!SDK.DOMNode} node + * @return {?Elements.ElementsTreeOutline.UpdateRecord} */ _updateRecordForHighlight(node) { if (!this._visible) @@ -1043,7 +1043,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _documentUpdated(event) { var inspectedRootDocument = event.data; @@ -1057,28 +1057,28 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _attributeModified(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data.node); + var node = /** @type {!SDK.DOMNode} */ (event.data.node); this._addUpdateRecord(node).attributeModified(event.data.name); this._updateModifiedNodesSoon(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _attributeRemoved(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data.node); + var node = /** @type {!SDK.DOMNode} */ (event.data.node); this._addUpdateRecord(node).attributeRemoved(event.data.name); this._updateModifiedNodesSoon(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _characterDataModified(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); this._addUpdateRecord(node).charDataModified(); // Text could be large and force us to render itself as the child in the tree outline. if (node.parentNode && node.parentNode.firstChild === node.parentNode.lastChild) @@ -1087,39 +1087,39 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _nodeInserted(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); - this._addUpdateRecord(/** @type {!WebInspector.DOMNode} */ (node.parentNode)).nodeInserted(node); + var node = /** @type {!SDK.DOMNode} */ (event.data); + this._addUpdateRecord(/** @type {!SDK.DOMNode} */ (node.parentNode)).nodeInserted(node); this._updateModifiedNodesSoon(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _nodeRemoved(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data.node); - var parentNode = /** @type {!WebInspector.DOMNode} */ (event.data.parent); + var node = /** @type {!SDK.DOMNode} */ (event.data.node); + var parentNode = /** @type {!SDK.DOMNode} */ (event.data.parent); this.resetClipboardIfNeeded(node); this._addUpdateRecord(parentNode).nodeRemoved(node); this._updateModifiedNodesSoon(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _childNodeCountUpdated(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); this._addUpdateRecord(node).childrenModified(); this._updateModifiedNodesSoon(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _distributedNodesChanged(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); this._addUpdateRecord(node).childrenModified(); this._updateModifiedNodesSoon(); } @@ -1186,7 +1186,7 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement */ populateTreeElement(treeElement) { if (treeElement.childCount() || !treeElement.isExpandable()) @@ -1196,12 +1196,12 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean=} closingTag - * @return {!WebInspector.ElementsTreeElement} + * @return {!Elements.ElementsTreeElement} */ _createElementTreeElement(node, closingTag) { - var treeElement = new WebInspector.ElementsTreeElement(node, closingTag); + var treeElement = new Elements.ElementsTreeElement(node, closingTag); treeElement.setExpandable(!closingTag && this._hasVisibleChildren(node)); if (node.nodeType() === Node.ELEMENT_NODE && node.parentNode && node.parentNode.nodeType() === Node.DOCUMENT_NODE && !node.parentNode.parentNode) @@ -1211,9 +1211,9 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement - * @param {!WebInspector.DOMNode} child - * @return {?WebInspector.ElementsTreeElement} + * @param {!Elements.ElementsTreeElement} treeElement + * @param {!SDK.DOMNode} child + * @return {?Elements.ElementsTreeElement} */ _showChild(treeElement, child) { if (treeElement.isClosingTag()) @@ -1225,15 +1225,15 @@ if (index >= treeElement.expandedChildrenLimit()) this.setExpandedChildrenLimit(treeElement, index + 1); - return /** @type {!WebInspector.ElementsTreeElement} */ (treeElement.childAt(index)); + return /** @type {!Elements.ElementsTreeElement} */ (treeElement.childAt(index)); } /** - * @param {!WebInspector.DOMNode} node - * @return {!Array.<!WebInspector.DOMNode>} visibleChildren + * @param {!SDK.DOMNode} node + * @return {!Array.<!SDK.DOMNode>} visibleChildren */ _visibleChildren(node) { - var visibleChildren = WebInspector.ElementsTreeElement.visibleShadowRoots(node); + var visibleChildren = Elements.ElementsTreeElement.visibleShadowRoots(node); var importedDocument = node.importedDocument(); if (importedDocument) @@ -1262,7 +1262,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {boolean} */ _hasVisibleChildren(node) { @@ -1270,17 +1270,17 @@ return true; if (node.templateContent()) return true; - if (WebInspector.ElementsTreeElement.visibleShadowRoots(node).length) + if (Elements.ElementsTreeElement.visibleShadowRoots(node).length) return true; if (node.hasPseudoElements()) return true; if (node.isInsertionPoint()) return true; - return !!node.childNodeCount() && !WebInspector.ElementsTreeElement.canShowInlineText(node); + return !!node.childNodeCount() && !Elements.ElementsTreeElement.canShowInlineText(node); } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement */ _createExpandAllButtonTreeElement(treeElement) { var button = createTextButton('', handleLoadAllChildren.bind(this)); @@ -1292,7 +1292,7 @@ return expandAllButtonElement; /** - * @this {WebInspector.ElementsTreeOutline} + * @this {Elements.ElementsTreeOutline} * @param {!Event} event */ function handleLoadAllChildren(event) { @@ -1300,13 +1300,13 @@ this.setExpandedChildrenLimit( treeElement, Math.max( visibleChildCount, treeElement.expandedChildrenLimit() + - WebInspector.ElementsTreeElement.InitialChildrenLimit)); + Elements.ElementsTreeElement.InitialChildrenLimit)); event.consume(); } } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement * @param {number} expandedChildrenLimit */ setExpandedChildrenLimit(treeElement, expandedChildrenLimit) { @@ -1319,7 +1319,7 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement */ _updateChildren(treeElement) { if (!treeElement.isExpandable()) { @@ -1335,8 +1335,8 @@ treeElement.node().getChildNodes(childNodesLoaded.bind(this)); /** - * @param {?Array.<!WebInspector.DOMNode>} children - * @this {WebInspector.ElementsTreeOutline} + * @param {?Array.<!SDK.DOMNode>} children + * @this {Elements.ElementsTreeOutline} */ function childNodesLoaded(children) { // FIXME: sort this out, it should not happen. @@ -1347,11 +1347,11 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement - * @param {!WebInspector.DOMNode} child + * @param {!Elements.ElementsTreeElement} treeElement + * @param {!SDK.DOMNode} child * @param {number} index * @param {boolean=} closingTag - * @return {!WebInspector.ElementsTreeElement} + * @return {!Elements.ElementsTreeElement} */ insertChildElement(treeElement, child, index, closingTag) { var newElement = this._createElementTreeElement(child, closingTag); @@ -1360,8 +1360,8 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement - * @param {!WebInspector.ElementsTreeElement} child + * @param {!Elements.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} child * @param {number} targetIndex */ _moveChild(treeElement, child, targetIndex) { @@ -1376,7 +1376,7 @@ } /** - * @param {!WebInspector.ElementsTreeElement} treeElement + * @param {!Elements.ElementsTreeElement} treeElement */ _innerUpdateChildren(treeElement) { if (this._treeElementsBeingUpdated.has(treeElement)) @@ -1393,12 +1393,12 @@ var existingTreeElements = new Map(); for (var i = treeElement.childCount() - 1; i >= 0; --i) { var existingTreeElement = treeElement.childAt(i); - if (!(existingTreeElement instanceof WebInspector.ElementsTreeElement)) { + if (!(existingTreeElement instanceof Elements.ElementsTreeElement)) { // Remove expand all button and shadow host toolbar. treeElement.removeChildAtIndex(i); continue; } - var elementsTreeElement = /** @type {!WebInspector.ElementsTreeElement} */ (existingTreeElement); + var elementsTreeElement = /** @type {!Elements.ElementsTreeElement} */ (existingTreeElement); var existingNode = elementsTreeElement.node(); if (visibleChildrenSet.has(existingNode)) { @@ -1419,7 +1419,7 @@ // No existing element found, insert a new element. var newElement = this.insertChildElement(treeElement, child, i); if (this._updateRecordForHighlight(node) && treeElement.expanded) - WebInspector.ElementsTreeElement.animateOnDOMUpdate(newElement); + Elements.ElementsTreeElement.animateOnDOMUpdate(newElement); // If a node was inserted in the middle of existing list dynamically we might need to increase the limit. if (treeElement.childCount() > treeElement.expandedChildrenLimit()) this.setExpandedChildrenLimit(treeElement, treeElement.expandedChildrenLimit() + 1); @@ -1434,7 +1434,7 @@ treeElement.expandAllButtonElement = this._createExpandAllButtonTreeElement(treeElement); treeElement.insertChild(treeElement.expandAllButtonElement, targetButtonIndex); treeElement.expandAllButtonElement.button.textContent = - WebInspector.UIString('Show All Nodes (%d More)', visibleChildren.length - expandedChildCount); + Common.UIString('Show All Nodes (%d More)', visibleChildren.length - expandedChildCount); } else if (treeElement.expandAllButtonElement) { delete treeElement.expandAllButtonElement; } @@ -1442,7 +1442,7 @@ // Insert shortcuts to distrubuted children. if (node.isInsertionPoint()) { for (var distributedNode of node.distributedNodes()) - treeElement.appendChild(new WebInspector.ElementsTreeOutline.ShortcutTreeElement(distributedNode)); + treeElement.appendChild(new Elements.ElementsTreeOutline.ShortcutTreeElement(distributedNode)); } // Insert close tag. @@ -1453,24 +1453,24 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _markersChanged(event) { - var node = /** @type {!WebInspector.DOMNode} */ (event.data); + var node = /** @type {!SDK.DOMNode} */ (event.data); var treeElement = node[this._treeElementSymbol]; if (treeElement) treeElement.updateDecorations(); } }; -WebInspector.ElementsTreeOutline._treeOutlineSymbol = Symbol('treeOutline'); +Elements.ElementsTreeOutline._treeOutlineSymbol = Symbol('treeOutline'); -/** @typedef {{node: !WebInspector.DOMNode, isCut: boolean}} */ -WebInspector.ElementsTreeOutline.ClipboardData; +/** @typedef {{node: !SDK.DOMNode, isCut: boolean}} */ +Elements.ElementsTreeOutline.ClipboardData; /** @enum {symbol} */ -WebInspector.ElementsTreeOutline.Events = { +Elements.ElementsTreeOutline.Events = { SelectedNodeChanged: Symbol('SelectedNodeChanged'), ElementsTreeUpdated: Symbol('ElementsTreeUpdated') }; @@ -1479,7 +1479,7 @@ * @const * @type {!Object.<string, string>} */ -WebInspector.ElementsTreeOutline.MappedCharToEntity = { +Elements.ElementsTreeOutline.MappedCharToEntity = { '\u00a0': 'nbsp', '\u0093': '#147', // <control> '\u00ad': 'shy', @@ -1503,7 +1503,7 @@ /** * @unrestricted */ -WebInspector.ElementsTreeOutline.UpdateRecord = class { +Elements.ElementsTreeOutline.UpdateRecord = class { /** * @param {string} attrName */ @@ -1527,7 +1527,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ nodeInserted(node) { this._hasChangedChildren = true; @@ -1584,10 +1584,10 @@ }; /** - * @implements {WebInspector.Renderer} + * @implements {Common.Renderer} * @unrestricted */ -WebInspector.ElementsTreeOutline.Renderer = class { +Elements.ElementsTreeOutline.Renderer = class { /** * @override * @param {!Object} object @@ -1601,12 +1601,12 @@ * @param {function(!Error)} reject */ function renderPromise(resolve, reject) { - if (object instanceof WebInspector.DOMNode) { - onNodeResolved(/** @type {!WebInspector.DOMNode} */ (object)); - } else if (object instanceof WebInspector.DeferredDOMNode) { - (/** @type {!WebInspector.DeferredDOMNode} */ (object)).resolve(onNodeResolved); - } else if (object instanceof WebInspector.RemoteObject) { - var domModel = WebInspector.DOMModel.fromTarget((/** @type {!WebInspector.RemoteObject} */ (object)).target()); + if (object instanceof SDK.DOMNode) { + onNodeResolved(/** @type {!SDK.DOMNode} */ (object)); + } else if (object instanceof SDK.DeferredDOMNode) { + (/** @type {!SDK.DeferredDOMNode} */ (object)).resolve(onNodeResolved); + } else if (object instanceof SDK.RemoteObject) { + var domModel = SDK.DOMModel.fromTarget((/** @type {!SDK.RemoteObject} */ (object)).target()); if (domModel) domModel.pushObjectAsNodeToFrontend(object, onNodeResolved); else @@ -1616,14 +1616,14 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ function onNodeResolved(node) { if (!node) { reject(new Error('Could not resolve node.')); return; } - var treeOutline = new WebInspector.ElementsTreeOutline(node.domModel(), false, false); + var treeOutline = new Elements.ElementsTreeOutline(node.domModel(), false, false); treeOutline.rootDOMNode = node; if (!treeOutline.firstChild().isExpandable()) treeOutline._element.classList.add('single-node'); @@ -1638,9 +1638,9 @@ /** * @unrestricted */ -WebInspector.ElementsTreeOutline.ShortcutTreeElement = class extends TreeElement { +Elements.ElementsTreeOutline.ShortcutTreeElement = class extends TreeElement { /** - * @param {!WebInspector.DOMNodeShortcut} nodeShortcut + * @param {!SDK.DOMNodeShortcut} nodeShortcut */ constructor(nodeShortcut) { super(''); @@ -1651,10 +1651,10 @@ text = '<' + text + '>'; title.textContent = '\u21AA ' + text; - var link = WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference(nodeShortcut.deferredNode); + var link = Components.DOMPresentationUtils.linkifyDeferredNodeReference(nodeShortcut.deferredNode); this.listItemElement.createTextChild(' '); link.classList.add('elements-tree-shortcut-link'); - link.textContent = WebInspector.UIString('reveal'); + link.textContent = Common.UIString('reveal'); this.listItemElement.appendChild(link); this._nodeShortcut = nodeShortcut; } @@ -1694,8 +1694,8 @@ this._nodeShortcut.deferredNode.highlight(); this._nodeShortcut.deferredNode.resolve(resolved.bind(this)); /** - * @param {?WebInspector.DOMNode} node - * @this {WebInspector.ElementsTreeOutline.ShortcutTreeElement} + * @param {?SDK.DOMNode} node + * @this {Elements.ElementsTreeOutline.ShortcutTreeElement} */ function resolved(node) { if (node) {
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js index 397cd5b6..6fbe037 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
@@ -27,38 +27,38 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ToolbarItem.ItemsProvider} + * @implements {UI.ToolbarItem.ItemsProvider} * @unrestricted */ -WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget { +Elements.EventListenersWidget = class extends UI.ThrottledWidget { constructor() { super(); this.element.classList.add('events-pane'); this._toolbarItems = []; - this._showForAncestorsSetting = WebInspector.settings.moduleSetting('showEventListenersForAncestors'); + this._showForAncestorsSetting = Common.settings.moduleSetting('showEventListenersForAncestors'); this._showForAncestorsSetting.addChangeListener(this.update.bind(this)); - this._dispatchFilterBySetting = WebInspector.settings.createSetting( - 'eventListenerDispatchFilterType', WebInspector.EventListenersWidget.DispatchFilterBy.All); + this._dispatchFilterBySetting = Common.settings.createSetting( + 'eventListenerDispatchFilterType', Elements.EventListenersWidget.DispatchFilterBy.All); this._dispatchFilterBySetting.addChangeListener(this.update.bind(this)); - this._showFrameworkListenersSetting = WebInspector.settings.createSetting('showFrameowkrListeners', true); + this._showFrameworkListenersSetting = Common.settings.createSetting('showFrameowkrListeners', true); this._showFrameworkListenersSetting.addChangeListener(this._showFrameworkListenersChanged.bind(this)); - this._eventListenersView = new WebInspector.EventListenersView(this.element, this.update.bind(this)); + this._eventListenersView = new Components.EventListenersView(this.element, this.update.bind(this)); - var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + var refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); refreshButton.addEventListener('click', this.update.bind(this)); this._toolbarItems.push(refreshButton); - this._toolbarItems.push(new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Ancestors'), WebInspector.UIString('Show listeners on the ancestors'), + this._toolbarItems.push(new UI.ToolbarCheckbox( + Common.UIString('Ancestors'), Common.UIString('Show listeners on the ancestors'), this._showForAncestorsSetting)); - var dispatchFilter = new WebInspector.ToolbarComboBox(this._onDispatchFilterTypeChanged.bind(this)); + var dispatchFilter = new UI.ToolbarComboBox(this._onDispatchFilterTypeChanged.bind(this)); /** * @param {string} name * @param {string} value - * @this {WebInspector.EventListenersWidget} + * @this {Elements.EventListenersWidget} */ function addDispatchFilterOption(name, value) { var option = dispatchFilter.createOption(name, '', value); @@ -66,18 +66,18 @@ dispatchFilter.select(option); } addDispatchFilterOption.call( - this, WebInspector.UIString('All'), WebInspector.EventListenersWidget.DispatchFilterBy.All); + this, Common.UIString('All'), Elements.EventListenersWidget.DispatchFilterBy.All); addDispatchFilterOption.call( - this, WebInspector.UIString('Passive'), WebInspector.EventListenersWidget.DispatchFilterBy.Passive); + this, Common.UIString('Passive'), Elements.EventListenersWidget.DispatchFilterBy.Passive); addDispatchFilterOption.call( - this, WebInspector.UIString('Blocking'), WebInspector.EventListenersWidget.DispatchFilterBy.Blocking); + this, Common.UIString('Blocking'), Elements.EventListenersWidget.DispatchFilterBy.Blocking); dispatchFilter.setMaxWidth(200); this._toolbarItems.push(dispatchFilter); - this._toolbarItems.push(new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Framework listeners'), - WebInspector.UIString('Resolve event listeners bound with framework'), this._showFrameworkListenersSetting)); + this._toolbarItems.push(new UI.ToolbarCheckbox( + Common.UIString('Framework listeners'), + Common.UIString('Resolve event listeners bound with framework'), this._showFrameworkListenersSetting)); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this.update, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this.update, this); this.update(); } @@ -89,10 +89,10 @@ doUpdate() { if (this._lastRequestedNode) { this._lastRequestedNode.target().runtimeAgent().releaseObjectGroup( - WebInspector.EventListenersWidget._objectGroupName); + Elements.EventListenersWidget._objectGroupName); delete this._lastRequestedNode; } - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); if (!node) { this._eventListenersView.reset(); this._eventListenersView.addEmptyHolderIfNeeded(); @@ -102,11 +102,11 @@ var selectedNodeOnly = !this._showForAncestorsSetting.get(); var promises = []; var listenersView = this._eventListenersView; - promises.push(node.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName)); + promises.push(node.resolveToObjectPromise(Elements.EventListenersWidget._objectGroupName)); if (!selectedNodeOnly) { var currentNode = node.parentNode; while (currentNode) { - promises.push(currentNode.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName)); + promises.push(currentNode.resolveToObjectPromise(Elements.EventListenersWidget._objectGroupName)); currentNode = currentNode.parentNode; } promises.push(this._windowObjectInNodeContext(node)); @@ -118,7 +118,7 @@ /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ toolbarItems() { return this._toolbarItems; @@ -133,17 +133,17 @@ _showFrameworkListenersChanged() { var dispatchFilter = this._dispatchFilterBySetting.get(); - var showPassive = dispatchFilter === WebInspector.EventListenersWidget.DispatchFilterBy.All || - dispatchFilter === WebInspector.EventListenersWidget.DispatchFilterBy.Passive; - var showBlocking = dispatchFilter === WebInspector.EventListenersWidget.DispatchFilterBy.All || - dispatchFilter === WebInspector.EventListenersWidget.DispatchFilterBy.Blocking; + var showPassive = dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.All || + dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.Passive; + var showBlocking = dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.All || + dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.Blocking; this._eventListenersView.showFrameworkListeners( this._showFrameworkListenersSetting.get(), showPassive, showBlocking); } /** - * @param {!WebInspector.DOMNode} node - * @return {!Promise<!WebInspector.RemoteObject>} + * @param {!SDK.DOMNode} node + * @return {!Promise<!SDK.RemoteObject>} */ _windowObjectInNodeContext(node) { return new Promise(windowObjectInNodeContext); @@ -165,7 +165,7 @@ context = executionContexts[0]; } context.evaluate( - 'self', WebInspector.EventListenersWidget._objectGroupName, false, true, false, false, false, fulfill); + 'self', Elements.EventListenersWidget._objectGroupName, false, true, false, false, false, fulfill); } } @@ -173,10 +173,10 @@ } }; -WebInspector.EventListenersWidget.DispatchFilterBy = { +Elements.EventListenersWidget.DispatchFilterBy = { All: 'All', Blocking: 'Blocking', Passive: 'Passive' }; -WebInspector.EventListenersWidget._objectGroupName = 'event-listeners-panel'; +Elements.EventListenersWidget._objectGroupName = 'event-listeners-panel';
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/InspectElementModeController.js b/third_party/WebKit/Source/devtools/front_end/elements/InspectElementModeController.js index f9d3b2b..92a078d9 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/InspectElementModeController.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/InspectElementModeController.js
@@ -26,40 +26,40 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.InspectElementModeController = class { +Elements.InspectElementModeController = class { constructor() { - this._toggleSearchAction = WebInspector.actionRegistry.action('elements.toggle-element-search'); + this._toggleSearchAction = UI.actionRegistry.action('elements.toggle-element-search'); if (Runtime.experiments.isEnabled('layoutEditor')) { this._layoutEditorButton = - new WebInspector.ToolbarToggle(WebInspector.UIString('Toggle Layout Editor'), 'largeicon-layout-editor'); + new UI.ToolbarToggle(Common.UIString('Toggle Layout Editor'), 'largeicon-layout-editor'); this._layoutEditorButton.addEventListener('click', this._toggleLayoutEditor, this); } this._mode = Protocol.DOM.InspectMode.None; - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._suspendStateChanged, this); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.DOM); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._suspendStateChanged, this); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.DOM); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { // When DevTools are opening in the inspect element mode, the first target comes in // much later than the InspectorFrontendAPI.enterInspectElementMode event. if (this._mode === Protocol.DOM.InspectMode.None) return; - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); domModel.setInspectMode(this._mode); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } @@ -90,14 +90,14 @@ } _toggleInspectMode() { - if (WebInspector.targetManager.allTargetsSuspended()) + if (SDK.targetManager.allTargetsSuspended()) return; var mode; if (this.isInInspectElementMode()) mode = Protocol.DOM.InspectMode.None; else - mode = WebInspector.moduleSetting('showUAShadowDOM').get() ? Protocol.DOM.InspectMode.SearchForUAShadowDOM : + mode = Common.moduleSetting('showUAShadowDOM').get() ? Protocol.DOM.InspectMode.SearchForUAShadowDOM : Protocol.DOM.InspectMode.SearchForNode; this._setMode(mode); @@ -108,7 +108,7 @@ */ _setMode(mode) { this._mode = mode; - for (var domModel of WebInspector.DOMModel.instances()) + for (var domModel of SDK.DOMModel.instances()) domModel.setInspectMode(mode); if (this._layoutEditorButton) { @@ -121,7 +121,7 @@ } _suspendStateChanged() { - if (!WebInspector.targetManager.allTargetsSuspended()) + if (!SDK.targetManager.allTargetsSuspended()) return; this._mode = Protocol.DOM.InspectMode.None; @@ -132,41 +132,41 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.InspectElementModeController.ToggleSearchActionDelegate = class { +Elements.InspectElementModeController.ToggleSearchActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - if (!WebInspector.inspectElementModeController) + if (!Elements.inspectElementModeController) return false; - WebInspector.inspectElementModeController._toggleInspectMode(); + Elements.inspectElementModeController._toggleInspectMode(); return true; } }; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.InspectElementModeController.LayoutEditorButtonProvider = class { +Elements.InspectElementModeController.LayoutEditorButtonProvider = class { /** * @override - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item() { - if (!WebInspector.inspectElementModeController) + if (!Elements.inspectElementModeController) return null; - return WebInspector.inspectElementModeController._layoutEditorButton; + return Elements.inspectElementModeController._layoutEditorButton; } }; -/** @type {?WebInspector.InspectElementModeController} */ -WebInspector.inspectElementModeController = - Runtime.queryParam('isSharedWorker') ? null : new WebInspector.InspectElementModeController(); +/** @type {?Elements.InspectElementModeController} */ +Elements.inspectElementModeController = + Runtime.queryParam('isSharedWorker') ? null : new Elements.InspectElementModeController();
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js index 2d21ae62..ab5aab4d 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/MetricsSidebarPane.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -WebInspector.MetricsSidebarPane = class extends WebInspector.ElementsSidebarPane { +Elements.MetricsSidebarPane = class extends Elements.ElementsSidebarPane { constructor() { super(); } @@ -55,7 +55,7 @@ /** * @param {?Map.<string, string>} style - * @this {WebInspector.MetricsSidebarPane} + * @this {Elements.MetricsSidebarPane} */ function callback(style) { if (!style || this.node() !== node) @@ -63,8 +63,8 @@ this._updateMetrics(style); } /** - * @param {?WebInspector.CSSModel.InlineStyleResult} inlineStyleResult - * @this {WebInspector.MetricsSidebarPane} + * @param {?SDK.CSSModel.InlineStyleResult} inlineStyleResult + * @this {Elements.MetricsSidebarPane} */ function inlineStyleCallback(inlineStyleResult) { if (inlineStyleResult && this.node() === node) @@ -121,7 +121,7 @@ this.node().highlight(mode); } else { delete this._highlightMode; - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } for (var i = 0; this._boxElements && i < this._boxElements.length; ++i) { @@ -147,7 +147,7 @@ * @param {string} name * @param {string} side * @param {string} suffix - * @this {WebInspector.MetricsSidebarPane} + * @this {Elements.MetricsSidebarPane} */ function createBoxPartElement(style, name, side, suffix) { var propertyName = (name !== 'position' ? name + '-' : '') + side + suffix; @@ -224,13 +224,13 @@ var boxes = ['content', 'padding', 'border', 'margin', 'position']; var boxColors = [ - WebInspector.Color.PageHighlight.Content, WebInspector.Color.PageHighlight.Padding, - WebInspector.Color.PageHighlight.Border, WebInspector.Color.PageHighlight.Margin, - WebInspector.Color.fromRGBA([0, 0, 0, 0]) + Common.Color.PageHighlight.Content, Common.Color.PageHighlight.Padding, + Common.Color.PageHighlight.Border, Common.Color.PageHighlight.Margin, + Common.Color.fromRGBA([0, 0, 0, 0]) ]; var boxLabels = [ - WebInspector.UIString('content'), WebInspector.UIString('padding'), WebInspector.UIString('border'), - WebInspector.UIString('margin'), WebInspector.UIString('position') + Common.UIString('content'), Common.UIString('padding'), Common.UIString('border'), + Common.UIString('margin'), Common.UIString('position') ]; var previousBox = null; this._boxElements = []; @@ -246,7 +246,7 @@ var boxElement = createElement('div'); boxElement.className = name; - boxElement._backgroundColor = boxColors[i].asString(WebInspector.Color.Format.RGBA); + boxElement._backgroundColor = boxColors[i].asString(Common.Color.Format.RGBA); boxElement._name = name; boxElement.style.backgroundColor = boxElement._backgroundColor; boxElement.addEventListener( @@ -303,7 +303,7 @@ * @param {!Map.<string, string>} computedStyle */ startEditing(targetElement, box, styleProperty, computedStyle) { - if (WebInspector.isBeingEdited(targetElement)) + if (UI.isBeingEdited(targetElement)) return; var context = {box: box, styleProperty: styleProperty, computedStyle: computedStyle}; @@ -313,9 +313,9 @@ this._isEditingMetrics = true; - var config = new WebInspector.InplaceEditor.Config( + var config = new UI.InplaceEditor.Config( this._editingCommitted.bind(this), this.editingCancelled.bind(this), context); - WebInspector.InplaceEditor.startEditing(targetElement, config); + UI.InplaceEditor.startEditing(targetElement, config); targetElement.getComponentSelection().setBaseAndExtent(targetElement, 0, targetElement, 1); } @@ -326,7 +326,7 @@ /** * @param {string} originalValue * @param {string} replacementString - * @this {WebInspector.MetricsSidebarPane} + * @this {Elements.MetricsSidebarPane} */ function finishHandler(originalValue, replacementString) { this._applyUserInput(element, replacementString, originalValue, context, false); @@ -344,7 +344,7 @@ return prefix + number + suffix; } - WebInspector.handleElementValueModifications( + UI.handleElementValueModifications( event, element, finishHandler.bind(this), undefined, customNumberHandler); } @@ -394,7 +394,7 @@ if (computedStyle.get('box-sizing') === 'border-box' && (styleProperty === 'width' || styleProperty === 'height')) { if (!userInput.match(/px$/)) { - WebInspector.console.error( + Common.console.error( 'For elements with box-sizing: border-box, only absolute content area dimensions can be applied'); return; } @@ -429,7 +429,7 @@ /** * @param {boolean} success - * @this {WebInspector.MetricsSidebarPane} + * @this {Elements.MetricsSidebarPane} */ function callback(success) { if (!success)
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/PlatformFontsWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/PlatformFontsWidget.js index 0fccd648..b50738b 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/PlatformFontsWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/PlatformFontsWidget.js
@@ -31,21 +31,21 @@ /** * @unrestricted */ -WebInspector.PlatformFontsWidget = class extends WebInspector.ThrottledWidget { +Elements.PlatformFontsWidget = class extends UI.ThrottledWidget { /** - * @param {!WebInspector.ComputedStyleModel} sharedModel + * @param {!Elements.ComputedStyleModel} sharedModel */ constructor(sharedModel) { super(true); this.registerRequiredCSS('elements/platformFontsWidget.css'); this._sharedModel = sharedModel; - this._sharedModel.addEventListener(WebInspector.ComputedStyleModel.Events.ComputedStyleChanged, this.update, this); + this._sharedModel.addEventListener(Elements.ComputedStyleModel.Events.ComputedStyleChanged, this.update, this); this._sectionTitle = createElementWithClass('div', 'title'); this.contentElement.classList.add('platform-fonts'); this.contentElement.appendChild(this._sectionTitle); - this._sectionTitle.textContent = WebInspector.UIString('Rendered Fonts'); + this._sectionTitle.textContent = Common.UIString('Rendered Fonts'); this._fontStatsSection = this.contentElement.createChild('div', 'stats-section'); } @@ -64,7 +64,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {?Array.<!Protocol.CSS.PlatformFontUsage>} platformFonts */ _refreshUI(node, platformFonts) { @@ -91,13 +91,13 @@ fontDelimeterElement.textContent = '\u2014'; var fontOrigin = fontStatElement.createChild('span'); - fontOrigin.textContent = platformFonts[i].isCustomFont ? WebInspector.UIString('Network resource') : - WebInspector.UIString('Local file'); + fontOrigin.textContent = platformFonts[i].isCustomFont ? Common.UIString('Network resource') : + Common.UIString('Local file'); var fontUsageElement = fontStatElement.createChild('span', 'font-usage'); var usage = platformFonts[i].glyphCount; fontUsageElement.textContent = - usage === 1 ? WebInspector.UIString('(%d glyph)', usage) : WebInspector.UIString('(%d glyphs)', usage); + usage === 1 ? Common.UIString('(%d glyph)', usage) : Common.UIString('(%d glyphs)', usage); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js index 5f241e2..abc6b23 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js
@@ -30,28 +30,28 @@ /** * @unrestricted */ -WebInspector.PropertiesWidget = class extends WebInspector.ThrottledWidget { +Elements.PropertiesWidget = class extends UI.ThrottledWidget { constructor() { super(); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrModified, this._onNodeChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.AttrRemoved, this._onNodeChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._setNode, this); - this._node = WebInspector.context.flavor(WebInspector.DOMNode); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrModified, this._onNodeChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.AttrRemoved, this._onNodeChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.ChildNodeCountUpdated, this._onNodeChange, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._setNode, this); + this._node = UI.context.flavor(SDK.DOMNode); this.update(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _setNode(event) { - this._node = /** @type {?WebInspector.DOMNode} */ (event.data); + this._node = /** @type {?SDK.DOMNode} */ (event.data); this.update(); } @@ -63,7 +63,7 @@ doUpdate() { if (this._lastRequestedNode) { this._lastRequestedNode.target().runtimeAgent().releaseObjectGroup( - WebInspector.PropertiesWidget._objectGroupName); + Elements.PropertiesWidget._objectGroupName); delete this._lastRequestedNode; } @@ -74,12 +74,12 @@ } this._lastRequestedNode = this._node; - return this._node.resolveToObjectPromise(WebInspector.PropertiesWidget._objectGroupName) + return this._node.resolveToObjectPromise(Elements.PropertiesWidget._objectGroupName) .then(nodeResolved.bind(this)); /** - * @param {?WebInspector.RemoteObject} object - * @this {WebInspector.PropertiesWidget} + * @param {?SDK.RemoteObject} object + * @this {Elements.PropertiesWidget} */ function nodeResolved(object) { if (!object) @@ -105,8 +105,8 @@ } /** - * @param {!{object: ?WebInspector.RemoteObject, wasThrown: (boolean|undefined)}} result - * @this {WebInspector.PropertiesWidget} + * @param {!{object: ?SDK.RemoteObject, wasThrown: (boolean|undefined)}} result + * @this {Elements.PropertiesWidget} */ function nodePrototypesReady(result) { if (!result.object || result.wasThrown) @@ -118,8 +118,8 @@ } /** - * @param {!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}} result - * @this {WebInspector.PropertiesWidget} + * @param {!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}} result + * @this {Elements.PropertiesWidget} */ function fillSection(result) { if (!result || !result.properties) @@ -141,7 +141,7 @@ var property = properties[i].value; var title = property.description; title = title.replace(/Prototype$/, ''); - var section = new WebInspector.ObjectPropertiesSection(property, title); + var section = new Components.ObjectPropertiesSection(property, title); section.element.classList.add('properties-widget-section'); this.sections.push(section); this.element.appendChild(section.element); @@ -153,27 +153,27 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _propertyExpanded(event) { - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.DOMPropertiesExpanded); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.DOMPropertiesExpanded); for (var section of this.sections) { section.removeEventListener(TreeOutline.Events.ElementExpanded, this._propertyExpanded, this); } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onNodeChange(event) { if (!this._node) return; var data = event.data; - var node = /** @type {!WebInspector.DOMNode} */ (data instanceof WebInspector.DOMNode ? data : data.node); + var node = /** @type {!SDK.DOMNode} */ (data instanceof SDK.DOMNode ? data : data.node); if (this._node !== node) return; this.update(); } }; -WebInspector.PropertiesWidget._objectGroupName = 'properties-sidebar-pane'; +Elements.PropertiesWidget._objectGroupName = 'properties-sidebar-pane';
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/PropertyChangeHighlighter.js b/third_party/WebKit/Source/devtools/front_end/elements/PropertyChangeHighlighter.js index 98f04ac..fb665c2 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/PropertyChangeHighlighter.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/PropertyChangeHighlighter.js
@@ -4,12 +4,12 @@ /** * @unrestricted */ -WebInspector.PropertyChangeHighlighter = class { +Elements.PropertyChangeHighlighter = class { /** - * @param {!WebInspector.StylesSidebarPane} ssp - * @param {!WebInspector.CSSModel} cssModel + * @param {!Elements.StylesSidebarPane} ssp + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range */ constructor(ssp, cssModel, styleSheetId, range) { this._styleSidebarPane = ssp; @@ -80,8 +80,8 @@ /** * - * @param {!WebInspector.TextRange} outterRange - * @param {!WebInspector.TextRange} innerRange + * @param {!Common.TextRange} outterRange + * @param {!Common.TextRange} innerRange * @return {boolean} */ _checkRanges(outterRange, innerRange) { @@ -98,10 +98,10 @@ /** * @unrestricted */ -WebInspector.PropertyRevealHighlighter = class { +Elements.PropertyRevealHighlighter = class { /** - * @param {!WebInspector.StylesSidebarPane} ssp - * @param {!WebInspector.CSSProperty} cssProperty + * @param {!Elements.StylesSidebarPane} ssp + * @param {!SDK.CSSProperty} cssProperty */ constructor(ssp, cssProperty) { this._styleSidebarPane = ssp;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js index 337972b..5355cf2b 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -30,46 +30,46 @@ /** * @unrestricted */ -WebInspector.StylesSidebarPane = class extends WebInspector.ElementsSidebarPane { +Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane { constructor() { super(); this.setMinimumSize(96, 26); - WebInspector.moduleSetting('colorFormat').addChangeListener(this.update.bind(this)); - WebInspector.moduleSetting('textEditorIndent').addChangeListener(this.update.bind(this)); + Common.moduleSetting('colorFormat').addChangeListener(this.update.bind(this)); + Common.moduleSetting('textEditorIndent').addChangeListener(this.update.bind(this)); this._sectionsContainer = this.element.createChild('div'); - this._swatchPopoverHelper = new WebInspector.SwatchPopoverHelper(); - this._linkifier = new WebInspector.Linkifier(WebInspector.StylesSidebarPane._maxLinkLength, /* useLinkDecorator */ true); + this._swatchPopoverHelper = new UI.SwatchPopoverHelper(); + this._linkifier = new Components.Linkifier(Elements.StylesSidebarPane._maxLinkLength, /* useLinkDecorator */ true); this.element.classList.add('styles-pane'); - /** @type {!Array<!WebInspector.SectionBlock>} */ + /** @type {!Array<!Elements.SectionBlock>} */ this._sectionBlocks = []; - WebInspector.StylesSidebarPane._instance = this; + Elements.StylesSidebarPane._instance = this; - WebInspector.targetManager.addModelListener( - WebInspector.CSSModel, WebInspector.CSSModel.Events.LayoutEditorChange, this._onLayoutEditorChange, this); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this.forceUpdate, this); + SDK.targetManager.addModelListener( + SDK.CSSModel, SDK.CSSModel.Events.LayoutEditorChange, this._onLayoutEditorChange, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); } /** - * @param {!WebInspector.CSSProperty} property + * @param {!SDK.CSSProperty} property * @return {!Element} */ static createExclamationMark(property) { var exclamationElement = createElement('label', 'dt-icon-label'); exclamationElement.className = 'exclamation-mark'; - if (!WebInspector.StylesSidebarPane.ignoreErrorsForProperty(property)) + if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property)) exclamationElement.type = 'smallicon-warning'; - exclamationElement.title = WebInspector.cssMetadata().isCSSPropertyName(property.name) ? - WebInspector.UIString('Invalid property value') : - WebInspector.UIString('Unknown property name'); + exclamationElement.title = SDK.cssMetadata().isCSSPropertyName(property.name) ? + Common.UIString('Invalid property value') : + Common.UIString('Unknown property name'); return exclamationElement; } /** - * @param {!WebInspector.CSSProperty} property + * @param {!SDK.CSSProperty} property * @return {boolean} */ static ignoreErrorsForProperty(property) { @@ -151,22 +151,22 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onLayoutEditorChange(event) { - var cssModel = /** @type {!WebInspector.CSSModel} */ (event.target); + var cssModel = /** @type {!SDK.CSSModel} */ (event.target); var styleSheetId = event.data['id']; var sourceRange = /** @type {!Protocol.CSS.SourceRange} */ (event.data['range']); - var range = WebInspector.TextRange.fromObject(sourceRange); - this._decorator = new WebInspector.PropertyChangeHighlighter(this, cssModel, styleSheetId, range); + var range = Common.TextRange.fromObject(sourceRange); + this._decorator = new Elements.PropertyChangeHighlighter(this, cssModel, styleSheetId, range); this.update(); } /** - * @param {!WebInspector.CSSProperty} cssProperty + * @param {!SDK.CSSProperty} cssProperty */ revealProperty(cssProperty) { - this._decorator = new WebInspector.PropertyRevealHighlighter(this, cssProperty); + this._decorator = new Elements.PropertyRevealHighlighter(this, cssProperty); this._decorator.perform(); this.update(); } @@ -191,12 +191,12 @@ for (var i = 0; i < headers.length; ++i) { var header = headers[i]; var handler = this._createNewRuleInStyleSheet.bind(this, header); - contextMenuDescriptors.push({text: WebInspector.displayNameForURL(header.resourceURL()), handler: handler}); + contextMenuDescriptors.push({text: Bindings.displayNameForURL(header.resourceURL()), handler: handler}); } contextMenuDescriptors.sort(compareDescriptors); - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); for (var i = 0; i < contextMenuDescriptors.length; ++i) { var descriptor = contextMenuDescriptors[i]; contextMenu.appendItem(descriptor.text, descriptor.handler); @@ -216,7 +216,7 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @return {boolean} */ function styleSheetResourceHeader(header) { @@ -233,7 +233,7 @@ } /** - * @param {!WebInspector.StylePropertiesSection=} editedSection + * @param {!Elements.StylePropertiesSection=} editedSection */ _refreshUpdate(editedSection) { var node = this.node(); @@ -266,19 +266,19 @@ } /** - * @return {!Promise.<?WebInspector.CSSMatchedStyles>} + * @return {!Promise.<?SDK.CSSMatchedStyles>} */ _fetchMatchedCascade() { var node = this.node(); if (!node || !this.cssModel()) - return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */ (null)); + return Promise.resolve(/** @type {?SDK.CSSMatchedStyles} */ (null)); return this.cssModel().cachedMatchedCascadeForNode(node).then(validateStyles.bind(this)); /** - * @param {?WebInspector.CSSMatchedStyles} matchedStyles - * @return {?WebInspector.CSSMatchedStyles} - * @this {WebInspector.StylesSidebarPane} + * @param {?SDK.CSSMatchedStyles} matchedStyles + * @return {?SDK.CSSMatchedStyles} + * @this {Elements.StylesSidebarPane} */ function validateStyles(matchedStyles) { return matchedStyles && matchedStyles.node() === this.node() ? matchedStyles : null; @@ -297,10 +297,10 @@ /** * @override - * @param {!WebInspector.Event=} event + * @param {!Common.Event=} event */ onCSSModelChanged(event) { - var edit = event && event.data ? /** @type {?WebInspector.CSSModel.Edit} */ (event.data.edit) : null; + var edit = event && event.data ? /** @type {?SDK.CSSModel.Edit} */ (event.data.edit) : null; if (edit) { for (var section of this.allSections()) section._styleSheetEdited(edit); @@ -315,7 +315,7 @@ } /** - * @param {?WebInspector.CSSMatchedStyles} matchedStyles + * @param {?SDK.CSSMatchedStyles} matchedStyles */ _innerRebuildUpdate(matchedStyles) { this._linkifier.reset(); @@ -333,20 +333,20 @@ pseudoTypes.push(Protocol.DOM.PseudoType.Before); pseudoTypes = pseudoTypes.concat(keys.valuesArray().sort()); for (var pseudoType of pseudoTypes) { - var block = WebInspector.SectionBlock.createPseudoTypeBlock(pseudoType); + var block = Elements.SectionBlock.createPseudoTypeBlock(pseudoType); var styles = - /** @type {!Array<!WebInspector.CSSStyleDeclaration>} */ (matchedStyles.pseudoStyles().get(pseudoType)); + /** @type {!Array<!SDK.CSSStyleDeclaration>} */ (matchedStyles.pseudoStyles().get(pseudoType)); for (var style of styles) { - var section = new WebInspector.StylePropertiesSection(this, matchedStyles, style); + var section = new Elements.StylePropertiesSection(this, matchedStyles, style); block.sections.push(section); } this._sectionBlocks.push(block); } for (var keyframesRule of matchedStyles.keyframes()) { - var block = WebInspector.SectionBlock.createKeyframesBlock(keyframesRule.name().text); + var block = Elements.SectionBlock.createKeyframesBlock(keyframesRule.name().text); for (var keyframe of keyframesRule.keyframes()) - block.sections.push(new WebInspector.KeyframePropertiesSection(this, matchedStyles, keyframe.style)); + block.sections.push(new Elements.KeyframePropertiesSection(this, matchedStyles, keyframe.style)); this._sectionBlocks.push(block); } @@ -369,7 +369,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {boolean} rebuild */ _nodeStylesUpdatedForTest(node, rebuild) { @@ -377,21 +377,21 @@ } /** - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @return {!Array.<!WebInspector.SectionBlock>} + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @return {!Array.<!Elements.SectionBlock>} */ _rebuildSectionsForMatchedStyleRules(matchedStyles) { - var blocks = [new WebInspector.SectionBlock(null)]; + var blocks = [new Elements.SectionBlock(null)]; var lastParentNode = null; for (var style of matchedStyles.nodeStyles()) { var parentNode = matchedStyles.isInherited(style) ? matchedStyles.nodeForStyle(style) : null; if (parentNode && parentNode !== lastParentNode) { lastParentNode = parentNode; - var block = WebInspector.SectionBlock.createInheritedNodeBlock(lastParentNode); + var block = Elements.SectionBlock.createInheritedNodeBlock(lastParentNode); blocks.push(block); } - var section = new WebInspector.StylePropertiesSection(this, matchedStyles, style); + var section = new Elements.StylePropertiesSection(this, matchedStyles, style); blocks.peekLast().sections.push(section); } return blocks; @@ -406,8 +406,8 @@ cssModel.requestViaInspectorStylesheet(node, onViaInspectorStyleSheet.bind(this)); /** - * @param {?WebInspector.CSSStyleSheetHeader} styleSheetHeader - * @this {WebInspector.StylesSidebarPane} + * @param {?SDK.CSSStyleSheetHeader} styleSheetHeader + * @this {Elements.StylesSidebarPane} */ function onViaInspectorStyleSheet(styleSheetHeader) { delete this._userOperation; @@ -416,7 +416,7 @@ } /** - * @param {?WebInspector.CSSStyleSheetHeader} styleSheetHeader + * @param {?SDK.CSSStyleSheetHeader} styleSheetHeader */ _createNewRuleInStyleSheet(styleSheetHeader) { if (!styleSheetHeader) @@ -426,25 +426,25 @@ /** * @param {string} styleSheetId * @param {?string} text - * @this {WebInspector.StylesSidebarPane} + * @this {Elements.StylesSidebarPane} */ function onStyleSheetContent(styleSheetId, text) { text = text || ''; var lines = text.split('\n'); - var range = WebInspector.TextRange.createFromLocation(lines.length - 1, lines[lines.length - 1].length); + var range = Common.TextRange.createFromLocation(lines.length - 1, lines[lines.length - 1].length); this._addBlankSection(this._sectionBlocks[0].sections[0], styleSheetId, range); } } /** - * @param {!WebInspector.StylePropertiesSection} insertAfterSection + * @param {!Elements.StylePropertiesSection} insertAfterSection * @param {string} styleSheetId - * @param {!WebInspector.TextRange} ruleLocation + * @param {!Common.TextRange} ruleLocation */ _addBlankSection(insertAfterSection, styleSheetId, ruleLocation) { var node = this.node(); - var blankSection = new WebInspector.BlankStylePropertiesSection( - this, insertAfterSection._matchedStyles, node ? WebInspector.DOMPresentationUtils.simpleSelector(node) : '', + var blankSection = new Elements.BlankStylePropertiesSection( + this, insertAfterSection._matchedStyles, node ? Components.DOMPresentationUtils.simpleSelector(node) : '', styleSheetId, ruleLocation, insertAfterSection._style); this._sectionsContainer.insertBefore(blankSection.element, insertAfterSection.element.nextSibling); @@ -459,7 +459,7 @@ } /** - * @param {!WebInspector.StylePropertiesSection} section + * @param {!Elements.StylePropertiesSection} section */ removeSection(section) { for (var block of this._sectionBlocks) { @@ -492,7 +492,7 @@ } /** - * @return {!Array<!WebInspector.StylePropertiesSection>} + * @return {!Array<!Elements.StylePropertiesSection>} */ allSections() { var sections = []; @@ -502,12 +502,12 @@ } }; -WebInspector.StylesSidebarPane._maxLinkLength = 30; +Elements.StylesSidebarPane._maxLinkLength = 30; /** * @unrestricted */ -WebInspector.SectionBlock = class { +Elements.SectionBlock = class { /** * @param {?Element} titleElement */ @@ -518,37 +518,37 @@ /** * @param {!Protocol.DOM.PseudoType} pseudoType - * @return {!WebInspector.SectionBlock} + * @return {!Elements.SectionBlock} */ static createPseudoTypeBlock(pseudoType) { var separatorElement = createElement('div'); separatorElement.className = 'sidebar-separator'; - separatorElement.textContent = WebInspector.UIString('Pseudo ::%s element', pseudoType); - return new WebInspector.SectionBlock(separatorElement); + separatorElement.textContent = Common.UIString('Pseudo ::%s element', pseudoType); + return new Elements.SectionBlock(separatorElement); } /** * @param {string} keyframesName - * @return {!WebInspector.SectionBlock} + * @return {!Elements.SectionBlock} */ static createKeyframesBlock(keyframesName) { var separatorElement = createElement('div'); separatorElement.className = 'sidebar-separator'; - separatorElement.textContent = WebInspector.UIString('@keyframes ' + keyframesName); - return new WebInspector.SectionBlock(separatorElement); + separatorElement.textContent = Common.UIString('@keyframes ' + keyframesName); + return new Elements.SectionBlock(separatorElement); } /** - * @param {!WebInspector.DOMNode} node - * @return {!WebInspector.SectionBlock} + * @param {!SDK.DOMNode} node + * @return {!Elements.SectionBlock} */ static createInheritedNodeBlock(node) { var separatorElement = createElement('div'); separatorElement.className = 'sidebar-separator'; - var link = WebInspector.DOMPresentationUtils.linkifyNodeReference(node); - separatorElement.createTextChild(WebInspector.UIString('Inherited from') + ' '); + var link = Components.DOMPresentationUtils.linkifyNodeReference(node); + separatorElement.createTextChild(Common.UIString('Inherited from') + ' '); separatorElement.appendChild(link); - return new WebInspector.SectionBlock(separatorElement); + return new Elements.SectionBlock(separatorElement); } updateFilter() { @@ -571,11 +571,11 @@ /** * @unrestricted */ -WebInspector.StylePropertiesSection = class { +Elements.StylePropertiesSection = class { /** - * @param {!WebInspector.StylesSidebarPane} parentPane - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @param {!WebInspector.CSSStyleDeclaration} style + * @param {!Elements.StylesSidebarPane} parentPane + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @param {!SDK.CSSStyleDeclaration} style */ constructor(parentPane, matchedStyles, style) { this._parentPane = parentPane; @@ -624,7 +624,7 @@ if (rule.isUserAgent() || rule.isInjected()) { this.editable = false; } else { - // Check this is a real CSSRule, not a bogus object coming from WebInspector.BlankStylePropertiesSection. + // Check this is a real CSSRule, not a bogus object coming from Elements.BlankStylePropertiesSection. if (rule.styleSheetId) this.navigable = !!rule.resourceURL(); } @@ -651,9 +651,9 @@ } /** - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @param {!WebInspector.Linkifier} linkifier - * @param {?WebInspector.CSSRule} rule + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @param {!Components.Linkifier} linkifier + * @param {?SDK.CSSRule} rule * @return {!Node} */ static createRuleOriginNode(matchedStyles, linkifier, rule) { @@ -661,28 +661,28 @@ return createTextNode(''); var ruleLocation; - if (rule instanceof WebInspector.CSSStyleRule) { + if (rule instanceof SDK.CSSStyleRule) { var matchingSelectors = matchedStyles.matchingSelectors(rule); var firstMatchingIndex = matchingSelectors.length ? matchingSelectors[0] : 0; ruleLocation = rule.selectors[firstMatchingIndex].range; - } else if (rule instanceof WebInspector.CSSKeyframeRule) { + } else if (rule instanceof SDK.CSSKeyframeRule) { ruleLocation = rule.key().range; } var header = rule.styleSheetId ? matchedStyles.cssModel().styleSheetHeaderForId(rule.styleSheetId) : null; if (ruleLocation && rule.styleSheetId && header && header.resourceURL()) - return WebInspector.StylePropertiesSection._linkifyRuleLocation( + return Elements.StylePropertiesSection._linkifyRuleLocation( matchedStyles.cssModel(), linkifier, rule.styleSheetId, ruleLocation); if (rule.isUserAgent()) - return createTextNode(WebInspector.UIString('user agent stylesheet')); + return createTextNode(Common.UIString('user agent stylesheet')); if (rule.isInjected()) - return createTextNode(WebInspector.UIString('injected stylesheet')); + return createTextNode(Common.UIString('injected stylesheet')); if (rule.isViaInspector()) - return createTextNode(WebInspector.UIString('via inspector')); + return createTextNode(Common.UIString('via inspector')); if (header && header.ownerNode) { - var link = WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference(header.ownerNode); + var link = Components.DOMPresentationUtils.linkifyDeferredNodeReference(header.ownerNode); link.textContent = '<style>…</style>'; return link; } @@ -691,17 +691,17 @@ } /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.CSSModel} cssModel + * @param {!Components.Linkifier} linkifier * @param {string} styleSheetId - * @param {!WebInspector.TextRange} ruleLocation + * @param {!Common.TextRange} ruleLocation * @return {!Node} */ static _linkifyRuleLocation(cssModel, linkifier, styleSheetId, ruleLocation) { var styleSheetHeader = cssModel.styleSheetHeaderForId(styleSheetId); var lineNumber = styleSheetHeader.lineNumberInSource(ruleLocation.startLine); var columnNumber = styleSheetHeader.columnNumberInSource(ruleLocation.startLine, ruleLocation.startColumn); - var matchingSelectorLocation = new WebInspector.CSSLocation(styleSheetHeader, lineNumber, columnNumber); + var matchingSelectorLocation = new SDK.CSSLocation(styleSheetHeader, lineNumber, columnNumber); return linkifier.linkifyCSSLocation(matchingSelectorLocation); } @@ -721,7 +721,7 @@ * @param {!Event} event */ _onMouseMove(event) { - var hasCtrlOrMeta = WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)); + var hasCtrlOrMeta = UI.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)); this._setSectionHovered(hasCtrlOrMeta); } @@ -734,47 +734,47 @@ var items = []; var textShadowButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Add text-shadow'), 'largeicon-text-shadow'); + new UI.ToolbarButton(Common.UIString('Add text-shadow'), 'largeicon-text-shadow'); textShadowButton.addEventListener('click', this._onInsertShadowPropertyClick.bind(this, 'text-shadow')); items.push(textShadowButton); var boxShadowButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Add box-shadow'), 'largeicon-box-shadow'); + new UI.ToolbarButton(Common.UIString('Add box-shadow'), 'largeicon-box-shadow'); boxShadowButton.addEventListener('click', this._onInsertShadowPropertyClick.bind(this, 'box-shadow')); items.push(boxShadowButton); var colorButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Add color'), 'largeicon-foreground-color'); + new UI.ToolbarButton(Common.UIString('Add color'), 'largeicon-foreground-color'); colorButton.addEventListener('click', this._onInsertColorPropertyClick.bind(this)); items.push(colorButton); var backgroundButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Add background-color'), 'largeicon-background-color'); + new UI.ToolbarButton(Common.UIString('Add background-color'), 'largeicon-background-color'); backgroundButton.addEventListener('click', this._onInsertBackgroundColorPropertyClick.bind(this)); items.push(backgroundButton); var newRuleButton = null; if (this._style.parentRule) { newRuleButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Insert Style Rule Below'), 'largeicon-add'); + new UI.ToolbarButton(Common.UIString('Insert Style Rule Below'), 'largeicon-add'); newRuleButton.addEventListener('click', this._onNewRuleClick.bind(this)); items.push(newRuleButton); } - var sectionToolbar = new WebInspector.Toolbar('sidebar-pane-section-toolbar', container); + var sectionToolbar = new UI.Toolbar('sidebar-pane-section-toolbar', container); for (var i = 0; i < items.length; ++i) sectionToolbar.appendToolbarItem(items[i]); - var menuButton = new WebInspector.ToolbarButton(WebInspector.UIString('More tools\u2026'), 'largeicon-menu'); + var menuButton = new UI.ToolbarButton(Common.UIString('More tools\u2026'), 'largeicon-menu'); sectionToolbar.appendToolbarItem(menuButton); setItemsVisibility.call(this, items, false); sectionToolbar.element.addEventListener('mouseenter', setItemsVisibility.bind(this, items, true)); sectionToolbar.element.addEventListener('mouseleave', setItemsVisibility.bind(this, items, false)); /** - * @param {!Array<!WebInspector.ToolbarButton>} items + * @param {!Array<!UI.ToolbarButton>} items * @param {boolean} value - * @this {WebInspector.StylePropertiesSection} + * @this {Elements.StylePropertiesSection} */ function setItemsVisibility(items, value) { for (var i = 0; i < items.length; ++i) @@ -798,7 +798,7 @@ } /** - * @return {!WebInspector.CSSStyleDeclaration} + * @return {!SDK.CSSStyleDeclaration} */ style() { return this._style; @@ -809,17 +809,17 @@ */ _headerText() { var node = this._matchedStyles.nodeForStyle(this._style); - if (this._style.type === WebInspector.CSSStyleDeclaration.Type.Inline) - return this._matchedStyles.isInherited(this._style) ? WebInspector.UIString('Style Attribute') : 'element.style'; - if (this._style.type === WebInspector.CSSStyleDeclaration.Type.Attributes) - return node.nodeNameInCorrectCase() + '[' + WebInspector.UIString('Attributes Style') + ']'; + if (this._style.type === SDK.CSSStyleDeclaration.Type.Inline) + return this._matchedStyles.isInherited(this._style) ? Common.UIString('Style Attribute') : 'element.style'; + if (this._style.type === SDK.CSSStyleDeclaration.Type.Attributes) + return node.nodeNameInCorrectCase() + '[' + Common.UIString('Attributes Style') + ']'; return this._style.parentRule.selectorText(); } _onMouseOutSelector() { if (this._hoverTimer) clearTimeout(this._hoverTimer); - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } _onMouseEnterSelector() { @@ -829,7 +829,7 @@ } _highlight() { - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); var node = this._parentPane.node(); var domModel = node.domModel(); var selectors = this._style.parentRule ? this._style.parentRule.selectorText() : undefined; @@ -837,7 +837,7 @@ } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ firstSibling() { var parent = this.element.parentElement; @@ -855,7 +855,7 @@ } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ lastSibling() { var parent = this.element.parentElement; @@ -873,7 +873,7 @@ } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ nextSibling() { var curElement = this.element; @@ -885,7 +885,7 @@ } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ previousSibling() { var curElement = this.element; @@ -897,18 +897,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onNewRuleClick(event) { event.consume(); var rule = this._style.parentRule; - var range = WebInspector.TextRange.createFromLocation(rule.style.range.endLine, rule.style.range.endColumn + 1); + var range = Common.TextRange.createFromLocation(rule.style.range.endLine, rule.style.range.endColumn + 1); this._parentPane._addBlankSection(this, /** @type {string} */ (rule.styleSheetId), range); } /** * @param {string} propertyName - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onInsertShadowPropertyClick(propertyName, event) { event.consume(true); @@ -916,13 +916,13 @@ treeElement.property.name = propertyName; treeElement.property.value = '0 0 black'; treeElement.updateTitle(); - var shadowSwatchPopoverHelper = WebInspector.ShadowSwatchPopoverHelper.forTreeElement(treeElement); + var shadowSwatchPopoverHelper = Elements.ShadowSwatchPopoverHelper.forTreeElement(treeElement); if (shadowSwatchPopoverHelper) shadowSwatchPopoverHelper.showPopover(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onInsertColorPropertyClick(event) { event.consume(true); @@ -930,13 +930,13 @@ treeElement.property.name = 'color'; treeElement.property.value = 'black'; treeElement.updateTitle(); - var colorSwatch = WebInspector.ColorSwatchPopoverIcon.forTreeElement(treeElement); + var colorSwatch = Elements.ColorSwatchPopoverIcon.forTreeElement(treeElement); if (colorSwatch) colorSwatch.showPopover(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onInsertBackgroundColorPropertyClick(event) { event.consume(true); @@ -944,13 +944,13 @@ treeElement.property.name = 'background-color'; treeElement.property.value = 'white'; treeElement.updateTitle(); - var colorSwatch = WebInspector.ColorSwatchPopoverIcon.forTreeElement(treeElement); + var colorSwatch = Elements.ColorSwatchPopoverIcon.forTreeElement(treeElement); if (colorSwatch) colorSwatch.showPopover(); } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ _styleSheetEdited(edit) { var rule = this._style.parentRule; @@ -964,7 +964,7 @@ } /** - * @param {!Array.<!WebInspector.CSSMedia>} mediaRules + * @param {!Array.<!SDK.CSSMedia>} mediaRules */ _createMediaList(mediaRules) { for (var i = mediaRules.length - 1; i >= 0; --i) { @@ -976,11 +976,11 @@ var mediaContainerElement = mediaDataElement.createChild('span'); var mediaTextElement = mediaContainerElement.createChild('span', 'media-text'); switch (media.source) { - case WebInspector.CSSMedia.Source.LINKED_SHEET: - case WebInspector.CSSMedia.Source.INLINE_SHEET: + case SDK.CSSMedia.Source.LINKED_SHEET: + case SDK.CSSMedia.Source.INLINE_SHEET: mediaTextElement.textContent = 'media="' + media.text + '"'; break; - case WebInspector.CSSMedia.Source.MEDIA_RULE: + case SDK.CSSMedia.Source.MEDIA_RULE: var decoration = mediaContainerElement.createChild('span'); mediaContainerElement.insertBefore(decoration, mediaTextElement); decoration.textContent = '@media '; @@ -991,7 +991,7 @@ 'click', this._handleMediaRuleClick.bind(this, media, mediaTextElement), false); } break; - case WebInspector.CSSMedia.Source.IMPORT_RULE: + case SDK.CSSMedia.Source.IMPORT_RULE: mediaTextElement.textContent = '@import ' + media.text; break; } @@ -1000,7 +1000,7 @@ _updateMediaList() { this._mediaListElement.removeChildren(); - if (this._style.parentRule && this._style.parentRule instanceof WebInspector.CSSStyleRule) + if (this._style.parentRule && this._style.parentRule instanceof SDK.CSSStyleRule) this._createMediaList(this._style.parentRule.media); } @@ -1012,13 +1012,13 @@ if (this._matchedStyles.isInherited(this._style)) { // While rendering inherited stylesheet, reverse meaning of this property. // Render truly inherited properties with black, i.e. return them as non-inherited. - return !WebInspector.cssMetadata().isPropertyInherited(propertyName); + return !SDK.cssMetadata().isPropertyInherited(propertyName); } return false; } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ nextEditableSibling() { var curSection = this; @@ -1036,7 +1036,7 @@ } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ previousEditableSibling() { var curSection = this; @@ -1089,18 +1089,18 @@ var isShorthand = !!style.longhandProperties(property.name).length; var inherited = this.isPropertyInherited(property.name); var overloaded = this._isPropertyOverloaded(property); - var item = new WebInspector.StylePropertyTreeElement( + var item = new Elements.StylePropertyTreeElement( this._parentPane, this._matchedStyles, property, isShorthand, inherited, overloaded); this.propertiesTreeOutline.appendChild(item); } } /** - * @param {!WebInspector.CSSProperty} property + * @param {!SDK.CSSProperty} property * @return {boolean} */ _isPropertyOverloaded(property) { - return this._matchedStyles.propertyState(property) === WebInspector.CSSMatchedStyles.PropertyState.Overloaded; + return this._matchedStyles.propertyState(property) === SDK.CSSMatchedStyles.PropertyState.Overloaded; } /** @@ -1128,7 +1128,7 @@ var selectorTexts = rule.selectors.map(selector => selector.text); var matchingSelectorIndexes = - this._matchedStyles.matchingSelectors(/** @type {!WebInspector.CSSStyleRule} */ (rule)); + this._matchedStyles.matchingSelectors(/** @type {!SDK.CSSStyleRule} */ (rule)); var matchingSelectors = new Array(selectorTexts.length).fill(false); for (var matchingIndex of matchingSelectorIndexes) matchingSelectors[matchingIndex] = true; @@ -1224,12 +1224,12 @@ /** * @param {number=} index - * @return {!WebInspector.StylePropertyTreeElement} + * @return {!Elements.StylePropertyTreeElement} */ addNewBlankProperty(index) { var property = this._style.newBlankProperty(index); var item = - new WebInspector.StylePropertyTreeElement(this._parentPane, this._matchedStyles, property, false, false, false); + new Elements.StylePropertyTreeElement(this._parentPane, this._matchedStyles, property, false, false, false); index = property.index; this.propertiesTreeOutline.insertChild(item, index); item.listItemElement.textContent = ''; @@ -1272,23 +1272,23 @@ } /** - * @param {!WebInspector.CSSMedia} media + * @param {!SDK.CSSMedia} media * @param {!Element} element * @param {!Event} event */ _handleMediaRuleClick(media, element, event) { - if (WebInspector.isBeingEdited(element)) + if (UI.isBeingEdited(element)) return; - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && this.navigable) { + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && this.navigable) { var location = media.rawLocation(); if (!location) { event.consume(true); return; } - var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILocation(location); + var uiLocation = Bindings.cssWorkspaceBinding.rawLocationToUILocation(location); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation); + Common.Revealer.reveal(uiLocation); event.consume(true); return; } @@ -1296,10 +1296,10 @@ if (!this.editable || this._isSASSStyle()) return; - var config = new WebInspector.InplaceEditor.Config( + var config = new UI.InplaceEditor.Config( this._editingMediaCommitted.bind(this, media), this._editingMediaCancelled.bind(this, element), undefined, this._editingMediaBlurHandler.bind(this)); - WebInspector.InplaceEditor.startEditing(element, config); + UI.InplaceEditor.startEditing(element, config); element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); this._parentPane.setEditingStyle(true); @@ -1339,11 +1339,11 @@ } /** - * @param {!WebInspector.CSSMedia} media + * @param {!SDK.CSSMedia} media * @param {!Element} element * @param {string} newContent * @param {string} oldContent - * @param {(!WebInspector.StylePropertyTreeElement.Context|undefined)} context + * @param {(!Elements.StylePropertyTreeElement.Context|undefined)} context * @param {string} moveDirection */ _editingMediaCommitted(media, element, newContent, oldContent, context, moveDirection) { @@ -1355,7 +1355,7 @@ /** * @param {boolean} success - * @this {WebInspector.StylePropertiesSection} + * @this {Elements.StylePropertiesSection} */ function userCallback(success) { if (success) { @@ -1378,7 +1378,7 @@ * @param {!Event} event */ _handleSelectorClick(event) { - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && this.navigable && + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && this.navigable && event.target.classList.contains('simple-selector')) { this._navigateToSelectorSource(event.target._selectorIndex, true); event.consume(true); @@ -1399,10 +1399,10 @@ if (!header) return; var rawLocation = - new WebInspector.CSSLocation(header, rule.lineNumberInSource(index), rule.columnNumberInSource(index)); - var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILocation(rawLocation); + new SDK.CSSLocation(header, rule.lineNumberInSource(index), rule.columnNumberInSource(index)); + var uiLocation = Bindings.cssWorkspaceBinding.rawLocationToUILocation(rawLocation); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation, !focus); + Common.Revealer.reveal(uiLocation, !focus); } _startEditingOnMouseEvent() { @@ -1423,15 +1423,15 @@ startEditingSelector() { var element = this._selectorElement; - if (WebInspector.isBeingEdited(element)) + if (UI.isBeingEdited(element)) return; element.scrollIntoViewIfNeeded(false); element.textContent = element.textContent; // Reset selector marks in group. - var config = new WebInspector.InplaceEditor.Config( + var config = new UI.InplaceEditor.Config( this.editingSelectorCommitted.bind(this), this.editingSelectorCancelled.bind(this)); - WebInspector.InplaceEditor.startEditing(this._selectorElement, config); + UI.InplaceEditor.startEditing(this._selectorElement, config); element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); this._parentPane.setEditingStyle(true); @@ -1469,7 +1469,7 @@ * @param {!Element} element * @param {string} newContent * @param {string} oldContent - * @param {(!WebInspector.StylePropertyTreeElement.Context|undefined)} context + * @param {(!Elements.StylePropertyTreeElement.Context|undefined)} context * @param {string} moveDirection */ editingSelectorCommitted(element, newContent, oldContent, context, moveDirection) { @@ -1487,7 +1487,7 @@ return; /** - * @this {WebInspector.StylePropertiesSection} + * @this {Elements.StylePropertiesSection} */ function headerTextCommitted() { delete this._parentPane._userOperation; @@ -1501,16 +1501,16 @@ } /** - * @param {!WebInspector.CSSRule} rule + * @param {!SDK.CSSRule} rule * @param {string} newContent * @return {!Promise} */ _setHeaderText(rule, newContent) { /** - * @param {!WebInspector.CSSStyleRule} rule + * @param {!SDK.CSSStyleRule} rule * @param {boolean} success * @return {!Promise} - * @this {WebInspector.StylePropertiesSection} + * @this {Elements.StylePropertiesSection} */ function onSelectorsUpdated(rule, success) { if (!success) @@ -1519,8 +1519,8 @@ } /** - * @param {!WebInspector.CSSStyleRule} rule - * @this {WebInspector.StylePropertiesSection} + * @param {!SDK.CSSStyleRule} rule + * @this {Elements.StylePropertiesSection} */ function updateSourceRanges(rule) { var doesAffectSelectedNode = this._matchedStyles.matchingSelectors(rule).length > 0; @@ -1529,13 +1529,13 @@ this._parentPane._refreshUpdate(this); } - console.assert(rule instanceof WebInspector.CSSStyleRule); + console.assert(rule instanceof SDK.CSSStyleRule); var oldSelectorRange = rule.selectorRange(); if (!oldSelectorRange) return Promise.resolve(); var selectedNode = this._parentPane.node(); return rule.setSelectorText(newContent) - .then(onSelectorsUpdated.bind(this, /** @type {!WebInspector.CSSStyleRule} */ (rule), oldSelectorRange)); + .then(onSelectorsUpdated.bind(this, /** @type {!SDK.CSSStyleRule} */ (rule), oldSelectorRange)); } _editingSelectorCommittedForTest() { @@ -1543,7 +1543,7 @@ _updateRuleOrigin() { this._selectorRefElement.removeChildren(); - this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection.createRuleOriginNode( + this._selectorRefElement.appendChild(Elements.StylePropertiesSection.createRuleOriginNode( this._matchedStyles, this._parentPane._linkifier, this._style.parentRule)); } @@ -1564,23 +1564,23 @@ /** * @unrestricted */ -WebInspector.BlankStylePropertiesSection = class extends WebInspector.StylePropertiesSection { +Elements.BlankStylePropertiesSection = class extends Elements.StylePropertiesSection { /** - * @param {!WebInspector.StylesSidebarPane} stylesPane - * @param {!WebInspector.CSSMatchedStyles} matchedStyles + * @param {!Elements.StylesSidebarPane} stylesPane + * @param {!SDK.CSSMatchedStyles} matchedStyles * @param {string} defaultSelectorText * @param {string} styleSheetId - * @param {!WebInspector.TextRange} ruleLocation - * @param {!WebInspector.CSSStyleDeclaration} insertAfterStyle + * @param {!Common.TextRange} ruleLocation + * @param {!SDK.CSSStyleDeclaration} insertAfterStyle */ constructor(stylesPane, matchedStyles, defaultSelectorText, styleSheetId, ruleLocation, insertAfterStyle) { - var cssModel = /** @type {!WebInspector.CSSModel} */ (stylesPane.cssModel()); - var rule = WebInspector.CSSStyleRule.createDummyRule(cssModel, defaultSelectorText); + var cssModel = /** @type {!SDK.CSSModel} */ (stylesPane.cssModel()); + var rule = SDK.CSSStyleRule.createDummyRule(cssModel, defaultSelectorText); super(stylesPane, matchedStyles, rule.style); this._ruleLocation = ruleLocation; this._styleSheetId = styleSheetId; this._selectorRefElement.removeChildren(); - this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection._linkifyRuleLocation( + this._selectorRefElement.appendChild(Elements.StylePropertiesSection._linkifyRuleLocation( cssModel, this._parentPane._linkifier, styleSheetId, this._actualRuleLocation())); if (insertAfterStyle && insertAfterStyle.parentRule) this._createMediaList(insertAfterStyle.parentRule.media); @@ -1588,13 +1588,13 @@ } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ _actualRuleLocation() { var prefix = this._rulePrefix(); var lines = prefix.split('\n'); - var editRange = new WebInspector.TextRange(0, 0, lines.length - 1, lines.peekLast().length); - return this._ruleLocation.rebaseAfterTextEdit(WebInspector.TextRange.createFromLocation(0, 0), editRange); + var editRange = new Common.TextRange(0, 0, lines.length - 1, lines.peekLast().length); + return this._ruleLocation.rebaseAfterTextEdit(Common.TextRange.createFromLocation(0, 0), editRange); } /** @@ -1616,7 +1616,7 @@ * @param {!Element} element * @param {string} newContent * @param {string} oldContent - * @param {!WebInspector.StylePropertyTreeElement.Context|undefined} context + * @param {!Elements.StylePropertyTreeElement.Context|undefined} context * @param {string} moveDirection */ editingSelectorCommitted(element, newContent, oldContent, context, moveDirection) { @@ -1626,9 +1626,9 @@ } /** - * @param {?WebInspector.CSSStyleRule} newRule + * @param {?SDK.CSSStyleRule} newRule * @return {!Promise} - * @this {WebInspector.StylePropertiesSection} + * @this {Elements.StylePropertiesSection} */ function onRuleAdded(newRule) { if (!newRule) { @@ -1641,8 +1641,8 @@ } /** - * @param {!WebInspector.CSSStyleRule} newRule - * @this {WebInspector.StylePropertiesSection} + * @param {!SDK.CSSStyleRule} newRule + * @this {Elements.StylePropertiesSection} */ function onAddedToCascade(newRule) { var doesSelectorAffectSelectedNode = this._matchedStyles.matchingSelectors(newRule).length > 0; @@ -1686,12 +1686,12 @@ } /** - * @param {!WebInspector.CSSRule} newRule + * @param {!SDK.CSSRule} newRule */ _makeNormal(newRule) { this.element.classList.remove('blank-section'); this._style = newRule.style; - // FIXME: replace this instance by a normal WebInspector.StylePropertiesSection. + // FIXME: replace this instance by a normal Elements.StylePropertiesSection. this._normal = true; } }; @@ -1699,11 +1699,11 @@ /** * @unrestricted */ -WebInspector.KeyframePropertiesSection = class extends WebInspector.StylePropertiesSection { +Elements.KeyframePropertiesSection = class extends Elements.StylePropertiesSection { /** - * @param {!WebInspector.StylesSidebarPane} stylesPane - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @param {!WebInspector.CSSStyleDeclaration} style + * @param {!Elements.StylesSidebarPane} stylesPane + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @param {!SDK.CSSStyleDeclaration} style */ constructor(stylesPane, matchedStyles, style) { super(stylesPane, matchedStyles, style); @@ -1720,14 +1720,14 @@ /** * @override - * @param {!WebInspector.CSSRule} rule + * @param {!SDK.CSSRule} rule * @param {string} newContent * @return {!Promise} */ _setHeaderText(rule, newContent) { /** * @param {boolean} success - * @this {WebInspector.KeyframePropertiesSection} + * @this {Elements.KeyframePropertiesSection} */ function updateSourceRanges(success) { if (!success) @@ -1735,7 +1735,7 @@ this._parentPane._refreshUpdate(this); } - console.assert(rule instanceof WebInspector.CSSKeyframeRule); + console.assert(rule instanceof SDK.CSSKeyframeRule); var oldRange = rule.key().range; if (!oldRange) return Promise.resolve(); @@ -1754,7 +1754,7 @@ /** * @override - * @param {!WebInspector.CSSProperty} property + * @param {!SDK.CSSProperty} property * @return {boolean} */ _isPropertyOverloaded(property) { @@ -1784,11 +1784,11 @@ /** * @unrestricted */ -WebInspector.StylePropertyTreeElement = class extends TreeElement { +Elements.StylePropertyTreeElement = class extends TreeElement { /** - * @param {!WebInspector.StylesSidebarPane} stylesPane - * @param {!WebInspector.CSSMatchedStyles} matchedStyles - * @param {!WebInspector.CSSProperty} property + * @param {!Elements.StylesSidebarPane} stylesPane + * @param {!SDK.CSSMatchedStyles} matchedStyles + * @param {!SDK.CSSProperty} property * @param {boolean} isShorthand * @param {boolean} inherited * @param {boolean} overloaded @@ -1804,7 +1804,7 @@ this.selectable = false; this._parentPane = stylesPane; this.isShorthand = isShorthand; - this._applyStyleThrottler = new WebInspector.Throttler(0); + this._applyStyleThrottler = new Common.Throttler(0); } /** @@ -1879,21 +1879,21 @@ */ _processColor(text) { // We can be called with valid non-color values of |text| (like 'none' from border style) - var color = WebInspector.Color.parse(text); + var color = Common.Color.parse(text); if (!color) return createTextNode(text); if (!this._editable()) { - var swatch = WebInspector.ColorSwatch.create(); + var swatch = UI.ColorSwatch.create(); swatch.setColor(color); return swatch; } var swatchPopoverHelper = this._parentPane._swatchPopoverHelper; - var swatch = WebInspector.ColorSwatch.create(); + var swatch = UI.ColorSwatch.create(); swatch.setColor(color); - swatch.setFormat(WebInspector.Color.detectColorFormat(swatch.color())); - var swatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPopoverHelper, swatch); + swatch.setFormat(Common.Color.detectColorFormat(swatch.color())); + var swatchIcon = new Elements.ColorSwatchPopoverIcon(this, swatchPopoverHelper, swatch); /** * @param {?Array<string>} backgroundColors @@ -1905,7 +1905,7 @@ return; // TODO(samli): figure out what to do in the case of multiple background colors (i.e. gradients) var bgColorText = backgroundColors[0]; - var bgColor = WebInspector.Color.parse(bgColorText); + var bgColor = Common.Color.parse(bgColorText); if (!bgColor) return; @@ -1914,8 +1914,8 @@ // the unknown background is the same color as the text. if (bgColor.hasAlpha) { var blendedRGBA = []; - WebInspector.Color.blendColors(bgColor.rgba(), color.rgba(), blendedRGBA); - bgColor = new WebInspector.Color(blendedRGBA, WebInspector.Color.Format.RGBA); + Common.Color.blendColors(bgColor.rgba(), color.rgba(), blendedRGBA); + bgColor = new Common.Color(blendedRGBA, Common.Color.Format.RGBA); } swatchIcon.setContrastColor(bgColor); @@ -1942,12 +1942,12 @@ * @return {!Node} */ _processBezier(text) { - if (!this._editable() || !WebInspector.Geometry.CubicBezier.parse(text)) + if (!this._editable() || !Common.Geometry.CubicBezier.parse(text)) return createTextNode(text); var swatchPopoverHelper = this._parentPane._swatchPopoverHelper; - var swatch = WebInspector.BezierSwatch.create(); + var swatch = UI.BezierSwatch.create(); swatch.setBezierText(text); - new WebInspector.BezierPopoverIcon(this, swatchPopoverHelper, swatch); + new Elements.BezierPopoverIcon(this, swatchPopoverHelper, swatch); return swatch; } @@ -1961,9 +1961,9 @@ return createTextNode(propertyValue); var shadows; if (propertyName === 'text-shadow') - shadows = WebInspector.CSSShadowModel.parseTextShadow(propertyValue); + shadows = Common.CSSShadowModel.parseTextShadow(propertyValue); else - shadows = WebInspector.CSSShadowModel.parseBoxShadow(propertyValue); + shadows = Common.CSSShadowModel.parseBoxShadow(propertyValue); if (!shadows.length) return createTextNode(propertyValue); var container = createDocumentFragment(); @@ -1972,12 +1972,12 @@ if (i !== 0) container.appendChild(createTextNode(', ')); // Add back commas and spaces between each shadow. // TODO(flandy): editing the property value should use the original value with all spaces. - var cssShadowSwatch = WebInspector.CSSShadowSwatch.create(); + var cssShadowSwatch = UI.CSSShadowSwatch.create(); cssShadowSwatch.setCSSShadow(shadows[i]); - new WebInspector.ShadowSwatchPopoverHelper(this, swatchPopoverHelper, cssShadowSwatch); + new Elements.ShadowSwatchPopoverHelper(this, swatchPopoverHelper, cssShadowSwatch); var colorSwatch = cssShadowSwatch.colorSwatch(); if (colorSwatch) - new WebInspector.ColorSwatchPopoverIcon(this, swatchPopoverHelper, colorSwatch); + new Elements.ColorSwatchPopoverIcon(this, swatchPopoverHelper, colorSwatch); container.appendChild(cssShadowSwatch); } return container; @@ -1993,7 +1993,7 @@ this.listItemElement.classList.remove('implicit'); var hasIgnorableError = - !this.property.parsedOk && WebInspector.StylesSidebarPane.ignoreErrorsForProperty(this.property); + !this.property.parsedOk && Elements.StylesSidebarPane.ignoreErrorsForProperty(this.property); if (hasIgnorableError) this.listItemElement.classList.add('has-ignorable-error'); else @@ -2016,21 +2016,21 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._parentPane.node(); } /** - * @return {!WebInspector.StylesSidebarPane} + * @return {!Elements.StylesSidebarPane} */ parentPane() { return this._parentPane; } /** - * @return {?WebInspector.StylePropertiesSection} + * @return {?Elements.StylePropertiesSection} */ section() { return this.treeOutline && this.treeOutline.section; @@ -2053,7 +2053,7 @@ /** * @param {boolean} success - * @this {WebInspector.StylePropertyTreeElement} + * @this {Elements.StylePropertyTreeElement} */ function callback(success) { delete this._parentPane._userOperation; @@ -2088,10 +2088,10 @@ if (section) { inherited = section.isPropertyInherited(name); overloaded = this._matchedStyles.propertyState(longhandProperties[i]) === - WebInspector.CSSMatchedStyles.PropertyState.Overloaded; + SDK.CSSMatchedStyles.PropertyState.Overloaded; } - var item = new WebInspector.StylePropertyTreeElement( + var item = new Elements.StylePropertyTreeElement( this._parentPane, this._matchedStyles, longhandProperties[i], false, inherited, overloaded); this.appendChild(item); } @@ -2135,7 +2135,7 @@ this._expandElement.className = 'expand-element'; var propertyRenderer = - new WebInspector.StylesSidebarPropertyRenderer(this._style.parentRule, this.node(), this.name, this.value); + new Elements.StylesSidebarPropertyRenderer(this._style.parentRule, this.node(), this.name, this.value); if (this.property.parsedOk) { propertyRenderer.setColorHandler(this._processColor.bind(this)); propertyRenderer.setBezierHandler(this._processBezier.bind(this)); @@ -2148,7 +2148,7 @@ if (!this.treeOutline) return; - var indent = WebInspector.moduleSetting('textEditorIndent').get(); + var indent = Common.moduleSetting('textEditorIndent').get(); this.listItemElement.createChild('span', 'styles-clipboard-only') .createTextChild(indent + (this.property.disabled ? '/* ' : '')); this.listItemElement.appendChild(this.nameElement); @@ -2165,7 +2165,7 @@ // Add a separate exclamation mark IMG element with a tooltip. this.listItemElement.insertBefore( - WebInspector.StylesSidebarPane.createExclamationMark(this.property), this.listItemElement.firstChild); + Elements.StylesSidebarPane.createExclamationMark(this.property), this.listItemElement.firstChild); } if (!this.property.activeInStyle()) this.listItemElement.classList.add('inactive'); @@ -2201,7 +2201,7 @@ return; } - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(/** @type {!MouseEvent} */ (event)) && this.section().navigable) { this._navigateToSource(/** @type {!Element} */ (event.target)); return; @@ -2218,9 +2218,9 @@ if (!this.section().navigable) return; var propertyNameClicked = element === this.nameElement; - var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(this.property, propertyNameClicked); + var uiLocation = Bindings.cssWorkspaceBinding.propertyUILocation(this.property, propertyNameClicked); if (uiLocation) - WebInspector.Revealer.reveal(uiLocation, omitFocus); + Common.Revealer.reveal(uiLocation, omitFocus); } /** @@ -2244,7 +2244,7 @@ if (!selectElement) selectElement = this.nameElement; - if (WebInspector.isBeingEdited(selectElement)) + if (UI.isBeingEdited(selectElement)) return; var isEditingName = selectElement === this.nameElement; @@ -2270,7 +2270,7 @@ return splitFieldValue.join(''); } - /** @type {!WebInspector.StylePropertyTreeElement.Context} */ + /** @type {!Elements.StylePropertyTreeElement.Context} */ var context = { expanded: this.expanded, hasChildren: this.isExpandable(), @@ -2286,9 +2286,9 @@ selectElement.textContent = selectElement.textContent; // remove color swatch and the like /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {!Event} event - * @this {WebInspector.StylePropertyTreeElement} + * @this {Elements.StylePropertyTreeElement} */ function pasteHandler(context, event) { var data = event.clipboardData.getData('Text'); @@ -2317,9 +2317,9 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {!Event} event - * @this {WebInspector.StylePropertyTreeElement} + * @this {Elements.StylePropertyTreeElement} */ function blurListener(context, event) { var treeElement = this._parentPane._mouseDownTreeElement; @@ -2343,13 +2343,13 @@ selectElement.parentElement.scrollIntoViewIfNeeded(false); var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdit.bind(this) : undefined; - var cssCompletions = isEditingName ? WebInspector.cssMetadata().allProperties() : - WebInspector.cssMetadata().propertyValues(this.nameElement.textContent); - this._prompt = new WebInspector.StylesSidebarPane.CSSPropertyPrompt(cssCompletions, this, isEditingName); + var cssCompletions = isEditingName ? SDK.cssMetadata().allProperties() : + SDK.cssMetadata().propertyValues(this.nameElement.textContent); + this._prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(cssCompletions, this, isEditingName); this._prompt.setAutocompletionTimeout(0); if (applyItemCallback) { - this._prompt.addEventListener(WebInspector.TextPrompt.Events.ItemApplied, applyItemCallback, this); - this._prompt.addEventListener(WebInspector.TextPrompt.Events.ItemAccepted, applyItemCallback, this); + this._prompt.addEventListener(UI.TextPrompt.Events.ItemApplied, applyItemCallback, this); + this._prompt.addEventListener(UI.TextPrompt.Events.ItemAccepted, applyItemCallback, this); } var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurListener.bind(this, context)); this._navigateToSource(selectElement, true); @@ -2364,7 +2364,7 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {!Event} event */ _editingNameValueKeyDown(context, event) { @@ -2376,11 +2376,11 @@ if (isEnterKey(event)) { event.preventDefault(); result = 'forward'; - } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') + } else if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') result = 'cancel'; else if ( !context.isEditingName && this._newProperty && - event.keyCode === WebInspector.KeyboardShortcut.Keys.Backspace.code) { + event.keyCode === UI.KeyboardShortcut.Keys.Backspace.code) { // For a new property, when Backspace is pressed at the beginning of new property value, move back to the property name. var selection = event.target.getComponentSelection(); if (selection.isCollapsed && !selection.focusOffset) { @@ -2409,7 +2409,7 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {!Event} event */ _editingNameValueKeyPress(context, event) { @@ -2447,7 +2447,7 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {!Event} event */ _editingNameValueInput(context, event) { @@ -2467,7 +2467,7 @@ } /** - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context */ editingEnded(context) { this._resetMouseDownElement(); @@ -2485,7 +2485,7 @@ /** * @param {?Element} element - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context */ editingCancelled(element, context) { this._removePrompt(); @@ -2507,7 +2507,7 @@ /** * @param {string} moveDirection - * @return {?WebInspector.StylePropertyTreeElement} + * @return {?Elements.StylePropertyTreeElement} */ _findSibling(moveDirection) { var target = this; @@ -2520,7 +2520,7 @@ /** * @param {string} userInput - * @param {!WebInspector.StylePropertyTreeElement.Context} context + * @param {!Elements.StylePropertyTreeElement.Context} context * @param {string} moveDirection */ _editingCommitted(userInput, context, moveDirection) { @@ -2553,7 +2553,7 @@ var blankInput = userInput.isWhitespace(); var shouldCommitNewProperty = this._newProperty && (isPropertySplitPaste || moveToOther || (!moveDirection && !isEditingName) || (isEditingName && blankInput)); - var section = /** @type {!WebInspector.StylePropertiesSection} */ (this.section()); + var section = /** @type {!Elements.StylePropertiesSection} */ (this.section()); if (((userInput !== context.previousContent || isDirtyViaPaste) && !this._newProperty) || shouldCommitNewProperty) { section._afterUpdate = moveToNextCallback.bind(this, this._newProperty, !blankInput, section); var propertyText; @@ -2580,8 +2580,8 @@ * The Callback to start editing the next/previous property/selector. * @param {boolean} alreadyNew * @param {boolean} valueChanged - * @param {!WebInspector.StylePropertiesSection} section - * @this {WebInspector.StylePropertyTreeElement} + * @param {!Elements.StylePropertiesSection} section + * @this {Elements.StylePropertyTreeElement} */ function moveToNextCallback(alreadyNew, valueChanged, section) { if (!moveDirection) @@ -2691,7 +2691,7 @@ /** * @param {boolean} success - * @this {WebInspector.StylePropertyTreeElement} + * @this {Elements.StylePropertyTreeElement} */ function callback(success) { delete this._parentPane._userOperation; @@ -2743,21 +2743,21 @@ }; /** @typedef {{expanded: boolean, hasChildren: boolean, isEditingName: boolean, previousContent: string}} */ -WebInspector.StylePropertyTreeElement.Context; +Elements.StylePropertyTreeElement.Context; /** * @unrestricted */ -WebInspector.StylesSidebarPane.CSSPropertyPrompt = class extends WebInspector.TextPrompt { +Elements.StylesSidebarPane.CSSPropertyPrompt = class extends UI.TextPrompt { /** * @param {!Array<string>} cssCompletions - * @param {!WebInspector.StylePropertyTreeElement} treeElement + * @param {!Elements.StylePropertyTreeElement} treeElement * @param {boolean} isEditingName */ constructor(cssCompletions, treeElement, isEditingName) { // Use the same callback both for applyItemCallback and acceptItemCallback. super(); - this.initialize(this._buildPropertyCompletions.bind(this), WebInspector.StyleValueDelimiters); + this.initialize(this._buildPropertyCompletions.bind(this), UI.StyleValueDelimiters); this.setSuggestBoxEnabled(true); this._cssCompletions = cssCompletions; this._treeElement = treeElement; @@ -2770,13 +2770,13 @@ if (treeElement && treeElement.valueElement) { var cssValueText = treeElement.valueElement.textContent; if (cssValueText.match(/#[\da-f]{3,6}$/i)) - this.setTitle(WebInspector.UIString( + this.setTitle(Common.UIString( 'Increment/decrement with mousewheel or up/down keys. %s: R ±1, Shift: G ±1, Alt: B ±1', - WebInspector.isMac() ? 'Cmd' : 'Ctrl')); + Host.isMac() ? 'Cmd' : 'Ctrl')); else if (cssValueText.match(/\d+/)) - this.setTitle(WebInspector.UIString( + this.setTitle(Common.UIString( 'Increment/decrement with mousewheel or up/down keys. %s: ±100, Shift: ±10, Alt: ±0.1', - WebInspector.isMac() ? 'Cmd' : 'Ctrl')); + Host.isMac() ? 'Cmd' : 'Ctrl')); } } } @@ -2839,7 +2839,7 @@ /** * @param {string} originalValue * @param {string} replacementString - * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt} + * @this {Elements.StylesSidebarPane.CSSPropertyPrompt} */ function finishHandler(originalValue, replacementString) { // Synthesize property text disregarding any comments, custom whitespace etc. @@ -2852,18 +2852,18 @@ * @param {number} number * @param {string} suffix * @return {string} - * @this {WebInspector.StylesSidebarPane.CSSPropertyPrompt} + * @this {Elements.StylesSidebarPane.CSSPropertyPrompt} */ function customNumberHandler(prefix, number, suffix) { if (number !== 0 && !suffix.length && - WebInspector.cssMetadata().isLengthProperty(this._treeElement.property.name)) + SDK.cssMetadata().isLengthProperty(this._treeElement.property.name)) suffix = 'px'; return prefix + number + suffix; } // Handle numeric value increment/decrement only at this point. if (!this._isEditingName && - WebInspector.handleElementValueModifications( + UI.handleElementValueModifications( event, this._treeElement.valueElement, finishHandler.bind(this), this._isValueSuggestion.bind(this), customNumberHandler.bind(this))) return true; @@ -2907,7 +2907,7 @@ for (var i = 0; i < results.length; ++i) results[i] = results[i].toUpperCase(); } - var selectedIndex = this._isEditingName ? WebInspector.cssMetadata().mostUsedProperty(prefixResults) : 0; + var selectedIndex = this._isEditingName ? SDK.cssMetadata().mostUsedProperty(prefixResults) : 0; completionsReadyCallback(results, selectedIndex); /** @@ -2926,10 +2926,10 @@ /** * @unrestricted */ -WebInspector.StylesSidebarPropertyRenderer = class { +Elements.StylesSidebarPropertyRenderer = class { /** - * @param {?WebInspector.CSSRule} rule - * @param {?WebInspector.DOMNode} node + * @param {?SDK.CSSRule} rule + * @param {?SDK.DOMNode} node * @param {string} name * @param {string} value */ @@ -2983,23 +2983,23 @@ if (this._shadowHandler && (this._propertyName === 'box-shadow' || this._propertyName === 'text-shadow' || this._propertyName === '-webkit-box-shadow') && - !WebInspector.CSSMetadata.VariableRegex.test(this._propertyValue)) { + !SDK.CSSMetadata.VariableRegex.test(this._propertyValue)) { valueElement.appendChild(this._shadowHandler(this._propertyValue, this._propertyName)); valueElement.normalize(); return valueElement; } - var regexes = [WebInspector.CSSMetadata.VariableRegex, WebInspector.CSSMetadata.URLRegex]; + var regexes = [SDK.CSSMetadata.VariableRegex, SDK.CSSMetadata.URLRegex]; var processors = [createTextNode, this._processURL.bind(this)]; - if (this._bezierHandler && WebInspector.cssMetadata().isBezierAwareProperty(this._propertyName)) { - regexes.push(WebInspector.Geometry.CubicBezier.Regex); + if (this._bezierHandler && SDK.cssMetadata().isBezierAwareProperty(this._propertyName)) { + regexes.push(Common.Geometry.CubicBezier.Regex); processors.push(this._bezierHandler); } - if (this._colorHandler && WebInspector.cssMetadata().isColorAwareProperty(this._propertyName)) { - regexes.push(WebInspector.Color.Regex); + if (this._colorHandler && SDK.cssMetadata().isColorAwareProperty(this._propertyName)) { + regexes.push(Common.Color.Regex); processors.push(this._colorHandler); } - var results = WebInspector.TextUtils.splitStringByRegexes(this._propertyValue, regexes); + var results = Common.TextUtils.splitStringByRegexes(this._propertyValue, regexes); for (var i = 0; i < results.length; i++) { var result = results[i]; var processor = result.regexIndex === -1 ? createTextNode : processors[result.regexIndex]; @@ -3023,56 +3023,56 @@ container.createTextChild('url('); var hrefUrl = null; if (this._rule && this._rule.resourceURL()) - hrefUrl = WebInspector.ParsedURL.completeURL(this._rule.resourceURL(), url); + hrefUrl = Common.ParsedURL.completeURL(this._rule.resourceURL(), url); else if (this._node) hrefUrl = this._node.resolveURL(url); - var hasResource = hrefUrl && !!WebInspector.resourceForURL(hrefUrl); - // FIXME: WebInspector.linkifyURLAsNode() should really use baseURI. - container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl || url, url, undefined, !hasResource)); + var hasResource = hrefUrl && !!Bindings.resourceForURL(hrefUrl); + // FIXME: UI.linkifyURLAsNode() should really use baseURI. + container.appendChild(UI.linkifyURLAsNode(hrefUrl || url, url, undefined, !hasResource)); container.createTextChild(')'); return container; } }; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.StylesSidebarPane.ButtonProvider = class { +Elements.StylesSidebarPane.ButtonProvider = class { constructor() { - this._button = new WebInspector.ToolbarButton(WebInspector.UIString('New Style Rule'), 'largeicon-add'); + this._button = new UI.ToolbarButton(Common.UIString('New Style Rule'), 'largeicon-add'); this._button.addEventListener('click', this._clicked, this); - var longclickTriangle = WebInspector.Icon.create('largeicon-longclick-triangle', 'long-click-glyph'); + var longclickTriangle = UI.Icon.create('largeicon-longclick-triangle', 'long-click-glyph'); this._button.element.appendChild(longclickTriangle); - new WebInspector.LongClickController(this._button.element, this._longClicked.bind(this)); - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, onNodeChanged.bind(this)); + new UI.LongClickController(this._button.element, this._longClicked.bind(this)); + UI.context.addFlavorChangeListener(SDK.DOMNode, onNodeChanged.bind(this)); onNodeChanged.call(this); /** - * @this {WebInspector.StylesSidebarPane.ButtonProvider} + * @this {Elements.StylesSidebarPane.ButtonProvider} */ function onNodeChanged() { - var node = WebInspector.context.flavor(WebInspector.DOMNode); + var node = UI.context.flavor(SDK.DOMNode); node = node ? node.enclosingElementOrSelf() : null; this._button.setEnabled(!!node); } } _clicked() { - WebInspector.StylesSidebarPane._instance._createNewRuleInViaInspectorStyleSheet(); + Elements.StylesSidebarPane._instance._createNewRuleInViaInspectorStyleSheet(); } /** * @param {!Event} e */ _longClicked(e) { - WebInspector.StylesSidebarPane._instance._onAddButtonLongClick(e); + Elements.StylesSidebarPane._instance._onAddButtonLongClick(e); } /** * @override - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ item() { return this._button;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/module.json b/third_party/WebKit/Source/devtools/front_end/elements/module.json index 79370c1..4108da10 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/module.json +++ b/third_party/WebKit/Source/devtools/front_end/elements/module.json
@@ -6,27 +6,27 @@ "id": "elements", "title": "Elements", "order": 10, - "className": "WebInspector.ElementsPanel" + "className": "Elements.ElementsPanel" }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.RemoteObject", "WebInspector.DOMNode", "WebInspector.DeferredDOMNode"], - "className": "WebInspector.ElementsPanel.ContextMenuProvider" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["SDK.RemoteObject", "SDK.DOMNode", "SDK.DeferredDOMNode"], + "className": "Elements.ElementsPanel.ContextMenuProvider" }, { - "type": "@WebInspector.Renderer", - "contextTypes": ["WebInspector.DOMNode", "WebInspector.RemoteObject"], - "className": "WebInspector.ElementsTreeOutline.Renderer" + "type": "@Common.Renderer", + "contextTypes": ["SDK.DOMNode", "SDK.RemoteObject"], + "className": "Elements.ElementsTreeOutline.Renderer" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.DOMNode", "WebInspector.DeferredDOMNode", "WebInspector.RemoteObject" ], - "className": "WebInspector.ElementsPanel.DOMNodeRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.DOMNode", "SDK.DeferredDOMNode", "SDK.RemoteObject" ], + "className": "Elements.ElementsPanel.DOMNodeRevealer" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.CSSProperty" ], - "className": "WebInspector.ElementsPanel.CSSPropertyRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.CSSProperty" ], + "className": "Elements.ElementsPanel.CSSPropertyRevealer" }, { "type": "setting", @@ -94,28 +94,28 @@ "defaultValue": true }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.ElementStatePaneWidget.ButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Elements.ElementStatePaneWidget.ButtonProvider", "order": 1, "location": "styles-sidebarpane-toolbar" }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.ClassesPaneWidget.ButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Elements.ClassesPaneWidget.ButtonProvider", "order": 2, "location": "styles-sidebarpane-toolbar" }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.StylesSidebarPane.ButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Elements.StylesSidebarPane.ButtonProvider", "order": 100, "location": "styles-sidebarpane-toolbar" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "elements.hide-element", - "contextTypes": ["WebInspector.ElementsPanel"], - "className": "WebInspector.ElementsActionDelegate", + "contextTypes": ["Elements.ElementsPanel"], + "className": "Elements.ElementsActionDelegate", "bindings": [ { "shortcut": "H" @@ -123,10 +123,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "elements.edit-as-html", - "contextTypes": ["WebInspector.ElementsPanel"], - "className": "WebInspector.ElementsActionDelegate", + "contextTypes": ["Elements.ElementsPanel"], + "className": "Elements.ElementsActionDelegate", "bindings": [ { "shortcut": "F2" @@ -134,21 +134,21 @@ ] }, { - "type": "@WebInspector.DOMPresentationUtils.MarkerDecorator", - "className": "WebInspector.ElementsPanel.PseudoStateMarkerDecorator", + "type": "@Components.DOMPresentationUtils.MarkerDecorator", + "className": "Elements.ElementsPanel.PseudoStateMarkerDecorator", "marker": "pseudo-state-marker" }, { - "type": "@WebInspector.DOMPresentationUtils.MarkerDecorator", - "factoryName": "WebInspector.DOMPresentationUtils.GenericDecorator", + "type": "@Components.DOMPresentationUtils.MarkerDecorator", + "factoryName": "Components.DOMPresentationUtils.GenericDecorator", "marker": "hidden-marker", "title": "Element is hidden", "color": "#555" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "elements.toggle-element-search", - "className": "WebInspector.InspectElementModeController.ToggleSearchActionDelegate", + "className": "Elements.InspectElementModeController.ToggleSearchActionDelegate", "title": "Select an element in the page to inspect it", "iconClass": "largeicon-node-search", "bindings": [ @@ -163,22 +163,22 @@ ] }, { - "type": "@WebInspector.ToolbarItem.Provider", + "type": "@UI.ToolbarItem.Provider", "actionId": "elements.toggle-element-search", "location": "main-toolbar-left", "order": 0 }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.InspectElementModeController.LayoutEditorButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Elements.InspectElementModeController.LayoutEditorButtonProvider", "order": 4, "location": "styles-sidebarpane-toolbar", "experiment": "layoutEditor" }, { - "type": "@WebInspector.ViewLocationResolver", + "type": "@UI.ViewLocationResolver", "name": "elements-sidebar", - "className": "WebInspector.ElementsPanel" + "className": "Elements.ElementsPanel" }, { "type": "view", @@ -188,7 +188,7 @@ "order": 5, "hasToolbar": true, "persistence": "permanent", - "className": "WebInspector.EventListenersWidget" + "className": "Elements.EventListenersWidget" }, { "type": "view", @@ -197,7 +197,7 @@ "title": "DOM Breakpoints", "order": 6, "persistence": "permanent", - "factoryName": "WebInspector.DOMBreakpointsSidebarPane.Proxy" + "factoryName": "Components.DOMBreakpointsSidebarPane.Proxy" }, { "type": "view", @@ -206,7 +206,7 @@ "title": "Properties", "order": 7, "persistence": "permanent", - "className": "WebInspector.PropertiesWidget" + "className": "Elements.PropertiesWidget" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/AdvancedApp.js b/third_party/WebKit/Source/devtools/front_end/emulation/AdvancedApp.js index e4e5118..4f463841 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/AdvancedApp.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/AdvancedApp.js
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.App} + * @implements {Common.App} * @unrestricted */ -WebInspector.AdvancedApp = class { +Emulation.AdvancedApp = class { constructor() { - WebInspector.dockController.addEventListener( - WebInspector.DockController.Events.BeforeDockSideChanged, this._openToolboxWindow, this); + Components.dockController.addEventListener( + Components.DockController.Events.BeforeDockSideChanged, this._openToolboxWindow, this); } /** - * @return {!WebInspector.AdvancedApp} + * @return {!Emulation.AdvancedApp} */ static _instance() { - if (!WebInspector.AdvancedApp._appInstance) - WebInspector.AdvancedApp._appInstance = new WebInspector.AdvancedApp(); - return WebInspector.AdvancedApp._appInstance; + if (!Emulation.AdvancedApp._appInstance) + Emulation.AdvancedApp._appInstance = new Emulation.AdvancedApp(); + return Emulation.AdvancedApp._appInstance; } /** @@ -25,25 +25,25 @@ * @param {!Document} document */ presentUI(document) { - var rootView = new WebInspector.RootView(); + var rootView = new UI.RootView(); - this._rootSplitWidget = new WebInspector.SplitWidget(false, true, 'InspectorView.splitViewState', 555, 300, true); + this._rootSplitWidget = new UI.SplitWidget(false, true, 'InspectorView.splitViewState', 555, 300, true); this._rootSplitWidget.show(rootView.element); - this._rootSplitWidget.setSidebarWidget(WebInspector.inspectorView); - WebInspector.inspectorView.setOwnerSplit(this._rootSplitWidget); + this._rootSplitWidget.setSidebarWidget(UI.inspectorView); + UI.inspectorView.setOwnerSplit(this._rootSplitWidget); - this._inspectedPagePlaceholder = new WebInspector.InspectedPagePlaceholder(); + this._inspectedPagePlaceholder = new Emulation.InspectedPagePlaceholder(); this._inspectedPagePlaceholder.addEventListener( - WebInspector.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPageBounds.bind(this), this); - this._deviceModeView = new WebInspector.DeviceModeWrapper(this._inspectedPagePlaceholder); + Emulation.InspectedPagePlaceholder.Events.Update, this._onSetInspectedPageBounds.bind(this), this); + this._deviceModeView = new Emulation.DeviceModeWrapper(this._inspectedPagePlaceholder); - WebInspector.dockController.addEventListener( - WebInspector.DockController.Events.BeforeDockSideChanged, this._onBeforeDockSideChange, this); - WebInspector.dockController.addEventListener( - WebInspector.DockController.Events.DockSideChanged, this._onDockSideChange, this); - WebInspector.dockController.addEventListener( - WebInspector.DockController.Events.AfterDockSideChanged, this._onAfterDockSideChange, this); + Components.dockController.addEventListener( + Components.DockController.Events.BeforeDockSideChanged, this._onBeforeDockSideChange, this); + Components.dockController.addEventListener( + Components.DockController.Events.DockSideChanged, this._onDockSideChange, this); + Components.dockController.addEventListener( + Components.DockController.Events.AfterDockSideChanged, this._onAfterDockSideChange, this); this._onDockSideChange(); console.timeStamp('AdvancedApp.attachToBody'); @@ -52,10 +52,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _openToolboxWindow(event) { - if (/** @type {string} */ (event.data.to) !== WebInspector.DockController.State.Undocked) + if (/** @type {string} */ (event.data.to) !== Components.DockController.State.Undocked) return; if (this._toolboxWindow) @@ -69,12 +69,12 @@ * @param {!Document} toolboxDocument */ toolboxLoaded(toolboxDocument) { - WebInspector.initializeUIUtils(toolboxDocument, WebInspector.settings.createSetting('uiTheme', 'default')); - WebInspector.installComponentRootStyles(/** @type {!Element} */ (toolboxDocument.body)); - WebInspector.ContextMenu.installHandler(toolboxDocument); - WebInspector.Tooltip.installHandler(toolboxDocument); + UI.initializeUIUtils(toolboxDocument, Common.settings.createSetting('uiTheme', 'default')); + UI.installComponentRootStyles(/** @type {!Element} */ (toolboxDocument.body)); + UI.ContextMenu.installHandler(toolboxDocument); + UI.Tooltip.installHandler(toolboxDocument); - this._toolboxRootView = new WebInspector.RootView(); + this._toolboxRootView = new UI.RootView(); this._toolboxRootView.attachToDocument(toolboxDocument); this._updateDeviceModeView(); @@ -88,10 +88,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBeforeDockSideChange(event) { - if (/** @type {string} */ (event.data.to) === WebInspector.DockController.State.Undocked && this._toolboxRootView) { + if (/** @type {string} */ (event.data.to) === Components.DockController.State.Undocked && this._toolboxRootView) { // Hide inspectorView and force layout to mimic the undocked state. this._rootSplitWidget.hideSidebar(); this._inspectedPagePlaceholder.update(); @@ -101,17 +101,17 @@ } /** - * @param {!WebInspector.Event=} event + * @param {!Common.Event=} event */ _onDockSideChange(event) { this._updateDeviceModeView(); - var toDockSide = event ? /** @type {string} */ (event.data.to) : WebInspector.dockController.dockSide(); - if (toDockSide === WebInspector.DockController.State.Undocked) { + var toDockSide = event ? /** @type {string} */ (event.data.to) : Components.dockController.dockSide(); + if (toDockSide === Components.DockController.State.Undocked) { this._updateForUndocked(); } else if ( this._toolboxRootView && event && - /** @type {string} */ (event.data.from) === WebInspector.DockController.State.Undocked) { + /** @type {string} */ (event.data.from) === Components.DockController.State.Undocked) { // Don't update yet for smooth transition. this._rootSplitWidget.hideSidebar(); } else { @@ -120,13 +120,13 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onAfterDockSideChange(event) { // We may get here on the first dock side change while loading without BeforeDockSideChange. if (!this._changingDockSide) return; - if (/** @type {string} */ (event.data.from) === WebInspector.DockController.State.Undocked) { + if (/** @type {string} */ (event.data.from) === Components.DockController.State.Undocked) { // Restore docked layout in case of smooth transition. this._updateForDocked(/** @type {string} */ (event.data.to)); } @@ -138,28 +138,28 @@ * @param {string} dockSide */ _updateForDocked(dockSide) { - this._rootSplitWidget.setVertical(dockSide === WebInspector.DockController.State.DockedToRight); + this._rootSplitWidget.setVertical(dockSide === Components.DockController.State.DockedToRight); this._rootSplitWidget.setSecondIsSidebar( - dockSide === WebInspector.DockController.State.DockedToRight || - dockSide === WebInspector.DockController.State.DockedToBottom); + dockSide === Components.DockController.State.DockedToRight || + dockSide === Components.DockController.State.DockedToBottom); this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(), true); this._rootSplitWidget.toggleResizer( - WebInspector.inspectorView.topResizerElement(), dockSide === WebInspector.DockController.State.DockedToBottom); + UI.inspectorView.topResizerElement(), dockSide === Components.DockController.State.DockedToBottom); this._rootSplitWidget.showBoth(); } _updateForUndocked() { this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(), false); - this._rootSplitWidget.toggleResizer(WebInspector.inspectorView.topResizerElement(), false); + this._rootSplitWidget.toggleResizer(UI.inspectorView.topResizerElement(), false); this._rootSplitWidget.hideMain(); } _isDocked() { - return WebInspector.dockController.dockSide() !== WebInspector.DockController.State.Undocked; + return Components.dockController.dockSide() !== Components.DockController.State.Undocked; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSetInspectedPageBounds(event) { if (this._changingDockSide) @@ -175,20 +175,20 @@ } }; -/** @type {!WebInspector.AdvancedApp} */ -WebInspector.AdvancedApp._appInstance; +/** @type {!Emulation.AdvancedApp} */ +Emulation.AdvancedApp._appInstance; /** - * @implements {WebInspector.AppProvider} + * @implements {Common.AppProvider} * @unrestricted */ -WebInspector.AdvancedAppProvider = class { +Emulation.AdvancedAppProvider = class { /** * @override - * @return {!WebInspector.App} + * @return {!Common.App} */ createApp() { - return WebInspector.AdvancedApp._instance(); + return Emulation.AdvancedApp._instance(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js index d3a87cb..2fe860e 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
@@ -2,67 +2,67 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.DeviceModeModel = class { +Emulation.DeviceModeModel = class { /** * @param {function()} updateCallback */ constructor(updateCallback) { this._updateCallback = updateCallback; - this._screenRect = new WebInspector.Rect(0, 0, 1, 1); - this._visiblePageRect = new WebInspector.Rect(0, 0, 1, 1); + this._screenRect = new Common.Rect(0, 0, 1, 1); + this._visiblePageRect = new Common.Rect(0, 0, 1, 1); this._availableSize = new Size(1, 1); this._preferredSize = new Size(1, 1); this._initialized = false; - this._deviceMetricsThrottler = new WebInspector.Throttler(0); + this._deviceMetricsThrottler = new Common.Throttler(0); this._appliedDeviceSize = new Size(1, 1); this._appliedDeviceScaleFactor = window.devicePixelRatio; - this._appliedUserAgentType = WebInspector.DeviceModeModel.UA.Desktop; + this._appliedUserAgentType = Emulation.DeviceModeModel.UA.Desktop; - this._scaleSetting = WebInspector.settings.createSetting('emulation.deviceScale', 1); + this._scaleSetting = Common.settings.createSetting('emulation.deviceScale', 1); // We've used to allow zero before. if (!this._scaleSetting.get()) this._scaleSetting.set(1); this._scaleSetting.addChangeListener(this._scaleSettingChanged, this); - this._widthSetting = WebInspector.settings.createSetting('emulation.deviceWidth', 400); - if (this._widthSetting.get() < WebInspector.DeviceModeModel.MinDeviceSize) - this._widthSetting.set(WebInspector.DeviceModeModel.MinDeviceSize); - if (this._widthSetting.get() > WebInspector.DeviceModeModel.MaxDeviceSize) - this._widthSetting.set(WebInspector.DeviceModeModel.MaxDeviceSize); + this._widthSetting = Common.settings.createSetting('emulation.deviceWidth', 400); + if (this._widthSetting.get() < Emulation.DeviceModeModel.MinDeviceSize) + this._widthSetting.set(Emulation.DeviceModeModel.MinDeviceSize); + if (this._widthSetting.get() > Emulation.DeviceModeModel.MaxDeviceSize) + this._widthSetting.set(Emulation.DeviceModeModel.MaxDeviceSize); this._widthSetting.addChangeListener(this._widthSettingChanged, this); - this._heightSetting = WebInspector.settings.createSetting('emulation.deviceHeight', 0); - if (this._heightSetting.get() && this._heightSetting.get() < WebInspector.DeviceModeModel.MinDeviceSize) - this._heightSetting.set(WebInspector.DeviceModeModel.MinDeviceSize); - if (this._heightSetting.get() > WebInspector.DeviceModeModel.MaxDeviceSize) - this._heightSetting.set(WebInspector.DeviceModeModel.MaxDeviceSize); + this._heightSetting = Common.settings.createSetting('emulation.deviceHeight', 0); + if (this._heightSetting.get() && this._heightSetting.get() < Emulation.DeviceModeModel.MinDeviceSize) + this._heightSetting.set(Emulation.DeviceModeModel.MinDeviceSize); + if (this._heightSetting.get() > Emulation.DeviceModeModel.MaxDeviceSize) + this._heightSetting.set(Emulation.DeviceModeModel.MaxDeviceSize); this._heightSetting.addChangeListener(this._heightSettingChanged, this); - this._uaSetting = WebInspector.settings.createSetting('emulation.deviceUA', WebInspector.DeviceModeModel.UA.Mobile); + this._uaSetting = Common.settings.createSetting('emulation.deviceUA', Emulation.DeviceModeModel.UA.Mobile); this._uaSetting.addChangeListener(this._uaSettingChanged, this); - this._deviceScaleFactorSetting = WebInspector.settings.createSetting('emulation.deviceScaleFactor', 0); + this._deviceScaleFactorSetting = Common.settings.createSetting('emulation.deviceScaleFactor', 0); this._deviceScaleFactorSetting.addChangeListener(this._deviceScaleFactorSettingChanged, this); - this._deviceOutlineSetting = WebInspector.settings.moduleSetting('emulation.showDeviceOutline'); + this._deviceOutlineSetting = Common.settings.moduleSetting('emulation.showDeviceOutline'); this._deviceOutlineSetting.addChangeListener(this._deviceOutlineSettingChanged, this); - /** @type {!WebInspector.DeviceModeModel.Type} */ - this._type = WebInspector.DeviceModeModel.Type.None; - /** @type {?WebInspector.EmulatedDevice} */ + /** @type {!Emulation.DeviceModeModel.Type} */ + this._type = Emulation.DeviceModeModel.Type.None; + /** @type {?Emulation.EmulatedDevice} */ this._device = null; - /** @type {?WebInspector.EmulatedDevice.Mode} */ + /** @type {?Emulation.EmulatedDevice.Mode} */ this._mode = null; /** @type {number} */ this._fitScale = 1; - /** @type {?WebInspector.Target} */ + /** @type {?SDK.Target} */ this._target = null; /** @type {?function()} */ this._onTargetAvailable = null; - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** @@ -70,8 +70,8 @@ * @return {boolean} */ static deviceSizeValidator(value) { - if (/^[\d]+$/.test(value) && value >= WebInspector.DeviceModeModel.MinDeviceSize && - value <= WebInspector.DeviceModeModel.MaxDeviceSize) + if (/^[\d]+$/.test(value) && value >= Emulation.DeviceModeModel.MinDeviceSize && + value <= Emulation.DeviceModeModel.MaxDeviceSize) return true; return false; } @@ -98,16 +98,16 @@ } /** - * @param {!WebInspector.DeviceModeModel.Type} type - * @param {?WebInspector.EmulatedDevice} device - * @param {?WebInspector.EmulatedDevice.Mode} mode + * @param {!Emulation.DeviceModeModel.Type} type + * @param {?Emulation.EmulatedDevice} device + * @param {?Emulation.EmulatedDevice.Mode} mode * @param {number=} scale */ emulate(type, device, mode, scale) { var resetPageScaleFactor = this._type !== type || this._device !== device || this._mode !== mode; this._type = type; - if (type === WebInspector.DeviceModeModel.Type.Device) { + if (type === Emulation.DeviceModeModel.Type.Device) { console.assert(device && mode, 'Must pass device and mode for device emulation'); this._mode = mode; this._device = device; @@ -123,8 +123,8 @@ this._mode = null; } - if (type !== WebInspector.DeviceModeModel.Type.None) - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.DeviceModeEnabled); + if (type !== Emulation.DeviceModeModel.Type.None) + Host.userMetrics.actionTaken(Host.UserMetrics.Action.DeviceModeEnabled); this._calculateAndEmulate(resetPageScaleFactor); } @@ -132,7 +132,7 @@ * @param {number} width */ setWidth(width) { - var max = Math.min(WebInspector.DeviceModeModel.MaxDeviceSize, this._preferredScaledWidth()); + var max = Math.min(Emulation.DeviceModeModel.MaxDeviceSize, this._preferredScaledWidth()); width = Math.max(Math.min(width, max), 1); this._widthSetting.set(width); } @@ -141,7 +141,7 @@ * @param {number} width */ setWidthAndScaleToFit(width) { - width = Math.max(Math.min(width, WebInspector.DeviceModeModel.MaxDeviceSize), 1); + width = Math.max(Math.min(width, Emulation.DeviceModeModel.MaxDeviceSize), 1); this._scaleSetting.set(this._calculateFitScale(width, this._heightSetting.get())); this._widthSetting.set(width); } @@ -150,7 +150,7 @@ * @param {number} height */ setHeight(height) { - var max = Math.min(WebInspector.DeviceModeModel.MaxDeviceSize, this._preferredScaledHeight()); + var max = Math.min(Emulation.DeviceModeModel.MaxDeviceSize, this._preferredScaledHeight()); height = Math.max(Math.min(height, max), 0); if (height === this._preferredScaledHeight()) height = 0; @@ -161,7 +161,7 @@ * @param {number} height */ setHeightAndScaleToFit(height) { - height = Math.max(Math.min(height, WebInspector.DeviceModeModel.MaxDeviceSize), 0); + height = Math.max(Math.min(height, Emulation.DeviceModeModel.MaxDeviceSize), 0); this._scaleSetting.set(this._calculateFitScale(this._widthSetting.get(), height)); this._heightSetting.set(height); } @@ -174,21 +174,21 @@ } /** - * @return {?WebInspector.EmulatedDevice} + * @return {?Emulation.EmulatedDevice} */ device() { return this._device; } /** - * @return {?WebInspector.EmulatedDevice.Mode} + * @return {?Emulation.EmulatedDevice.Mode} */ mode() { return this._mode; } /** - * @return {!WebInspector.DeviceModeModel.Type} + * @return {!Emulation.DeviceModeModel.Type} */ type() { return this._type; @@ -210,21 +210,21 @@ } /** - * @return {!WebInspector.Rect} + * @return {!Common.Rect} */ outlineRect() { return this._outlineRect; } /** - * @return {!WebInspector.Rect} + * @return {!Common.Rect} */ screenRect() { return this._screenRect; } /** - * @return {!WebInspector.Rect} + * @return {!Common.Rect} */ visiblePageRect() { return this._visiblePageRect; @@ -259,7 +259,7 @@ } /** - * @return {!WebInspector.DeviceModeModel.UA} + * @return {!Emulation.DeviceModeModel.UA} */ appliedUserAgentType() { return this._appliedUserAgentType; @@ -273,28 +273,28 @@ } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ scaleSetting() { return this._scaleSetting; } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ uaSetting() { return this._uaSetting; } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ deviceScaleFactorSetting() { return this._deviceScaleFactorSetting; } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ deviceOutlineSetting() { return this._deviceOutlineSetting; @@ -305,12 +305,12 @@ this._scaleSetting.set(1); this.setWidth(400); this.setHeight(0); - this._uaSetting.set(WebInspector.DeviceModeModel.UA.Mobile); + this._uaSetting.set(Emulation.DeviceModeModel.UA.Mobile); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (!this._target) { @@ -325,7 +325,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (this._target === target) @@ -375,7 +375,7 @@ */ _currentOutline() { var outline = new Insets(0, 0, 0, 0); - if (this._type !== WebInspector.DeviceModeModel.Type.Device) + if (this._type !== Emulation.DeviceModeModel.Type.Device) return outline; var orientation = this._device.orientationByName(this._mode.orientation); if (this._deviceOutlineSetting.get()) @@ -387,7 +387,7 @@ * @return {!Insets} */ _currentInsets() { - if (this._type !== WebInspector.DeviceModeModel.Type.Device) + if (this._type !== Emulation.DeviceModeModel.Type.Device) return new Insets(0, 0, 0, 0); return this._mode.insets; } @@ -399,55 +399,55 @@ if (!this._target) this._onTargetAvailable = this._calculateAndEmulate.bind(this, resetPageScaleFactor); - if (this._type === WebInspector.DeviceModeModel.Type.Device) { + if (this._type === Emulation.DeviceModeModel.Type.Device) { var orientation = this._device.orientationByName(this._mode.orientation); var outline = this._currentOutline(); var insets = this._currentInsets(); this._fitScale = this._calculateFitScale(orientation.width, orientation.height, outline, insets); if (this._device.mobile()) - this._appliedUserAgentType = this._device.touch() ? WebInspector.DeviceModeModel.UA.Mobile : - WebInspector.DeviceModeModel.UA.MobileNoTouch; + this._appliedUserAgentType = this._device.touch() ? Emulation.DeviceModeModel.UA.Mobile : + Emulation.DeviceModeModel.UA.MobileNoTouch; else - this._appliedUserAgentType = this._device.touch() ? WebInspector.DeviceModeModel.UA.DesktopTouch : - WebInspector.DeviceModeModel.UA.Desktop; + this._appliedUserAgentType = this._device.touch() ? Emulation.DeviceModeModel.UA.DesktopTouch : + Emulation.DeviceModeModel.UA.Desktop; this._applyDeviceMetrics( new Size(orientation.width, orientation.height), insets, outline, this._scaleSetting.get(), this._device.deviceScaleFactor, this._device.mobile(), - this._mode.orientation === WebInspector.EmulatedDevice.Horizontal ? 'landscapePrimary' : 'portraitPrimary', + this._mode.orientation === Emulation.EmulatedDevice.Horizontal ? 'landscapePrimary' : 'portraitPrimary', resetPageScaleFactor); this._applyUserAgent(this._device.userAgent); this._applyTouch(this._device.touch(), this._device.mobile()); - } else if (this._type === WebInspector.DeviceModeModel.Type.None) { + } else if (this._type === Emulation.DeviceModeModel.Type.None) { this._fitScale = this._calculateFitScale(this._availableSize.width, this._availableSize.height); - this._appliedUserAgentType = WebInspector.DeviceModeModel.UA.Desktop; + this._appliedUserAgentType = Emulation.DeviceModeModel.UA.Desktop; this._applyDeviceMetrics( this._availableSize, new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0), 1, 0, false, '', resetPageScaleFactor); this._applyUserAgent(''); this._applyTouch(false, false); - } else if (this._type === WebInspector.DeviceModeModel.Type.Responsive) { + } else if (this._type === Emulation.DeviceModeModel.Type.Responsive) { var screenWidth = this._widthSetting.get(); if (!screenWidth || screenWidth > this._preferredScaledWidth()) screenWidth = this._preferredScaledWidth(); var screenHeight = this._heightSetting.get(); if (!screenHeight || screenHeight > this._preferredScaledHeight()) screenHeight = this._preferredScaledHeight(); - var mobile = this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile || - this._uaSetting.get() === WebInspector.DeviceModeModel.UA.MobileNoTouch; - var defaultDeviceScaleFactor = mobile ? WebInspector.DeviceModeModel.defaultMobileScaleFactor : 0; + var mobile = this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile || + this._uaSetting.get() === Emulation.DeviceModeModel.UA.MobileNoTouch; + var defaultDeviceScaleFactor = mobile ? Emulation.DeviceModeModel.defaultMobileScaleFactor : 0; this._fitScale = this._calculateFitScale(this._widthSetting.get(), this._heightSetting.get()); this._appliedUserAgentType = this._uaSetting.get(); this._applyDeviceMetrics( new Size(screenWidth, screenHeight), new Insets(0, 0, 0, 0), new Insets(0, 0, 0, 0), this._scaleSetting.get(), this._deviceScaleFactorSetting.get() || defaultDeviceScaleFactor, mobile, screenHeight >= screenWidth ? 'portraitPrimary' : 'landscapePrimary', resetPageScaleFactor); - this._applyUserAgent(mobile ? WebInspector.DeviceModeModel._defaultMobileUserAgent : ''); + this._applyUserAgent(mobile ? Emulation.DeviceModeModel._defaultMobileUserAgent : ''); this._applyTouch( - this._uaSetting.get() === WebInspector.DeviceModeModel.UA.DesktopTouch || - this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile, - this._uaSetting.get() === WebInspector.DeviceModeModel.UA.Mobile); + this._uaSetting.get() === Emulation.DeviceModeModel.UA.DesktopTouch || + this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile, + this._uaSetting.get() === Emulation.DeviceModeModel.UA.Mobile); } if (this._target) - this._target.renderingAgent().setShowViewportSizeOnResize(this._type === WebInspector.DeviceModeModel.Type.None); + this._target.renderingAgent().setShowViewportSizeOnResize(this._type === Emulation.DeviceModeModel.Type.None); this._updateCallback.call(null); } @@ -495,7 +495,7 @@ * @param {string} userAgent */ _applyUserAgent(userAgent) { - WebInspector.multitargetNetworkManager.setUserAgentOverride(userAgent); + SDK.multitargetNetworkManager.setUserAgentOverride(userAgent); } /** @@ -529,13 +529,13 @@ this._appliedDeviceSize = screenSize; this._appliedDeviceScaleFactor = deviceScaleFactor || window.devicePixelRatio; - this._screenRect = new WebInspector.Rect( + this._screenRect = new Common.Rect( Math.max(0, (this._availableSize.width - screenSize.width * scale) / 2), outline.top * scale, screenSize.width * scale, screenSize.height * scale); - this._outlineRect = new WebInspector.Rect( + this._outlineRect = new Common.Rect( this._screenRect.left - outline.left * scale, 0, (outline.left + screenSize.width + outline.right) * scale, (outline.top + screenSize.height + outline.bottom) * scale); - this._visiblePageRect = new WebInspector.Rect( + this._visiblePageRect = new Common.Rect( positionX * scale, positionY * scale, Math.min(pageWidth * scale, this._availableSize.width - this._screenRect.left - positionX * scale), Math.min(pageHeight * scale, this._availableSize.height - this._screenRect.top - positionY * scale)); @@ -557,7 +557,7 @@ this._deviceMetricsThrottler.schedule(setDeviceMetricsOverride.bind(this)); /** - * @this {WebInspector.DeviceModeModel} + * @this {Emulation.DeviceModeModel} * @return {!Promise.<?>} */ function setDeviceMetricsOverride() { @@ -604,32 +604,32 @@ * @param {boolean} mobile */ _applyTouch(touchEnabled, mobile) { - WebInspector.MultitargetTouchModel.instance().setTouchEnabled(touchEnabled, mobile); + Emulation.MultitargetTouchModel.instance().setTouchEnabled(touchEnabled, mobile); } }; /** @enum {string} */ -WebInspector.DeviceModeModel.Type = { +Emulation.DeviceModeModel.Type = { None: 'None', Responsive: 'Responsive', Device: 'Device' }; /** @enum {string} */ -WebInspector.DeviceModeModel.UA = { - Mobile: WebInspector.UIString('Mobile'), - MobileNoTouch: WebInspector.UIString('Mobile (no touch)'), - Desktop: WebInspector.UIString('Desktop'), - DesktopTouch: WebInspector.UIString('Desktop (touch)') +Emulation.DeviceModeModel.UA = { + Mobile: Common.UIString('Mobile'), + MobileNoTouch: Common.UIString('Mobile (no touch)'), + Desktop: Common.UIString('Desktop'), + DesktopTouch: Common.UIString('Desktop (touch)') }; -WebInspector.DeviceModeModel.MinDeviceSize = 50; -WebInspector.DeviceModeModel.MaxDeviceSize = 9999; +Emulation.DeviceModeModel.MinDeviceSize = 50; +Emulation.DeviceModeModel.MaxDeviceSize = 9999; -WebInspector.DeviceModeModel._defaultMobileUserAgent = +Emulation.DeviceModeModel._defaultMobileUserAgent = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36'; -WebInspector.DeviceModeModel._defaultMobileUserAgent = - WebInspector.MultitargetNetworkManager.patchUserAgentWithChromeVersion( - WebInspector.DeviceModeModel._defaultMobileUserAgent); -WebInspector.DeviceModeModel.defaultMobileScaleFactor = 2; +Emulation.DeviceModeModel._defaultMobileUserAgent = + SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion( + Emulation.DeviceModeModel._defaultMobileUserAgent); +Emulation.DeviceModeModel.defaultMobileScaleFactor = 2;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js index 6a448b3b..3d97de2 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.DeviceModeToolbar = class { +Emulation.DeviceModeToolbar = class { /** - * @param {!WebInspector.DeviceModeModel} model - * @param {!WebInspector.Setting} showMediaInspectorSetting - * @param {!WebInspector.Setting} showRulersSetting + * @param {!Emulation.DeviceModeModel} model + * @param {!Common.Setting} showMediaInspectorSetting + * @param {!Common.Setting} showRulersSetting */ constructor(model, showMediaInspectorSetting, showRulersSetting) { this._model = model; @@ -16,77 +16,77 @@ this._showRulersSetting = showRulersSetting; this._deviceOutlineSetting = this._model.deviceOutlineSetting(); - this._showDeviceScaleFactorSetting = WebInspector.settings.createSetting('emulation.showDeviceScaleFactor', false); + this._showDeviceScaleFactorSetting = Common.settings.createSetting('emulation.showDeviceScaleFactor', false); this._showDeviceScaleFactorSetting.addChangeListener(this._updateDeviceScaleFactorVisibility, this); - this._showUserAgentTypeSetting = WebInspector.settings.createSetting('emulation.showUserAgentType', false); + this._showUserAgentTypeSetting = Common.settings.createSetting('emulation.showUserAgentType', false); this._showUserAgentTypeSetting.addChangeListener(this._updateUserAgentTypeVisibility, this); - this._showNetworkConditionsSetting = WebInspector.settings.createSetting('emulation.showNetworkConditions', false); + this._showNetworkConditionsSetting = Common.settings.createSetting('emulation.showNetworkConditions', false); this._showNetworkConditionsSetting.addChangeListener(this._updateNetworkConditionsVisibility, this); - /** @type {!Map<!WebInspector.EmulatedDevice, !WebInspector.EmulatedDevice.Mode>} */ + /** @type {!Map<!Emulation.EmulatedDevice, !Emulation.EmulatedDevice.Mode>} */ this._lastMode = new Map(); - /** @type {!Map<!WebInspector.EmulatedDevice, number>} */ + /** @type {!Map<!Emulation.EmulatedDevice, number>} */ this._lastScale = new Map(); this._element = createElementWithClass('div', 'device-mode-toolbar'); var leftContainer = this._element.createChild('div', 'device-mode-toolbar-spacer'); leftContainer.createChild('div', 'device-mode-toolbar-spacer'); - var leftToolbar = new WebInspector.Toolbar('', leftContainer); + var leftToolbar = new UI.Toolbar('', leftContainer); leftToolbar.makeWrappable(); this._fillLeftToolbar(leftToolbar); - var mainToolbar = new WebInspector.Toolbar('', this._element); + var mainToolbar = new UI.Toolbar('', this._element); mainToolbar.makeWrappable(); this._fillMainToolbar(mainToolbar); var rightContainer = this._element.createChild('div', 'device-mode-toolbar-spacer'); - var rightToolbar = new WebInspector.Toolbar('device-mode-toolbar-fixed-size', rightContainer); + var rightToolbar = new UI.Toolbar('device-mode-toolbar-fixed-size', rightContainer); rightToolbar.makeWrappable(); this._fillRightToolbar(rightToolbar); - var modeToolbar = new WebInspector.Toolbar('device-mode-toolbar-fixed-size', rightContainer); + var modeToolbar = new UI.Toolbar('device-mode-toolbar-fixed-size', rightContainer); modeToolbar.makeWrappable(); this._fillModeToolbar(modeToolbar); rightContainer.createChild('div', 'device-mode-toolbar-spacer'); - var optionsToolbar = new WebInspector.Toolbar('', rightContainer); + var optionsToolbar = new UI.Toolbar('', rightContainer); optionsToolbar.makeWrappable(true); this._fillOptionsToolbar(optionsToolbar); - this._emulatedDevicesList = WebInspector.EmulatedDevicesList.instance(); + this._emulatedDevicesList = Emulation.EmulatedDevicesList.instance(); this._emulatedDevicesList.addEventListener( - WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated, this._deviceListChanged, this); + Emulation.EmulatedDevicesList.Events.CustomDevicesUpdated, this._deviceListChanged, this); this._emulatedDevicesList.addEventListener( - WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated, this._deviceListChanged, this); + Emulation.EmulatedDevicesList.Events.StandardDevicesUpdated, this._deviceListChanged, this); this._persistenceSetting = - WebInspector.settings.createSetting('emulation.deviceModeValue', {device: '', orientation: '', mode: ''}); + Common.settings.createSetting('emulation.deviceModeValue', {device: '', orientation: '', mode: ''}); } /** - * @param {!WebInspector.Toolbar} toolbar + * @param {!UI.Toolbar} toolbar */ _fillLeftToolbar(toolbar) { toolbar.appendToolbarItem( this._wrapToolbarItem(createElementWithClass('div', 'device-mode-empty-toolbar-element'))); - this._deviceSelectItem = new WebInspector.ToolbarMenuButton(this._appendDeviceMenuItems.bind(this)); + this._deviceSelectItem = new UI.ToolbarMenuButton(this._appendDeviceMenuItems.bind(this)); this._deviceSelectItem.setGlyph(''); this._deviceSelectItem.turnIntoSelect(95); toolbar.appendToolbarItem(this._deviceSelectItem); } /** - * @param {!WebInspector.Toolbar} toolbar + * @param {!UI.Toolbar} toolbar */ _fillMainToolbar(toolbar) { var widthInput = createElementWithClass('input', 'device-mode-size-input'); widthInput.maxLength = 4; widthInput.type = 'text'; - widthInput.title = WebInspector.UIString('Width'); - this._updateWidthInput = WebInspector.bindInput( - widthInput, this._applyWidth.bind(this), WebInspector.DeviceModeModel.deviceSizeValidator, true); + widthInput.title = Common.UIString('Width'); + this._updateWidthInput = UI.bindInput( + widthInput, this._applyWidth.bind(this), Emulation.DeviceModeModel.deviceSizeValidator, true); this._widthInput = widthInput; this._widthItem = this._wrapToolbarItem(widthInput); toolbar.appendToolbarItem(this._widthItem); @@ -99,8 +99,8 @@ var heightInput = createElementWithClass('input', 'device-mode-size-input'); heightInput.maxLength = 4; heightInput.type = 'text'; - heightInput.title = WebInspector.UIString('Height (leave empty for full)'); - this._updateHeightInput = WebInspector.bindInput(heightInput, this._applyHeight.bind(this), validateHeight, true); + heightInput.title = Common.UIString('Height (leave empty for full)'); + this._updateHeightInput = UI.bindInput(heightInput, this._applyHeight.bind(this), validateHeight, true); this._heightInput = heightInput; this._heightItem = this._wrapToolbarItem(heightInput); toolbar.appendToolbarItem(this._heightItem); @@ -110,7 +110,7 @@ * @return {boolean} */ function validateHeight(value) { - return !value || WebInspector.DeviceModeModel.deviceSizeValidator(value); + return !value || Emulation.DeviceModeModel.deviceSizeValidator(value); } } @@ -131,22 +131,22 @@ } /** - * @param {!WebInspector.Toolbar} toolbar + * @param {!UI.Toolbar} toolbar */ _fillRightToolbar(toolbar) { toolbar.appendToolbarItem( this._wrapToolbarItem(createElementWithClass('div', 'device-mode-empty-toolbar-element'))); - this._scaleItem = new WebInspector.ToolbarMenuButton(this._appendScaleMenuItems.bind(this)); - this._scaleItem.setTitle(WebInspector.UIString('Zoom')); + this._scaleItem = new UI.ToolbarMenuButton(this._appendScaleMenuItems.bind(this)); + this._scaleItem.setTitle(Common.UIString('Zoom')); this._scaleItem.setGlyph(''); this._scaleItem.turnIntoSelect(); toolbar.appendToolbarItem(this._scaleItem); toolbar.appendToolbarItem( this._wrapToolbarItem(createElementWithClass('div', 'device-mode-empty-toolbar-element'))); - this._deviceScaleItem = new WebInspector.ToolbarMenuButton(this._appendDeviceScaleMenuItems.bind(this)); + this._deviceScaleItem = new UI.ToolbarMenuButton(this._appendDeviceScaleMenuItems.bind(this)); this._deviceScaleItem.setVisible(this._showDeviceScaleFactorSetting.get()); - this._deviceScaleItem.setTitle(WebInspector.UIString('Device pixel ratio')); + this._deviceScaleItem.setTitle(Common.UIString('Device pixel ratio')); this._deviceScaleItem.setGlyph(''); this._deviceScaleItem.turnIntoSelect(); this._deviceScaleItem.element.style.padding = '0 5px'; @@ -154,9 +154,9 @@ toolbar.appendToolbarItem( this._wrapToolbarItem(createElementWithClass('div', 'device-mode-empty-toolbar-element'))); - this._uaItem = new WebInspector.ToolbarMenuButton(this._appendUserAgentMenuItems.bind(this)); + this._uaItem = new UI.ToolbarMenuButton(this._appendUserAgentMenuItems.bind(this)); this._uaItem.setVisible(this._showUserAgentTypeSetting.get()); - this._uaItem.setTitle(WebInspector.UIString('Device type')); + this._uaItem.setTitle(Common.UIString('Device type')); this._uaItem.setGlyph(''); this._uaItem.turnIntoSelect(); this._uaItem.element.style.padding = '0 5px'; @@ -164,29 +164,29 @@ } /** - * @param {!WebInspector.Toolbar} toolbar + * @param {!UI.Toolbar} toolbar */ _fillModeToolbar(toolbar) { toolbar.appendToolbarItem( this._wrapToolbarItem(createElementWithClass('div', 'device-mode-empty-toolbar-element'))); - this._modeButton = new WebInspector.ToolbarButton('', 'largeicon-rotate-screen'); + this._modeButton = new UI.ToolbarButton('', 'largeicon-rotate-screen'); this._modeButton.addEventListener('click', this._modeMenuClicked, this); toolbar.appendToolbarItem(this._modeButton); } /** - * @param {!WebInspector.Toolbar} toolbar + * @param {!UI.Toolbar} toolbar */ _fillOptionsToolbar(toolbar) { - this._networkConditionsItem = WebInspector.NetworkConditionsSelector.createToolbarMenuButton(); + this._networkConditionsItem = Components.NetworkConditionsSelector.createToolbarMenuButton(); this._networkConditionsItem.setVisible(this._showNetworkConditionsSetting.get()); - this._networkConditionsItem.setTitle(WebInspector.UIString('Network throttling')); + this._networkConditionsItem.setTitle(Common.UIString('Network throttling')); this._networkConditionsItem.element.style.padding = '0 5px'; this._networkConditionsItem.element.style.maxWidth = '140px'; toolbar.appendToolbarItem(this._networkConditionsItem); - var moreOptionsButton = new WebInspector.ToolbarMenuButton(this._appendOptionsMenuItems.bind(this)); - moreOptionsButton.setTitle(WebInspector.UIString('More options')); + var moreOptionsButton = new UI.ToolbarMenuButton(this._appendOptionsMenuItems.bind(this)); + moreOptionsButton.setTitle(Common.UIString('More options')); toolbar.appendToolbarItem(moreOptionsButton); toolbar.appendToolbarItem( @@ -194,26 +194,26 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendScaleMenuItems(contextMenu) { - if (this._model.type() === WebInspector.DeviceModeModel.Type.Device) { + if (this._model.type() === Emulation.DeviceModeModel.Type.Device) { contextMenu.appendItem( - WebInspector.UIString('Fit to window (%.0f%%)', this._model.fitScale() * 100), + Common.UIString('Fit to window (%.0f%%)', this._model.fitScale() * 100), this._onScaleMenuChanged.bind(this, this._model.fitScale()), false); contextMenu.appendSeparator(); } var boundAppendScaleItem = appendScaleItem.bind(this); - boundAppendScaleItem(WebInspector.UIString('50%'), 0.5); - boundAppendScaleItem(WebInspector.UIString('75%'), 0.75); - boundAppendScaleItem(WebInspector.UIString('100%'), 1); - boundAppendScaleItem(WebInspector.UIString('125%'), 1.25); - boundAppendScaleItem(WebInspector.UIString('150%'), 1.5); + boundAppendScaleItem(Common.UIString('50%'), 0.5); + boundAppendScaleItem(Common.UIString('75%'), 0.75); + boundAppendScaleItem(Common.UIString('100%'), 1); + boundAppendScaleItem(Common.UIString('125%'), 1.25); + boundAppendScaleItem(Common.UIString('150%'), 1.5); /** * @param {string} title * @param {number} value - * @this {!WebInspector.DeviceModeToolbar} + * @this {!Emulation.DeviceModeToolbar} */ function appendScaleItem(title, value) { contextMenu.appendCheckboxItem( @@ -232,19 +232,19 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendDeviceScaleMenuItems(contextMenu) { var deviceScaleFactorSetting = this._model.deviceScaleFactorSetting(); - var defaultValue = this._model.uaSetting().get() === WebInspector.DeviceModeModel.UA.Mobile || - this._model.uaSetting().get() === WebInspector.DeviceModeModel.UA.MobileNoTouch ? - WebInspector.DeviceModeModel.defaultMobileScaleFactor : + var defaultValue = this._model.uaSetting().get() === Emulation.DeviceModeModel.UA.Mobile || + this._model.uaSetting().get() === Emulation.DeviceModeModel.UA.MobileNoTouch ? + Emulation.DeviceModeModel.defaultMobileScaleFactor : window.devicePixelRatio; - appendDeviceScaleFactorItem(WebInspector.UIString('Default: %.1f', defaultValue), 0); + appendDeviceScaleFactorItem(Common.UIString('Default: %.1f', defaultValue), 0); contextMenu.appendSeparator(); - appendDeviceScaleFactorItem(WebInspector.UIString('1'), 1); - appendDeviceScaleFactorItem(WebInspector.UIString('2'), 2); - appendDeviceScaleFactorItem(WebInspector.UIString('3'), 3); + appendDeviceScaleFactorItem(Common.UIString('1'), 1); + appendDeviceScaleFactorItem(Common.UIString('2'), 2); + appendDeviceScaleFactorItem(Common.UIString('3'), 3); /** * @param {string} title @@ -258,18 +258,18 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendUserAgentMenuItems(contextMenu) { var uaSetting = this._model.uaSetting(); - appendUAItem(WebInspector.DeviceModeModel.UA.Mobile, WebInspector.DeviceModeModel.UA.Mobile); - appendUAItem(WebInspector.DeviceModeModel.UA.MobileNoTouch, WebInspector.DeviceModeModel.UA.MobileNoTouch); - appendUAItem(WebInspector.DeviceModeModel.UA.Desktop, WebInspector.DeviceModeModel.UA.Desktop); - appendUAItem(WebInspector.DeviceModeModel.UA.DesktopTouch, WebInspector.DeviceModeModel.UA.DesktopTouch); + appendUAItem(Emulation.DeviceModeModel.UA.Mobile, Emulation.DeviceModeModel.UA.Mobile); + appendUAItem(Emulation.DeviceModeModel.UA.MobileNoTouch, Emulation.DeviceModeModel.UA.MobileNoTouch); + appendUAItem(Emulation.DeviceModeModel.UA.Desktop, Emulation.DeviceModeModel.UA.Desktop); + appendUAItem(Emulation.DeviceModeModel.UA.DesktopTouch, Emulation.DeviceModeModel.UA.DesktopTouch); /** * @param {string} title - * @param {!WebInspector.DeviceModeModel.UA} value + * @param {!Emulation.DeviceModeModel.UA} value */ function appendUAItem(title, value) { contextMenu.appendCheckboxItem(title, uaSetting.set.bind(uaSetting, value), uaSetting.get() === value); @@ -277,42 +277,42 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendOptionsMenuItems(contextMenu) { var model = this._model; appendToggleItem( - this._deviceOutlineSetting, WebInspector.UIString('Hide device frame'), - WebInspector.UIString('Show device frame'), model.type() !== WebInspector.DeviceModeModel.Type.Device); + this._deviceOutlineSetting, Common.UIString('Hide device frame'), + Common.UIString('Show device frame'), model.type() !== Emulation.DeviceModeModel.Type.Device); appendToggleItem( - this._showMediaInspectorSetting, WebInspector.UIString('Hide media queries'), - WebInspector.UIString('Show media queries')); + this._showMediaInspectorSetting, Common.UIString('Hide media queries'), + Common.UIString('Show media queries')); appendToggleItem( - this._showRulersSetting, WebInspector.UIString('Hide rulers'), WebInspector.UIString('Show rulers')); + this._showRulersSetting, Common.UIString('Hide rulers'), Common.UIString('Show rulers')); contextMenu.appendSeparator(); appendToggleItem( - this._showDeviceScaleFactorSetting, WebInspector.UIString('Remove device pixel ratio'), - WebInspector.UIString('Add device pixel ratio')); + this._showDeviceScaleFactorSetting, Common.UIString('Remove device pixel ratio'), + Common.UIString('Add device pixel ratio')); appendToggleItem( - this._showUserAgentTypeSetting, WebInspector.UIString('Remove device type'), - WebInspector.UIString('Add device type')); + this._showUserAgentTypeSetting, Common.UIString('Remove device type'), + Common.UIString('Add device type')); appendToggleItem( - this._showNetworkConditionsSetting, WebInspector.UIString('Remove network throttling'), - WebInspector.UIString('Add network throttling')); + this._showNetworkConditionsSetting, Common.UIString('Remove network throttling'), + Common.UIString('Add network throttling')); contextMenu.appendSeparator(); contextMenu.appendItemsAtLocation('deviceModeMenu'); contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Reset to defaults'), this._reset.bind(this)); + contextMenu.appendItem(Common.UIString('Reset to defaults'), this._reset.bind(this)); /** - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting * @param {string} title1 * @param {string} title2 * @param {boolean=} disabled */ function appendToggleItem(setting, title1, title2, disabled) { if (typeof disabled === 'undefined') - disabled = model.type() === WebInspector.DeviceModeModel.Type.None; + disabled = model.type() === Emulation.DeviceModeModel.Type.None; contextMenu.appendItem(setting.get() ? title1 : title2, setting.set.bind(setting, !setting.get()), disabled); } } @@ -329,78 +329,78 @@ /** * @param {!Element} element - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ _wrapToolbarItem(element) { var container = createElement('div'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(container, 'emulation/deviceModeToolbar.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(container, 'emulation/deviceModeToolbar.css'); shadowRoot.appendChild(element); - return new WebInspector.ToolbarItem(container); + return new UI.ToolbarItem(container); } /** - * @param {!WebInspector.EmulatedDevice} device + * @param {!Emulation.EmulatedDevice} device */ _emulateDevice(device) { this._model.emulate( - WebInspector.DeviceModeModel.Type.Device, device, this._lastMode.get(device) || device.modes[0], + Emulation.DeviceModeModel.Type.Device, device, this._lastMode.get(device) || device.modes[0], this._lastScale.get(device)); } _switchToResponsive() { - this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); + this._model.emulate(Emulation.DeviceModeModel.Type.Responsive, null, null); } /** - * @param {!Array<!WebInspector.EmulatedDevice>} devices - * @return {!Array<!WebInspector.EmulatedDevice>} + * @param {!Array<!Emulation.EmulatedDevice>} devices + * @return {!Array<!Emulation.EmulatedDevice>} */ _filterDevices(devices) { devices = devices.filter(function(d) { return d.show(); }); - devices.sort(WebInspector.EmulatedDevice.deviceComparator); + devices.sort(Emulation.EmulatedDevice.deviceComparator); return devices; } /** - * @return {!Array<!WebInspector.EmulatedDevice>} + * @return {!Array<!Emulation.EmulatedDevice>} */ _standardDevices() { return this._filterDevices(this._emulatedDevicesList.standard()); } /** - * @return {!Array<!WebInspector.EmulatedDevice>} + * @return {!Array<!Emulation.EmulatedDevice>} */ _customDevices() { return this._filterDevices(this._emulatedDevicesList.custom()); } /** - * @return {!Array<!WebInspector.EmulatedDevice>} + * @return {!Array<!Emulation.EmulatedDevice>} */ _allDevices() { return this._standardDevices().concat(this._customDevices()); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendDeviceMenuItems(contextMenu) { contextMenu.appendCheckboxItem( - WebInspector.UIString('Responsive'), this._switchToResponsive.bind(this), - this._model.type() === WebInspector.DeviceModeModel.Type.Responsive, false); + Common.UIString('Responsive'), this._switchToResponsive.bind(this), + this._model.type() === Emulation.DeviceModeModel.Type.Responsive, false); appendGroup.call(this, this._standardDevices()); appendGroup.call(this, this._customDevices()); contextMenu.appendSeparator(); contextMenu.appendItem( - WebInspector.UIString('Edit\u2026'), + Common.UIString('Edit\u2026'), this._emulatedDevicesList.revealCustomSetting.bind(this._emulatedDevicesList), false); /** - * @param {!Array<!WebInspector.EmulatedDevice>} devices - * @this {WebInspector.DeviceModeToolbar} + * @param {!Array<!Emulation.EmulatedDevice>} devices + * @this {Emulation.DeviceModeToolbar} */ function appendGroup(devices) { if (!devices.length) @@ -413,7 +413,7 @@ } /** - * @this {WebInspector.DeviceModeToolbar} + * @this {Emulation.DeviceModeToolbar} */ _deviceListChanged() { var device = this._model.device(); @@ -425,7 +425,7 @@ if (devices.length) this._emulateDevice(devices[0]); else - this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); + this._model.emulate(Emulation.DeviceModeModel.Type.Responsive, null, null); } } @@ -442,7 +442,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _modeMenuClicked(event) { var device = this._model.device(); @@ -453,11 +453,11 @@ return; } - var contextMenu = new WebInspector.ContextMenu( + var contextMenu = new UI.ContextMenu( /** @type {!Event} */ (event.data), false, event.target.element.totalOffsetLeft(), event.target.element.totalOffsetTop() + event.target.element.offsetHeight); - addOrientation(WebInspector.EmulatedDevice.Vertical, WebInspector.UIString('Portrait')); - addOrientation(WebInspector.EmulatedDevice.Horizontal, WebInspector.UIString('Landscape')); + addOrientation(Emulation.EmulatedDevice.Vertical, Common.UIString('Portrait')); + addOrientation(Emulation.EmulatedDevice.Horizontal, Common.UIString('Landscape')); contextMenu.show(); /** @@ -477,7 +477,7 @@ } /** - * @param {!WebInspector.EmulatedDevice.Mode} mode + * @param {!Emulation.EmulatedDevice.Mode} mode * @param {string} title */ function addMode(mode, title) { @@ -485,7 +485,7 @@ } /** - * @param {!WebInspector.EmulatedDevice.Mode} mode + * @param {!Emulation.EmulatedDevice.Mode} mode */ function applyMode(mode) { model.emulate(model.type(), model.device(), mode); @@ -502,28 +502,28 @@ update() { if (this._model.type() !== this._cachedModelType) { this._cachedModelType = this._model.type(); - this._widthInput.disabled = this._model.type() !== WebInspector.DeviceModeModel.Type.Responsive; - this._heightInput.disabled = this._model.type() !== WebInspector.DeviceModeModel.Type.Responsive; - this._deviceScaleItem.setEnabled(this._model.type() === WebInspector.DeviceModeModel.Type.Responsive); - this._uaItem.setEnabled(this._model.type() === WebInspector.DeviceModeModel.Type.Responsive); + this._widthInput.disabled = this._model.type() !== Emulation.DeviceModeModel.Type.Responsive; + this._heightInput.disabled = this._model.type() !== Emulation.DeviceModeModel.Type.Responsive; + this._deviceScaleItem.setEnabled(this._model.type() === Emulation.DeviceModeModel.Type.Responsive); + this._uaItem.setEnabled(this._model.type() === Emulation.DeviceModeModel.Type.Responsive); } var size = this._model.appliedDeviceSize(); this._updateHeightInput( - this._model.type() === WebInspector.DeviceModeModel.Type.Responsive && this._model.isFullHeight() ? + this._model.type() === Emulation.DeviceModeModel.Type.Responsive && this._model.isFullHeight() ? '' : String(size.height)); this._updateWidthInput(String(size.width)); this._heightInput.placeholder = size.height; if (this._model.scale() !== this._cachedScale) { - this._scaleItem.setText(WebInspector.UIString('%.0f%%', this._model.scale() * 100)); + this._scaleItem.setText(Common.UIString('%.0f%%', this._model.scale() * 100)); this._cachedScale = this._model.scale(); } var deviceScale = this._model.appliedDeviceScaleFactor(); if (deviceScale !== this._cachedDeviceScale) { - this._deviceScaleItem.setText(WebInspector.UIString('DPR: %.1f', deviceScale)); + this._deviceScaleItem.setText(Common.UIString('DPR: %.1f', deviceScale)); this._cachedDeviceScale = deviceScale; } @@ -533,10 +533,10 @@ this._cachedUaType = uaType; } - var deviceItemTitle = WebInspector.UIString('None'); - if (this._model.type() === WebInspector.DeviceModeModel.Type.Responsive) - deviceItemTitle = WebInspector.UIString('Responsive'); - if (this._model.type() === WebInspector.DeviceModeModel.Type.Device) + var deviceItemTitle = Common.UIString('None'); + if (this._model.type() === Emulation.DeviceModeModel.Type.Responsive) + deviceItemTitle = Common.UIString('Responsive'); + if (this._model.type() === Emulation.DeviceModeModel.Type.Device) deviceItemTitle = this._model.device().title; this._deviceSelectItem.setText(deviceItemTitle); @@ -547,17 +547,17 @@ var modeCount = device ? device.modes.length : 0; this._modeButton.setEnabled(modeCount >= 2); this._modeButton.setTitle( - modeCount === 2 ? WebInspector.UIString('Rotate') : WebInspector.UIString('Screen options')); + modeCount === 2 ? Common.UIString('Rotate') : Common.UIString('Screen options')); } this._cachedModelDevice = device; } - if (this._model.type() === WebInspector.DeviceModeModel.Type.Device) + if (this._model.type() === Emulation.DeviceModeModel.Type.Device) this._lastMode.set( - /** @type {!WebInspector.EmulatedDevice} */ (this._model.device()), - /** @type {!WebInspector.EmulatedDevice.Mode} */ (this._model.mode())); + /** @type {!Emulation.EmulatedDevice} */ (this._model.device()), + /** @type {!Emulation.EmulatedDevice.Mode} */ (this._model.mode())); - if (this._model.mode() !== this._cachedModelMode && this._model.type() !== WebInspector.DeviceModeModel.Type.None) { + if (this._model.mode() !== this._cachedModelMode && this._model.type() !== Emulation.DeviceModeModel.Type.None) { this._cachedModelMode = this._model.mode(); var value = this._persistenceSetting.get(); if (this._model.device()) { @@ -587,6 +587,6 @@ } } - this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); + this._model.emulate(Emulation.DeviceModeModel.Type.Responsive, null, null); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js index 6e0f8056..411b20b 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -4,34 +4,34 @@ /** * @unrestricted */ -WebInspector.DeviceModeView = class extends WebInspector.VBox { +Emulation.DeviceModeView = class extends UI.VBox { constructor() { super(true); this.setMinimumSize(150, 150); this.element.classList.add('device-mode-view'); this.registerRequiredCSS('emulation/deviceModeView.css'); - WebInspector.Tooltip.addNativeOverrideContainer(this.contentElement); + UI.Tooltip.addNativeOverrideContainer(this.contentElement); - this._model = new WebInspector.DeviceModeModel(this._updateUI.bind(this)); - this._mediaInspector = new WebInspector.MediaQueryInspector( + this._model = new Emulation.DeviceModeModel(this._updateUI.bind(this)); + this._mediaInspector = new Emulation.MediaQueryInspector( () => this._model.appliedDeviceSize().width, this._model.setWidth.bind(this._model)); - this._showMediaInspectorSetting = WebInspector.settings.moduleSetting('showMediaQueryInspector'); + this._showMediaInspectorSetting = Common.settings.moduleSetting('showMediaQueryInspector'); this._showMediaInspectorSetting.addChangeListener(this._updateUI, this); - this._showRulersSetting = WebInspector.settings.moduleSetting('emulation.showRulers'); + this._showRulersSetting = Common.settings.moduleSetting('emulation.showRulers'); this._showRulersSetting.addChangeListener(this._updateUI, this); - this._topRuler = new WebInspector.DeviceModeView.Ruler(true, this._model.setWidthAndScaleToFit.bind(this._model)); + this._topRuler = new Emulation.DeviceModeView.Ruler(true, this._model.setWidthAndScaleToFit.bind(this._model)); this._topRuler.element.classList.add('device-mode-ruler-top'); this._leftRuler = - new WebInspector.DeviceModeView.Ruler(false, this._model.setHeightAndScaleToFit.bind(this._model)); + new Emulation.DeviceModeView.Ruler(false, this._model.setHeightAndScaleToFit.bind(this._model)); this._leftRuler.element.classList.add('device-mode-ruler-left'); this._createUI(); - WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._zoomChanged, this); + UI.zoomManager.addEventListener(UI.ZoomManager.Events.ZoomChanged, this._zoomChanged, this); } _createUI() { this._toolbar = - new WebInspector.DeviceModeToolbar(this._model, this._showMediaInspectorSetting, this._showRulersSetting); + new Emulation.DeviceModeToolbar(this._model, this._showMediaInspectorSetting, this._showRulersSetting); this.contentElement.appendChild(this._toolbar.element()); this._contentClip = this.contentElement.createChild('div', 'device-mode-content-clip vbox'); @@ -71,7 +71,7 @@ this._bottomResizerElement.createChild('div', ''); this._createResizer(this._bottomResizerElement, 0, 1); this._bottomResizerElement.addEventListener('dblclick', this._model.setHeight.bind(this._model, 0), false); - this._bottomResizerElement.title = WebInspector.UIString('Double-click for full height'); + this._bottomResizerElement.title = Common.UIString('Double-click for full height'); this._pageArea = this._screenArea.createChild('div', 'device-mode-page-area'); this._pageArea.createChild('content'); @@ -80,9 +80,9 @@ _populatePresetsContainer() { var sizes = [320, 375, 425, 768, 1024, 1440, 2560]; var titles = [ - WebInspector.UIString('Mobile S'), WebInspector.UIString('Mobile M'), WebInspector.UIString('Mobile L'), - WebInspector.UIString('Tablet'), WebInspector.UIString('Laptop'), WebInspector.UIString('Laptop L'), - WebInspector.UIString('4K') + Common.UIString('Mobile S'), Common.UIString('Mobile M'), Common.UIString('Mobile L'), + Common.UIString('Tablet'), Common.UIString('Laptop'), Common.UIString('Laptop L'), + Common.UIString('4K') ]; this._presetBlocks = []; var inner = this._responsivePresetsContainer.createChild('div', 'device-mode-presets-container-inner'); @@ -98,10 +98,10 @@ /** * @param {number} width * @param {!Event} e - * @this {WebInspector.DeviceModeView} + * @this {Emulation.DeviceModeView} */ function applySize(width, e) { - this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); + this._model.emulate(Emulation.DeviceModeModel.Type.Responsive, null, null); this._model.setSizeAndScaleToFit(width, 0); e.consume(); } @@ -111,10 +111,10 @@ * @param {!Element} element * @param {number} widthFactor * @param {number} heightFactor - * @return {!WebInspector.ResizerWidget} + * @return {!UI.ResizerWidget} */ _createResizer(element, widthFactor, heightFactor) { - var resizer = new WebInspector.ResizerWidget(); + var resizer = new UI.ResizerWidget(); resizer.addElement(element); var cursor = widthFactor ? 'ew-resize' : 'ns-resize'; if (widthFactor * heightFactor > 0) @@ -122,15 +122,15 @@ if (widthFactor * heightFactor < 0) cursor = 'nesw-resize'; resizer.setCursor(cursor); - resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeStart, this._onResizeStart, this); + resizer.addEventListener(UI.ResizerWidget.Events.ResizeStart, this._onResizeStart, this); resizer.addEventListener( - WebInspector.ResizerWidget.Events.ResizeUpdate, this._onResizeUpdate.bind(this, widthFactor, heightFactor)); - resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeEnd, this._onResizeEnd, this); + UI.ResizerWidget.Events.ResizeUpdate, this._onResizeUpdate.bind(this, widthFactor, heightFactor)); + resizer.addEventListener(UI.ResizerWidget.Events.ResizeEnd, this._onResizeEnd, this); return resizer; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeStart(event) { this._slowPositionStart = null; @@ -141,7 +141,7 @@ /** * @param {number} widthFactor * @param {number} heightFactor - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeUpdate(widthFactor, heightFactor, event) { if (event.data.shiftKey !== !!this._slowPositionStart) @@ -157,36 +157,36 @@ } if (widthFactor) { - var dipOffsetX = cssOffsetX * WebInspector.zoomManager.zoomFactor(); + var dipOffsetX = cssOffsetX * UI.zoomManager.zoomFactor(); var newWidth = this._resizeStart.width + dipOffsetX * widthFactor; newWidth = Math.round(newWidth / this._model.scale()); - if (newWidth >= WebInspector.DeviceModeModel.MinDeviceSize && - newWidth <= WebInspector.DeviceModeModel.MaxDeviceSize) + if (newWidth >= Emulation.DeviceModeModel.MinDeviceSize && + newWidth <= Emulation.DeviceModeModel.MaxDeviceSize) this._model.setWidth(newWidth); } if (heightFactor) { - var dipOffsetY = cssOffsetY * WebInspector.zoomManager.zoomFactor(); + var dipOffsetY = cssOffsetY * UI.zoomManager.zoomFactor(); var newHeight = this._resizeStart.height + dipOffsetY * heightFactor; newHeight = Math.round(newHeight / this._model.scale()); - if (newHeight >= WebInspector.DeviceModeModel.MinDeviceSize && - newHeight <= WebInspector.DeviceModeModel.MaxDeviceSize) + if (newHeight >= Emulation.DeviceModeModel.MinDeviceSize && + newHeight <= Emulation.DeviceModeModel.MaxDeviceSize) this._model.setHeight(newHeight); } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeEnd(event) { delete this._resizeStart; - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ResizedViewInResponsiveMode); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ResizedViewInResponsiveMode); } _updateUI() { /** * @param {!Element} element - * @param {!WebInspector.Rect} rect + * @param {!Common.Rect} rect */ function applyRect(element, rect) { element.style.left = rect.left + 'px'; @@ -198,9 +198,9 @@ if (!this.isShowing()) return; - var zoomFactor = WebInspector.zoomManager.zoomFactor(); + var zoomFactor = UI.zoomManager.zoomFactor(); var callDoResize = false; - var showRulers = this._showRulersSetting.get() && this._model.type() !== WebInspector.DeviceModeModel.Type.None; + var showRulers = this._showRulersSetting.get() && this._model.type() !== Emulation.DeviceModeModel.Type.None; var contentAreaResized = false; var updateRulers = false; @@ -227,7 +227,7 @@ } this._contentClip.classList.toggle('device-mode-outline-visible', !!this._model.outlineImage()); - var resizable = this._model.type() === WebInspector.DeviceModeModel.Type.Responsive; + var resizable = this._model.type() === Emulation.DeviceModeModel.Type.Responsive; if (resizable !== this._cachedResizable) { this._rightResizerElement.classList.toggle('hidden', !resizable); this._leftResizerElement.classList.toggle('hidden', !resizable); @@ -238,7 +238,7 @@ } var mediaInspectorVisible = - this._showMediaInspectorSetting.get() && this._model.type() !== WebInspector.DeviceModeModel.Type.None; + this._showMediaInspectorSetting.get() && this._model.type() !== Emulation.DeviceModeModel.Type.None; if (mediaInspectorVisible !== this._cachedMediaInspectorVisible) { if (mediaInspectorVisible) this._mediaInspector.show(this._mediaInspectorContainer); @@ -312,7 +312,7 @@ } _contentAreaResized() { - var zoomFactor = WebInspector.zoomManager.zoomFactor(); + var zoomFactor = UI.zoomManager.zoomFactor(); var rect = this._contentArea.getBoundingClientRect(); var availableSize = new Size(Math.max(rect.width * zoomFactor, 1), Math.max(rect.height * zoomFactor, 1)); var preferredSize = new Size( @@ -360,23 +360,23 @@ * @override */ willHide() { - this._model.emulate(WebInspector.DeviceModeModel.Type.None, null, null); + this._model.emulate(Emulation.DeviceModeModel.Type.None, null, null); } captureScreenshot() { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (!mainTarget) return; - WebInspector.DOMModel.muteHighlight(); + SDK.DOMModel.muteHighlight(); - var zoomFactor = WebInspector.zoomManager.zoomFactor(); + var zoomFactor = UI.zoomManager.zoomFactor(); var rect = this._contentArea.getBoundingClientRect(); var availableSize = new Size(Math.max(rect.width * zoomFactor, 1), Math.max(rect.height * zoomFactor, 1)); var outlineVisible = this._model.deviceOutlineSetting().get(); if (availableSize.width < this._model.screenRect().width || availableSize.height < this._model.screenRect().height) { - WebInspector.inspectorView.minimize(); + UI.inspectorView.minimize(); this._model.deviceOutlineSetting().set(false); } @@ -385,7 +385,7 @@ /** * @param {?Protocol.Error} error * @param {string} content - * @this {WebInspector.DeviceModeView} + * @this {Emulation.DeviceModeView} */ function screenshotCaptured(error, content) { this._model.deviceOutlineSetting().set(outlineVisible); @@ -400,8 +400,8 @@ outlineRect.left = 0; outlineRect.top = 0; - WebInspector.DOMModel.unmuteHighlight(); - WebInspector.inspectorView.restore(); + SDK.DOMModel.unmuteHighlight(); + UI.inspectorView.restore(); if (error) { console.error(error); @@ -425,7 +425,7 @@ /** * @param {string} src - * @param {!WebInspector.Rect} rect + * @param {!Common.Rect} rect * @return {!Promise<undefined>} */ function paintImage(src, rect) { @@ -452,7 +452,7 @@ } /** - * @this {WebInspector.DeviceModeView} + * @this {Emulation.DeviceModeView} */ function paintScreenshot() { var pageImage = new Image(); @@ -462,8 +462,8 @@ Math.min(pageImage.naturalHeight, screenRect.height)); var url = mainTarget && mainTarget.inspectedURL(); var fileName = url ? url.trimURL().removeURLFragment() : ''; - if (this._model.type() === WebInspector.DeviceModeModel.Type.Device) - fileName += WebInspector.UIString('(%s)', this._model.device().title); + if (this._model.type() === Emulation.DeviceModeModel.Type.Device) + fileName += Common.UIString('(%s)', this._model.device().title); // Trigger download. var link = createElement('a'); link.download = fileName + '.png'; @@ -477,7 +477,7 @@ /** * @unrestricted */ -WebInspector.DeviceModeView.Ruler = class extends WebInspector.VBox { +Emulation.DeviceModeView.Ruler = class extends UI.VBox { /** * @param {boolean} horizontal * @param {function(number)} applyCallback @@ -490,7 +490,7 @@ this._horizontal = horizontal; this._scale = 1; this._count = 0; - this._throttler = new WebInspector.Throttler(0); + this._throttler = new Common.Throttler(0); this._applyCallback = applyCallback; } @@ -513,7 +513,7 @@ * @return {!Promise.<?>} */ _update() { - var zoomFactor = WebInspector.zoomManager.zoomFactor(); + var zoomFactor = UI.zoomManager.zoomFactor(); var size = this._horizontal ? this._contentElement.offsetWidth : this._contentElement.offsetHeight; if (this._scale !== this._renderedScale || zoomFactor !== this._renderedZoomFactor) {
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js index 7bf1a89a..faaa35b 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
@@ -4,18 +4,18 @@ /** * @unrestricted */ -WebInspector.DeviceModeWrapper = class extends WebInspector.VBox { +Emulation.DeviceModeWrapper = class extends UI.VBox { /** - * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder + * @param {!Emulation.InspectedPagePlaceholder} inspectedPagePlaceholder */ constructor(inspectedPagePlaceholder) { super(); - WebInspector.DeviceModeView._wrapperInstance = this; + Emulation.DeviceModeView._wrapperInstance = this; this._inspectedPagePlaceholder = inspectedPagePlaceholder; - /** @type {?WebInspector.DeviceModeView} */ + /** @type {?Emulation.DeviceModeView} */ this._deviceModeView = null; - this._toggleDeviceModeAction = WebInspector.actionRegistry.action('emulation.toggle-device-mode'); - this._showDeviceModeSetting = WebInspector.settings.createSetting('emulation.showDeviceMode', false); + this._toggleDeviceModeAction = UI.actionRegistry.action('emulation.toggle-device-mode'); + this._showDeviceModeSetting = Common.settings.createSetting('emulation.showDeviceMode', false); this._showDeviceModeSetting.addChangeListener(this._update.bind(this, false)); this._update(true); } @@ -47,7 +47,7 @@ if (this._showDeviceModeSetting.get()) { if (!this._deviceModeView) - this._deviceModeView = new WebInspector.DeviceModeView(); + this._deviceModeView = new Emulation.DeviceModeView(); this._deviceModeView.show(this.element); this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); this._inspectedPagePlaceholder.show(this._deviceModeView.element); @@ -60,28 +60,28 @@ } }; -/** @type {!WebInspector.DeviceModeWrapper} */ -WebInspector.DeviceModeView._wrapperInstance; +/** @type {!Emulation.DeviceModeWrapper} */ +Emulation.DeviceModeView._wrapperInstance; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.DeviceModeWrapper.ActionDelegate = class { +Emulation.DeviceModeWrapper.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - if (WebInspector.DeviceModeView._wrapperInstance) { + if (Emulation.DeviceModeView._wrapperInstance) { if (actionId === 'emulation.toggle-device-mode') { - WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode(); + Emulation.DeviceModeView._wrapperInstance._toggleDeviceMode(); return true; } if (actionId === 'emulation.capture-screenshot') - return WebInspector.DeviceModeView._wrapperInstance._captureScreenshot(); + return Emulation.DeviceModeView._wrapperInstance._captureScreenshot(); } return false; }
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceOrientation.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceOrientation.js index 33e106c..8cf327d4 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceOrientation.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceOrientation.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.DeviceOrientation = class { +Emulation.DeviceOrientation = class { /** * @param {number} alpha * @param {number} beta @@ -17,26 +17,26 @@ } /** - * @return {!WebInspector.DeviceOrientation} + * @return {!Emulation.DeviceOrientation} */ static parseSetting(value) { if (value) { var jsonObject = JSON.parse(value); - return new WebInspector.DeviceOrientation(jsonObject.alpha, jsonObject.beta, jsonObject.gamma); + return new Emulation.DeviceOrientation(jsonObject.alpha, jsonObject.beta, jsonObject.gamma); } - return new WebInspector.DeviceOrientation(0, 0, 0); + return new Emulation.DeviceOrientation(0, 0, 0); } /** - * @return {?WebInspector.DeviceOrientation} + * @return {?Emulation.DeviceOrientation} */ static parseUserInput(alphaString, betaString, gammaString) { if (!alphaString && !betaString && !gammaString) return null; - var isAlphaValid = WebInspector.DeviceOrientation.validator(alphaString); - var isBetaValid = WebInspector.DeviceOrientation.validator(betaString); - var isGammaValid = WebInspector.DeviceOrientation.validator(gammaString); + var isAlphaValid = Emulation.DeviceOrientation.validator(alphaString); + var isBetaValid = Emulation.DeviceOrientation.validator(betaString); + var isGammaValid = Emulation.DeviceOrientation.validator(gammaString); if (!isAlphaValid && !isBetaValid && !isGammaValid) return null; @@ -45,7 +45,7 @@ var beta = isBetaValid ? parseFloat(betaString) : -1; var gamma = isGammaValid ? parseFloat(gammaString) : -1; - return new WebInspector.DeviceOrientation(alpha, beta, gamma); + return new Emulation.DeviceOrientation(alpha, beta, gamma); } /** @@ -64,12 +64,12 @@ } apply() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) target.deviceOrientationAgent().setDeviceOrientationOverride(this.alpha, this.beta, this.gamma); } clear() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) target.deviceOrientationAgent().clearDeviceOrientationOverride(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DevicesSettingsTab.js b/third_party/WebKit/Source/devtools/front_end/emulation/DevicesSettingsTab.js index 7e05f95..945fac6 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DevicesSettingsTab.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DevicesSettingsTab.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.DevicesSettingsTab = class extends WebInspector.VBox { +Emulation.DevicesSettingsTab = class extends UI.VBox { constructor() { super(); this.element.classList.add('settings-tab-container'); @@ -13,26 +13,26 @@ this.registerRequiredCSS('emulation/devicesSettingsTab.css'); var header = this.element.createChild('header'); - header.createChild('h3').createTextChild(WebInspector.UIString('Emulated Devices')); + header.createChild('h3').createTextChild(Common.UIString('Emulated Devices')); this.containerElement = this.element.createChild('div', 'help-container-wrapper') .createChild('div', 'settings-tab help-content help-container'); var buttonsRow = this.containerElement.createChild('div', 'devices-button-row'); this._addCustomButton = - createTextButton(WebInspector.UIString('Add custom device...'), this._addCustomDevice.bind(this)); + createTextButton(Common.UIString('Add custom device...'), this._addCustomDevice.bind(this)); buttonsRow.appendChild(this._addCustomButton); - this._list = new WebInspector.ListWidget(this); + this._list = new UI.ListWidget(this); this._list.registerRequiredCSS('emulation/devicesSettingsTab.css'); this._list.element.classList.add('devices-list'); this._list.show(this.containerElement); this._muteUpdate = false; - this._emulatedDevicesList = WebInspector.EmulatedDevicesList.instance(); + this._emulatedDevicesList = Emulation.EmulatedDevicesList.instance(); this._emulatedDevicesList.addEventListener( - WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated, this._devicesUpdated, this); + Emulation.EmulatedDevicesList.Events.CustomDevicesUpdated, this._devicesUpdated, this); this._emulatedDevicesList.addEventListener( - WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated, this._devicesUpdated, this); + Emulation.EmulatedDevicesList.Events.StandardDevicesUpdated, this._devicesUpdated, this); this.setDefaultFocusedElement(this._addCustomButton); } @@ -58,7 +58,7 @@ this._list.appendSeparator(); devices = this._emulatedDevicesList.standard().slice(); - devices.sort(WebInspector.EmulatedDevice.deviceComparator); + devices.sort(Emulation.EmulatedDevice.deviceComparator); for (var i = 0; i < devices.length; ++i) this._list.appendItem(devices[i], false); } @@ -76,7 +76,7 @@ } _addCustomDevice() { - var device = new WebInspector.EmulatedDevice(); + var device = new Emulation.EmulatedDevice(); device.deviceScaleFactor = 0; device.horizontal.width = 700; device.horizontal.height = 400; @@ -100,7 +100,7 @@ * @return {!Element} */ renderItem(item, editable) { - var device = /** @type {!WebInspector.EmulatedDevice} */ (item); + var device = /** @type {!Emulation.EmulatedDevice} */ (item); var element = createElementWithClass('div', 'devices-list-item'); var checkbox = element.createChild('input', 'devices-list-checkbox'); checkbox.type = 'checkbox'; @@ -111,7 +111,7 @@ /** * @param {!Event} event - * @this {WebInspector.DevicesSettingsTab} + * @this {Emulation.DevicesSettingsTab} */ function onItemClicked(event) { var show = !checkbox.checked; @@ -128,17 +128,17 @@ * @param {number} index */ removeItemRequested(item, index) { - this._emulatedDevicesList.removeCustomDevice(/** @type {!WebInspector.EmulatedDevice} */ (item)); + this._emulatedDevicesList.removeCustomDevice(/** @type {!Emulation.EmulatedDevice} */ (item)); } /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { - var device = /** @type {!WebInspector.EmulatedDevice} */ (item); + var device = /** @type {!Emulation.EmulatedDevice} */ (item); device.title = editor.control('title').value.trim(); device.vertical.width = editor.control('width').value ? parseInt(editor.control('width').value, 10) : 0; device.vertical.height = editor.control('height').value ? parseInt(editor.control('height').value, 10) : 0; @@ -148,15 +148,15 @@ device.userAgent = editor.control('user-agent').value; device.modes = []; device.modes.push( - {title: '', orientation: WebInspector.EmulatedDevice.Vertical, insets: new Insets(0, 0, 0, 0), image: null}); + {title: '', orientation: Emulation.EmulatedDevice.Vertical, insets: new Insets(0, 0, 0, 0), image: null}); device.modes.push( - {title: '', orientation: WebInspector.EmulatedDevice.Horizontal, insets: new Insets(0, 0, 0, 0), image: null}); + {title: '', orientation: Emulation.EmulatedDevice.Horizontal, insets: new Insets(0, 0, 0, 0), image: null}); device.capabilities = []; var uaType = editor.control('ua-type').value; - if (uaType === WebInspector.DeviceModeModel.UA.Mobile || uaType === WebInspector.DeviceModeModel.UA.MobileNoTouch) - device.capabilities.push(WebInspector.EmulatedDevice.Capability.Mobile); - if (uaType === WebInspector.DeviceModeModel.UA.Mobile || uaType === WebInspector.DeviceModeModel.UA.DesktopTouch) - device.capabilities.push(WebInspector.EmulatedDevice.Capability.Touch); + if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.DeviceModeModel.UA.MobileNoTouch) + device.capabilities.push(Emulation.EmulatedDevice.Capability.Mobile); + if (uaType === Emulation.DeviceModeModel.UA.Mobile || uaType === Emulation.DeviceModeModel.UA.DesktopTouch) + device.capabilities.push(Emulation.EmulatedDevice.Capability.Touch); if (isNew) this._emulatedDevicesList.addCustomDevice(device); else @@ -168,10 +168,10 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { - var device = /** @type {!WebInspector.EmulatedDevice} */ (item); + var device = /** @type {!Emulation.EmulatedDevice} */ (item); var editor = this._createEditor(); editor.control('title').value = device.title; editor.control('width').value = this._toNumericInputValue(device.vertical.width); @@ -180,40 +180,40 @@ editor.control('user-agent').value = device.userAgent; var uaType; if (device.mobile()) - uaType = device.touch() ? WebInspector.DeviceModeModel.UA.Mobile : WebInspector.DeviceModeModel.UA.MobileNoTouch; + uaType = device.touch() ? Emulation.DeviceModeModel.UA.Mobile : Emulation.DeviceModeModel.UA.MobileNoTouch; else - uaType = device.touch() ? WebInspector.DeviceModeModel.UA.DesktopTouch : WebInspector.DeviceModeModel.UA.Desktop; + uaType = device.touch() ? Emulation.DeviceModeModel.UA.DesktopTouch : Emulation.DeviceModeModel.UA.Desktop; editor.control('ua-type').value = uaType; return editor; } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createEditor() { if (this._editor) return this._editor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._editor = editor; var content = editor.contentElement(); var fields = content.createChild('div', 'devices-edit-fields'); fields.createChild('div', 'hbox') - .appendChild(editor.createInput('title', 'text', WebInspector.UIString('Device name'), titleValidator)); + .appendChild(editor.createInput('title', 'text', Common.UIString('Device name'), titleValidator)); var screen = fields.createChild('div', 'hbox'); - screen.appendChild(editor.createInput('width', 'text', WebInspector.UIString('Width'), sizeValidator)); - screen.appendChild(editor.createInput('height', 'text', WebInspector.UIString('height'), sizeValidator)); - var dpr = editor.createInput('scale', 'text', WebInspector.UIString('Device pixel ratio'), scaleValidator); + screen.appendChild(editor.createInput('width', 'text', Common.UIString('Width'), sizeValidator)); + screen.appendChild(editor.createInput('height', 'text', Common.UIString('height'), sizeValidator)); + var dpr = editor.createInput('scale', 'text', Common.UIString('Device pixel ratio'), scaleValidator); dpr.classList.add('device-edit-fixed'); screen.appendChild(dpr); var ua = fields.createChild('div', 'hbox'); - ua.appendChild(editor.createInput('user-agent', 'text', WebInspector.UIString('User agent string'), () => true)); + ua.appendChild(editor.createInput('user-agent', 'text', Common.UIString('User agent string'), () => true)); var uaType = editor.createSelect( 'ua-type', [ - WebInspector.DeviceModeModel.UA.Mobile, WebInspector.DeviceModeModel.UA.MobileNoTouch, - WebInspector.DeviceModeModel.UA.Desktop, WebInspector.DeviceModeModel.UA.DesktopTouch + Emulation.DeviceModeModel.UA.Mobile, Emulation.DeviceModeModel.UA.MobileNoTouch, + Emulation.DeviceModeModel.UA.Desktop, Emulation.DeviceModeModel.UA.DesktopTouch ], () => true); uaType.classList.add('device-edit-fixed'); @@ -239,7 +239,7 @@ * @return {boolean} */ function sizeValidator(item, index, input) { - return WebInspector.DeviceModeModel.deviceSizeValidator(input.value); + return Emulation.DeviceModeModel.deviceSizeValidator(input.value); } /** @@ -249,7 +249,7 @@ * @return {boolean} */ function scaleValidator(item, index, input) { - return WebInspector.DeviceModeModel.deviceScaleFactorValidator(input.value); + return Emulation.DeviceModeModel.deviceScaleFactorValidator(input.value); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js index ba5f28d..397be0be 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js
@@ -4,27 +4,27 @@ /** * @unrestricted */ -WebInspector.EmulatedDevice = class { +Emulation.EmulatedDevice = class { constructor() { /** @type {string} */ this.title = ''; /** @type {string} */ - this.type = WebInspector.EmulatedDevice.Type.Unknown; - /** @type {!WebInspector.EmulatedDevice.Orientation} */ + this.type = Emulation.EmulatedDevice.Type.Unknown; + /** @type {!Emulation.EmulatedDevice.Orientation} */ this.vertical = {width: 0, height: 0, outlineInsets: null, outlineImage: null}; - /** @type {!WebInspector.EmulatedDevice.Orientation} */ + /** @type {!Emulation.EmulatedDevice.Orientation} */ this.horizontal = {width: 0, height: 0, outlineInsets: null, outlineImage: null}; /** @type {number} */ this.deviceScaleFactor = 1; /** @type {!Array.<string>} */ - this.capabilities = [WebInspector.EmulatedDevice.Capability.Touch, WebInspector.EmulatedDevice.Capability.Mobile]; + this.capabilities = [Emulation.EmulatedDevice.Capability.Touch, Emulation.EmulatedDevice.Capability.Mobile]; /** @type {string} */ this.userAgent = ''; - /** @type {!Array.<!WebInspector.EmulatedDevice.Mode>} */ + /** @type {!Array.<!Emulation.EmulatedDevice.Mode>} */ this.modes = []; /** @type {string} */ - this._show = WebInspector.EmulatedDevice._Show.Default; + this._show = Emulation.EmulatedDevice._Show.Default; /** @type {boolean} */ this._showByDefault = true; @@ -34,7 +34,7 @@ /** * @param {*} json - * @return {?WebInspector.EmulatedDevice} + * @return {?Emulation.EmulatedDevice} */ static fromJSONV1(json) { try { @@ -81,19 +81,19 @@ /** * @param {*} json - * @return {!WebInspector.EmulatedDevice.Orientation} + * @return {!Emulation.EmulatedDevice.Orientation} */ function parseOrientation(json) { var result = {}; result.width = parseIntValue(json, 'width'); - if (result.width < 0 || result.width > WebInspector.DeviceModeModel.MaxDeviceSize || - result.width < WebInspector.DeviceModeModel.MinDeviceSize) + if (result.width < 0 || result.width > Emulation.DeviceModeModel.MaxDeviceSize || + result.width < Emulation.DeviceModeModel.MinDeviceSize) throw new Error('Emulated device has wrong width: ' + result.width); result.height = parseIntValue(json, 'height'); - if (result.height < 0 || result.height > WebInspector.DeviceModeModel.MaxDeviceSize || - result.height < WebInspector.DeviceModeModel.MinDeviceSize) + if (result.height < 0 || result.height > Emulation.DeviceModeModel.MaxDeviceSize || + result.height < Emulation.DeviceModeModel.MinDeviceSize) throw new Error('Emulated device has wrong height: ' + result.height); var outlineInsets = parseValue(json['outline'], 'insets', 'object', null); @@ -103,14 +103,14 @@ throw new Error('Emulated device has wrong outline insets'); result.outlineImage = /** @type {string} */ (parseValue(json['outline'], 'image', 'string')); } - return /** @type {!WebInspector.EmulatedDevice.Orientation} */ (result); + return /** @type {!Emulation.EmulatedDevice.Orientation} */ (result); } - var result = new WebInspector.EmulatedDevice(); + var result = new Emulation.EmulatedDevice(); result.title = /** @type {string} */ (parseValue(json, 'title', 'string')); result.type = /** @type {string} */ (parseValue(json, 'type', 'string')); var rawUserAgent = /** @type {string} */ (parseValue(json, 'user-agent', 'string')); - result.userAgent = WebInspector.MultitargetNetworkManager.patchUserAgentWithChromeVersion(rawUserAgent); + result.userAgent = SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion(rawUserAgent); var capabilities = parseValue(json, 'capabilities', 'object', []); if (!Array.isArray(capabilities)) @@ -137,8 +137,8 @@ var mode = {}; mode.title = /** @type {string} */ (parseValue(modes[i], 'title', 'string')); mode.orientation = /** @type {string} */ (parseValue(modes[i], 'orientation', 'string')); - if (mode.orientation !== WebInspector.EmulatedDevice.Vertical && - mode.orientation !== WebInspector.EmulatedDevice.Horizontal) + if (mode.orientation !== Emulation.EmulatedDevice.Vertical && + mode.orientation !== Emulation.EmulatedDevice.Horizontal) throw new Error('Emulated device mode has wrong orientation \'' + mode.orientation + '\''); var orientation = result.orientationByName(mode.orientation); mode.insets = parseInsets(parseValue(modes[i], 'insets', 'object')); @@ -153,7 +153,7 @@ result._showByDefault = /** @type {boolean} */ (parseValue(json, 'show-by-default', 'boolean', undefined)); result._show = - /** @type {string} */ (parseValue(json, 'show', 'string', WebInspector.EmulatedDevice._Show.Default)); + /** @type {string} */ (parseValue(json, 'show', 'string', Emulation.EmulatedDevice._Show.Default)); return result; } catch (e) { @@ -162,8 +162,8 @@ } /** - * @param {!WebInspector.EmulatedDevice} device1 - * @param {!WebInspector.EmulatedDevice} device2 + * @param {!Emulation.EmulatedDevice} device1 + * @param {!Emulation.EmulatedDevice} device2 * @return {number} */ static deviceComparator(device1, device2) { @@ -192,7 +192,7 @@ /** * @param {string} orientation - * @return {!Array.<!WebInspector.EmulatedDevice.Mode>} + * @return {!Array.<!Emulation.EmulatedDevice.Mode>} */ modesForOrientation(orientation) { var result = []; @@ -240,7 +240,7 @@ } /** - * @param {!WebInspector.EmulatedDevice.Orientation} orientation + * @param {!Emulation.EmulatedDevice.Orientation} orientation * @return {*} */ _orientationToJSON(orientation) { @@ -260,7 +260,7 @@ } /** - * @param {!WebInspector.EmulatedDevice.Mode} mode + * @param {!Emulation.EmulatedDevice.Mode} mode * @return {string} */ modeImage(mode) { @@ -272,7 +272,7 @@ } /** - * @param {!WebInspector.EmulatedDevice.Mode} mode + * @param {!Emulation.EmulatedDevice.Mode} mode * @return {string} */ outlineImage(mode) { @@ -286,30 +286,30 @@ /** * @param {string} name - * @return {!WebInspector.EmulatedDevice.Orientation} + * @return {!Emulation.EmulatedDevice.Orientation} */ orientationByName(name) { - return name === WebInspector.EmulatedDevice.Vertical ? this.vertical : this.horizontal; + return name === Emulation.EmulatedDevice.Vertical ? this.vertical : this.horizontal; } /** * @return {boolean} */ show() { - if (this._show === WebInspector.EmulatedDevice._Show.Default) + if (this._show === Emulation.EmulatedDevice._Show.Default) return this._showByDefault; - return this._show === WebInspector.EmulatedDevice._Show.Always; + return this._show === Emulation.EmulatedDevice._Show.Always; } /** * @param {boolean} show */ setShow(show) { - this._show = show ? WebInspector.EmulatedDevice._Show.Always : WebInspector.EmulatedDevice._Show.Never; + this._show = show ? Emulation.EmulatedDevice._Show.Always : Emulation.EmulatedDevice._Show.Never; } /** - * @param {!WebInspector.EmulatedDevice} other + * @param {!Emulation.EmulatedDevice} other */ copyShowFrom(other) { this._show = other._show; @@ -319,27 +319,27 @@ * @return {boolean} */ touch() { - return this.capabilities.indexOf(WebInspector.EmulatedDevice.Capability.Touch) !== -1; + return this.capabilities.indexOf(Emulation.EmulatedDevice.Capability.Touch) !== -1; } /** * @return {boolean} */ mobile() { - return this.capabilities.indexOf(WebInspector.EmulatedDevice.Capability.Mobile) !== -1; + return this.capabilities.indexOf(Emulation.EmulatedDevice.Capability.Mobile) !== -1; } }; /** @typedef {!{title: string, orientation: string, insets: !Insets, image: ?string}} */ -WebInspector.EmulatedDevice.Mode; +Emulation.EmulatedDevice.Mode; /** @typedef {!{width: number, height: number, outlineInsets: ?Insets, outlineImage: ?string}} */ -WebInspector.EmulatedDevice.Orientation; +Emulation.EmulatedDevice.Orientation; -WebInspector.EmulatedDevice.Horizontal = 'horizontal'; -WebInspector.EmulatedDevice.Vertical = 'vertical'; +Emulation.EmulatedDevice.Horizontal = 'horizontal'; +Emulation.EmulatedDevice.Vertical = 'vertical'; -WebInspector.EmulatedDevice.Type = { +Emulation.EmulatedDevice.Type = { Phone: 'phone', Tablet: 'tablet', Notebook: 'notebook', @@ -347,12 +347,12 @@ Unknown: 'unknown' }; -WebInspector.EmulatedDevice.Capability = { +Emulation.EmulatedDevice.Capability = { Touch: 'touch', Mobile: 'mobile' }; -WebInspector.EmulatedDevice._Show = { +Emulation.EmulatedDevice._Show = { Always: 'Always', Default: 'Default', Never: 'Never' @@ -362,39 +362,39 @@ /** * @unrestricted */ -WebInspector.EmulatedDevicesList = class extends WebInspector.Object { +Emulation.EmulatedDevicesList = class extends Common.Object { constructor() { super(); - /** @type {!WebInspector.Setting} */ - this._standardSetting = WebInspector.settings.createSetting('standardEmulatedDeviceList', []); - /** @type {!Array.<!WebInspector.EmulatedDevice>} */ + /** @type {!Common.Setting} */ + this._standardSetting = Common.settings.createSetting('standardEmulatedDeviceList', []); + /** @type {!Array.<!Emulation.EmulatedDevice>} */ this._standard = []; this._listFromJSONV1(this._standardSetting.get(), this._standard); this._updateStandardDevices(); - /** @type {!WebInspector.Setting} */ - this._customSetting = WebInspector.settings.createSetting('customEmulatedDeviceList', []); - /** @type {!Array.<!WebInspector.EmulatedDevice>} */ + /** @type {!Common.Setting} */ + this._customSetting = Common.settings.createSetting('customEmulatedDeviceList', []); + /** @type {!Array.<!Emulation.EmulatedDevice>} */ this._custom = []; if (!this._listFromJSONV1(this._customSetting.get(), this._custom)) this.saveCustomDevices(); } /** - * @return {!WebInspector.EmulatedDevicesList} + * @return {!Emulation.EmulatedDevicesList} */ static instance() { - if (!WebInspector.EmulatedDevicesList._instance) - WebInspector.EmulatedDevicesList._instance = new WebInspector.EmulatedDevicesList(); - return /** @type {!WebInspector.EmulatedDevicesList} */ (WebInspector.EmulatedDevicesList._instance); + if (!Emulation.EmulatedDevicesList._instance) + Emulation.EmulatedDevicesList._instance = new Emulation.EmulatedDevicesList(); + return /** @type {!Emulation.EmulatedDevicesList} */ (Emulation.EmulatedDevicesList._instance); } _updateStandardDevices() { var devices = []; var extensions = self.runtime.extensions('emulated-device'); for (var i = 0; i < extensions.length; ++i) { - var device = WebInspector.EmulatedDevice.fromJSONV1(extensions[i].descriptor()['device']); + var device = Emulation.EmulatedDevice.fromJSONV1(extensions[i].descriptor()['device']); device.setExtension(extensions[i]); devices.push(device); } @@ -405,7 +405,7 @@ /** * @param {!Array.<*>} jsonArray - * @param {!Array.<!WebInspector.EmulatedDevice>} result + * @param {!Array.<!Emulation.EmulatedDevice>} result * @return {boolean} */ _listFromJSONV1(jsonArray, result) { @@ -413,19 +413,19 @@ return false; var success = true; for (var i = 0; i < jsonArray.length; ++i) { - var device = WebInspector.EmulatedDevice.fromJSONV1(jsonArray[i]); + var device = Emulation.EmulatedDevice.fromJSONV1(jsonArray[i]); if (device) { result.push(device); if (!device.modes.length) { device.modes.push({ title: '', - orientation: WebInspector.EmulatedDevice.Horizontal, + orientation: Emulation.EmulatedDevice.Horizontal, insets: new Insets(0, 0, 0, 0), image: null }); device.modes.push({ title: '', - orientation: WebInspector.EmulatedDevice.Vertical, + orientation: Emulation.EmulatedDevice.Vertical, insets: new Insets(0, 0, 0, 0), image: null }); @@ -438,25 +438,25 @@ } /** - * @return {!Array.<!WebInspector.EmulatedDevice>} + * @return {!Array.<!Emulation.EmulatedDevice>} */ standard() { return this._standard; } /** - * @return {!Array.<!WebInspector.EmulatedDevice>} + * @return {!Array.<!Emulation.EmulatedDevice>} */ custom() { return this._custom; } revealCustomSetting() { - WebInspector.Revealer.reveal(this._customSetting); + Common.Revealer.reveal(this._customSetting); } /** - * @param {!WebInspector.EmulatedDevice} device + * @param {!Emulation.EmulatedDevice} device */ addCustomDevice(device) { this._custom.push(device); @@ -464,7 +464,7 @@ } /** - * @param {!WebInspector.EmulatedDevice} device + * @param {!Emulation.EmulatedDevice} device */ removeCustomDevice(device) { this._custom.remove(device); @@ -472,24 +472,24 @@ } saveCustomDevices() { - var json = this._custom.map(/** @param {!WebInspector.EmulatedDevice} device */ function(device) { + var json = this._custom.map(/** @param {!Emulation.EmulatedDevice} device */ function(device) { return device._toJSON(); }); this._customSetting.set(json); - this.dispatchEventToListeners(WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated); + this.dispatchEventToListeners(Emulation.EmulatedDevicesList.Events.CustomDevicesUpdated); } saveStandardDevices() { - var json = this._standard.map(/** @param {!WebInspector.EmulatedDevice} device */ function(device) { + var json = this._standard.map(/** @param {!Emulation.EmulatedDevice} device */ function(device) { return device._toJSON(); }); this._standardSetting.set(json); - this.dispatchEventToListeners(WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated); + this.dispatchEventToListeners(Emulation.EmulatedDevicesList.Events.StandardDevicesUpdated); } /** - * @param {!Array.<!WebInspector.EmulatedDevice>} from - * @param {!Array.<!WebInspector.EmulatedDevice>} to + * @param {!Array.<!Emulation.EmulatedDevice>} from + * @param {!Array.<!Emulation.EmulatedDevice>} to */ _copyShowValues(from, to) { var deviceById = new Map(); @@ -499,16 +499,16 @@ for (var i = 0; i < to.length; ++i) { var title = to[i].title; if (deviceById.has(title)) - to[i].copyShowFrom(/** @type {!WebInspector.EmulatedDevice} */ (deviceById.get(title))); + to[i].copyShowFrom(/** @type {!Emulation.EmulatedDevice} */ (deviceById.get(title))); } } }; /** @enum {symbol} */ -WebInspector.EmulatedDevicesList.Events = { +Emulation.EmulatedDevicesList.Events = { CustomDevicesUpdated: Symbol('CustomDevicesUpdated'), StandardDevicesUpdated: Symbol('StandardDevicesUpdated') }; -/** @type {?WebInspector.EmulatedDevicesList} */ -WebInspector.EmulatedDevicesList._instance; +/** @type {?Emulation.EmulatedDevicesList} */ +Emulation.EmulatedDevicesList._instance;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js index f5ce75c..e977fd5 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.Geolocation = class { +Emulation.Geolocation = class { /** * @param {number} latitude * @param {number} longitude @@ -17,7 +17,7 @@ } /** - * @return {!WebInspector.Geolocation} + * @return {!Emulation.Geolocation} */ static parseSetting(value) { if (value) { @@ -25,32 +25,32 @@ if (splitError.length === 2) { var splitPosition = splitError[0].split('@'); if (splitPosition.length === 2) - return new WebInspector.Geolocation( + return new Emulation.Geolocation( parseFloat(splitPosition[0]), parseFloat(splitPosition[1]), splitError[1]); } } - return new WebInspector.Geolocation(0, 0, false); + return new Emulation.Geolocation(0, 0, false); } /** * @param {string} latitudeString * @param {string} longitudeString * @param {string} errorStatus - * @return {?WebInspector.Geolocation} + * @return {?Emulation.Geolocation} */ static parseUserInput(latitudeString, longitudeString, errorStatus) { if (!latitudeString && !longitudeString) return null; - var isLatitudeValid = WebInspector.Geolocation.latitudeValidator(latitudeString); - var isLongitudeValid = WebInspector.Geolocation.longitudeValidator(longitudeString); + var isLatitudeValid = Emulation.Geolocation.latitudeValidator(latitudeString); + var isLongitudeValid = Emulation.Geolocation.longitudeValidator(longitudeString); if (!isLatitudeValid && !isLongitudeValid) return null; var latitude = isLatitudeValid ? parseFloat(latitudeString) : -1; var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1; - return new WebInspector.Geolocation(latitude, longitude, !!errorStatus); + return new Emulation.Geolocation(latitude, longitude, !!errorStatus); } /** @@ -81,20 +81,20 @@ } apply() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) { + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) { if (this.error) target.emulationAgent().setGeolocationOverride(); else target.emulationAgent().setGeolocationOverride( - this.latitude, this.longitude, WebInspector.Geolocation.DefaultMockAccuracy); + this.latitude, this.longitude, Emulation.Geolocation.DefaultMockAccuracy); } } clear() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) target.emulationAgent().clearGeolocationOverride(); } }; -WebInspector.Geolocation.DefaultMockAccuracy = 150; +Emulation.Geolocation.DefaultMockAccuracy = 150;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js b/third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js index 91777fd..dd46640f 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.InspectedPagePlaceholder = class extends WebInspector.Widget { +Emulation.InspectedPagePlaceholder = class extends UI.Widget { constructor() { super(true); this.registerRequiredCSS('emulation/inspectedPagePlaceholder.css'); - WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._scheduleUpdate, this); + UI.zoomManager.addEventListener(UI.ZoomManager.Events.ZoomChanged, this._scheduleUpdate, this); this._margins = {top: 0, right: 0, bottom: 0, left: 0}; this.restoreMinimumSizeAndMargins(); } @@ -23,10 +23,10 @@ var parent = widget.parentWidget(); // This view assumes it's always inside the main split widget element, not a sidebar. // Every parent which is not a split widget, must be of the same size as this widget. - if (parent instanceof WebInspector.SplitWidget) { + if (parent instanceof UI.SplitWidget) { var side = parent.sidebarSide(); if (adjacent[side] && !parent.hasCustomResizer() && parent.isResizable()) - margins[side] = WebInspector.InspectedPagePlaceholder.MarginValue; + margins[side] = Emulation.InspectedPagePlaceholder.MarginValue; adjacent[side] = false; } widget = parent; @@ -67,7 +67,7 @@ } _dipPageRect() { - var zoomFactor = WebInspector.zoomManager.zoomFactor(); + var zoomFactor = UI.zoomManager.zoomFactor(); var rect = this.element.getBoundingClientRect(); var bodyRect = this.element.ownerDocument.body.getBoundingClientRect(); @@ -88,13 +88,13 @@ height: Math.max(1, Math.round(rect.height)), width: Math.max(1, Math.round(rect.width)) }; - this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Events.Update, bounds); + this.dispatchEventToListeners(Emulation.InspectedPagePlaceholder.Events.Update, bounds); } }; /** @enum {symbol} */ -WebInspector.InspectedPagePlaceholder.Events = { +Emulation.InspectedPagePlaceholder.Events = { Update: Symbol('Update') }; -WebInspector.InspectedPagePlaceholder.MarginValue = 3; +Emulation.InspectedPagePlaceholder.MarginValue = 3;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/MediaQueryInspector.js b/third_party/WebKit/Source/devtools/front_end/emulation/MediaQueryInspector.js index 7fbfcdb..04a2cfb 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/MediaQueryInspector.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/MediaQueryInspector.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.MediaQueryInspector = class extends WebInspector.Widget { +Emulation.MediaQueryInspector = class extends UI.Widget { /** * @param {function():number} getWidthCallback * @param {function(number)} setWidthCallback @@ -16,53 +16,53 @@ this.contentElement.classList.add('media-inspector-view'); this.contentElement.addEventListener('click', this._onMediaQueryClicked.bind(this), false); this.contentElement.addEventListener('contextmenu', this._onContextMenu.bind(this), false); - this._mediaThrottler = new WebInspector.Throttler(0); + this._mediaThrottler = new Common.Throttler(0); this._getWidthCallback = getWidthCallback; this._setWidthCallback = setWidthCallback; this._scale = 1; - WebInspector.targetManager.observeTargets(this); - WebInspector.zoomManager.addEventListener( - WebInspector.ZoomManager.Events.ZoomChanged, this._renderMediaQueries.bind(this), this); + SDK.targetManager.observeTargets(this); + UI.zoomManager.addEventListener( + UI.ZoomManager.Events.ZoomChanged, this._renderMediaQueries.bind(this), this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { // FIXME: adapt this to multiple targets. if (this._cssModel) return; - this._cssModel = WebInspector.CSSModel.fromTarget(target); + this._cssModel = SDK.CSSModel.fromTarget(target); if (!this._cssModel) return; this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetAdded, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetAdded, this._scheduleMediaQueriesUpdate, this); this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetRemoved, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetRemoved, this._scheduleMediaQueriesUpdate, this); this._cssModel.addEventListener( - WebInspector.CSSModel.Events.StyleSheetChanged, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetChanged, this._scheduleMediaQueriesUpdate, this); this._cssModel.addEventListener( - WebInspector.CSSModel.Events.MediaQueryResultChanged, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.MediaQueryResultChanged, this._scheduleMediaQueriesUpdate, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - if (WebInspector.CSSModel.fromTarget(target) !== this._cssModel) + if (SDK.CSSModel.fromTarget(target) !== this._cssModel) return; this._cssModel.removeEventListener( - WebInspector.CSSModel.Events.StyleSheetAdded, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetAdded, this._scheduleMediaQueriesUpdate, this); this._cssModel.removeEventListener( - WebInspector.CSSModel.Events.StyleSheetRemoved, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetRemoved, this._scheduleMediaQueriesUpdate, this); this._cssModel.removeEventListener( - WebInspector.CSSModel.Events.StyleSheetChanged, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.StyleSheetChanged, this._scheduleMediaQueriesUpdate, this); this._cssModel.removeEventListener( - WebInspector.CSSModel.Events.MediaQueryResultChanged, this._scheduleMediaQueriesUpdate, this); + SDK.CSSModel.Events.MediaQueryResultChanged, this._scheduleMediaQueriesUpdate, this); delete this._cssModel; } @@ -85,11 +85,11 @@ return; var model = mediaQueryMarker._model; - if (model.section() === WebInspector.MediaQueryInspector.Section.Max) { + if (model.section() === Emulation.MediaQueryInspector.Section.Max) { this._setWidthCallback(model.maxWidthExpression().computedLength()); return; } - if (model.section() === WebInspector.MediaQueryInspector.Section.Min) { + if (model.section() === Emulation.MediaQueryInspector.Section.Min) { this._setWidthCallback(model.minWidthExpression().computedLength()); return; } @@ -114,7 +114,7 @@ var locations = mediaQueryMarker._locations; var uiLocations = new Map(); for (var i = 0; i < locations.length; ++i) { - var uiLocation = WebInspector.cssWorkspaceBinding.rawLocationToUILocation(locations[i]); + var uiLocation = Bindings.cssWorkspaceBinding.rawLocationToUILocation(locations[i]); if (!uiLocation) continue; var descriptor = String.sprintf( @@ -123,22 +123,22 @@ } var contextMenuItems = uiLocations.keysArray().sort(); - var contextMenu = new WebInspector.ContextMenu(event); - var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString.capitalize('Reveal in ^source ^code')); + var contextMenu = new UI.ContextMenu(event); + var subMenuItem = contextMenu.appendSubMenuItem(Common.UIString.capitalize('Reveal in ^source ^code')); for (var i = 0; i < contextMenuItems.length; ++i) { var title = contextMenuItems[i]; subMenuItem.appendItem( title, - this._revealSourceLocation.bind(this, /** @type {!WebInspector.UILocation} */ (uiLocations.get(title)))); + this._revealSourceLocation.bind(this, /** @type {!Workspace.UILocation} */ (uiLocations.get(title)))); } contextMenu.show(); } /** - * @param {!WebInspector.UILocation} location + * @param {!Workspace.UILocation} location */ _revealSourceLocation(location) { - WebInspector.Revealer.reveal(location); + Common.Revealer.reveal(location); } _scheduleMediaQueriesUpdate() { @@ -155,8 +155,8 @@ } /** - * @param {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>} models - * @return {!Array.<!WebInspector.MediaQueryInspector.MediaQueryUIModel>} + * @param {!Array.<!Emulation.MediaQueryInspector.MediaQueryUIModel>} models + * @return {!Array.<!Emulation.MediaQueryInspector.MediaQueryUIModel>} */ _squashAdjacentEqual(models) { var filtered = []; @@ -169,7 +169,7 @@ } /** - * @param {!Array.<!WebInspector.CSSMedia>} cssMedias + * @param {!Array.<!SDK.CSSMedia>} cssMedias */ _rebuildMediaQueries(cssMedias) { var queryModels = []; @@ -179,7 +179,7 @@ continue; for (var j = 0; j < cssMedia.mediaList.length; ++j) { var mediaQuery = cssMedia.mediaList[j]; - var queryModel = WebInspector.MediaQueryInspector.MediaQueryUIModel.createFromMediaQuery(cssMedia, mediaQuery); + var queryModel = Emulation.MediaQueryInspector.MediaQueryUIModel.createFromMediaQuery(cssMedia, mediaQuery); if (queryModel && queryModel.rawLocation()) queryModels.push(queryModel); } @@ -196,8 +196,8 @@ this._renderMediaQueries(); /** - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} model1 - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} model2 + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} model1 + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} model2 * @return {number} */ function compareModels(model1, model2) { @@ -241,7 +241,7 @@ * @return {number} */ _zoomFactor() { - return WebInspector.zoomManager.zoomFactor() / this._scale; + return UI.zoomManager.zoomFactor() / this._scale; } /** @@ -252,7 +252,7 @@ } /** - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} model + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} model * @return {!Element} */ _createElementFromMediaQueryModel(model) { @@ -261,7 +261,7 @@ var maxWidthValue = model.maxWidthExpression() ? model.maxWidthExpression().computedLength() / zoomFactor : 0; var result = createElementWithClass('div', 'media-inspector-bar'); - if (model.section() === WebInspector.MediaQueryInspector.Section.Max) { + if (model.section() === Emulation.MediaQueryInspector.Section.Max) { result.createChild('div', 'media-inspector-marker-spacer'); var markerElement = result.createChild('div', 'media-inspector-marker media-inspector-marker-max-width'); markerElement.style.width = maxWidthValue + 'px'; @@ -271,7 +271,7 @@ result.createChild('div', 'media-inspector-marker-spacer'); } - if (model.section() === WebInspector.MediaQueryInspector.Section.MinMax) { + if (model.section() === Emulation.MediaQueryInspector.Section.MinMax) { result.createChild('div', 'media-inspector-marker-spacer'); var leftElement = result.createChild('div', 'media-inspector-marker media-inspector-marker-min-max-width'); leftElement.style.width = (maxWidthValue - minWidthValue) * 0.5 + 'px'; @@ -287,7 +287,7 @@ result.createChild('div', 'media-inspector-marker-spacer'); } - if (model.section() === WebInspector.MediaQueryInspector.Section.Min) { + if (model.section() === Emulation.MediaQueryInspector.Section.Min) { var leftElement = result.createChild( 'div', 'media-inspector-marker media-inspector-marker-min-width media-inspector-marker-min-width-left'); leftElement.title = model.mediaText(); @@ -318,7 +318,7 @@ /** * @enum {number} */ -WebInspector.MediaQueryInspector.Section = { +Emulation.MediaQueryInspector.Section = { Max: 0, MinMax: 1, Min: 2 @@ -327,11 +327,11 @@ /** * @unrestricted */ -WebInspector.MediaQueryInspector.MediaQueryUIModel = class { +Emulation.MediaQueryInspector.MediaQueryUIModel = class { /** - * @param {!WebInspector.CSSMedia} cssMedia - * @param {?WebInspector.CSSMediaQueryExpression} minWidthExpression - * @param {?WebInspector.CSSMediaQueryExpression} maxWidthExpression + * @param {!SDK.CSSMedia} cssMedia + * @param {?SDK.CSSMediaQueryExpression} minWidthExpression + * @param {?SDK.CSSMediaQueryExpression} maxWidthExpression * @param {boolean} active */ constructor(cssMedia, minWidthExpression, maxWidthExpression, active) { @@ -340,17 +340,17 @@ this._maxWidthExpression = maxWidthExpression; this._active = active; if (maxWidthExpression && !minWidthExpression) - this._section = WebInspector.MediaQueryInspector.Section.Max; + this._section = Emulation.MediaQueryInspector.Section.Max; else if (minWidthExpression && maxWidthExpression) - this._section = WebInspector.MediaQueryInspector.Section.MinMax; + this._section = Emulation.MediaQueryInspector.Section.MinMax; else - this._section = WebInspector.MediaQueryInspector.Section.Min; + this._section = Emulation.MediaQueryInspector.Section.Min; } /** - * @param {!WebInspector.CSSMedia} cssMedia - * @param {!WebInspector.CSSMediaQuery} mediaQuery - * @return {?WebInspector.MediaQueryInspector.MediaQueryUIModel} + * @param {!SDK.CSSMedia} cssMedia + * @param {!SDK.CSSMediaQuery} mediaQuery + * @return {?Emulation.MediaQueryInspector.MediaQueryUIModel} */ static createFromMediaQuery(cssMedia, mediaQuery) { var maxWidthExpression = null; @@ -375,12 +375,12 @@ if (minWidthPixels > maxWidthPixels || (!maxWidthExpression && !minWidthExpression)) return null; - return new WebInspector.MediaQueryInspector.MediaQueryUIModel( + return new Emulation.MediaQueryInspector.MediaQueryUIModel( cssMedia, minWidthExpression, maxWidthExpression, mediaQuery.active()); } /** - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} other + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} other * @return {boolean} */ equals(other) { @@ -388,7 +388,7 @@ } /** - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} other + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} other * @return {boolean} */ dimensionsEqual(other) { @@ -400,7 +400,7 @@ } /** - * @param {!WebInspector.MediaQueryInspector.MediaQueryUIModel} other + * @param {!Emulation.MediaQueryInspector.MediaQueryUIModel} other * @return {number} */ compareTo(other) { @@ -420,16 +420,16 @@ return myLocation.url.compareTo(otherLocation.url) || myLocation.lineNumber - otherLocation.lineNumber || myLocation.columnNumber - otherLocation.columnNumber; } - if (this.section() === WebInspector.MediaQueryInspector.Section.Max) + if (this.section() === Emulation.MediaQueryInspector.Section.Max) return other.maxWidthExpression().computedLength() - this.maxWidthExpression().computedLength(); - if (this.section() === WebInspector.MediaQueryInspector.Section.Min) + if (this.section() === Emulation.MediaQueryInspector.Section.Min) return this.minWidthExpression().computedLength() - other.minWidthExpression().computedLength(); return this.minWidthExpression().computedLength() - other.minWidthExpression().computedLength() || other.maxWidthExpression().computedLength() - this.maxWidthExpression().computedLength(); } /** - * @return {!WebInspector.MediaQueryInspector.Section} + * @return {!Emulation.MediaQueryInspector.Section} */ section() { return this._section; @@ -443,7 +443,7 @@ } /** - * @return {?WebInspector.CSSLocation} + * @return {?SDK.CSSLocation} */ rawLocation() { if (!this._rawLocation) @@ -452,14 +452,14 @@ } /** - * @return {?WebInspector.CSSMediaQueryExpression} + * @return {?SDK.CSSMediaQueryExpression} */ minWidthExpression() { return this._minWidthExpression; } /** - * @return {?WebInspector.CSSMediaQueryExpression} + * @return {?SDK.CSSMediaQueryExpression} */ maxWidthExpression() { return this._maxWidthExpression;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js index 508194f7..73e1821 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
@@ -4,21 +4,21 @@ /** * @unrestricted */ -WebInspector.SensorsView = class extends WebInspector.VBox { +Emulation.SensorsView = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('emulation/sensors.css'); this.contentElement.classList.add('sensors-view'); - this._geolocationSetting = WebInspector.settings.createSetting('emulation.geolocationOverride', ''); - this._geolocation = WebInspector.Geolocation.parseSetting(this._geolocationSetting.get()); + this._geolocationSetting = Common.settings.createSetting('emulation.geolocationOverride', ''); + this._geolocation = Emulation.Geolocation.parseSetting(this._geolocationSetting.get()); this._geolocationOverrideEnabled = false; this._createGeolocationSection(this._geolocation); this.contentElement.createChild('div').classList.add('panel-section-separator'); - this._deviceOrientationSetting = WebInspector.settings.createSetting('emulation.deviceOrientationOverride', ''); - this._deviceOrientation = WebInspector.DeviceOrientation.parseSetting(this._deviceOrientationSetting.get()); + this._deviceOrientationSetting = Common.settings.createSetting('emulation.deviceOrientationOverride', ''); + this._deviceOrientation = Emulation.DeviceOrientation.parseSetting(this._deviceOrientationSetting.get()); this._deviceOrientationOverrideEnabled = false; this._createDeviceOrientationSection(); @@ -28,35 +28,35 @@ } /** - * @return {!WebInspector.SensorsView} + * @return {!Emulation.SensorsView} */ static instance() { - if (!WebInspector.SensorsView._instanceObject) - WebInspector.SensorsView._instanceObject = new WebInspector.SensorsView(); - return WebInspector.SensorsView._instanceObject; + if (!Emulation.SensorsView._instanceObject) + Emulation.SensorsView._instanceObject = new Emulation.SensorsView(); + return Emulation.SensorsView._instanceObject; } /** - * @param {!WebInspector.Geolocation} geolocation + * @param {!Emulation.Geolocation} geolocation */ _createGeolocationSection(geolocation) { var geogroup = this.contentElement.createChild('section', 'sensors-group'); - geogroup.createChild('div', 'sensors-group-title').textContent = WebInspector.UIString('Geolocation'); + geogroup.createChild('div', 'sensors-group-title').textContent = Common.UIString('Geolocation'); var fields = geogroup.createChild('div', 'geo-fields'); const noOverrideOption = { - title: WebInspector.UIString('No override'), - location: WebInspector.SensorsView.NonPresetOptions.NoOverride + title: Common.UIString('No override'), + location: Emulation.SensorsView.NonPresetOptions.NoOverride }; const customLocationOption = { - title: WebInspector.UIString('Custom location...'), - location: WebInspector.SensorsView.NonPresetOptions.Custom + title: Common.UIString('Custom location...'), + location: Emulation.SensorsView.NonPresetOptions.Custom }; this._locationSelectElement = this.contentElement.createChild('select', 'chrome-select'); this._locationSelectElement.appendChild(new Option(noOverrideOption.title, noOverrideOption.location)); this._locationSelectElement.appendChild(new Option(customLocationOption.title, customLocationOption.location)); - var locationGroups = WebInspector.SensorsView.PresetLocations; + var locationGroups = Emulation.SensorsView.PresetLocations; for (var i = 0; i < locationGroups.length; ++i) { var group = locationGroups[i].value; var groupElement = this._locationSelectElement.createChild('optgroup'); @@ -79,54 +79,54 @@ this._latitudeInput = latitudeGroup.createChild('input'); this._latitudeInput.setAttribute('type', 'number'); this._latitudeInput.value = 0; - this._latitudeSetter = WebInspector.bindInput( - this._latitudeInput, this._applyGeolocationUserInput.bind(this), WebInspector.Geolocation.latitudeValidator, + this._latitudeSetter = UI.bindInput( + this._latitudeInput, this._applyGeolocationUserInput.bind(this), Emulation.Geolocation.latitudeValidator, true); this._latitudeSetter(String(geolocation.latitude)); this._longitudeInput = longitudeGroup.createChild('input'); this._longitudeInput.setAttribute('type', 'number'); this._longitudeInput.value = 0; - this._longitudeSetter = WebInspector.bindInput( - this._longitudeInput, this._applyGeolocationUserInput.bind(this), WebInspector.Geolocation.longitudeValidator, + this._longitudeSetter = UI.bindInput( + this._longitudeInput, this._applyGeolocationUserInput.bind(this), Emulation.Geolocation.longitudeValidator, true); this._longitudeSetter(String(geolocation.longitude)); - latitudeGroup.createChild('div', 'latlong-title').textContent = WebInspector.UIString('Latitude'); - longitudeGroup.createChild('div', 'latlong-title').textContent = WebInspector.UIString('Longitude'); + latitudeGroup.createChild('div', 'latlong-title').textContent = Common.UIString('Latitude'); + longitudeGroup.createChild('div', 'latlong-title').textContent = Common.UIString('Longitude'); } _geolocationSelectChanged() { this._fieldsetElement.disabled = false; var value = this._locationSelectElement.options[this._locationSelectElement.selectedIndex].value; - if (value === WebInspector.SensorsView.NonPresetOptions.NoOverride) { + if (value === Emulation.SensorsView.NonPresetOptions.NoOverride) { this._geolocationOverrideEnabled = false; this._fieldsetElement.disabled = true; - } else if (value === WebInspector.SensorsView.NonPresetOptions.Custom) { + } else if (value === Emulation.SensorsView.NonPresetOptions.Custom) { this._geolocationOverrideEnabled = true; - } else if (value === WebInspector.SensorsView.NonPresetOptions.Unavailable) { + } else if (value === Emulation.SensorsView.NonPresetOptions.Unavailable) { this._geolocationOverrideEnabled = true; - this._geolocation = new WebInspector.Geolocation(0, 0, true); + this._geolocation = new Emulation.Geolocation(0, 0, true); } else { this._geolocationOverrideEnabled = true; var coordinates = JSON.parse(value); - this._geolocation = new WebInspector.Geolocation(coordinates[0], coordinates[1], false); + this._geolocation = new Emulation.Geolocation(coordinates[0], coordinates[1], false); this._latitudeSetter(coordinates[0]); this._longitudeSetter(coordinates[1]); } this._applyGeolocation(); - if (value === WebInspector.SensorsView.NonPresetOptions.Custom) + if (value === Emulation.SensorsView.NonPresetOptions.Custom) this._latitudeInput.focus(); } _applyGeolocationUserInput() { - var geolocation = WebInspector.Geolocation.parseUserInput( + var geolocation = Emulation.Geolocation.parseUserInput( this._latitudeInput.value.trim(), this._longitudeInput.value.trim(), ''); if (!geolocation) return; - this._setSelectElementLabel(this._locationSelectElement, WebInspector.SensorsView.NonPresetOptions.Custom); + this._setSelectElementLabel(this._locationSelectElement, Emulation.SensorsView.NonPresetOptions.Custom); this._geolocation = geolocation; this._applyGeolocation(); } @@ -142,17 +142,17 @@ _createDeviceOrientationSection() { var orientationGroup = this.contentElement.createChild('section', 'sensors-group'); - orientationGroup.createChild('div', 'sensors-group-title').textContent = WebInspector.UIString('Orientation'); + orientationGroup.createChild('div', 'sensors-group-title').textContent = Common.UIString('Orientation'); var orientationContent = orientationGroup.createChild('div', 'orientation-content'); var fields = orientationContent.createChild('div', 'orientation-fields'); const orientationOffOption = { - title: WebInspector.UIString('Off'), - orientation: WebInspector.SensorsView.NonPresetOptions.NoOverride + title: Common.UIString('Off'), + orientation: Emulation.SensorsView.NonPresetOptions.NoOverride }; const customOrientationOption = { - title: WebInspector.UIString('Custom orientation...'), - orientation: WebInspector.SensorsView.NonPresetOptions.Custom + title: Common.UIString('Custom orientation...'), + orientation: Emulation.SensorsView.NonPresetOptions.Custom }; this._orientationSelectElement = this.contentElement.createChild('select', 'chrome-select'); this._orientationSelectElement.appendChild( @@ -160,7 +160,7 @@ this._orientationSelectElement.appendChild( new Option(customOrientationOption.title, customOrientationOption.orientation)); - var orientationGroups = WebInspector.SensorsView.PresetOrientations; + var orientationGroups = Emulation.SensorsView.PresetOrientations; for (var i = 0; i < orientationGroups.length; ++i) { var groupElement = this._orientationSelectElement.createChild('optgroup'); groupElement.label = orientationGroups[i].title; @@ -175,7 +175,7 @@ this._deviceOrientationFieldset = this._createDeviceOrientationOverrideElement(this._deviceOrientation); this._stageElement = orientationContent.createChild('div', 'orientation-stage'); - this._stageElement.title = WebInspector.UIString('Shift+drag horizontally to rotate around the y-axis'); + this._stageElement.title = Common.UIString('Shift+drag horizontally to rotate around the y-axis'); this._orientationLayer = this._stageElement.createChild('div', 'orientation-layer'); this._boxElement = this._orientationLayer.createChild('section', 'orientation-box orientation-element'); @@ -186,7 +186,7 @@ this._boxElement.createChild('section', 'orientation-right orientation-element'); this._boxElement.createChild('section', 'orientation-bottom orientation-element'); - WebInspector.installDragHandle( + UI.installDragHandle( this._stageElement, this._onBoxDragStart.bind(this), this._onBoxDrag.bind(this), null, '-webkit-grabbing', '-webkit-grab'); @@ -212,18 +212,18 @@ var value = this._orientationSelectElement.options[this._orientationSelectElement.selectedIndex].value; this._enableOrientationFields(false); - if (value === WebInspector.SensorsView.NonPresetOptions.NoOverride) { + if (value === Emulation.SensorsView.NonPresetOptions.NoOverride) { this._deviceOrientationOverrideEnabled = false; this._enableOrientationFields(true); - } else if (value === WebInspector.SensorsView.NonPresetOptions.Custom) { + } else if (value === Emulation.SensorsView.NonPresetOptions.Custom) { this._deviceOrientationOverrideEnabled = true; this._alphaElement.focus(); } else { var parsedValue = JSON.parse(value); this._deviceOrientationOverrideEnabled = true; - this._deviceOrientation = new WebInspector.DeviceOrientation(parsedValue[0], parsedValue[1], parsedValue[2]); + this._deviceOrientation = new Emulation.DeviceOrientation(parsedValue[0], parsedValue[1], parsedValue[2]); this._setDeviceOrientation( - this._deviceOrientation, WebInspector.SensorsView.DeviceOrientationModificationSource.SelectPreset); + this._deviceOrientation, Emulation.SensorsView.DeviceOrientationModificationSource.SelectPreset); } } @@ -247,22 +247,22 @@ _applyDeviceOrientationUserInput() { this._setDeviceOrientation( - WebInspector.DeviceOrientation.parseUserInput( + Emulation.DeviceOrientation.parseUserInput( this._alphaElement.value.trim(), this._betaElement.value.trim(), this._gammaElement.value.trim()), - WebInspector.SensorsView.DeviceOrientationModificationSource.UserInput); - this._setSelectElementLabel(this._orientationSelectElement, WebInspector.SensorsView.NonPresetOptions.Custom); + Emulation.SensorsView.DeviceOrientationModificationSource.UserInput); + this._setSelectElementLabel(this._orientationSelectElement, Emulation.SensorsView.NonPresetOptions.Custom); } _resetDeviceOrientation() { this._setDeviceOrientation( - new WebInspector.DeviceOrientation(0, 90, 0), - WebInspector.SensorsView.DeviceOrientationModificationSource.ResetButton); + new Emulation.DeviceOrientation(0, 90, 0), + Emulation.SensorsView.DeviceOrientationModificationSource.ResetButton); this._setSelectElementLabel(this._orientationSelectElement, '[0, 90, 0]'); } /** - * @param {?WebInspector.DeviceOrientation} deviceOrientation - * @param {!WebInspector.SensorsView.DeviceOrientationModificationSource} modificationSource + * @param {?Emulation.DeviceOrientation} deviceOrientation + * @param {!Emulation.SensorsView.DeviceOrientationModificationSource} modificationSource */ _setDeviceOrientation(deviceOrientation, modificationSource) { if (!deviceOrientation) @@ -276,13 +276,13 @@ return Math.round(angle * 10000) / 10000; } - if (modificationSource !== WebInspector.SensorsView.DeviceOrientationModificationSource.UserInput) { + if (modificationSource !== Emulation.SensorsView.DeviceOrientationModificationSource.UserInput) { this._alphaSetter(roundAngle(deviceOrientation.alpha)); this._betaSetter(roundAngle(deviceOrientation.beta)); this._gammaSetter(roundAngle(deviceOrientation.gamma)); } - var animate = modificationSource !== WebInspector.SensorsView.DeviceOrientationModificationSource.UserDrag; + var animate = modificationSource !== Emulation.SensorsView.DeviceOrientationModificationSource.UserDrag; this._setBoxOrientation(deviceOrientation, animate); this._deviceOrientation = deviceOrientation; @@ -300,12 +300,12 @@ div.appendChild(input); div.createTextChild(label); input.type = 'number'; - return WebInspector.bindInput( - input, this._applyDeviceOrientationUserInput.bind(this), WebInspector.DeviceOrientation.validator, true); + return UI.bindInput( + input, this._applyDeviceOrientationUserInput.bind(this), Emulation.DeviceOrientation.validator, true); } /** - * @param {!WebInspector.DeviceOrientation} deviceOrientation + * @param {!Emulation.DeviceOrientation} deviceOrientation * @return {!Element} */ _createDeviceOrientationOverrideElement(deviceOrientation) { @@ -314,24 +314,24 @@ var cellElement = fieldsetElement.createChild('td', 'orientation-inputs-cell'); this._alphaElement = createElement('input'); - this._alphaSetter = this._createAxisInput(cellElement, this._alphaElement, WebInspector.UIString('\u03B1 (alpha)')); + this._alphaSetter = this._createAxisInput(cellElement, this._alphaElement, Common.UIString('\u03B1 (alpha)')); this._alphaSetter(String(deviceOrientation.alpha)); this._betaElement = createElement('input'); - this._betaSetter = this._createAxisInput(cellElement, this._betaElement, WebInspector.UIString('\u03B2 (beta)')); + this._betaSetter = this._createAxisInput(cellElement, this._betaElement, Common.UIString('\u03B2 (beta)')); this._betaSetter(String(deviceOrientation.beta)); this._gammaElement = createElement('input'); - this._gammaSetter = this._createAxisInput(cellElement, this._gammaElement, WebInspector.UIString('\u03B3 (gamma)')); + this._gammaSetter = this._createAxisInput(cellElement, this._gammaElement, Common.UIString('\u03B3 (gamma)')); this._gammaSetter(String(deviceOrientation.gamma)); cellElement.appendChild(createTextButton( - WebInspector.UIString('Reset'), this._resetDeviceOrientation.bind(this), 'orientation-reset-button')); + Common.UIString('Reset'), this._resetDeviceOrientation.bind(this), 'orientation-reset-button')); return fieldsetElement; } /** - * @param {!WebInspector.DeviceOrientation} deviceOrientation + * @param {!Emulation.DeviceOrientation} deviceOrientation * @param {boolean} animate */ _setBoxOrientation(deviceOrientation, animate) { @@ -344,7 +344,7 @@ var matrix = new WebKitCSSMatrix(); this._boxMatrix = matrix.rotate(-deviceOrientation.beta, deviceOrientation.gamma, -deviceOrientation.alpha); var eulerAngles = - new WebInspector.Geometry.EulerAngles(deviceOrientation.alpha, deviceOrientation.beta, deviceOrientation.gamma); + new Common.Geometry.EulerAngles(deviceOrientation.alpha, deviceOrientation.beta, deviceOrientation.gamma); this._orientationLayer.style.transform = eulerAngles.toRotate3DString(); } @@ -360,11 +360,11 @@ event.consume(true); var axis, angle; if (event.shiftKey) { - axis = new WebInspector.Geometry.Vector(0, 0, -1); - angle = (this._mouseDownVector.x - mouseMoveVector.x) * WebInspector.SensorsView.ShiftDragOrientationSpeed; + axis = new Common.Geometry.Vector(0, 0, -1); + angle = (this._mouseDownVector.x - mouseMoveVector.x) * Emulation.SensorsView.ShiftDragOrientationSpeed; } else { - axis = WebInspector.Geometry.crossProduct(this._mouseDownVector, mouseMoveVector); - angle = WebInspector.Geometry.calculateAngle(this._mouseDownVector, mouseMoveVector); + axis = Common.Geometry.crossProduct(this._mouseDownVector, mouseMoveVector); + angle = Common.Geometry.calculateAngle(this._mouseDownVector, mouseMoveVector); } // The mouse movement vectors occur in the screen space, which is offset by 90 degrees from @@ -375,10 +375,10 @@ .rotate(90, 0, 0) .multiply(this._originalBoxMatrix); - var eulerAngles = WebInspector.Geometry.EulerAngles.fromRotationMatrix(currentMatrix); - var newOrientation = new WebInspector.DeviceOrientation(-eulerAngles.alpha, -eulerAngles.beta, eulerAngles.gamma); - this._setDeviceOrientation(newOrientation, WebInspector.SensorsView.DeviceOrientationModificationSource.UserDrag); - this._setSelectElementLabel(this._orientationSelectElement, WebInspector.SensorsView.NonPresetOptions.Custom); + var eulerAngles = Common.Geometry.EulerAngles.fromRotationMatrix(currentMatrix); + var newOrientation = new Emulation.DeviceOrientation(-eulerAngles.alpha, -eulerAngles.beta, eulerAngles.gamma); + this._setDeviceOrientation(newOrientation, Emulation.SensorsView.DeviceOrientationModificationSource.UserDrag); + this._setSelectElementLabel(this._orientationSelectElement, Emulation.SensorsView.NonPresetOptions.Custom); return false; } @@ -403,7 +403,7 @@ /** * @param {number} x * @param {number} y - * @return {?WebInspector.Geometry.Vector} + * @return {?Common.Geometry.Vector} */ _calculateRadiusVector(x, y) { var rect = this._stageElement.getBoundingClientRect(); @@ -412,9 +412,9 @@ var sphereY = (y - rect.top - rect.height / 2) / radius; var sqrSum = sphereX * sphereX + sphereY * sphereY; if (sqrSum > 0.5) - return new WebInspector.Geometry.Vector(sphereX, sphereY, 0.5 / Math.sqrt(sqrSum)); + return new Common.Geometry.Vector(sphereX, sphereY, 0.5 / Math.sqrt(sqrSum)); - return new WebInspector.Geometry.Vector(sphereX, sphereY, Math.sqrt(1 - sqrSum)); + return new Common.Geometry.Vector(sphereX, sphereY, Math.sqrt(1 - sqrSum)); } _appendTouchControl() { @@ -422,20 +422,20 @@ var title = groupElement.createChild('div', 'sensors-group-title'); var fieldsElement = groupElement.createChild('div', 'sensors-group-fields'); - title.textContent = WebInspector.UIString('Touch'); + title.textContent = Common.UIString('Touch'); var select = fieldsElement.createChild('select', 'chrome-select'); - select.appendChild(new Option(WebInspector.UIString('Device-based'), 'auto')); - select.appendChild(new Option(WebInspector.UIString('Force enabled'), 'enabled')); + select.appendChild(new Option(Common.UIString('Device-based'), 'auto')); + select.appendChild(new Option(Common.UIString('Force enabled'), 'enabled')); select.addEventListener('change', applyTouch, false); function applyTouch() { - WebInspector.MultitargetTouchModel.instance().setCustomTouchEnabled(select.value === 'enabled'); + Emulation.MultitargetTouchModel.instance().setCustomTouchEnabled(select.value === 'enabled'); } } }; /** @enum {string} */ -WebInspector.SensorsView.DeviceOrientationModificationSource = { +Emulation.SensorsView.DeviceOrientationModificationSource = { UserInput: 'userInput', UserDrag: 'userDrag', ResetButton: 'resetButton', @@ -443,66 +443,66 @@ }; /** {string} */ -WebInspector.SensorsView.NonPresetOptions = { +Emulation.SensorsView.NonPresetOptions = { 'NoOverride': 'noOverride', 'Custom': 'custom', 'Unavailable': 'unavailable' }; /** @type {!Array.<{title: string, value: !Array.<{title: string, location: string}>}>} */ -WebInspector.SensorsView.PresetLocations = [ +Emulation.SensorsView.PresetLocations = [ { title: 'Presets', value: [ - {title: WebInspector.UIString('Berlin'), location: '[52.520007, 13.404954]'}, - {title: WebInspector.UIString('London'), location: '[51.507351, -0.127758]'}, - {title: WebInspector.UIString('Moscow'), location: '[55.755826, 37.617300]'}, - {title: WebInspector.UIString('Mountain View'), location: '[37.386052, -122.083851]'}, - {title: WebInspector.UIString('Mumbai'), location: '[19.075984, 72.877656]'}, - {title: WebInspector.UIString('San Francisco'), location: '[37.774929, -122.419416]'}, - {title: WebInspector.UIString('Shanghai'), location: '[31.230416, 121.473701]'}, - {title: WebInspector.UIString('São Paulo'), location: '[-23.550520, -46.633309]'}, - {title: WebInspector.UIString('Tokyo'), location: '[35.689487, 139.691706]'}, + {title: Common.UIString('Berlin'), location: '[52.520007, 13.404954]'}, + {title: Common.UIString('London'), location: '[51.507351, -0.127758]'}, + {title: Common.UIString('Moscow'), location: '[55.755826, 37.617300]'}, + {title: Common.UIString('Mountain View'), location: '[37.386052, -122.083851]'}, + {title: Common.UIString('Mumbai'), location: '[19.075984, 72.877656]'}, + {title: Common.UIString('San Francisco'), location: '[37.774929, -122.419416]'}, + {title: Common.UIString('Shanghai'), location: '[31.230416, 121.473701]'}, + {title: Common.UIString('São Paulo'), location: '[-23.550520, -46.633309]'}, + {title: Common.UIString('Tokyo'), location: '[35.689487, 139.691706]'}, ] }, { title: 'Error', value: [{ - title: WebInspector.UIString('Location unavailable'), - location: WebInspector.SensorsView.NonPresetOptions.Unavailable + title: Common.UIString('Location unavailable'), + location: Emulation.SensorsView.NonPresetOptions.Unavailable }] } ]; -/** @type {!Array.<{title: string, value: !Array.<{title: string, orientation: !WebInspector.DeviceOrientation}>}>} */ -WebInspector.SensorsView.PresetOrientations = [{ +/** @type {!Array.<{title: string, value: !Array.<{title: string, orientation: !Emulation.DeviceOrientation}>}>} */ +Emulation.SensorsView.PresetOrientations = [{ title: 'Presets', value: [ - {title: WebInspector.UIString('Portrait'), orientation: '[0, 90, 0]'}, - {title: WebInspector.UIString('Portrait upside down'), orientation: '[180, -90, 0]'}, - {title: WebInspector.UIString('Landscape left'), orientation: '[0, 90, -90]'}, - {title: WebInspector.UIString('Landscape right'), orientation: '[0, 90, 90]'}, - {title: WebInspector.UIString('Display up'), orientation: '[0, 0, 0]'}, - {title: WebInspector.UIString('Display down'), orientation: '[0, 180, 0]'} + {title: Common.UIString('Portrait'), orientation: '[0, 90, 0]'}, + {title: Common.UIString('Portrait upside down'), orientation: '[180, -90, 0]'}, + {title: Common.UIString('Landscape left'), orientation: '[0, 90, -90]'}, + {title: Common.UIString('Landscape right'), orientation: '[0, 90, 90]'}, + {title: Common.UIString('Display up'), orientation: '[0, 0, 0]'}, + {title: Common.UIString('Display down'), orientation: '[0, 180, 0]'} ] }]; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SensorsView.ShowActionDelegate = class { +Emulation.SensorsView.ShowActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - WebInspector.viewManager.showView('sensors'); + UI.viewManager.showView('sensors'); return true; } }; -WebInspector.SensorsView.ShiftDragOrientationSpeed = 16; +Emulation.SensorsView.ShiftDragOrientationSpeed = 16;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/TouchModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/TouchModel.js index 10198f0..6fbeeb77 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/TouchModel.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/TouchModel.js
@@ -2,25 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.MultitargetTouchModel = class { +Emulation.MultitargetTouchModel = class { constructor() { this._touchEnabled = false; this._touchMobile = false; this._customTouchEnabled = false; - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** - * @return {!WebInspector.MultitargetTouchModel} + * @return {!Emulation.MultitargetTouchModel} */ static instance() { - if (!WebInspector.MultitargetTouchModel._instance) - WebInspector.MultitargetTouchModel._instance = new WebInspector.MultitargetTouchModel(); - return /** @type {!WebInspector.MultitargetTouchModel} */ (WebInspector.MultitargetTouchModel._instance); + if (!Emulation.MultitargetTouchModel._instance) + Emulation.MultitargetTouchModel._instance = new Emulation.MultitargetTouchModel(); + return /** @type {!Emulation.MultitargetTouchModel} */ (Emulation.MultitargetTouchModel._instance); } /** @@ -42,19 +42,19 @@ } _updateAllTargets() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) this._applyToTarget(target); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _applyToTarget(target) { var current = {enabled: this._touchEnabled, configuration: this._touchMobile ? 'mobile' : 'desktop'}; if (this._customTouchEnabled) current = {enabled: true, configuration: 'mobile'}; - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); var inspectModeEnabled = domModel ? domModel.inspectModeEnabled() : false; if (inspectModeEnabled) current = {enabled: false, configuration: 'mobile'}; @@ -74,7 +74,7 @@ } }; - var symbol = WebInspector.MultitargetTouchModel._symbol; + var symbol = Emulation.MultitargetTouchModel._symbol; var previous = target[symbol] || {enabled: false, configuration: 'mobile', scriptId: ''}; if (previous.enabled === current.enabled && (!current.enabled || previous.configuration === current.configuration)) @@ -103,37 +103,37 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _inspectModeToggled(event) { - var domModel = /** @type {!WebInspector.DOMModel} */ (event.target); + var domModel = /** @type {!SDK.DOMModel} */ (event.target); this._applyToTarget(domModel.target()); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (domModel) - domModel.addEventListener(WebInspector.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeToggled, this); + domModel.addEventListener(SDK.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeToggled, this); this._applyToTarget(target); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (domModel) domModel.removeEventListener( - WebInspector.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeToggled, this); + SDK.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeToggled, this); } }; -WebInspector.MultitargetTouchModel._symbol = Symbol('MultitargetTouchModel.symbol'); +Emulation.MultitargetTouchModel._symbol = Symbol('MultitargetTouchModel.symbol'); -/** @type {?WebInspector.MultitargetTouchModel} */ -WebInspector.MultitargetTouchModel._instance = null; +/** @type {?Emulation.MultitargetTouchModel} */ +Emulation.MultitargetTouchModel._instance = null;
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/module.json b/third_party/WebKit/Source/devtools/front_end/emulation/module.json index 4cc10e52..3b718a7 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/module.json +++ b/third_party/WebKit/Source/devtools/front_end/emulation/module.json
@@ -1,16 +1,16 @@ { "extensions": [ { - "type": "@WebInspector.AppProvider", + "type": "@Common.AppProvider", "condition": "can_dock", - "className": "WebInspector.AdvancedAppProvider", + "className": "Emulation.AdvancedAppProvider", "order": 0 }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Mobile", "actionId": "emulation.toggle-device-mode", - "className": "WebInspector.DeviceModeWrapper.ActionDelegate", + "className": "Emulation.DeviceModeWrapper.ActionDelegate", "condition": "can_dock", "title": "Toggle device toolbar", "iconClass": "largeicon-phone", @@ -26,10 +26,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "emulation.capture-screenshot", "category": "Mobile", - "className": "WebInspector.DeviceModeWrapper.ActionDelegate", + "className": "Emulation.DeviceModeWrapper.ActionDelegate", "title": "Capture screenshot", "tags": "device" }, @@ -40,7 +40,7 @@ "actionId": "emulation.capture-screenshot" }, { - "type": "@WebInspector.ToolbarItem.Provider", + "type": "@UI.ToolbarItem.Provider", "actionId": "emulation.toggle-device-mode", "condition": "can_dock", "location": "main-toolbar-left", @@ -88,17 +88,17 @@ "id": "devices", "title": "Devices", "order": "30", - "className": "WebInspector.DevicesSettingsTab", + "className": "Emulation.DevicesSettingsTab", "settings": [ "standardEmulatedDeviceList", "customEmulatedDeviceList" ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "emulation.show-sensors", "title": "Sensors", - "className": "WebInspector.SensorsView.ShowActionDelegate" + "className": "Emulation.SensorsView.ShowActionDelegate" }, { "type": "view", @@ -107,7 +107,7 @@ "title": "Sensors", "persistence": "closeable", "order": 100, - "className": "WebInspector.SensorsView", + "className": "Emulation.SensorsView", "tags": "geolocation, accelerometer, device orientation" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAuditCategory.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAuditCategory.js index ed7a680..4fe89f62 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAuditCategory.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAuditCategory.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.ExtensionAuditCategory = class { +Extensions.ExtensionAuditCategory = class { /** * @param {string} extensionOrigin * @param {string} id @@ -49,9 +49,9 @@ /** * @interface */ -WebInspector.ExtensionAuditCategoryResults = function() {}; +Extensions.ExtensionAuditCategoryResults = function() {}; -WebInspector.ExtensionAuditCategoryResults.prototype = { +Extensions.ExtensionAuditCategoryResults.prototype = { /** * @return {string} */
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js index ce0ca876..fc6ceb4 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionPanel.js
@@ -28,12 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.ExtensionPanel = class extends WebInspector.Panel { +Extensions.ExtensionPanel = class extends UI.Panel { /** - * @param {!WebInspector.ExtensionServer} server + * @param {!Extensions.ExtensionServer} server * @param {string} panelName * @param {string} id * @param {string} pageURL @@ -43,17 +43,17 @@ this._server = server; this._id = id; this.setHideOnDetach(); - this._panelToolbar = new WebInspector.Toolbar('hidden', this.element); + this._panelToolbar = new UI.Toolbar('hidden', this.element); - this._searchableView = new WebInspector.SearchableView(this); + this._searchableView = new UI.SearchableView(this); this._searchableView.show(this.element); - var extensionView = new WebInspector.ExtensionView(server, this._id, pageURL, 'extension'); + var extensionView = new Extensions.ExtensionView(server, this._id, pageURL, 'extension'); extensionView.show(this._searchableView.element); } /** - * @param {!WebInspector.ToolbarItem} item + * @param {!UI.ToolbarItem} item */ addToolbarItem(item) { this._panelToolbar.element.classList.remove('hidden'); @@ -64,13 +64,13 @@ * @override */ searchCanceled() { - this._server.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.CancelSearch); + this._server.notifySearchAction(this._id, Extensions.extensionAPI.panels.SearchAction.CancelSearch); this._searchableView.updateSearchMatchesCount(0); } /** * @override - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -78,27 +78,27 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ performSearch(searchConfig, shouldJump, jumpBackwards) { var query = searchConfig.query; - this._server.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.PerformSearch, query); + this._server.notifySearchAction(this._id, Extensions.extensionAPI.panels.SearchAction.PerformSearch, query); } /** * @override */ jumpToNextSearchResult() { - this._server.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.NextSearchResult); + this._server.notifySearchAction(this._id, Extensions.extensionAPI.panels.SearchAction.NextSearchResult); } /** * @override */ jumpToPreviousSearchResult() { - this._server.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.PreviousSearchResult); + this._server.notifySearchAction(this._id, Extensions.extensionAPI.panels.SearchAction.PreviousSearchResult); } /** @@ -121,9 +121,9 @@ /** * @unrestricted */ -WebInspector.ExtensionButton = class { +Extensions.ExtensionButton = class { /** - * @param {!WebInspector.ExtensionServer} server + * @param {!Extensions.ExtensionServer} server * @param {string} id * @param {string} iconURL * @param {string=} tooltip @@ -132,7 +132,7 @@ constructor(server, id, iconURL, tooltip, disabled) { this._id = id; - this._toolbarButton = new WebInspector.ToolbarButton('', ''); + this._toolbarButton = new UI.ToolbarButton('', ''); this._toolbarButton.addEventListener('click', server.notifyButtonClicked.bind(server, this._id)); this.update(iconURL, tooltip, disabled); } @@ -152,7 +152,7 @@ } /** - * @return {!WebInspector.ToolbarButton} + * @return {!UI.ToolbarButton} */ toolbarButton() { return this._toolbarButton; @@ -162,9 +162,9 @@ /** * @unrestricted */ -WebInspector.ExtensionSidebarPane = class extends WebInspector.SimpleView { +Extensions.ExtensionSidebarPane = class extends UI.SimpleView { /** - * @param {!WebInspector.ExtensionServer} server + * @param {!Extensions.ExtensionServer} server * @param {string} panelName * @param {string} title * @param {string} id @@ -198,7 +198,7 @@ */ setObject(object, title, callback) { this._createObjectPropertiesView(); - this._setObject(WebInspector.RemoteObject.fromLocalObject(object), title, callback); + this._setObject(SDK.RemoteObject.fromLocalObject(object), title, callback); } /** @@ -225,7 +225,7 @@ if (this._extensionView) this._extensionView.detach(); - this._extensionView = new WebInspector.ExtensionView(this._server, this._id, url, 'extension fill'); + this._extensionView = new Extensions.ExtensionView(this._server, this._id, url, 'extension fill'); this._extensionView.show(this.element); if (!this.element.style.height) @@ -243,14 +243,14 @@ * @param {string} title * @param {function(?string=)} callback * @param {?Protocol.Error} error - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {boolean=} wasThrown */ _onEvaluate(title, callback, error, result, wasThrown) { if (error) callback(error.toString()); else - this._setObject(/** @type {!WebInspector.RemoteObject} */ (result), title, callback); + this._setObject(/** @type {!SDK.RemoteObject} */ (result), title, callback); } _createObjectPropertiesView() { @@ -260,12 +260,12 @@ this._extensionView.detach(); delete this._extensionView; } - this._objectPropertiesView = new WebInspector.ExtensionNotifierView(this._server, this._id); + this._objectPropertiesView = new Extensions.ExtensionNotifierView(this._server, this._id); this._objectPropertiesView.show(this.element); } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object * @param {string} title * @param {function(?string=)} callback */ @@ -276,7 +276,7 @@ return; } this._objectPropertiesView.element.removeChildren(); - var section = new WebInspector.ObjectPropertiesSection(object, title); + var section = new Components.ObjectPropertiesSection(object, title); if (!title) section.titleLessMode(); section.expand();
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionRegistryStub.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionRegistryStub.js index 5765bbe..323be736 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionRegistryStub.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionRegistryStub.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ - WebInspector.InspectorExtensionRegistryStub = class { + Extensions.InspectorExtensionRegistryStub = class { getExtensionsAsync() { } }; - var InspectorExtensionRegistry = new WebInspector.InspectorExtensionRegistryStub(); + var InspectorExtensionRegistry = new Extensions.InspectorExtensionRegistryStub(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js index cb029576..cc63880 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.ExtensionServer = class extends WebInspector.Object { +Extensions.ExtensionServer = class extends Common.Object { /** * @suppressGlobalPropertiesCheck */ @@ -46,15 +46,15 @@ this._requests = {}; this._lastRequestId = 0; this._registeredExtensions = {}; - this._status = new WebInspector.ExtensionStatus(); - /** @type {!Array.<!WebInspector.ExtensionSidebarPane>} */ + this._status = new Extensions.ExtensionStatus(); + /** @type {!Array.<!Extensions.ExtensionSidebarPane>} */ this._sidebarPanes = []; - /** @type {!Array.<!WebInspector.ExtensionAuditCategory>} */ + /** @type {!Array.<!Extensions.ExtensionAuditCategory>} */ this._auditCategories = []; - /** @type {!Array.<!WebInspector.ExtensionTraceProvider>} */ + /** @type {!Array.<!Extensions.ExtensionTraceProvider>} */ this._traceProviders = []; - var commands = WebInspector.extensionAPI.Commands; + var commands = Extensions.extensionAPI.Commands; this._registerHandler(commands.AddAuditCategory, this._onAddAuditCategory.bind(this)); this._registerHandler(commands.AddAuditResult, this._onAddAuditResult.bind(this)); @@ -114,7 +114,7 @@ * @param {string=} searchString */ notifySearchAction(panelId, action, searchString) { - this._postNotification(WebInspector.extensionAPI.Events.PanelSearch + panelId, action, searchString); + this._postNotification(Extensions.extensionAPI.Events.PanelSearch + panelId, action, searchString); } /** @@ -122,34 +122,34 @@ * @param {number=} frameIndex */ notifyViewShown(identifier, frameIndex) { - this._postNotification(WebInspector.extensionAPI.Events.ViewShown + identifier, frameIndex); + this._postNotification(Extensions.extensionAPI.Events.ViewShown + identifier, frameIndex); } /** * @param {string} identifier */ notifyViewHidden(identifier) { - this._postNotification(WebInspector.extensionAPI.Events.ViewHidden + identifier); + this._postNotification(Extensions.extensionAPI.Events.ViewHidden + identifier); } /** * @param {string} identifier */ notifyButtonClicked(identifier) { - this._postNotification(WebInspector.extensionAPI.Events.ButtonClicked + identifier); + this._postNotification(Extensions.extensionAPI.Events.ButtonClicked + identifier); } _inspectedURLChanged(event) { - if (event.data !== WebInspector.targetManager.mainTarget()) + if (event.data !== SDK.targetManager.mainTarget()) return; this._requests = {}; var url = event.data.inspectedURL(); - this._postNotification(WebInspector.extensionAPI.Events.InspectedURLChanged, url); + this._postNotification(Extensions.extensionAPI.Events.InspectedURLChanged, url); } /** * @param {string} categoryId - * @param {!WebInspector.ExtensionAuditCategoryResults} auditResults + * @param {!Extensions.ExtensionAuditCategoryResults} auditResults */ startAuditRun(categoryId, auditResults) { this._clientObjects[auditResults.id()] = auditResults; @@ -157,7 +157,7 @@ } /** - * @param {!WebInspector.ExtensionAuditCategoryResults} auditResults + * @param {!Extensions.ExtensionAuditCategoryResults} auditResults */ stopAuditRun(auditResults) { delete this._clientObjects[auditResults.id()]; @@ -241,7 +241,7 @@ } } - WebInspector.multitargetNetworkManager.setExtraHTTPHeaders(allHeaders); + SDK.multitargetNetworkManager.setExtraHTTPHeaders(allHeaders); } /** @@ -260,32 +260,32 @@ var id = message.id; // The ids are generated on the client API side and must be unique, so the check below // shouldn't be hit unless someone is bypassing the API. - if (id in this._clientObjects || WebInspector.inspectorView.hasPanel(id)) + if (id in this._clientObjects || UI.inspectorView.hasPanel(id)) return this._status.E_EXISTS(id); var page = this._expandResourcePath(port._extensionOrigin, message.page); var persistentId = port._extensionOrigin + message.title; persistentId = persistentId.replace(/\s/g, ''); - var panelView = new WebInspector.ExtensionServerPanelView( - persistentId, message.title, new WebInspector.ExtensionPanel(this, persistentId, id, page)); + var panelView = new Extensions.ExtensionServerPanelView( + persistentId, message.title, new Extensions.ExtensionPanel(this, persistentId, id, page)); this._clientObjects[id] = panelView; - WebInspector.inspectorView.addPanel(panelView); + UI.inspectorView.addPanel(panelView); return this._status.OK(); } _onShowPanel(message) { var panelViewId = message.id; var panelView = this._clientObjects[message.id]; - if (panelView && panelView instanceof WebInspector.ExtensionServerPanelView) + if (panelView && panelView instanceof Extensions.ExtensionServerPanelView) panelViewId = panelView.viewId(); - WebInspector.inspectorView.showPanel(panelViewId); + UI.inspectorView.showPanel(panelViewId); } _onCreateToolbarButton(message, port) { var panelView = this._clientObjects[message.panel]; - if (!panelView || !(panelView instanceof WebInspector.ExtensionServerPanelView)) + if (!panelView || !(panelView instanceof Extensions.ExtensionServerPanelView)) return this._status.E_NOTFOUND(message.panel); - var button = new WebInspector.ExtensionButton( + var button = new Extensions.ExtensionButton( this, message.id, this._expandResourcePath(port._extensionOrigin, message.icon), message.tooltip, message.disabled); this._clientObjects[message.id] = button; @@ -293,10 +293,10 @@ panelView.widget().then(appendButton); /** - * @param {!WebInspector.Widget} panel + * @param {!UI.Widget} panel */ function appendButton(panel) { - /** @type {!WebInspector.ExtensionPanel} panel*/ (panel).addToolbarItem(button.toolbarButton()); + /** @type {!Extensions.ExtensionPanel} panel*/ (panel).addToolbarItem(button.toolbarButton()); } return this._status.OK(); @@ -304,7 +304,7 @@ _onUpdateButton(message, port) { var button = this._clientObjects[message.id]; - if (!button || !(button instanceof WebInspector.ExtensionButton)) + if (!button || !(button instanceof Extensions.ExtensionButton)) return this._status.E_NOTFOUND(message.id); button.update(this._expandResourcePath(port._extensionOrigin, message.icon), message.tooltip, message.disabled); return this._status.OK(); @@ -314,16 +314,16 @@ if (message.panel !== 'elements' && message.panel !== 'sources') return this._status.E_NOTFOUND(message.panel); var id = message.id; - var sidebar = new WebInspector.ExtensionSidebarPane(this, message.panel, message.title, id); + var sidebar = new Extensions.ExtensionSidebarPane(this, message.panel, message.title, id); this._sidebarPanes.push(sidebar); this._clientObjects[id] = sidebar; - this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.SidebarPaneAdded, sidebar); + this.dispatchEventToListeners(Extensions.ExtensionServer.Events.SidebarPaneAdded, sidebar); return this._status.OK(); } /** - * @return {!Array.<!WebInspector.ExtensionSidebarPane>} + * @return {!Array.<!Extensions.ExtensionSidebarPane>} */ sidebarPanes() { return this._sidebarPanes; @@ -343,7 +343,7 @@ return this._status.E_NOTFOUND(message.id); /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function callback(error) { var result = error ? this._status.E_FAILED(error) : this._status.OK(); @@ -363,21 +363,21 @@ } _onOpenResource(message) { - var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(message.url); + var uiSourceCode = Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(message.url); if (uiSourceCode) { - WebInspector.Revealer.reveal(uiSourceCode.uiLocation(message.lineNumber, 0)); + Common.Revealer.reveal(uiSourceCode.uiLocation(message.lineNumber, 0)); return this._status.OK(); } - var resource = WebInspector.resourceForURL(message.url); + var resource = Bindings.resourceForURL(message.url); if (resource) { - WebInspector.Revealer.reveal(resource); + Common.Revealer.reveal(resource); return this._status.OK(); } - var request = WebInspector.NetworkLog.requestForURL(message.url); + var request = SDK.NetworkLog.requestForURL(message.url); if (request) { - WebInspector.Revealer.reveal(request); + Common.Revealer.reveal(request); return this._status.OK(); } @@ -387,14 +387,14 @@ _onSetOpenResourceHandler(message, port) { var name = this._registeredExtensions[port._extensionOrigin].name || ('Extension ' + port._extensionOrigin); if (message.handlerPresent) - WebInspector.openAnchorLocationRegistry.registerHandler(name, this._handleOpenURL.bind(this, port)); + Components.openAnchorLocationRegistry.registerHandler(name, this._handleOpenURL.bind(this, port)); else - WebInspector.openAnchorLocationRegistry.unregisterHandler(name); + Components.openAnchorLocationRegistry.unregisterHandler(name); } _handleOpenURL(port, details) { var url = /** @type {string} */ (details.url); - var contentProvider = WebInspector.workspace.uiSourceCodeForURL(url) || WebInspector.resourceForURL(url); + var contentProvider = Workspace.workspace.uiSourceCodeForURL(url) || Bindings.resourceForURL(url); if (!contentProvider) return false; @@ -408,21 +408,21 @@ _onReload(message) { var options = /** @type {!ExtensionReloadOptions} */ (message.options || {}); - WebInspector.multitargetNetworkManager.setUserAgentOverride( + SDK.multitargetNetworkManager.setUserAgentOverride( typeof options.userAgent === 'string' ? options.userAgent : ''); var injectedScript; if (options.injectedScript) injectedScript = '(function(){' + options.injectedScript + '})()'; - WebInspector.targetManager.reloadPage(!!options.ignoreCache, injectedScript); + SDK.targetManager.reloadPage(!!options.ignoreCache, injectedScript); return this._status.OK(); } _onEvaluateOnInspectedPage(message, port) { /** * @param {?Protocol.Error} error - * @param {?WebInspector.RemoteObject} remoteObject + * @param {?SDK.RemoteObject} remoteObject * @param {boolean=} wasThrown - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function callback(error, remoteObject, wasThrown) { var result; @@ -440,58 +440,58 @@ } _onGetHAR() { - var requests = WebInspector.NetworkLog.requests(); - var harLog = (new WebInspector.HARLog(requests)).build(); + var requests = SDK.NetworkLog.requests(); + var harLog = (new SDK.HARLog(requests)).build(); for (var i = 0; i < harLog.entries.length; ++i) harLog.entries[i]._requestId = this._requestId(requests[i]); return harLog; } /** - * @param {!WebInspector.ContentProvider} contentProvider + * @param {!Common.ContentProvider} contentProvider */ _makeResource(contentProvider) { return {url: contentProvider.contentURL(), type: contentProvider.contentType().name()}; } /** - * @return {!Array<!WebInspector.ContentProvider>} + * @return {!Array<!Common.ContentProvider>} */ _onGetPageResources() { - /** @type {!Map<string, !WebInspector.ContentProvider>} */ + /** @type {!Map<string, !Common.ContentProvider>} */ var resources = new Map(); /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function pushResourceData(contentProvider) { if (!resources.has(contentProvider.contentURL())) resources.set(contentProvider.contentURL(), this._makeResource(contentProvider)); } - var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network); + var uiSourceCodes = Workspace.workspace.uiSourceCodesForProjectType(Workspace.projectTypes.Network); uiSourceCodes = uiSourceCodes.concat( - WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.ContentScripts)); + Workspace.workspace.uiSourceCodesForProjectType(Workspace.projectTypes.ContentScripts)); uiSourceCodes.forEach(pushResourceData.bind(this)); - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) - WebInspector.ResourceTreeModel.fromTarget(target).forAllResources(pushResourceData.bind(this)); + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) + SDK.ResourceTreeModel.fromTarget(target).forAllResources(pushResourceData.bind(this)); return resources.valuesArray(); } /** - * @param {!WebInspector.ContentProvider} contentProvider + * @param {!Common.ContentProvider} contentProvider * @param {!Object} message * @param {!MessagePort} port */ _getResourceContent(contentProvider, message, port) { /** * @param {?string} content - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function onContentAvailable(content) { var contentEncoded = false; - if (contentProvider instanceof WebInspector.Resource) + if (contentProvider instanceof SDK.Resource) contentEncoded = contentProvider.contentEncoded; - if (contentProvider instanceof WebInspector.NetworkRequest) + if (contentProvider instanceof SDK.NetworkRequest) contentEncoded = contentProvider.contentEncoded; var response = {encoding: contentEncoded && content ? 'base64' : '', content: content}; this._dispatchCallback(message.requestId, port, response); @@ -509,7 +509,7 @@ _onGetResourceContent(message, port) { var url = /** @type {string} */ (message.url); - var contentProvider = WebInspector.workspace.uiSourceCodeForURL(url) || WebInspector.resourceForURL(url); + var contentProvider = Workspace.workspace.uiSourceCodeForURL(url) || Bindings.resourceForURL(url); if (!contentProvider) return this._status.E_NOTFOUND(url); this._getResourceContent(contentProvider, message, port); @@ -518,7 +518,7 @@ _onSetResourceContent(message, port) { /** * @param {?Protocol.Error} error - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function callbackWrapper(error) { var response = error ? this._status.E_FAILED(error) : this._status.OK(); @@ -526,9 +526,9 @@ } var url = /** @type {string} */ (message.url); - var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); + var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url); if (!uiSourceCode || !uiSourceCode.contentType().isDocumentOrScriptOrStyleSheet()) { - var resource = WebInspector.ResourceTreeModel.resourceForURL(url); + var resource = SDK.ResourceTreeModel.resourceForURL(url); if (!resource) return this._status.E_NOTFOUND(url); return this._status.E_NOTSUPPORTED('Resource is not editable'); @@ -552,11 +552,11 @@ } _onAddAuditCategory(message, port) { - var category = new WebInspector.ExtensionAuditCategory( + var category = new Extensions.ExtensionAuditCategory( port._extensionOrigin, message.id, message.displayName, message.resultCount); this._clientObjects[message.id] = category; this._auditCategories.push(category); - this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.AuditCategoryAdded, category); + this.dispatchEventToListeners(Extensions.ExtensionServer.Events.AuditCategoryAdded, category); } /** @@ -564,28 +564,28 @@ * @param {!MessagePort} port */ _onAddTraceProvider(message, port) { - var provider = new WebInspector.ExtensionTraceProvider( + var provider = new Extensions.ExtensionTraceProvider( port._extensionOrigin, message.id, message.categoryName, message.categoryTooltip); this._clientObjects[message.id] = provider; this._traceProviders.push(provider); } /** - * @return {!Array<!WebInspector.ExtensionTraceProvider>} + * @return {!Array<!Extensions.ExtensionTraceProvider>} */ traceProviders() { return this._traceProviders; } /** - * @return {!Array.<!WebInspector.ExtensionAuditCategory>} + * @return {!Array.<!Extensions.ExtensionAuditCategory>} */ auditCategories() { return this._auditCategories; } _onAddAuditResult(message) { - var auditResult = /** {!WebInspector.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); + var auditResult = /** {!Extensions.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); if (!auditResult) return this._status.E_NOTFOUND(message.resultId); try { @@ -597,14 +597,14 @@ } _onUpdateAuditProgress(message) { - var auditResult = /** {!WebInspector.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); + var auditResult = /** {!Extensions.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); if (!auditResult) return this._status.E_NOTFOUND(message.resultId); auditResult.updateProgress(Math.min(Math.max(0, message.progress), 1)); } _onStopAuditCategoryRun(message) { - var auditRun = /** {!WebInspector.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); + var auditRun = /** {!Extensions.ExtensionAuditCategoryResults} */ (this._clientObjects[message.resultId]); if (!auditRun) return this._status.E_NOTFOUND(message.resultId); auditRun.done(); @@ -654,66 +654,66 @@ _initExtensions() { this._registerAutosubscriptionHandler( - WebInspector.extensionAPI.Events.ResourceAdded, WebInspector.workspace, - WebInspector.Workspace.Events.UISourceCodeAdded, this._notifyResourceAdded); + Extensions.extensionAPI.Events.ResourceAdded, Workspace.workspace, + Workspace.Workspace.Events.UISourceCodeAdded, this._notifyResourceAdded); this._registerAutosubscriptionTargetManagerHandler( - WebInspector.extensionAPI.Events.NetworkRequestFinished, WebInspector.NetworkManager, - WebInspector.NetworkManager.Events.RequestFinished, this._notifyRequestFinished); + Extensions.extensionAPI.Events.NetworkRequestFinished, SDK.NetworkManager, + SDK.NetworkManager.Events.RequestFinished, this._notifyRequestFinished); /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function onElementsSubscriptionStarted() { - WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._notifyElementsSelectionChanged, this); + UI.context.addFlavorChangeListener(SDK.DOMNode, this._notifyElementsSelectionChanged, this); } /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function onElementsSubscriptionStopped() { - WebInspector.context.removeFlavorChangeListener(WebInspector.DOMNode, this._notifyElementsSelectionChanged, this); + UI.context.removeFlavorChangeListener(SDK.DOMNode, this._notifyElementsSelectionChanged, this); } this._registerSubscriptionHandler( - WebInspector.extensionAPI.Events.PanelObjectSelected + 'elements', onElementsSubscriptionStarted.bind(this), + Extensions.extensionAPI.Events.PanelObjectSelected + 'elements', onElementsSubscriptionStarted.bind(this), onElementsSubscriptionStopped.bind(this)); this._registerResourceContentCommittedHandler(this._notifyUISourceCodeContentCommitted); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); InspectorExtensionRegistry.getExtensionsAsync(); } _notifyResourceAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); - this._postNotification(WebInspector.extensionAPI.Events.ResourceAdded, this._makeResource(uiSourceCode)); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); + this._postNotification(Extensions.extensionAPI.Events.ResourceAdded, this._makeResource(uiSourceCode)); } _notifyUISourceCodeContentCommitted(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode); var content = /** @type {string} */ (event.data.content); this._postNotification( - WebInspector.extensionAPI.Events.ResourceContentCommitted, this._makeResource(uiSourceCode), content); + Extensions.extensionAPI.Events.ResourceContentCommitted, this._makeResource(uiSourceCode), content); } _notifyRequestFinished(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._postNotification( - WebInspector.extensionAPI.Events.NetworkRequestFinished, this._requestId(request), - (new WebInspector.HAREntry(request)).build()); + Extensions.extensionAPI.Events.NetworkRequestFinished, this._requestId(request), + (new SDK.HAREntry(request)).build()); } _notifyElementsSelectionChanged() { - this._postNotification(WebInspector.extensionAPI.Events.PanelObjectSelected + 'elements'); + this._postNotification(Extensions.extensionAPI.Events.PanelObjectSelected + 'elements'); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _addExtensions(event) { - if (WebInspector.extensionServer._overridePlatformExtensionAPIForTest) - window.buildPlatformExtensionAPI = WebInspector.extensionServer._overridePlatformExtensionAPIForTest; + if (Extensions.extensionServer._overridePlatformExtensionAPIForTest) + window.buildPlatformExtensionAPI = Extensions.extensionServer._overridePlatformExtensionAPIForTest; var extensionInfos = /** @type {!Array.<!ExtensionDescriptor>} */ (event.data); if (this._initializeCommandIssued) @@ -723,7 +723,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _setInspectedTabId(event) { this._inspectedTabId = /** @type {string} */ (event.data); @@ -748,8 +748,8 @@ if (!this._registeredExtensions[extensionOrigin]) { // See ExtensionAPI.js for details. var injectedAPI = buildExtensionAPIInjectedScript( - extensionInfo, this._inspectedTabId, WebInspector.themeSupport.themeName(), - WebInspector.extensionServer['_extensionAPITestHook']); + extensionInfo, this._inspectedTabId, UI.themeSupport.themeName(), + Extensions.extensionServer['_extensionAPITestHook']); InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin, injectedAPI); this._registeredExtensions[extensionOrigin] = {name: name}; } @@ -807,7 +807,7 @@ * @param {string} eventTopic * @param {!Object} eventTarget * @param {string} frontendEventType - * @param {function(!WebInspector.Event)} handler + * @param {function(!Common.Event)} handler */ _registerAutosubscriptionHandler(eventTopic, eventTarget, frontendEventType, handler) { this._registerSubscriptionHandler( @@ -819,36 +819,36 @@ * @param {string} eventTopic * @param {!Function} modelClass * @param {string} frontendEventType - * @param {function(!WebInspector.Event)} handler + * @param {function(!Common.Event)} handler */ _registerAutosubscriptionTargetManagerHandler(eventTopic, modelClass, frontendEventType, handler) { this._registerSubscriptionHandler( - eventTopic, WebInspector.targetManager.addModelListener.bind( - WebInspector.targetManager, modelClass, frontendEventType, handler, this), - WebInspector.targetManager.removeModelListener.bind( - WebInspector.targetManager, modelClass, frontendEventType, handler, this)); + eventTopic, SDK.targetManager.addModelListener.bind( + SDK.targetManager, modelClass, frontendEventType, handler, this), + SDK.targetManager.removeModelListener.bind( + SDK.targetManager, modelClass, frontendEventType, handler, this)); } _registerResourceContentCommittedHandler(handler) { /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function addFirstEventListener() { - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommittedByUser, handler, this); - WebInspector.workspace.setHasResourceContentTrackingExtensions(true); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.WorkingCopyCommittedByUser, handler, this); + Workspace.workspace.setHasResourceContentTrackingExtensions(true); } /** - * @this {WebInspector.ExtensionServer} + * @this {Extensions.ExtensionServer} */ function removeLastEventListener() { - WebInspector.workspace.setHasResourceContentTrackingExtensions(false); - WebInspector.workspace.removeEventListener( - WebInspector.Workspace.Events.WorkingCopyCommittedByUser, handler, this); + Workspace.workspace.setHasResourceContentTrackingExtensions(false); + Workspace.workspace.removeEventListener( + Workspace.Workspace.Events.WorkingCopyCommittedByUser, handler, this); } this._registerSubscriptionHandler( - WebInspector.extensionAPI.Events.ResourceContentCommitted, addFirstEventListener.bind(this), + Extensions.extensionAPI.Events.ResourceContentCommitted, addFirstEventListener.bind(this), removeLastEventListener.bind(this)); } @@ -882,8 +882,8 @@ * @param {boolean} returnByValue * @param {?Object} options * @param {string} securityOrigin - * @param {function(?string, ?WebInspector.RemoteObject, boolean=)} callback - * @return {!WebInspector.ExtensionStatus.Record|undefined} + * @param {function(?string, ?SDK.RemoteObject, boolean=)} callback + * @return {!Extensions.ExtensionStatus.Record|undefined} */ evaluate(expression, exposeCommandLineAPI, returnByValue, options, securityOrigin, callback) { var contextId; @@ -898,7 +898,7 @@ found = (frame.url === url) ? frame : null; return found; } - WebInspector.ResourceTreeModel.frames().some(hasMatchingURL); + SDK.ResourceTreeModel.frames().some(hasMatchingURL); return found; } @@ -907,8 +907,8 @@ if (options.frameURL) { frame = resolveURLToFrame(options.frameURL); } else { - var target = WebInspector.targetManager.mainTarget(); - var resourceTreeModel = target && WebInspector.ResourceTreeModel.fromTarget(target); + var target = SDK.targetManager.mainTarget(); + var resourceTreeModel = target && SDK.ResourceTreeModel.fromTarget(target); frame = resourceTreeModel && resourceTreeModel.mainFrame; } if (!frame) { @@ -950,7 +950,7 @@ contextId = context.id; } - var target = target ? target : WebInspector.targetManager.mainTarget(); + var target = target ? target : SDK.targetManager.mainTarget(); if (!target) return; @@ -973,7 +973,7 @@ }; /** @enum {symbol} */ -WebInspector.ExtensionServer.Events = { +Extensions.ExtensionServer.Events = { SidebarPaneAdded: Symbol('SidebarPaneAdded'), AuditCategoryAdded: Symbol('AuditCategoryAdded') }; @@ -981,11 +981,11 @@ /** * @unrestricted */ -WebInspector.ExtensionServerPanelView = class extends WebInspector.SimpleView { +Extensions.ExtensionServerPanelView = class extends UI.SimpleView { /** * @param {string} name * @param {string} title - * @param {!WebInspector.Panel} panel + * @param {!UI.Panel} panel */ constructor(name, title, panel) { super(title); @@ -1003,22 +1003,22 @@ /** * @override - * @return {!Promise.<!WebInspector.Widget>} + * @return {!Promise.<!UI.Widget>} */ widget() { - return /** @type {!Promise.<!WebInspector.Widget>} */ (Promise.resolve(this._panel)); + return /** @type {!Promise.<!UI.Widget>} */ (Promise.resolve(this._panel)); } }; /** * @unrestricted */ -WebInspector.ExtensionStatus = class { +Extensions.ExtensionStatus = class { constructor() { /** * @param {string} code * @param {string} description - * @return {!WebInspector.ExtensionStatus.Record} + * @return {!Extensions.ExtensionStatus.Record} */ function makeStatus(code, description) { var details = Array.prototype.slice.call(arguments, 2); @@ -1044,10 +1044,10 @@ /** * @typedef {{code: string, description: string, details: !Array.<*>}} */ -WebInspector.ExtensionStatus.Record; +Extensions.ExtensionStatus.Record; -WebInspector.extensionAPI = {}; -defineCommonExtensionSymbols(WebInspector.extensionAPI); +Extensions.extensionAPI = {}; +defineCommonExtensionSymbols(Extensions.extensionAPI); -/** @type {!WebInspector.ExtensionServer} */ -WebInspector.extensionServer; +/** @type {!Extensions.ExtensionServer} */ +Extensions.extensionServer;
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js index f0754ad..b480c15 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js
@@ -1,7 +1,7 @@ /** * @unrestricted */ -WebInspector.ExtensionTraceProvider = class { +Extensions.ExtensionTraceProvider = class { /** * @param {string} extensionOrigin * @param {string} id @@ -15,10 +15,10 @@ this._categoryTooltip = categoryTooltip; } start() { - WebInspector.extensionServer.startTraceRecording(this._id); + Extensions.extensionServer.startTraceRecording(this._id); } stop() { - WebInspector.extensionServer.stopTraceRecording(this._id); + Extensions.extensionServer.stopTraceRecording(this._id); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionView.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionView.js index b784964..79e38ed 100644 --- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionView.js +++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.ExtensionView = class extends WebInspector.Widget { +Extensions.ExtensionView = class extends UI.Widget { /** - * @param {!WebInspector.ExtensionServer} server + * @param {!Extensions.ExtensionServer} server * @param {string} id * @param {string} src * @param {string} className @@ -81,9 +81,9 @@ /** * @unrestricted */ -WebInspector.ExtensionNotifierView = class extends WebInspector.VBox { +Extensions.ExtensionNotifierView = class extends UI.VBox { /** - * @param {!WebInspector.ExtensionServer} server + * @param {!Extensions.ExtensionServer} server * @param {string} id */ constructor(server, id) {
diff --git a/third_party/WebKit/Source/devtools/front_end/externs.js b/third_party/WebKit/Source/devtools/front_end/externs.js index d85ca05..fb308e4 100644 --- a/third_party/WebKit/Source/devtools/front_end/externs.js +++ b/third_party/WebKit/Source/devtools/front_end/externs.js
@@ -272,8 +272,6 @@ */ DevToolsHost.upgradeDraggedFileSystemPermissions = function(fileSystem) {}; -var WebInspector = function() {}; - /** Extensions API */ /** @constructor */ @@ -805,3 +803,50 @@ /** @param {string} eventName * @param {!Function} handler */ on: function(eventName, handler) {} }; + +// Module namespaces. +var Accessibility = {}; +var Animation = {}; +var Audits = {}; +var Audits2 = {}; +var Audits2Worker = {}; +var Bindings = {}; +var CmModes = {}; +var Common = {}; +var Components = {}; +var Console = {}; +var Devices = {}; +var Diff = {}; +var Elements = {}; +var Emulation = {}; +var Extensions = {}; +var FormatterWorker = {}; +var Gonzales = {}; +var HeapSnapshotWorker = {}; +var Host = {}; +var LayerViewer = {}; +var Layers = {}; +var Main = {}; +var Network = {}; +var Persistence = {}; +var Platform = {}; +var Profiler = {}; +var Resources = {}; +var Sass = {}; +var Screencast = {}; +var SDK = {}; +var Security = {}; +var Services = {}; +var Settings = {}; +var Snippets = {}; +var SourceFrame = {}; +var Sources = {}; +var Terminal = {}; +var TextEditor = {}; +var Timeline = {}; +var TimelineModel = {}; +var ToolboxBootstrap = {}; +var UI = {}; +var UtilitySharedWorker = {}; +var WorkerService = {}; +var Workspace = {};
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/AcornTokenizer.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/AcornTokenizer.js index 968d3cf..ae39313 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/AcornTokenizer.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/AcornTokenizer.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.AcornTokenizer = class { +FormatterWorker.AcornTokenizer = class { /** * @param {string} content */
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js index 35eac08..fcb40eb 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.CSSFormatter = class { +FormatterWorker.CSSFormatter = class { /** - * @param {!WebInspector.FormattedContentBuilder} builder + * @param {!FormatterWorker.FormattedContentBuilder} builder */ constructor(builder) { this._builder = builder; @@ -51,7 +51,7 @@ this._toOffset = toOffset; this._lastLine = -1; this._state = {}; - var tokenize = WebInspector.createTokenizer('text/css'); + var tokenize = FormatterWorker.createTokenizer('text/css'); var oldEnforce = this._builder.setEnforceSpaceBetweenWords(false); tokenize(text.substring(this._fromOffset, this._toOffset), this._tokenCallback.bind(this)); this._builder.setEnforceSpaceBetweenWords(oldEnforce);
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSRuleParser.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSRuleParser.js index 58c15aa..6e0a9ae 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSRuleParser.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSRuleParser.js
@@ -1,7 +1,7 @@ // Copyright 2016 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. -WebInspector.CSSParserStates = { +FormatterWorker.CSSParserStates = { Initial: 'Initial', Selector: 'Selector', Style: 'Style', @@ -13,21 +13,21 @@ /** * @param {string} text */ -WebInspector.parseCSS = function(text) { - WebInspector._innerParseCSS(text, postMessage); +FormatterWorker.parseCSS = function(text) { + FormatterWorker._innerParseCSS(text, postMessage); }; /** * @param {string} text * @param {function(*)} chunkCallback */ -WebInspector._innerParseCSS = function(text, chunkCallback) { +FormatterWorker._innerParseCSS = function(text, chunkCallback) { var chunkSize = 100000; // characters per data chunk var lines = text.split('\n'); var rules = []; var processedChunkCharacters = 0; - var state = WebInspector.CSSParserStates.Initial; + var state = FormatterWorker.CSSParserStates.Initial; var rule; var property; var UndefTokenType = new Set(); @@ -46,7 +46,7 @@ function processToken(tokenValue, tokenTypes, column, newColumn) { var tokenType = tokenTypes ? new Set(tokenTypes.split(' ')) : UndefTokenType; switch (state) { - case WebInspector.CSSParserStates.Initial: + case FormatterWorker.CSSParserStates.Initial: if (tokenType.has('qualifier') || tokenType.has('builtin') || tokenType.has('tag')) { rule = { selectorText: tokenValue, @@ -54,35 +54,35 @@ columnNumber: column, properties: [], }; - state = WebInspector.CSSParserStates.Selector; + state = FormatterWorker.CSSParserStates.Selector; } else if (tokenType.has('def')) { rule = { atRule: tokenValue, lineNumber: lineNumber, columnNumber: column, }; - state = WebInspector.CSSParserStates.AtRule; + state = FormatterWorker.CSSParserStates.AtRule; } break; - case WebInspector.CSSParserStates.Selector: + case FormatterWorker.CSSParserStates.Selector: if (tokenValue === '{' && tokenType === UndefTokenType) { rule.selectorText = rule.selectorText.trim(); rule.styleRange = createRange(lineNumber, newColumn); - state = WebInspector.CSSParserStates.Style; + state = FormatterWorker.CSSParserStates.Style; } else { rule.selectorText += tokenValue; } break; - case WebInspector.CSSParserStates.AtRule: + case FormatterWorker.CSSParserStates.AtRule: if ((tokenValue === ';' || tokenValue === '{') && tokenType === UndefTokenType) { rule.atRule = rule.atRule.trim(); rules.push(rule); - state = WebInspector.CSSParserStates.Initial; + state = FormatterWorker.CSSParserStates.Initial; } else { rule.atRule += tokenValue; } break; - case WebInspector.CSSParserStates.Style: + case FormatterWorker.CSSParserStates.Style: if (tokenType.has('meta') || tokenType.has('property')) { property = { name: tokenValue, @@ -90,12 +90,12 @@ range: createRange(lineNumber, column), nameRange: createRange(lineNumber, column) }; - state = WebInspector.CSSParserStates.PropertyName; + state = FormatterWorker.CSSParserStates.PropertyName; } else if (tokenValue === '}' && tokenType === UndefTokenType) { rule.styleRange.endLine = lineNumber; rule.styleRange.endColumn = column; rules.push(rule); - state = WebInspector.CSSParserStates.Initial; + state = FormatterWorker.CSSParserStates.Initial; } else if (tokenType.has('comment')) { // The |processToken| is called per-line, so no token spans more than one line. // Support only a one-line comments. @@ -104,7 +104,7 @@ var uncommentedText = tokenValue.substring(2, tokenValue.length - 2); var fakeRule = 'a{\n' + uncommentedText + '}'; disabledRules = []; - WebInspector._innerParseCSS(fakeRule, disabledRulesCallback); + FormatterWorker._innerParseCSS(fakeRule, disabledRulesCallback); if (disabledRules.length === 1 && disabledRules[0].properties.length === 1) { var disabledProperty = disabledRules[0].properties[0]; disabledProperty.disabled = true; @@ -124,18 +124,18 @@ } } break; - case WebInspector.CSSParserStates.PropertyName: + case FormatterWorker.CSSParserStates.PropertyName: if (tokenValue === ':' && tokenType === UndefTokenType) { property.name = property.name; property.nameRange.endLine = lineNumber; property.nameRange.endColumn = column; property.valueRange = createRange(lineNumber, newColumn); - state = WebInspector.CSSParserStates.PropertyValue; + state = FormatterWorker.CSSParserStates.PropertyValue; } else if (tokenType.has('property')) { property.name += tokenValue; } break; - case WebInspector.CSSParserStates.PropertyValue: + case FormatterWorker.CSSParserStates.PropertyValue: if ((tokenValue === ';' || tokenValue === '}') && tokenType === UndefTokenType) { property.value = property.value; property.valueRange.endLine = lineNumber; @@ -147,9 +147,9 @@ rule.styleRange.endLine = lineNumber; rule.styleRange.endColumn = column; rules.push(rule); - state = WebInspector.CSSParserStates.Initial; + state = FormatterWorker.CSSParserStates.Initial; } else { - state = WebInspector.CSSParserStates.Style; + state = FormatterWorker.CSSParserStates.Style; } } else if (!tokenType.has('comment')) { property.value += tokenValue; @@ -165,7 +165,7 @@ processedChunkCharacters = 0; } } - var tokenizer = WebInspector.createTokenizer('text/css'); + var tokenizer = FormatterWorker.createTokenizer('text/css'); var lineNumber; for (lineNumber = 0; lineNumber < lines.length; ++lineNumber) { var line = lines[lineNumber];
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/ESTreeWalker.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/ESTreeWalker.js index 84aea297a..1f9398b 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/ESTreeWalker.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/ESTreeWalker.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ESTreeWalker = class { +FormatterWorker.ESTreeWalker = class { /** * @param {function(!ESTree.Node):(!Object|undefined)} beforeVisit * @param {function(!ESTree.Node)=} afterVisit @@ -44,12 +44,12 @@ return; node.parent = parent; - if (this._beforeVisit.call(null, node) === WebInspector.ESTreeWalker.SkipSubtree) { + if (this._beforeVisit.call(null, node) === FormatterWorker.ESTreeWalker.SkipSubtree) { this._afterVisit.call(null, node); return; } - var walkOrder = WebInspector.ESTreeWalker._walkOrder[node.type]; + var walkOrder = FormatterWorker.ESTreeWalker._walkOrder[node.type]; if (!walkOrder) { console.error('Walk order not defined for ' + node.type); return; @@ -86,11 +86,11 @@ } }; -/** @typedef {!Object} WebInspector.ESTreeWalker.SkipSubtree */ -WebInspector.ESTreeWalker.SkipSubtree = {}; +/** @typedef {!Object} FormatterWorker.ESTreeWalker.SkipSubtree */ +FormatterWorker.ESTreeWalker.SkipSubtree = {}; /** @enum {!Array.<string>} */ -WebInspector.ESTreeWalker._walkOrder = { +FormatterWorker.ESTreeWalker._walkOrder = { 'ArrayExpression': ['elements'], 'ArrowFunctionExpression': ['params', 'body'], 'AssignmentExpression': ['left', 'right'],
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js index 1a838d10..0816616 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.FormattedContentBuilder = class { +FormatterWorker.FormattedContentBuilder = class { /** * @param {string} indentString */
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js index 4cdf13a..c3f4c1e 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js
@@ -31,7 +31,7 @@ * @param {string} mimeType * @return {function(string, function(string, ?string, number, number):(!Object|undefined))} */ -WebInspector.createTokenizer = function(mimeType) { +FormatterWorker.createTokenizer = function(mimeType) { var mode = CodeMirror.getMode({indentUnit: 2}, mimeType); var state = CodeMirror.startState(mode); /** @@ -43,7 +43,7 @@ while (!stream.eol()) { var style = mode.token(stream, state); var value = stream.current(); - if (callback(value, style, stream.start, stream.start + value.length) === WebInspector.AbortTokenization) + if (callback(value, style, stream.start, stream.start + value.length) === FormatterWorker.AbortTokenization) return; stream.start = stream.pos; } @@ -51,7 +51,7 @@ return tokenize; }; -WebInspector.AbortTokenization = {}; +FormatterWorker.AbortTokenization = {}; self.onmessage = function(event) { var method = /** @type {string} */ (event.data.method); @@ -61,25 +61,25 @@ switch (method) { case 'format': - WebInspector.format(params.mimeType, params.content, params.indentString); + FormatterWorker.format(params.mimeType, params.content, params.indentString); break; case 'parseCSS': - WebInspector.parseCSS(params.content); + FormatterWorker.parseCSS(params.content); break; case 'parseSCSS': - WebInspector.FormatterWorkerContentParser.parse(params.content, 'text/x-scss'); + FormatterWorker.FormatterWorkerContentParser.parse(params.content, 'text/x-scss'); break; case 'javaScriptOutline': - WebInspector.javaScriptOutline(params.content); + FormatterWorker.javaScriptOutline(params.content); break; case 'javaScriptIdentifiers': - WebInspector.javaScriptIdentifiers(params.content); + FormatterWorker.javaScriptIdentifiers(params.content); break; case 'evaluatableJavaScriptSubstring': - WebInspector.evaluatableJavaScriptSubstring(params.content); + FormatterWorker.evaluatableJavaScriptSubstring(params.content); break; case 'relaxedJSONParser': - WebInspector.relaxedJSONParser(params.content); + FormatterWorker.relaxedJSONParser(params.content); break; default: console.error('Unsupport method name: ' + method); @@ -89,38 +89,38 @@ /** * @param {string} content */ -WebInspector.relaxedJSONParser = function(content) { - postMessage(WebInspector.RelaxedJSONParser.parse(content)); +FormatterWorker.relaxedJSONParser = function(content) { + postMessage(FormatterWorker.RelaxedJSONParser.parse(content)); }; /** * @param {string} content */ -WebInspector.evaluatableJavaScriptSubstring = function(content) { +FormatterWorker.evaluatableJavaScriptSubstring = function(content) { var tokenizer = acorn.tokenizer(content, {ecmaVersion: 6}); var result = ''; try { var token = tokenizer.getToken(); - while (token.type !== acorn.tokTypes.eof && WebInspector.AcornTokenizer.punctuator(token)) + while (token.type !== acorn.tokTypes.eof && FormatterWorker.AcornTokenizer.punctuator(token)) token = tokenizer.getToken(); var startIndex = token.start; var endIndex = token.end; var openBracketsCounter = 0; while (token.type !== acorn.tokTypes.eof) { - var isIdentifier = WebInspector.AcornTokenizer.identifier(token); - var isThis = WebInspector.AcornTokenizer.keyword(token, 'this'); + var isIdentifier = FormatterWorker.AcornTokenizer.identifier(token); + var isThis = FormatterWorker.AcornTokenizer.keyword(token, 'this'); var isString = token.type === acorn.tokTypes.string; if (!isThis && !isIdentifier && !isString) break; endIndex = token.end; token = tokenizer.getToken(); - while (WebInspector.AcornTokenizer.punctuator(token, '.[]')) { - if (WebInspector.AcornTokenizer.punctuator(token, '[')) + while (FormatterWorker.AcornTokenizer.punctuator(token, '.[]')) { + if (FormatterWorker.AcornTokenizer.punctuator(token, '[')) openBracketsCounter++; - if (WebInspector.AcornTokenizer.punctuator(token, ']')) { + if (FormatterWorker.AcornTokenizer.punctuator(token, ']')) { endIndex = openBracketsCounter > 0 ? token.end : endIndex; openBracketsCounter--; } @@ -138,12 +138,12 @@ /** * @param {string} content */ -WebInspector.javaScriptIdentifiers = function(content) { +FormatterWorker.javaScriptIdentifiers = function(content) { var root = acorn.parse(content, {ranges: false, ecmaVersion: 6}); /** @type {!Array<!ESTree.Node>} */ var identifiers = []; - var walker = new WebInspector.ESTreeWalker(beforeVisit); + var walker = new FormatterWorker.ESTreeWalker(beforeVisit); /** * @param {!ESTree.Node} node @@ -161,7 +161,7 @@ if (isFunction(node)) { if (node.id) identifiers.push(node.id); - return WebInspector.ESTreeWalker.SkipSubtree; + return FormatterWorker.ESTreeWalker.SkipSubtree; } if (node.type !== 'Identifier') @@ -191,28 +191,28 @@ * @param {string} text * @param {string=} indentString */ -WebInspector.format = function(mimeType, text, indentString) { +FormatterWorker.format = function(mimeType, text, indentString) { // Default to a 4-space indent. indentString = indentString || ' '; var result = {}; - var builder = new WebInspector.FormattedContentBuilder(indentString); + var builder = new FormatterWorker.FormattedContentBuilder(indentString); var lineEndings = text.computeLineEndings(); try { switch (mimeType) { case 'text/html': - var formatter = new WebInspector.HTMLFormatter(builder); + var formatter = new FormatterWorker.HTMLFormatter(builder); formatter.format(text, lineEndings); break; case 'text/css': - var formatter = new WebInspector.CSSFormatter(builder); + var formatter = new FormatterWorker.CSSFormatter(builder); formatter.format(text, lineEndings, 0, text.length); break; case 'text/javascript': - var formatter = new WebInspector.JavaScriptFormatter(builder); + var formatter = new FormatterWorker.JavaScriptFormatter(builder); formatter.format(text, lineEndings, 0, text.length); break; default: - var formatter = new WebInspector.IdentityFormatter(builder); + var formatter = new FormatterWorker.IdentityFormatter(builder); formatter.format(text, lineEndings, 0, text.length); } result.mapping = builder.mapping(); @@ -228,9 +228,9 @@ /** * @interface */ -WebInspector.FormatterWorkerContentParser = function() {}; +FormatterWorker.FormatterWorkerContentParser = function() {}; -WebInspector.FormatterWorkerContentParser.prototype = { +FormatterWorker.FormatterWorkerContentParser.prototype = { /** * @param {string} content * @return {!Object} @@ -242,8 +242,8 @@ * @param {string} content * @param {string} mimeType */ -WebInspector.FormatterWorkerContentParser.parse = function(content, mimeType) { - var extension = self.runtime.extensions(WebInspector.FormatterWorkerContentParser).find(findExtension); +FormatterWorker.FormatterWorkerContentParser.parse = function(content, mimeType) { + var extension = self.runtime.extensions(FormatterWorker.FormatterWorkerContentParser).find(findExtension); console.assert(extension); extension.instance().then(instance => instance.parse(content)).catchException(null).then(postMessage);
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js index 23590a8..8a34442c 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/HTMLFormatter.js
@@ -4,14 +4,14 @@ /** * @unrestricted */ -WebInspector.HTMLFormatter = class { +FormatterWorker.HTMLFormatter = class { /** - * @param {!WebInspector.FormattedContentBuilder} builder + * @param {!FormatterWorker.FormattedContentBuilder} builder */ constructor(builder) { this._builder = builder; - this._jsFormatter = new WebInspector.JavaScriptFormatter(builder); - this._cssFormatter = new WebInspector.CSSFormatter(builder); + this._jsFormatter = new FormatterWorker.JavaScriptFormatter(builder); + this._cssFormatter = new FormatterWorker.CSSFormatter(builder); } /** @@ -21,12 +21,12 @@ format(text, lineEndings) { this._text = text; this._lineEndings = lineEndings; - this._model = new WebInspector.HTMLModel(text); + this._model = new FormatterWorker.HTMLModel(text); this._walk(this._model.document()); } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element * @param {number} offset */ _formatTokensTill(element, offset) { @@ -37,7 +37,7 @@ } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element */ _walk(element) { if (element.parent) @@ -55,7 +55,7 @@ } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element */ _beforeOpenTag(element) { if (!element.children.length || element === this._model.document()) @@ -64,7 +64,7 @@ } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element */ _afterOpenTag(element) { if (!element.children.length || element === this._model.document()) @@ -74,7 +74,7 @@ } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element */ _beforeCloseTag(element) { if (!element.children.length || element === this._model.document()) @@ -84,15 +84,15 @@ } /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element */ _afterCloseTag(element) { this._builder.addNewLine(); } /** - * @param {!WebInspector.HTMLModel.Element} element - * @param {!WebInspector.HTMLModel.Token} token + * @param {!FormatterWorker.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Token} token */ _formatToken(element, token) { if (token.value.isWhitespace()) @@ -118,7 +118,7 @@ this._builder.increaseNestingLevel(); var mimeType = element.openTag.attributes.has('type') ? element.openTag.attributes.get('type').toLowerCase() : null; - if (!mimeType || WebInspector.HTMLFormatter.SupportedJavaScriptMimeTypes.has(mimeType)) { + if (!mimeType || FormatterWorker.HTMLFormatter.SupportedJavaScriptMimeTypes.has(mimeType)) { this._jsFormatter.format(this._text, this._lineEndings, token.startOffset, token.endOffset); } else { this._builder.addToken(token.value, token.startOffset); @@ -135,22 +135,22 @@ } }; -WebInspector.HTMLFormatter.SupportedJavaScriptMimeTypes = +FormatterWorker.HTMLFormatter.SupportedJavaScriptMimeTypes = new Set(['text/javascript', 'text/ecmascript', 'application/javascript', 'application/ecmascript']); /** * @unrestricted */ -WebInspector.HTMLModel = class { +FormatterWorker.HTMLModel = class { /** * @param {string} text */ constructor(text) { - this._state = WebInspector.HTMLModel.ParseState.Initial; - this._document = new WebInspector.HTMLModel.Element('document'); - this._document.openTag = new WebInspector.HTMLModel.Tag('document', 0, 0, new Map(), true, false); + this._state = FormatterWorker.HTMLModel.ParseState.Initial; + this._document = new FormatterWorker.HTMLModel.Element('document'); + this._document.openTag = new FormatterWorker.HTMLModel.Tag('document', 0, 0, new Map(), true, false); this._document.closeTag = - new WebInspector.HTMLModel.Tag('document', text.length, text.length, new Map(), false, false); + new FormatterWorker.HTMLModel.Tag('document', text.length, text.length, new Map(), false, false); this._stack = [this._document]; @@ -163,7 +163,7 @@ * @param {string} text */ _build(text) { - var tokenizer = WebInspector.createTokenizer('text/html'); + var tokenizer = FormatterWorker.createTokenizer('text/html'); var lastOffset = 0; var lowerCaseText = text.toLowerCase(); @@ -178,12 +178,12 @@ var tokenStart = element.openTag.endOffset; var tokenEnd = lastOffset; var tokenValue = text.substring(tokenStart, tokenEnd); - this._tokens.push(new WebInspector.HTMLModel.Token(tokenValue, new Set(), tokenStart, tokenEnd)); + this._tokens.push(new FormatterWorker.HTMLModel.Token(tokenValue, new Set(), tokenStart, tokenEnd)); } while (this._stack.length > 1) { var element = this._stack.peekLast(); - this._popElement(new WebInspector.HTMLModel.Tag(element.name, text.length, text.length, new Map(), false, false)); + this._popElement(new FormatterWorker.HTMLModel.Tag(element.name, text.length, text.length, new Map(), false, false)); } /** @@ -193,7 +193,7 @@ * @param {number} tokenStart * @param {number} tokenEnd * @return {(!Object|undefined)} - * @this {WebInspector.HTMLModel} + * @this {FormatterWorker.HTMLModel} */ function processToken(baseOffset, tokenValue, type, tokenStart, tokenEnd) { tokenStart += baseOffset; @@ -201,22 +201,22 @@ lastOffset = tokenEnd; var tokenType = type ? new Set(type.split(' ')) : new Set(); - var token = new WebInspector.HTMLModel.Token(tokenValue, tokenType, tokenStart, tokenEnd); + var token = new FormatterWorker.HTMLModel.Token(tokenValue, tokenType, tokenStart, tokenEnd); this._tokens.push(token); this._updateDOM(token); var element = this._stack.peekLast(); if (element && (element.name === 'script' || element.name === 'style') && element.openTag.endOffset === lastOffset) - return WebInspector.AbortTokenization; + return FormatterWorker.AbortTokenization; } } /** - * @param {!WebInspector.HTMLModel.Token} token + * @param {!FormatterWorker.HTMLModel.Token} token */ _updateDOM(token) { - var S = WebInspector.HTMLModel.ParseState; + var S = FormatterWorker.HTMLModel.ParseState; var value = token.value; var type = token.type; switch (this._state) { @@ -259,7 +259,7 @@ } /** - * @param {!WebInspector.HTMLModel.Token} token + * @param {!FormatterWorker.HTMLModel.Token} token */ _onStartTag(token) { this._tagName = ''; @@ -271,18 +271,18 @@ } /** - * @param {!WebInspector.HTMLModel.Token} token + * @param {!FormatterWorker.HTMLModel.Token} token */ _onEndTag(token) { this._tagEndOffset = token.endOffset; - var selfClosingTag = token.value === '/>' || WebInspector.HTMLModel.SelfClosingTags.has(this._tagName); - var tag = new WebInspector.HTMLModel.Tag( + var selfClosingTag = token.value === '/>' || FormatterWorker.HTMLModel.SelfClosingTags.has(this._tagName); + var tag = new FormatterWorker.HTMLModel.Tag( this._tagName, this._tagStartOffset, this._tagEndOffset, this._attributes, this._isOpenTag, selfClosingTag); this._onTagComplete(tag); } /** - * @param {!WebInspector.HTMLModel.Tag} tag + * @param {!FormatterWorker.HTMLModel.Tag} tag */ _onTagComplete(tag) { if (tag.isOpenTag) { @@ -290,8 +290,8 @@ if (topElement !== this._document && topElement.openTag.selfClosingTag) this._popElement(autocloseTag(topElement, topElement.openTag.endOffset)); else if ( - (topElement.name in WebInspector.HTMLModel.AutoClosingTags) && - WebInspector.HTMLModel.AutoClosingTags[topElement.name].has(tag.name)) + (topElement.name in FormatterWorker.HTMLModel.AutoClosingTags) && + FormatterWorker.HTMLModel.AutoClosingTags[topElement.name].has(tag.name)) this._popElement(autocloseTag(topElement, tag.startOffset)); this._pushElement(tag); return; @@ -304,17 +304,17 @@ this._popElement(tag); /** - * @param {!WebInspector.HTMLModel.Element} element + * @param {!FormatterWorker.HTMLModel.Element} element * @param {number} offset - * @return {!WebInspector.HTMLModel.Tag} + * @return {!FormatterWorker.HTMLModel.Tag} */ function autocloseTag(element, offset) { - return new WebInspector.HTMLModel.Tag(element.name, offset, offset, new Map(), false, false); + return new FormatterWorker.HTMLModel.Tag(element.name, offset, offset, new Map(), false, false); } } /** - * @param {!WebInspector.HTMLModel.Tag} closeTag + * @param {!FormatterWorker.HTMLModel.Tag} closeTag */ _popElement(closeTag) { var element = this._stack.pop(); @@ -322,11 +322,11 @@ } /** - * @param {!WebInspector.HTMLModel.Tag} openTag + * @param {!FormatterWorker.HTMLModel.Tag} openTag */ _pushElement(openTag) { var topElement = this._stack.peekLast(); - var newElement = new WebInspector.HTMLModel.Element(openTag.name); + var newElement = new FormatterWorker.HTMLModel.Element(openTag.name); newElement.parent = topElement; topElement.children.push(newElement); newElement.openTag = openTag; @@ -334,34 +334,34 @@ } /** - * @return {?WebInspector.HTMLModel.Token} + * @return {?FormatterWorker.HTMLModel.Token} */ peekToken() { return this._tokenIndex < this._tokens.length ? this._tokens[this._tokenIndex] : null; } /** - * @return {?WebInspector.HTMLModel.Token} + * @return {?FormatterWorker.HTMLModel.Token} */ nextToken() { return this._tokens[this._tokenIndex++]; } /** - * @return {!WebInspector.HTMLModel.Element} + * @return {!FormatterWorker.HTMLModel.Element} */ document() { return this._document; } }; -WebInspector.HTMLModel.SelfClosingTags = new Set([ +FormatterWorker.HTMLModel.SelfClosingTags = new Set([ 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr' ]); // @see https://www.w3.org/TR/html/syntax.html 8.1.2.4 Optional tags -WebInspector.HTMLModel.AutoClosingTags = { +FormatterWorker.HTMLModel.AutoClosingTags = { 'head': new Set(['body']), 'li': new Set(['li']), 'dt': new Set(['dt', 'dd']), @@ -387,7 +387,7 @@ }; /** @enum {string} */ -WebInspector.HTMLModel.ParseState = { +FormatterWorker.HTMLModel.ParseState = { Initial: 'Initial', Tag: 'Tag', AttributeName: 'AttributeName', @@ -397,7 +397,7 @@ /** * @unrestricted */ -WebInspector.HTMLModel.Token = class { +FormatterWorker.HTMLModel.Token = class { /** * @param {string} value * @param {!Set<string>} type @@ -415,7 +415,7 @@ /** * @unrestricted */ -WebInspector.HTMLModel.Tag = class { +FormatterWorker.HTMLModel.Tag = class { /** * @param {string} name * @param {number} startOffset @@ -437,7 +437,7 @@ /** * @unrestricted */ -WebInspector.HTMLModel.Element = class { +FormatterWorker.HTMLModel.Element = class { /** * @param {string} name */
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js index b102ef0..e01742c 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/IdentityFormatter.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.IdentityFormatter = class { +FormatterWorker.IdentityFormatter = class { /** - * @param {!WebInspector.FormattedContentBuilder} builder + * @param {!FormatterWorker.FormattedContentBuilder} builder */ constructor(builder) { this._builder = builder;
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js index 811a2039..3c9e296f 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptFormatter.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.JavaScriptFormatter = class { +FormatterWorker.JavaScriptFormatter = class { /** - * @param {!WebInspector.FormattedContentBuilder} builder + * @param {!FormatterWorker.FormattedContentBuilder} builder */ constructor(builder) { this._builder = builder; @@ -50,9 +50,9 @@ this._toOffset = toOffset; this._content = text.substring(this._fromOffset, this._toOffset); this._lastLineNumber = 0; - this._tokenizer = new WebInspector.AcornTokenizer(this._content); + this._tokenizer = new FormatterWorker.AcornTokenizer(this._content); var ast = acorn.parse(this._content, {ranges: false, ecmaVersion: 6}); - var walker = new WebInspector.ESTreeWalker(this._beforeVisit.bind(this), this._afterVisit.bind(this)); + var walker = new FormatterWorker.ESTreeWalker(this._beforeVisit.bind(this), this._afterVisit.bind(this)); walker.walk(ast); } @@ -127,7 +127,7 @@ * @return {string} */ _formatToken(node, token) { - var AT = WebInspector.AcornTokenizer; + var AT = FormatterWorker.AcornTokenizer; if (AT.lineComment(token)) return 'tn'; if (AT.blockComment(token))
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptOutline.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptOutline.js index a11b0fa2..f4f1d70 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptOutline.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/JavaScriptOutline.js
@@ -4,7 +4,7 @@ /** * @param {string} content */ -WebInspector.javaScriptOutline = function(content) { +FormatterWorker.javaScriptOutline = function(content) { var chunkSize = 100000; // characters per data chunk var outlineChunk = []; var previousIdentifier = null; @@ -14,8 +14,8 @@ var isReadingArguments = false; var argumentsText = ''; var currentFunction = null; - var tokenizer = new WebInspector.AcornTokenizer(content); - var AT = WebInspector.AcornTokenizer; + var tokenizer = new FormatterWorker.AcornTokenizer(content); + var AT = FormatterWorker.AcornTokenizer; while (tokenizer.peekToken()) { var token = /** @type {!Acorn.TokenOrComment} */ (tokenizer.nextToken());
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js index 7312f45..7f1cb5e5 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js
@@ -1,16 +1,16 @@ // Copyright 2016 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. -WebInspector.RelaxedJSONParser = {}; +FormatterWorker.RelaxedJSONParser = {}; /** @enum {string} */ -WebInspector.RelaxedJSONParser.States = { +FormatterWorker.RelaxedJSONParser.States = { ExpectKey: 'ExpectKey', ExpectValue: 'ExpectValue' }; /** @enum {*} */ -WebInspector.RelaxedJSONParser.Keywords = { +FormatterWorker.RelaxedJSONParser.Keywords = { 'NaN': NaN, 'true': true, 'false': false, @@ -23,9 +23,9 @@ * @param {string} content * @return {*} */ -WebInspector.RelaxedJSONParser.parse = function(content) { - var Keywords = WebInspector.RelaxedJSONParser.Keywords; - var States = WebInspector.RelaxedJSONParser.States; +FormatterWorker.RelaxedJSONParser.parse = function(content) { + var Keywords = FormatterWorker.RelaxedJSONParser.Keywords; + var States = FormatterWorker.RelaxedJSONParser.States; content = '(' + content + ')'; try { @@ -34,14 +34,14 @@ return null; } - var walker = new WebInspector.ESTreeWalker(beforeVisit, afterVisit); + var walker = new FormatterWorker.ESTreeWalker(beforeVisit, afterVisit); var rootTip = []; - /** @type {!Array.<!WebInspector.RelaxedJSONParser.Context>} */ + /** @type {!Array.<!FormatterWorker.RelaxedJSONParser.Context>} */ var stack = []; - var stackData = /** @type {!WebInspector.RelaxedJSONParser.Context} */ ( + var stackData = /** @type {!FormatterWorker.RelaxedJSONParser.Context} */ ( {key: 0, tip: rootTip, state: States.ExpectValue, parentIsArray: true}); walker.setWalkNulls(true); @@ -54,7 +54,7 @@ return rootTip.length ? rootTip[0] : null; /** - * @param {!WebInspector.RelaxedJSONParser.Context} newStack + * @param {!FormatterWorker.RelaxedJSONParser.Context} newStack */ function pushStack(newStack) { stack.push(stackData); @@ -86,14 +86,14 @@ var newTip = {}; applyValue(newTip); - pushStack(/** @type {!WebInspector.RelaxedJSONParser.Context} */ ( + pushStack(/** @type {!FormatterWorker.RelaxedJSONParser.Context} */ ( {key: null, tip: newTip, state: null, parentIsArray: false})); break; case 'ArrayExpression': var newTip = []; applyValue(newTip); - pushStack(/** @type {!WebInspector.RelaxedJSONParser.Context} */ ( + pushStack(/** @type {!FormatterWorker.RelaxedJSONParser.Context} */ ( {key: 0, tip: newTip, state: States.ExpectValue, parentIsArray: true})); break; case 'Property': @@ -105,7 +105,7 @@ stackData.state = States.ExpectValue; } else if (stackData.state === States.ExpectValue) { applyValue(extractValue(node)); - return WebInspector.ESTreeWalker.SkipSubtree; + return FormatterWorker.ESTreeWalker.SkipSubtree; } break; case 'Identifier': @@ -114,13 +114,13 @@ stackData.state = States.ExpectValue; } else if (stackData.state === States.ExpectValue) { applyValue(extractValue(node)); - return WebInspector.ESTreeWalker.SkipSubtree; + return FormatterWorker.ESTreeWalker.SkipSubtree; } break; case 'UnaryExpression': if (stackData.state === States.ExpectValue) { applyValue(extractValue(node)); - return WebInspector.ESTreeWalker.SkipSubtree; + return FormatterWorker.ESTreeWalker.SkipSubtree; } break; case 'Program': @@ -129,7 +129,7 @@ default: if (stackData.state === States.ExpectValue) applyValue(extractValue(node)); - return WebInspector.ESTreeWalker.SkipSubtree; + return FormatterWorker.ESTreeWalker.SkipSubtree; } } @@ -176,6 +176,6 @@ }; /** - * @typedef {!{key: (number|string), tip: (!Array|!Object), state: ?WebInspector.RelaxedJSONParser.States, parentIsArray: boolean}} + * @typedef {!{key: (number|string), tip: (!Array|!Object), state: ?FormatterWorker.RelaxedJSONParser.States, parentIsArray: boolean}} */ -WebInspector.RelaxedJSONParser.Context; +FormatterWorker.RelaxedJSONParser.Context;
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json b/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json index 184eb47..91777c6 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json
@@ -4,7 +4,6 @@ "../cm/headlesscodemirror.js", "../cm/css.js", "../cm/xml.js", - "../common/WebInspector.js", "../common/Text.js", "../common/TextRange.js", "ESTreeWalker.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js b/third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js index cc00215..41483922f 100644 --- a/third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js +++ b/third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js
@@ -4,17 +4,17 @@ /** * @constructor - * @implements {WebInspector.FormatterWorkerContentParser} + * @implements {FormatterWorker.FormatterWorkerContentParser} */ -WebInspector.SCSSParser = function() +Gonzales.SCSSParser = function() { } -WebInspector.SCSSParser.prototype = { +Gonzales.SCSSParser.prototype = { /** * @override * @param {string} content - * @return {!Array<!WebInspector.SCSSParser.Rule>} + * @return {!Array<!Gonzales.SCSSParser.Rule>} */ parse: function(content) { @@ -33,7 +33,7 @@ /** @type {!Array<!{properties: !Array<!Gonzales.Node>, node: !Gonzales.Node}>} */ var blocks = [rootBlock]; ast.selectors = []; - WebInspector.SCSSParser.extractNodes(ast, blocks, rootBlock); + Gonzales.SCSSParser.extractNodes(ast, blocks, rootBlock); var rules = []; for (var block of blocks) @@ -43,13 +43,13 @@ /** * @param {!{node: !Gonzales.Node, properties: !Array<!Gonzales.Node>}} block - * @param {!Array<!WebInspector.SCSSParser.Rule>} output + * @param {!Array<!Gonzales.SCSSParser.Rule>} output */ _handleBlock: function(block, output) { - var selectors = block.node.selectors.map(WebInspector.SCSSParser.rangeFromNode); + var selectors = block.node.selectors.map(Gonzales.SCSSParser.rangeFromNode); var properties = []; - var styleRange = WebInspector.SCSSParser.rangeFromNode(block.node); + var styleRange = Gonzales.SCSSParser.rangeFromNode(block.node); styleRange.startColumn += 1; styleRange.endColumn -= 1; for (var node of block.properties) { @@ -62,13 +62,13 @@ } if (!selectors.length && !properties.length) return; - var rule = new WebInspector.SCSSParser.Rule(selectors, properties, styleRange); + var rule = new Gonzales.SCSSParser.Rule(selectors, properties, styleRange); output.push(rule); }, /** * @param {!Gonzales.Node} node - * @param {!Array<!WebInspector.SCSSParser.Property>} output + * @param {!Array<!Gonzales.SCSSParser.Property>} output */ _handleDeclaration: function(node, output) { @@ -77,39 +77,39 @@ if (!propertyNode || !valueNode) return; - var nameRange = WebInspector.SCSSParser.rangeFromNode(propertyNode); - var valueRange = WebInspector.SCSSParser.rangeFromNode(valueNode); - var range = /** @type {!WebInspector.TextRange} */(node.declarationRange); + var nameRange = Gonzales.SCSSParser.rangeFromNode(propertyNode); + var valueRange = Gonzales.SCSSParser.rangeFromNode(valueNode); + var range = /** @type {!Common.TextRange} */(node.declarationRange); - var property = new WebInspector.SCSSParser.Property(range, nameRange, valueRange, false); + var property = new Gonzales.SCSSParser.Property(range, nameRange, valueRange, false); output.push(property); }, /** * @param {!Gonzales.Node} node - * @param {!Array<!WebInspector.SCSSParser.Property>} output + * @param {!Array<!Gonzales.SCSSParser.Property>} output */ _handleInclude: function(node, output) { var mixinName = node.content.find(node => node.type === "ident"); if (!mixinName) return; - var nameRange = WebInspector.SCSSParser.rangeFromNode(mixinName); + var nameRange = Gonzales.SCSSParser.rangeFromNode(mixinName); var mixinArguments = node.content.find(node => node.type === "arguments"); if (!mixinArguments) return; var parameters = mixinArguments.content.filter(node => node.type !== "delimiter" && node.type !== "space"); for (var parameter of parameters) { - var range = WebInspector.SCSSParser.rangeFromNode(node); - var valueRange = WebInspector.SCSSParser.rangeFromNode(parameter); - var property = new WebInspector.SCSSParser.Property(range, nameRange, valueRange, false); + var range = Gonzales.SCSSParser.rangeFromNode(node); + var valueRange = Gonzales.SCSSParser.rangeFromNode(parameter); + var property = new Gonzales.SCSSParser.Property(range, nameRange, valueRange, false); output.push(property); } }, /** * @param {!Gonzales.Node} node - * @param {!Array<!WebInspector.SCSSParser.Property>} output + * @param {!Array<!Gonzales.SCSSParser.Property>} output */ _handleComment: function(node, output) { @@ -127,21 +127,21 @@ /** * @param {!Gonzales.Node} node - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ -WebInspector.SCSSParser.rangeFromNode = function(node) +Gonzales.SCSSParser.rangeFromNode = function(node) { - return new WebInspector.TextRange(node.start.line - 1, node.start.column - 1, node.end.line - 1, node.end.column); + return new Common.TextRange(node.start.line - 1, node.start.column - 1, node.end.line - 1, node.end.column); } /** * @constructor - * @param {!WebInspector.TextRange} range - * @param {!WebInspector.TextRange} nameRange - * @param {!WebInspector.TextRange} valueRange + * @param {!Common.TextRange} range + * @param {!Common.TextRange} nameRange + * @param {!Common.TextRange} valueRange * @param {boolean} disabled */ -WebInspector.SCSSParser.Property = function(range, nameRange, valueRange, disabled) +Gonzales.SCSSParser.Property = function(range, nameRange, valueRange, disabled) { this.range = range; this.name = nameRange; @@ -149,41 +149,41 @@ this.disabled = disabled; } -WebInspector.SCSSParser.Property.prototype = { +Gonzales.SCSSParser.Property.prototype = { /** * @param {!Gonzales.Node} commentNode - * @return {!WebInspector.SCSSParser.Property} + * @return {!Gonzales.SCSSParser.Property} */ rebaseInsideOneLineComment: function(commentNode) { var lineOffset = commentNode.start.line - 1; // Account for the "/*". var columnOffset = commentNode.start.column - 1 + 2; - var range = WebInspector.SCSSParser.rangeFromNode(commentNode); + var range = Gonzales.SCSSParser.rangeFromNode(commentNode); var name = rebaseRange(this.name, lineOffset, columnOffset); var value = rebaseRange(this.value, lineOffset, columnOffset); - return new WebInspector.SCSSParser.Property(range, name, value, true); + return new Gonzales.SCSSParser.Property(range, name, value, true); /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {number} lineOffset * @param {number} columnOffset - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ function rebaseRange(range, lineOffset, columnOffset) { - return new WebInspector.TextRange(range.startLine + lineOffset, range.startColumn + columnOffset, range.endLine + lineOffset, range.endColumn + columnOffset); + return new Common.TextRange(range.startLine + lineOffset, range.startColumn + columnOffset, range.endLine + lineOffset, range.endColumn + columnOffset); } } } /** * @constructor - * @param {!Array<!WebInspector.TextRange>} selectors - * @param {!Array<!WebInspector.SCSSParser.Property>} properties - * @param {!WebInspector.TextRange} styleRange + * @param {!Array<!Common.TextRange>} selectors + * @param {!Array<!Gonzales.SCSSParser.Property>} properties + * @param {!Common.TextRange} styleRange */ -WebInspector.SCSSParser.Rule = function(selectors, properties, styleRange) +Gonzales.SCSSParser.Rule = function(selectors, properties, styleRange) { this.selectors = selectors; this.properties = properties; @@ -195,7 +195,7 @@ * @param {!Array<{node: !Gonzales.Node, properties: !Array<!Gonzales.Node>}>} blocks * @param {!{node: !Gonzales.Node, properties: !Array<!Gonzales.Node>}} lastBlock */ -WebInspector.SCSSParser.extractNodes = function(node, blocks, lastBlock) +Gonzales.SCSSParser.extractNodes = function(node, blocks, lastBlock) { if (!Array.isArray(node.content)) return; @@ -224,9 +224,9 @@ lastBlock.properties.push(child); if (child.type === "declaration") { lastDeclaration = child; - lastDeclaration.declarationRange = WebInspector.TextRange.createFromLocation(child.start.line - 1, child.start.column - 1); + lastDeclaration.declarationRange = Common.TextRange.createFromLocation(child.start.line - 1, child.start.column - 1); } - WebInspector.SCSSParser.extractNodes(child, blocks, lastBlock); + Gonzales.SCSSParser.extractNodes(child, blocks, lastBlock); } if (lastDeclaration) { lastDeclaration.declarationRange.endLine = node.end.line - 1;
diff --git a/third_party/WebKit/Source/devtools/front_end/gonzales/module.json b/third_party/WebKit/Source/devtools/front_end/gonzales/module.json index 1e0d51a..bc6d507 100644 --- a/third_party/WebKit/Source/devtools/front_end/gonzales/module.json +++ b/third_party/WebKit/Source/devtools/front_end/gonzales/module.json
@@ -8,8 +8,8 @@ ], "extensions": [ { - "type": "@WebInspector.FormatterWorkerContentParser", - "className": "WebInspector.SCSSParser", + "type": "@FormatterWorker.FormatterWorkerContentParser", + "className": "Gonzales.SCSSParser", "mimeType": "text/x-scss" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/AllocationProfile.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/AllocationProfile.js index 94506db..f7e543a2 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/AllocationProfile.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/AllocationProfile.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.AllocationProfile = class { +HeapSnapshotWorker.AllocationProfile = class { constructor(profile, liveObjectStats) { this._strings = profile.strings; this._liveObjectStats = liveObjectStats; @@ -64,7 +64,7 @@ var functionInfos = this._functionInfos = new Array(infoLength / functionInfoFieldCount); var index = 0; for (var i = 0; i < infoLength; i += functionInfoFieldCount) { - functionInfos[index++] = new WebInspector.FunctionAllocationInfo( + functionInfos[index++] = new HeapSnapshotWorker.FunctionAllocationInfo( strings[rawInfos[i + functionNameOffset]], strings[rawInfos[i + scriptNameOffset]], rawInfos[i + scriptIdOffset], rawInfos[i + lineOffset], rawInfos[i + columnOffset]); } @@ -89,7 +89,7 @@ var stats = liveObjectStats[id]; var liveCount = stats ? stats.count : 0; var liveSize = stats ? stats.size : 0; - var result = new WebInspector.TopDownAllocationNode( + var result = new HeapSnapshotWorker.TopDownAllocationNode( id, functionInfo, rawNodeArray[nodeOffset + allocationCountOffset], rawNodeArray[nodeOffset + allocationSizeOffset], liveCount, liveSize, parent); idToTopDownNode[id] = result; @@ -106,7 +106,7 @@ } /** - * @return {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} + * @return {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} */ serializeTraceTops() { if (this._traceTops) @@ -131,7 +131,7 @@ /** * @param {number} nodeId - * @return {!WebInspector.HeapSnapshotCommon.AllocationNodeCallers} + * @return {!Profiler.HeapSnapshotCommon.AllocationNodeCallers} */ serializeCallers(nodeId) { var node = this._ensureBottomUpNode(nodeId); @@ -146,19 +146,19 @@ for (var i = 0; i < callers.length; i++) { branchingCallers.push(this._serializeCaller(callers[i])); } - return new WebInspector.HeapSnapshotCommon.AllocationNodeCallers(nodesWithSingleCaller, branchingCallers); + return new Profiler.HeapSnapshotCommon.AllocationNodeCallers(nodesWithSingleCaller, branchingCallers); } /** * @param {number} traceNodeId - * @return {!Array.<!WebInspector.HeapSnapshotCommon.AllocationStackFrame>} + * @return {!Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame>} */ serializeAllocationStack(traceNodeId) { var node = this._idToTopDownNode[traceNodeId]; var result = []; while (node) { var functionInfo = node.functionInfo; - result.push(new WebInspector.HeapSnapshotCommon.AllocationStackFrame( + result.push(new Profiler.HeapSnapshotCommon.AllocationStackFrame( functionInfo.functionName, functionInfo.scriptName, functionInfo.scriptId, functionInfo.line, functionInfo.column)); node = node.parent; @@ -176,7 +176,7 @@ /** * @param {number} nodeId - * @return {!WebInspector.BottomUpAllocationNode} + * @return {!HeapSnapshotWorker.BottomUpAllocationNode} */ _ensureBottomUpNode(nodeId) { var node = this._idToNode[nodeId]; @@ -190,8 +190,8 @@ } /** - * @param {!WebInspector.BottomUpAllocationNode} node - * @return {!WebInspector.HeapSnapshotCommon.SerializedAllocationNode} + * @param {!HeapSnapshotWorker.BottomUpAllocationNode} node + * @return {!Profiler.HeapSnapshotCommon.SerializedAllocationNode} */ _serializeCaller(node) { var callerId = this._nextNodeId++; @@ -203,16 +203,16 @@ /** * @param {number} nodeId - * @param {!WebInspector.FunctionAllocationInfo} functionInfo + * @param {!HeapSnapshotWorker.FunctionAllocationInfo} functionInfo * @param {number} count * @param {number} size * @param {number} liveCount * @param {number} liveSize * @param {boolean} hasChildren - * @return {!WebInspector.HeapSnapshotCommon.SerializedAllocationNode} + * @return {!Profiler.HeapSnapshotCommon.SerializedAllocationNode} */ _serializeNode(nodeId, functionInfo, count, size, liveCount, liveSize, hasChildren) { - return new WebInspector.HeapSnapshotCommon.SerializedAllocationNode( + return new Profiler.HeapSnapshotCommon.SerializedAllocationNode( nodeId, functionInfo.functionName, functionInfo.scriptName, functionInfo.scriptId, functionInfo.line, functionInfo.column, count, size, liveCount, liveSize, hasChildren); } @@ -221,15 +221,15 @@ /** * @unrestricted */ -WebInspector.TopDownAllocationNode = class { +HeapSnapshotWorker.TopDownAllocationNode = class { /** * @param {number} id - * @param {!WebInspector.FunctionAllocationInfo} functionInfo + * @param {!HeapSnapshotWorker.FunctionAllocationInfo} functionInfo * @param {number} count * @param {number} size * @param {number} liveCount * @param {number} liveSize - * @param {?WebInspector.TopDownAllocationNode} parent + * @param {?HeapSnapshotWorker.TopDownAllocationNode} parent */ constructor(id, functionInfo, count, size, liveCount, liveSize, parent) { this.id = id; @@ -246,9 +246,9 @@ /** * @unrestricted */ -WebInspector.BottomUpAllocationNode = class { +HeapSnapshotWorker.BottomUpAllocationNode = class { /** - * @param {!WebInspector.FunctionAllocationInfo} functionInfo + * @param {!HeapSnapshotWorker.FunctionAllocationInfo} functionInfo */ constructor(functionInfo) { this.functionInfo = functionInfo; @@ -261,8 +261,8 @@ } /** - * @param {!WebInspector.TopDownAllocationNode} traceNode - * @return {!WebInspector.BottomUpAllocationNode} + * @param {!HeapSnapshotWorker.TopDownAllocationNode} traceNode + * @return {!HeapSnapshotWorker.BottomUpAllocationNode} */ addCaller(traceNode) { var functionInfo = traceNode.functionInfo; @@ -275,14 +275,14 @@ } } if (!result) { - result = new WebInspector.BottomUpAllocationNode(functionInfo); + result = new HeapSnapshotWorker.BottomUpAllocationNode(functionInfo); this._callers.push(result); } return result; } /** - * @return {!Array.<!WebInspector.BottomUpAllocationNode>} + * @return {!Array.<!HeapSnapshotWorker.BottomUpAllocationNode>} */ callers() { return this._callers; @@ -299,7 +299,7 @@ /** * @unrestricted */ -WebInspector.FunctionAllocationInfo = class { +HeapSnapshotWorker.FunctionAllocationInfo = class { /** * @param {string} functionName * @param {string} scriptName @@ -321,7 +321,7 @@ } /** - * @param {!WebInspector.TopDownAllocationNode} node + * @param {!HeapSnapshotWorker.TopDownAllocationNode} node */ addTraceTopNode(node) { if (node.allocationCount === 0) @@ -334,7 +334,7 @@ } /** - * @return {?WebInspector.BottomUpAllocationNode} + * @return {?HeapSnapshotWorker.BottomUpAllocationNode} */ bottomUpRoot() { if (!this._traceTops.length) @@ -345,7 +345,7 @@ } _buildAllocationTraceTree() { - this._bottomUpTree = new WebInspector.BottomUpAllocationNode(this); + this._bottomUpTree = new HeapSnapshotWorker.BottomUpAllocationNode(this); for (var i = 0; i < this._traceTops.length; i++) { var node = this._traceTops[i];
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js index 8e4b87b2..38b0cacc 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.HeapSnapshotItem = function() {}; +HeapSnapshotWorker.HeapSnapshotItem = function() {}; -WebInspector.HeapSnapshotItem.prototype = { +HeapSnapshotWorker.HeapSnapshotItem.prototype = { /** * @return {number} */ @@ -45,12 +45,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItem} + * @implements {HeapSnapshotWorker.HeapSnapshotItem} * @unrestricted */ -WebInspector.HeapSnapshotEdge = class { +HeapSnapshotWorker.HeapSnapshotEdge = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot * @param {number=} edgeIndex */ constructor(snapshot, edgeIndex) { @@ -60,10 +60,10 @@ } /** - * @return {!WebInspector.HeapSnapshotEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotEdge} */ clone() { - return new WebInspector.HeapSnapshotEdge(this._snapshot, this.edgeIndex); + return new HeapSnapshotWorker.HeapSnapshotEdge(this._snapshot, this.edgeIndex); } /** @@ -81,7 +81,7 @@ } /** - * @return {!WebInspector.HeapSnapshotNode} + * @return {!HeapSnapshotWorker.HeapSnapshotNode} */ node() { return this._snapshot.createNode(this.nodeIndex()); @@ -119,10 +119,10 @@ /** * @override - * @return {!WebInspector.HeapSnapshotCommon.Edge} + * @return {!Profiler.HeapSnapshotCommon.Edge} */ serialize() { - return new WebInspector.HeapSnapshotCommon.Edge(this.name(), this.node().serialize(), this.type(), this.edgeIndex); + return new Profiler.HeapSnapshotCommon.Edge(this.name(), this.node().serialize(), this.type(), this.edgeIndex); } /** @@ -137,16 +137,16 @@ /** * @interface */ -WebInspector.HeapSnapshotItemIterator = function() {}; +HeapSnapshotWorker.HeapSnapshotItemIterator = function() {}; -WebInspector.HeapSnapshotItemIterator.prototype = { +HeapSnapshotWorker.HeapSnapshotItemIterator.prototype = { /** * @return {boolean} */ hasNext: function() {}, /** - * @return {!WebInspector.HeapSnapshotItem} + * @return {!HeapSnapshotWorker.HeapSnapshotItem} */ item: function() {}, @@ -156,23 +156,23 @@ /** * @interface */ -WebInspector.HeapSnapshotItemIndexProvider = function() {}; +HeapSnapshotWorker.HeapSnapshotItemIndexProvider = function() {}; -WebInspector.HeapSnapshotItemIndexProvider.prototype = { +HeapSnapshotWorker.HeapSnapshotItemIndexProvider.prototype = { /** * @param {number} newIndex - * @return {!WebInspector.HeapSnapshotItem} + * @return {!HeapSnapshotWorker.HeapSnapshotItem} */ itemForIndex: function(newIndex) {}, }; /** - * @implements {WebInspector.HeapSnapshotItemIndexProvider} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIndexProvider} * @unrestricted */ -WebInspector.HeapSnapshotNodeIndexProvider = class { +HeapSnapshotWorker.HeapSnapshotNodeIndexProvider = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot */ constructor(snapshot) { this._node = snapshot.createNode(); @@ -181,7 +181,7 @@ /** * @override * @param {number} index - * @return {!WebInspector.HeapSnapshotNode} + * @return {!HeapSnapshotWorker.HeapSnapshotNode} */ itemForIndex(index) { this._node.nodeIndex = index; @@ -190,12 +190,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIndexProvider} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIndexProvider} * @unrestricted */ -WebInspector.HeapSnapshotEdgeIndexProvider = class { +HeapSnapshotWorker.HeapSnapshotEdgeIndexProvider = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot */ constructor(snapshot) { this._edge = snapshot.createEdge(0); @@ -204,7 +204,7 @@ /** * @override * @param {number} index - * @return {!WebInspector.HeapSnapshotEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotEdge} */ itemForIndex(index) { this._edge.edgeIndex = index; @@ -213,12 +213,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIndexProvider} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIndexProvider} * @unrestricted */ -WebInspector.HeapSnapshotRetainerEdgeIndexProvider = class { +HeapSnapshotWorker.HeapSnapshotRetainerEdgeIndexProvider = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot */ constructor(snapshot) { this._retainerEdge = snapshot.createRetainingEdge(0); @@ -227,7 +227,7 @@ /** * @override * @param {number} index - * @return {!WebInspector.HeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotRetainerEdge} */ itemForIndex(index) { this._retainerEdge.setRetainerIndex(index); @@ -236,12 +236,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIterator} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIterator} * @unrestricted */ -WebInspector.HeapSnapshotEdgeIterator = class { +HeapSnapshotWorker.HeapSnapshotEdgeIterator = class { /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node */ constructor(node) { this._sourceNode = node; @@ -258,7 +258,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotEdge} */ item() { return this.edge; @@ -273,12 +273,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItem} + * @implements {HeapSnapshotWorker.HeapSnapshotItem} * @unrestricted */ -WebInspector.HeapSnapshotRetainerEdge = class { +HeapSnapshotWorker.HeapSnapshotRetainerEdge = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot * @param {number} retainerIndex */ constructor(snapshot, retainerIndex) { @@ -287,10 +287,10 @@ } /** - * @return {!WebInspector.HeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotRetainerEdge} */ clone() { - return new WebInspector.HeapSnapshotRetainerEdge(this._snapshot, this.retainerIndex()); + return new HeapSnapshotWorker.HeapSnapshotRetainerEdge(this._snapshot, this.retainerIndex()); } /** @@ -308,7 +308,7 @@ } /** - * @return {!WebInspector.HeapSnapshotNode} + * @return {!HeapSnapshotWorker.HeapSnapshotNode} */ node() { return this._node(); @@ -378,10 +378,10 @@ /** * @override - * @return {!WebInspector.HeapSnapshotCommon.Edge} + * @return {!Profiler.HeapSnapshotCommon.Edge} */ serialize() { - return new WebInspector.HeapSnapshotCommon.Edge( + return new Profiler.HeapSnapshotCommon.Edge( this.name(), this.node().serialize(), this.type(), this._globalEdgeIndex); } @@ -394,12 +394,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIterator} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIterator} * @unrestricted */ -WebInspector.HeapSnapshotRetainerEdgeIterator = class { +HeapSnapshotWorker.HeapSnapshotRetainerEdgeIterator = class { /** - * @param {!WebInspector.HeapSnapshotNode} retainedNode + * @param {!HeapSnapshotWorker.HeapSnapshotNode} retainedNode */ constructor(retainedNode) { var snapshot = retainedNode._snapshot; @@ -419,7 +419,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.HeapSnapshotRetainerEdge} */ item() { return this.retainer; @@ -434,12 +434,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItem} + * @implements {HeapSnapshotWorker.HeapSnapshotItem} * @unrestricted */ -WebInspector.HeapSnapshotNode = class { +HeapSnapshotWorker.HeapSnapshotNode = class { /** - * @param {!WebInspector.HeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot * @param {number=} nodeIndex */ constructor(snapshot, nodeIndex) { @@ -477,10 +477,10 @@ } /** - * @return {!WebInspector.HeapSnapshotEdgeIterator} + * @return {!HeapSnapshotWorker.HeapSnapshotEdgeIterator} */ edges() { - return new WebInspector.HeapSnapshotEdgeIterator(this); + return new HeapSnapshotWorker.HeapSnapshotEdgeIterator(this); } /** @@ -519,10 +519,10 @@ } /** - * @return {!WebInspector.HeapSnapshotRetainerEdgeIterator} + * @return {!HeapSnapshotWorker.HeapSnapshotRetainerEdgeIterator} */ retainers() { - return new WebInspector.HeapSnapshotRetainerEdgeIterator(this); + return new HeapSnapshotWorker.HeapSnapshotRetainerEdgeIterator(this); } /** @@ -567,10 +567,10 @@ /** * @override - * @return {!WebInspector.HeapSnapshotCommon.Node} + * @return {!Profiler.HeapSnapshotCommon.Node} */ serialize() { - return new WebInspector.HeapSnapshotCommon.Node( + return new Profiler.HeapSnapshotCommon.Node( this.id(), this.name(), this.distance(), this.nodeIndex, this.retainedSize(), this.selfSize(), this.type()); } @@ -621,12 +621,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIterator} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIterator} * @unrestricted */ -WebInspector.HeapSnapshotNodeIterator = class { +HeapSnapshotWorker.HeapSnapshotNodeIterator = class { /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node */ constructor(node) { this.node = node; @@ -643,7 +643,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotNode} + * @return {!HeapSnapshotWorker.HeapSnapshotNode} */ item() { return this.node; @@ -658,12 +658,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIterator} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIterator} * @unrestricted */ -WebInspector.HeapSnapshotIndexRangeIterator = class { +HeapSnapshotWorker.HeapSnapshotIndexRangeIterator = class { /** - * @param {!WebInspector.HeapSnapshotItemIndexProvider} itemProvider + * @param {!HeapSnapshotWorker.HeapSnapshotItemIndexProvider} itemProvider * @param {!Array.<number>|!Uint32Array} indexes */ constructor(itemProvider, indexes) { @@ -682,7 +682,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotItem} + * @return {!HeapSnapshotWorker.HeapSnapshotItem} */ item() { var index = this._indexes[this._position]; @@ -698,13 +698,13 @@ }; /** - * @implements {WebInspector.HeapSnapshotItemIterator} + * @implements {HeapSnapshotWorker.HeapSnapshotItemIterator} * @unrestricted */ -WebInspector.HeapSnapshotFilteredIterator = class { +HeapSnapshotWorker.HeapSnapshotFilteredIterator = class { /** - * @param {!WebInspector.HeapSnapshotItemIterator} iterator - * @param {function(!WebInspector.HeapSnapshotItem):boolean=} filter + * @param {!HeapSnapshotWorker.HeapSnapshotItemIterator} iterator + * @param {function(!HeapSnapshotWorker.HeapSnapshotItem):boolean=} filter */ constructor(iterator, filter) { this._iterator = iterator; @@ -722,7 +722,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotItem} + * @return {!HeapSnapshotWorker.HeapSnapshotItem} */ item() { return this._iterator.item(); @@ -746,9 +746,9 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotProgress = class { +HeapSnapshotWorker.HeapSnapshotProgress = class { /** - * @param {!WebInspector.HeapSnapshotWorkerDispatcher=} dispatcher + * @param {!HeapSnapshotWorker.HeapSnapshotWorkerDispatcher=} dispatcher */ constructor(dispatcher) { this._dispatcher = dispatcher; @@ -758,7 +758,7 @@ * @param {string} status */ updateStatus(status) { - this._sendUpdateEvent(WebInspector.UIString(status)); + this._sendUpdateEvent(Common.UIString(status)); } /** @@ -768,7 +768,7 @@ */ updateProgress(title, value, total) { var percentValue = ((total ? (value / total) : 0) * 100).toFixed(0); - this._sendUpdateEvent(WebInspector.UIString(title, percentValue)); + this._sendUpdateEvent(Common.UIString(title, percentValue)); } /** @@ -777,7 +777,7 @@ reportProblem(error) { // May be undefined in tests. if (this._dispatcher) - this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgressEvent.BrokenSnapshot, error); + this._dispatcher.sendEvent(Profiler.HeapSnapshotProgressEvent.BrokenSnapshot, error); } /** @@ -786,14 +786,14 @@ _sendUpdateEvent(text) { // May be undefined in tests. if (this._dispatcher) - this._dispatcher.sendEvent(WebInspector.HeapSnapshotProgressEvent.Update, text); + this._dispatcher.sendEvent(Profiler.HeapSnapshotProgressEvent.Update, text); } }; /** * @unrestricted */ -WebInspector.HeapSnapshotProblemReport = class { +HeapSnapshotWorker.HeapSnapshotProblemReport = class { /** * @param {string} title */ @@ -822,10 +822,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshot = class { +HeapSnapshotWorker.HeapSnapshot = class { /** * @param {!Object} profile - * @param {!WebInspector.HeapSnapshotProgress} progress + * @param {!HeapSnapshotWorker.HeapSnapshotProgress} progress */ constructor(profile, progress) { /** @type {!Uint32Array} */ @@ -836,7 +836,7 @@ this._metaNode = profile.snapshot.meta; /** @type {!Array.<number>} */ this._rawSamples = profile.samples; - /** @type {?WebInspector.HeapSnapshotCommon.Samples} */ + /** @type {?Profiler.HeapSnapshotCommon.Samples} */ this._samples = null; /** @type {!Array.<string>} */ this.strings = profile.strings; @@ -945,7 +945,7 @@ stats.size += node.selfSize(); stats.ids.push(node.id()); } - this._allocationProfile = new WebInspector.AllocationProfile(this._profile, liveObjects); + this._allocationProfile = new HeapSnapshotWorker.AllocationProfile(this._profile, liveObjects); this._progress.updateStatus('Done'); } } @@ -1019,7 +1019,7 @@ /** * @param {number} edgeIndex - * @return {!WebInspector.JSHeapSnapshotEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotEdge} */ createEdge(edgeIndex) { throw new Error('Not implemented'); @@ -1027,18 +1027,18 @@ /** * @param {number} retainerIndex - * @return {!WebInspector.JSHeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotRetainerEdge} */ createRetainingEdge(retainerIndex) { throw new Error('Not implemented'); } _allNodes() { - return new WebInspector.HeapSnapshotNodeIterator(this.rootNode()); + return new HeapSnapshotWorker.HeapSnapshotNodeIterator(this.rootNode()); } /** - * @return {!WebInspector.HeapSnapshotNode} + * @return {!HeapSnapshotWorker.HeapSnapshotNode} */ rootNode() { return this.createNode(this._rootNodeIndex); @@ -1059,8 +1059,8 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter - * @return {undefined|function(!WebInspector.HeapSnapshotNode):boolean} + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter + * @return {undefined|function(!HeapSnapshotWorker.HeapSnapshotNode):boolean} */ _createFilter(nodeFilter) { var minNodeId = nodeFilter.minNodeId; @@ -1078,8 +1078,8 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.SearchConfig} searchConfig - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter + * @param {!Profiler.HeapSnapshotCommon.SearchConfig} searchConfig + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter * @return {!Array.<number>} */ search(searchConfig, nodeFilter) { @@ -1124,8 +1124,8 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter - * @return {!Object.<string, !WebInspector.HeapSnapshotCommon.Aggregate>} + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter + * @return {!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>} */ aggregatesWithFilter(nodeFilter) { var filter = this._createFilter(nodeFilter); @@ -1136,11 +1136,11 @@ /** * @param {number} minNodeId * @param {number} maxNodeId - * @return {function(!WebInspector.HeapSnapshotNode):boolean} + * @return {function(!HeapSnapshotWorker.HeapSnapshotNode):boolean} */ _createNodeIdFilter(minNodeId, maxNodeId) { /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {boolean} */ function nodeIdFilter(node) { @@ -1152,7 +1152,7 @@ /** * @param {number} bottomUpAllocationNodeId - * @return {function(!WebInspector.HeapSnapshotNode):boolean|undefined} + * @return {function(!HeapSnapshotWorker.HeapSnapshotNode):boolean|undefined} */ _createAllocationStackFilter(bottomUpAllocationNodeId) { var traceIds = this._allocationProfile.traceIds(bottomUpAllocationNodeId); @@ -1162,7 +1162,7 @@ for (var i = 0; i < traceIds.length; i++) set[traceIds[i]] = true; /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {boolean} */ function traceIdFilter(node) { @@ -1174,8 +1174,8 @@ /** * @param {boolean} sortedIndexes * @param {string=} key - * @param {function(!WebInspector.HeapSnapshotNode):boolean=} filter - * @return {!Object.<string, !WebInspector.HeapSnapshotCommon.Aggregate>} + * @param {function(!HeapSnapshotWorker.HeapSnapshotNode):boolean=} filter + * @return {!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>} */ aggregates(sortedIndexes, key, filter) { var aggregatesByClassName = key && this._aggregates[key]; @@ -1196,7 +1196,7 @@ } /** - * @return {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} + * @return {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} */ allocationTracesTops() { return this._allocationProfile.serializeTraceTops(); @@ -1204,7 +1204,7 @@ /** * @param {number} nodeId - * @return {!WebInspector.HeapSnapshotCommon.AllocationNodeCallers} + * @return {!Profiler.HeapSnapshotCommon.AllocationNodeCallers} */ allocationNodeCallers(nodeId) { return this._allocationProfile.serializeCallers(nodeId); @@ -1212,7 +1212,7 @@ /** * @param {number} nodeIndex - * @return {?Array.<!WebInspector.HeapSnapshotCommon.AllocationStackFrame>} + * @return {?Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame>} */ allocationStack(nodeIndex) { var node = this.createNode(nodeIndex); @@ -1223,7 +1223,7 @@ } /** - * @return {!Object.<string, !WebInspector.HeapSnapshotCommon.AggregateForDiff>} + * @return {!Object.<string, !Profiler.HeapSnapshotCommon.AggregateForDiff>} */ aggregatesForDiff() { if (this._aggregatesForDiff) @@ -1251,7 +1251,7 @@ /** * @protected - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {boolean} */ isUserRoot(node) { @@ -1259,7 +1259,7 @@ } /** - * @param {function(!WebInspector.HeapSnapshotNode)} action + * @param {function(!HeapSnapshotWorker.HeapSnapshotNode)} action * @param {boolean=} userRootsOnly */ forEachRoot(action, userRootsOnly) { @@ -1271,7 +1271,7 @@ } /** - * @param {function(!WebInspector.HeapSnapshotNode,!WebInspector.HeapSnapshotEdge):boolean=} filter + * @param {function(!HeapSnapshotWorker.HeapSnapshotNode,!HeapSnapshotWorker.HeapSnapshotEdge):boolean=} filter */ calculateDistances(filter) { var nodeCount = this.nodeCount; @@ -1285,7 +1285,7 @@ /** * @param {number} distance - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node */ function enqueueNode(distance, node) { var ordinal = node.ordinal(); @@ -1300,7 +1300,7 @@ // bfs for the rest of objects nodesToVisitLength = 0; - this.forEachRoot(enqueueNode.bind(null, WebInspector.HeapSnapshotCommon.baseSystemDistance), false); + this.forEachRoot(enqueueNode.bind(null, Profiler.HeapSnapshotCommon.baseSystemDistance), false); this._bfs(nodesToVisit, nodesToVisitLength, distances, filter); } @@ -1308,7 +1308,7 @@ * @param {!Uint32Array} nodesToVisit * @param {number} nodesToVisitLength * @param {!Int32Array} distances - * @param {function(!WebInspector.HeapSnapshotNode,!WebInspector.HeapSnapshotEdge):boolean=} filter + * @param {function(!HeapSnapshotWorker.HeapSnapshotNode,!HeapSnapshotWorker.HeapSnapshotEdge):boolean=} filter */ _bfs(nodesToVisit, nodesToVisitLength, distances, filter) { // Preload fields into local variables for better performance. @@ -1547,7 +1547,7 @@ if (postOrderIndex === nodeCount || iteration > 1) break; - var errors = new WebInspector.HeapSnapshotProblemReport( + var errors = new HeapSnapshotWorker.HeapSnapshotProblemReport( `Heap snapshot: ${nodeCount - postOrderIndex} nodes are unreachable from the root. Following nodes have only weak retainers:`); var dumpNode = this.rootNode(); @@ -1577,7 +1577,7 @@ // If we already processed all orphan nodes that have only weak retainers and still have some orphans... if (postOrderIndex !== nodeCount) { - var errors = new WebInspector.HeapSnapshotProblemReport( + var errors = new HeapSnapshotWorker.HeapSnapshotProblemReport( 'Still found ' + (nodeCount - postOrderIndex) + ' unreachable nodes in heap snapshot:'); var dumpNode = this.rootNode(); // Remove root from the result (last node in the array) and put it at the bottom of the stack so that it is @@ -1845,11 +1845,11 @@ } sizeForRange[rangeIndex] += node.selfSize(); } - this._samples = new WebInspector.HeapSnapshotCommon.Samples(timestamps, lastAssignedIds, sizeForRange); + this._samples = new Profiler.HeapSnapshotCommon.Samples(timestamps, lastAssignedIds, sizeForRange); } /** - * @return {?WebInspector.HeapSnapshotCommon.Samples} + * @return {?Profiler.HeapSnapshotCommon.Samples} */ getSamples() { return this._samples; @@ -1875,8 +1875,8 @@ /** * @param {string} baseSnapshotId - * @param {!Object.<string, !WebInspector.HeapSnapshotCommon.AggregateForDiff>} baseSnapshotAggregates - * @return {!Object.<string, !WebInspector.HeapSnapshotCommon.Diff>} + * @param {!Object.<string, !Profiler.HeapSnapshotCommon.AggregateForDiff>} baseSnapshotAggregates + * @return {!Object.<string, !Profiler.HeapSnapshotCommon.Diff>} */ calculateSnapshotDiff(baseSnapshotId, baseSnapshotAggregates) { var snapshotDiff = this._snapshotDiffs[baseSnapshotId]; @@ -1891,7 +1891,7 @@ if (diff) snapshotDiff[className] = diff; } - var emptyBaseAggregate = new WebInspector.HeapSnapshotCommon.AggregateForDiff(); + var emptyBaseAggregate = new Profiler.HeapSnapshotCommon.AggregateForDiff(); for (var className in aggregates) { if (className in baseSnapshotAggregates) continue; @@ -1903,9 +1903,9 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.AggregateForDiff} baseAggregate - * @param {!WebInspector.HeapSnapshotCommon.Aggregate} aggregate - * @return {?WebInspector.HeapSnapshotCommon.Diff} + * @param {!Profiler.HeapSnapshotCommon.AggregateForDiff} baseAggregate + * @param {!Profiler.HeapSnapshotCommon.Aggregate} aggregate + * @return {?Profiler.HeapSnapshotCommon.Diff} */ _calculateDiffForClass(baseAggregate, aggregate) { var baseIds = baseAggregate.ids; @@ -1916,7 +1916,7 @@ var i = 0, l = baseIds.length; var j = 0, m = indexes.length; - var diff = new WebInspector.HeapSnapshotCommon.Diff(); + var diff = new Profiler.HeapSnapshotCommon.Diff(); var nodeB = this.createNode(indexes[j]); while (i < l && j < m) { @@ -1991,35 +1991,35 @@ /** * @param {number} nodeIndex - * @return {!WebInspector.HeapSnapshotEdgesProvider} + * @return {!HeapSnapshotWorker.HeapSnapshotEdgesProvider} */ createEdgesProvider(nodeIndex) { var node = this.createNode(nodeIndex); var filter = this.containmentEdgesFilter(); - var indexProvider = new WebInspector.HeapSnapshotEdgeIndexProvider(this); - return new WebInspector.HeapSnapshotEdgesProvider(this, filter, node.edges(), indexProvider); + var indexProvider = new HeapSnapshotWorker.HeapSnapshotEdgeIndexProvider(this); + return new HeapSnapshotWorker.HeapSnapshotEdgesProvider(this, filter, node.edges(), indexProvider); } /** * @param {number} nodeIndex - * @param {?function(!WebInspector.HeapSnapshotEdge):boolean} filter - * @return {!WebInspector.HeapSnapshotEdgesProvider} + * @param {?function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} filter + * @return {!HeapSnapshotWorker.HeapSnapshotEdgesProvider} */ createEdgesProviderForTest(nodeIndex, filter) { var node = this.createNode(nodeIndex); - var indexProvider = new WebInspector.HeapSnapshotEdgeIndexProvider(this); - return new WebInspector.HeapSnapshotEdgesProvider(this, filter, node.edges(), indexProvider); + var indexProvider = new HeapSnapshotWorker.HeapSnapshotEdgeIndexProvider(this); + return new HeapSnapshotWorker.HeapSnapshotEdgesProvider(this, filter, node.edges(), indexProvider); } /** - * @return {?function(!WebInspector.HeapSnapshotEdge):boolean} + * @return {?function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} */ retainingEdgesFilter() { return null; } /** - * @return {?function(!WebInspector.HeapSnapshotEdge):boolean} + * @return {?function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} */ containmentEdgesFilter() { return null; @@ -2027,36 +2027,36 @@ /** * @param {number} nodeIndex - * @return {!WebInspector.HeapSnapshotEdgesProvider} + * @return {!HeapSnapshotWorker.HeapSnapshotEdgesProvider} */ createRetainingEdgesProvider(nodeIndex) { var node = this.createNode(nodeIndex); var filter = this.retainingEdgesFilter(); - var indexProvider = new WebInspector.HeapSnapshotRetainerEdgeIndexProvider(this); - return new WebInspector.HeapSnapshotEdgesProvider(this, filter, node.retainers(), indexProvider); + var indexProvider = new HeapSnapshotWorker.HeapSnapshotRetainerEdgeIndexProvider(this); + return new HeapSnapshotWorker.HeapSnapshotEdgesProvider(this, filter, node.retainers(), indexProvider); } /** * @param {string} baseSnapshotId * @param {string} className - * @return {!WebInspector.HeapSnapshotNodesProvider} + * @return {!HeapSnapshotWorker.HeapSnapshotNodesProvider} */ createAddedNodesProvider(baseSnapshotId, className) { var snapshotDiff = this._snapshotDiffs[baseSnapshotId]; var diffForClass = snapshotDiff[className]; - return new WebInspector.HeapSnapshotNodesProvider(this, null, diffForClass.addedIndexes); + return new HeapSnapshotWorker.HeapSnapshotNodesProvider(this, null, diffForClass.addedIndexes); } /** * @param {!Array.<number>} nodeIndexes - * @return {!WebInspector.HeapSnapshotNodesProvider} + * @return {!HeapSnapshotWorker.HeapSnapshotNodesProvider} */ createDeletedNodesProvider(nodeIndexes) { - return new WebInspector.HeapSnapshotNodesProvider(this, null, nodeIndexes); + return new HeapSnapshotWorker.HeapSnapshotNodesProvider(this, null, nodeIndexes); } /** - * @return {?function(!WebInspector.HeapSnapshotNode):boolean} + * @return {?function(!HeapSnapshotWorker.HeapSnapshotNode):boolean} */ classNodesFilter() { return null; @@ -2064,11 +2064,11 @@ /** * @param {string} className - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter - * @return {!WebInspector.HeapSnapshotNodesProvider} + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter + * @return {!HeapSnapshotWorker.HeapSnapshotNodesProvider} */ createNodesProviderForClass(className, nodeFilter) { - return new WebInspector.HeapSnapshotNodesProvider( + return new HeapSnapshotWorker.HeapSnapshotNodesProvider( this, this.classNodesFilter(), this.aggregatesWithFilter(nodeFilter)[className].idxs); } @@ -2092,10 +2092,10 @@ } /** - * @return {!WebInspector.HeapSnapshotCommon.StaticData} + * @return {!Profiler.HeapSnapshotCommon.StaticData} */ updateStaticData() { - return new WebInspector.HeapSnapshotCommon.StaticData( + return new Profiler.HeapSnapshotCommon.StaticData( this.nodeCount, this._rootNodeIndex, this.totalSize, this._maxJsNodeId()); } }; @@ -2134,10 +2134,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotItemProvider = class { +HeapSnapshotWorker.HeapSnapshotItemProvider = class { /** - * @param {!WebInspector.HeapSnapshotItemIterator} iterator - * @param {!WebInspector.HeapSnapshotItemIndexProvider} indexProvider + * @param {!HeapSnapshotWorker.HeapSnapshotItemIterator} iterator + * @param {!HeapSnapshotWorker.HeapSnapshotItemIndexProvider} indexProvider */ constructor(iterator, indexProvider) { this._iterator = iterator; @@ -2168,7 +2168,7 @@ /** * @param {number} begin * @param {number} end - * @return {!WebInspector.HeapSnapshotCommon.ItemsRange} + * @return {!Profiler.HeapSnapshotCommon.ItemsRange} */ serializeItemsRange(begin, end) { this._createIterationOrder(); @@ -2193,7 +2193,7 @@ var item = this._indexProvider.itemForIndex(itemIndex); result[i] = item.serialize(); } - return new WebInspector.HeapSnapshotCommon.ItemsRange(begin, end, this._iterationOrder.length, result); + return new Profiler.HeapSnapshotCommon.ItemsRange(begin, end, this._iterationOrder.length, result); } sortAndRewind(comparator) { @@ -2206,24 +2206,24 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotEdgesProvider = class extends WebInspector.HeapSnapshotItemProvider { +HeapSnapshotWorker.HeapSnapshotEdgesProvider = class extends HeapSnapshotWorker.HeapSnapshotItemProvider { /** - * @param {!WebInspector.HeapSnapshot} snapshot - * @param {?function(!WebInspector.HeapSnapshotEdge):boolean} filter - * @param {!WebInspector.HeapSnapshotEdgeIterator} edgesIter - * @param {!WebInspector.HeapSnapshotItemIndexProvider} indexProvider + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot + * @param {?function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} filter + * @param {!HeapSnapshotWorker.HeapSnapshotEdgeIterator} edgesIter + * @param {!HeapSnapshotWorker.HeapSnapshotItemIndexProvider} indexProvider */ constructor(snapshot, filter, edgesIter, indexProvider) { var iter = filter ? - new WebInspector.HeapSnapshotFilteredIterator( - edgesIter, /** @type {function(!WebInspector.HeapSnapshotItem):boolean} */ (filter)) : + new HeapSnapshotWorker.HeapSnapshotFilteredIterator( + edgesIter, /** @type {function(!HeapSnapshotWorker.HeapSnapshotItem):boolean} */ (filter)) : edgesIter; super(iter, indexProvider); this.snapshot = snapshot; } /** - * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator + * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator * @param {number} leftBound * @param {number} rightBound * @param {number} windowLeft @@ -2305,19 +2305,19 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotNodesProvider = class extends WebInspector.HeapSnapshotItemProvider { +HeapSnapshotWorker.HeapSnapshotNodesProvider = class extends HeapSnapshotWorker.HeapSnapshotItemProvider { /** - * @param {!WebInspector.HeapSnapshot} snapshot - * @param {?function(!WebInspector.HeapSnapshotNode):boolean} filter + * @param {!HeapSnapshotWorker.HeapSnapshot} snapshot + * @param {?function(!HeapSnapshotWorker.HeapSnapshotNode):boolean} filter * @param {(!Array.<number>|!Uint32Array)} nodeIndexes */ constructor(snapshot, filter, nodeIndexes) { - var indexProvider = new WebInspector.HeapSnapshotNodeIndexProvider(snapshot); - var it = new WebInspector.HeapSnapshotIndexRangeIterator(indexProvider, nodeIndexes); + var indexProvider = new HeapSnapshotWorker.HeapSnapshotNodeIndexProvider(snapshot); + var it = new HeapSnapshotWorker.HeapSnapshotIndexRangeIterator(indexProvider, nodeIndexes); if (filter) - it = new WebInspector.HeapSnapshotFilteredIterator( - it, /** @type {function(!WebInspector.HeapSnapshotItem):boolean} */ (filter)); + it = new HeapSnapshotWorker.HeapSnapshotFilteredIterator( + it, /** @type {function(!HeapSnapshotWorker.HeapSnapshotItem):boolean} */ (filter)); super(it, indexProvider); this.snapshot = snapshot; } @@ -2386,7 +2386,7 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator + * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator * @param {number} leftBound * @param {number} rightBound * @param {number} windowLeft
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotLoader.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotLoader.js index b6c707b..a244d2cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotLoader.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotLoader.js
@@ -31,13 +31,13 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotLoader = class { +HeapSnapshotWorker.HeapSnapshotLoader = class { /** - * @param {!WebInspector.HeapSnapshotWorkerDispatcher} dispatcher + * @param {!HeapSnapshotWorker.HeapSnapshotWorkerDispatcher} dispatcher */ constructor(dispatcher) { this._reset(); - this._progress = new WebInspector.HeapSnapshotProgress(dispatcher); + this._progress = new HeapSnapshotWorker.HeapSnapshotProgress(dispatcher); } dispose() { @@ -56,11 +56,11 @@ } /** - * @return {!WebInspector.JSHeapSnapshot} + * @return {!HeapSnapshotWorker.JSHeapSnapshot} */ buildSnapshot() { this._progress.updateStatus('Processing snapshot\u2026'); - var result = new WebInspector.JSHeapSnapshot(this._snapshot, this._progress); + var result = new HeapSnapshotWorker.JSHeapSnapshot(this._snapshot, this._progress); this._reset(); return result; } @@ -129,7 +129,7 @@ this._state = 'parse-snapshot-info'; this._progress.updateStatus('Loading snapshot info\u2026'); this._json = null; // tokenizer takes over input. - this._jsonTokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(this._writeBalancedJSON.bind(this)); + this._jsonTokenizer = new Common.TextUtils.BalancedJSONTokenizer(this._writeBalancedJSON.bind(this)); // Fall through with adjusted payload. chunk = json; }
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorker.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorker.js index 4642dd64..ff785332 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorker.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorker.js
@@ -31,7 +31,7 @@ postMessage(message); } -var dispatcher = new WebInspector.HeapSnapshotWorkerDispatcher(this, postMessageWrapper); +var dispatcher = new HeapSnapshotWorker.HeapSnapshotWorkerDispatcher(this, postMessageWrapper); /** * @param {function(!Event)} listener
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js index 6ace7a8..309c669 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotWorkerDispatcher = class { +HeapSnapshotWorker.HeapSnapshotWorkerDispatcher = class { constructor(globalObject, postMessage) { this._objects = []; this._global = globalObject; @@ -55,7 +55,7 @@ } dispatchMessage(event) { - var data = /** @type {!WebInspector.HeapSnapshotCommon.WorkerCommand } */ (event.data); + var data = /** @type {!Profiler.HeapSnapshotCommon.WorkerCommand } */ (event.data); var response = {callId: data.callId}; try { switch (data.disposition) {
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/JSHeapSnapshot.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/JSHeapSnapshot.js index 5b28330..c4b0e547 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/JSHeapSnapshot.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/JSHeapSnapshot.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.JSHeapSnapshot = class extends WebInspector.HeapSnapshot { +HeapSnapshotWorker.JSHeapSnapshot = class extends HeapSnapshotWorker.HeapSnapshot { /** * @param {!Object} profile - * @param {!WebInspector.HeapSnapshotProgress} progress + * @param {!HeapSnapshotWorker.HeapSnapshotProgress} progress */ constructor(profile, progress) { super(profile, progress); @@ -51,33 +51,33 @@ /** * @override * @param {number=} nodeIndex - * @return {!WebInspector.JSHeapSnapshotNode} + * @return {!HeapSnapshotWorker.JSHeapSnapshotNode} */ createNode(nodeIndex) { - return new WebInspector.JSHeapSnapshotNode(this, nodeIndex === undefined ? -1 : nodeIndex); + return new HeapSnapshotWorker.JSHeapSnapshotNode(this, nodeIndex === undefined ? -1 : nodeIndex); } /** * @override * @param {number} edgeIndex - * @return {!WebInspector.JSHeapSnapshotEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotEdge} */ createEdge(edgeIndex) { - return new WebInspector.JSHeapSnapshotEdge(this, edgeIndex); + return new HeapSnapshotWorker.JSHeapSnapshotEdge(this, edgeIndex); } /** * @override * @param {number} retainerIndex - * @return {!WebInspector.JSHeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotRetainerEdge} */ createRetainingEdge(retainerIndex) { - return new WebInspector.JSHeapSnapshotRetainerEdge(this, retainerIndex); + return new HeapSnapshotWorker.JSHeapSnapshotRetainerEdge(this, retainerIndex); } /** * @override - * @return {?function(!WebInspector.HeapSnapshotNode):boolean} + * @return {?function(!HeapSnapshotWorker.HeapSnapshotNode):boolean} */ classNodesFilter() { var mapAndFlag = this.userObjectsMapAndFlag(); @@ -86,7 +86,7 @@ var map = mapAndFlag.map; var flag = mapAndFlag.flag; /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {boolean} */ function filter(node) { @@ -97,7 +97,7 @@ /** * @override - * @return {function(!WebInspector.HeapSnapshotEdge):boolean} + * @return {function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} */ containmentEdgesFilter() { return edge => !edge.isInvisible(); @@ -105,7 +105,7 @@ /** * @override - * @return {function(!WebInspector.HeapSnapshotEdge):boolean} + * @return {function(!HeapSnapshotWorker.HeapSnapshotEdge):boolean} */ retainingEdgesFilter() { var containmentEdgesFilter = this.containmentEdgesFilter(); @@ -130,8 +130,8 @@ */ calculateDistances() { /** - * @param {!WebInspector.HeapSnapshotNode} node - * @param {!WebInspector.HeapSnapshotEdge} edge + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotEdge} edge * @return {boolean} */ function filter(node, edge) { @@ -164,7 +164,7 @@ /** * @override * @protected - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {boolean} */ isUserRoot(node) { @@ -173,14 +173,14 @@ /** * @override - * @param {function(!WebInspector.HeapSnapshotNode)} action + * @param {function(!HeapSnapshotWorker.HeapSnapshotNode)} action * @param {boolean=} userRootsOnly */ forEachRoot(action, userRootsOnly) { /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @param {string} name - * @return {?WebInspector.HeapSnapshotNode} + * @return {?HeapSnapshotWorker.HeapSnapshotNode} */ function getChildNodeByName(node, name) { for (var iter = node.edges(); iter.hasNext(); iter.next()) { @@ -193,7 +193,7 @@ var visitedNodes = {}; /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node */ function doAction(node) { var ordinal = node.ordinal(); @@ -234,7 +234,7 @@ } /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {number} */ _flagsOfNode(node) { @@ -388,7 +388,7 @@ for (var nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) { var nodeSize = nodes[nodeIndex + nodeSizeOffset]; var ordinal = nodeIndex / nodeFieldCount; - if (distances[ordinal] >= WebInspector.HeapSnapshotCommon.baseSystemDistance) { + if (distances[ordinal] >= Profiler.HeapSnapshotCommon.baseSystemDistance) { sizeSystem += nodeSize; continue; } @@ -403,7 +403,7 @@ else if (node.name() === 'Array') sizeJSArrays += this._calculateArraySize(node); } - this._statistics = new WebInspector.HeapSnapshotCommon.Statistics(); + this._statistics = new Profiler.HeapSnapshotCommon.Statistics(); this._statistics.total = this.totalSize; this._statistics.v8heap = this.totalSize - sizeNative; this._statistics.native = sizeNative; @@ -414,7 +414,7 @@ } /** - * @param {!WebInspector.HeapSnapshotNode} node + * @param {!HeapSnapshotWorker.HeapSnapshotNode} node * @return {number} */ _calculateArraySize(node) { @@ -445,7 +445,7 @@ } /** - * @return {!WebInspector.HeapSnapshotCommon.Statistics} + * @return {!Profiler.HeapSnapshotCommon.Statistics} */ getStatistics() { return this._statistics; @@ -455,9 +455,9 @@ /** * @unrestricted */ -WebInspector.JSHeapSnapshotNode = class extends WebInspector.HeapSnapshotNode { +HeapSnapshotWorker.JSHeapSnapshotNode = class extends HeapSnapshotWorker.HeapSnapshotNode { /** - * @param {!WebInspector.JSHeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.JSHeapSnapshot} snapshot * @param {number=} nodeIndex */ constructor(snapshot, nodeIndex) { @@ -624,7 +624,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotCommon.Node} + * @return {!Profiler.HeapSnapshotCommon.Node} */ serialize() { var result = super.serialize(); @@ -640,9 +640,9 @@ /** * @unrestricted */ -WebInspector.JSHeapSnapshotEdge = class extends WebInspector.HeapSnapshotEdge { +HeapSnapshotWorker.JSHeapSnapshotEdge = class extends HeapSnapshotWorker.HeapSnapshotEdge { /** - * @param {!WebInspector.JSHeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.JSHeapSnapshot} snapshot * @param {number=} edgeIndex */ constructor(snapshot, edgeIndex) { @@ -651,11 +651,11 @@ /** * @override - * @return {!WebInspector.JSHeapSnapshotEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotEdge} */ clone() { - var snapshot = /** @type {!WebInspector.JSHeapSnapshot} */ (this._snapshot); - return new WebInspector.JSHeapSnapshotEdge(snapshot, this.edgeIndex); + var snapshot = /** @type {!HeapSnapshotWorker.JSHeapSnapshot} */ (this._snapshot); + return new HeapSnapshotWorker.JSHeapSnapshotEdge(snapshot, this.edgeIndex); } /** @@ -785,9 +785,9 @@ /** * @unrestricted */ -WebInspector.JSHeapSnapshotRetainerEdge = class extends WebInspector.HeapSnapshotRetainerEdge { +HeapSnapshotWorker.JSHeapSnapshotRetainerEdge = class extends HeapSnapshotWorker.HeapSnapshotRetainerEdge { /** - * @param {!WebInspector.JSHeapSnapshot} snapshot + * @param {!HeapSnapshotWorker.JSHeapSnapshot} snapshot * @param {number} retainerIndex */ constructor(snapshot, retainerIndex) { @@ -796,11 +796,11 @@ /** * @override - * @return {!WebInspector.JSHeapSnapshotRetainerEdge} + * @return {!HeapSnapshotWorker.JSHeapSnapshotRetainerEdge} */ clone() { - var snapshot = /** @type {!WebInspector.JSHeapSnapshot} */ (this._snapshot); - return new WebInspector.JSHeapSnapshotRetainerEdge(snapshot, this.retainerIndex()); + var snapshot = /** @type {!HeapSnapshotWorker.JSHeapSnapshot} */ (this._snapshot); + return new HeapSnapshotWorker.JSHeapSnapshotRetainerEdge(snapshot, this.retainerIndex()); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/module.json b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/module.json index 4934e4f..51358cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/module.json +++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/module.json
@@ -1,7 +1,6 @@ { "scripts": [ "../platform/utilities.js", - "../common/WebInspector.js", "../common/UIString.js", "../common/TextUtils.js", "../profiler/HeapSnapshotCommon.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js index bbf252b..528fda29 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js +++ b/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js
@@ -31,7 +31,7 @@ * @implements {InspectorFrontendHostAPI} * @unrestricted */ -WebInspector.InspectorFrontendHostStub = class { +Host.InspectorFrontendHostStub = class { /** * @suppressGlobalPropertiesCheck */ @@ -41,7 +41,7 @@ */ function stopEventPropagation(event) { // Let browser handle Ctrl+/Ctrl- shortcuts in hosted mode. - var zoomModifier = WebInspector.isMac() ? event.metaKey : event.ctrlKey; + var zoomModifier = Host.isMac() ? event.metaKey : event.ctrlKey; if (zoomModifier && (event.keyCode === 187 || event.keyCode === 189)) event.stopPropagation(); } @@ -135,7 +135,7 @@ * @suppressGlobalPropertiesCheck */ inspectedURLChanged(url) { - document.title = WebInspector.UIString('Developer Tools - %s', url); + document.title = Common.UIString('Developer Tools - %s', url); } /** @@ -143,7 +143,7 @@ * @param {string} text */ copyText(text) { - WebInspector.console.error('Clipboard is not enabled in hosted mode. Please inspect using chrome://inspect'); + Common.console.error('Clipboard is not enabled in hosted mode. Please inspect using chrome://inspect'); } /** @@ -161,7 +161,7 @@ * @param {boolean} forceSaveAs */ save(url, content, forceSaveAs) { - WebInspector.console.error('Saving files is not enabled in hosted mode. Please inspect using chrome://inspect'); + Common.console.error('Saving files is not enabled in hosted mode. Please inspect using chrome://inspect'); this.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.CanceledSaveURL, url); } @@ -171,7 +171,7 @@ * @param {string} content */ append(url, content) { - WebInspector.console.error('Saving files is not enabled in hosted mode. Please inspect using chrome://inspect'); + Common.console.error('Saving files is not enabled in hosted mode. Please inspect using chrome://inspect'); } /** @@ -231,7 +231,7 @@ loadNetworkResource(url, headers, streamId, callback) { Runtime.loadResourcePromise(url) .then(function(text) { - WebInspector.ResourceLoader.streamWrite(streamId, text); + Host.ResourceLoader.streamWrite(streamId, text); callback({statusCode: 200}); }) .catch(function() { @@ -470,7 +470,7 @@ * @param {string} chunk */ streamWrite(id, chunk) { - WebInspector.ResourceLoader.streamWrite(id, chunk); + Host.ResourceLoader.streamWrite(id, chunk); } }; @@ -484,10 +484,10 @@ function initializeInspectorFrontendHost() { if (!InspectorFrontendHost) { // Instantiate stub for web-hosted mode if necessary. - window.InspectorFrontendHost = InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub(); + window.InspectorFrontendHost = InspectorFrontendHost = new Host.InspectorFrontendHostStub(); } else { // Otherwise add stubs for missing methods that are declared in the interface. - var proto = WebInspector.InspectorFrontendHostStub.prototype; + var proto = Host.InspectorFrontendHostStub.prototype; for (var name in proto) { var value = proto[name]; if (typeof value !== 'function' || InspectorFrontendHost[name]) @@ -508,17 +508,17 @@ } // Attach the events object. - InspectorFrontendHost.events = new WebInspector.Object(); + InspectorFrontendHost.events = new Common.Object(); } // FIXME: This file is included into both apps, since the devtools_app needs the InspectorFrontendHostAPI only, // so the host instance should not initialized there. initializeInspectorFrontendHost(); window.InspectorFrontendAPI = new InspectorFrontendAPIImpl(); - WebInspector.setLocalizationPlatform(InspectorFrontendHost.platform()); + Common.setLocalizationPlatform(InspectorFrontendHost.platform()); })(); /** - * @type {!WebInspector.EventTarget} + * @type {!Common.EventTarget} */ InspectorFrontendHost.events;
diff --git a/third_party/WebKit/Source/devtools/front_end/host/Platform.js b/third_party/WebKit/Source/devtools/front_end/host/Platform.js index 0f8a86b..387d989 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/Platform.js +++ b/third_party/WebKit/Source/devtools/front_end/host/Platform.js
@@ -28,77 +28,77 @@ /** * @return {string} */ -WebInspector.platform = function() { - if (!WebInspector._platform) - WebInspector._platform = InspectorFrontendHost.platform(); - return WebInspector._platform; +Host.platform = function() { + if (!Host._platform) + Host._platform = InspectorFrontendHost.platform(); + return Host._platform; }; /** * @return {boolean} */ -WebInspector.isMac = function() { - if (typeof WebInspector._isMac === 'undefined') - WebInspector._isMac = WebInspector.platform() === 'mac'; +Host.isMac = function() { + if (typeof Host._isMac === 'undefined') + Host._isMac = Host.platform() === 'mac'; - return WebInspector._isMac; + return Host._isMac; }; /** * @return {boolean} */ -WebInspector.isWin = function() { - if (typeof WebInspector._isWin === 'undefined') - WebInspector._isWin = WebInspector.platform() === 'windows'; +Host.isWin = function() { + if (typeof Host._isWin === 'undefined') + Host._isWin = Host.platform() === 'windows'; - return WebInspector._isWin; + return Host._isWin; }; /** * @return {boolean} */ -WebInspector.isCustomDevtoolsFrontend = function() { - if (typeof WebInspector._isCustomDevtoolsFronend === 'undefined') - WebInspector._isCustomDevtoolsFronend = window.location.toString().startsWith('chrome-devtools://devtools/custom/'); - return WebInspector._isCustomDevtoolsFronend; +Host.isCustomDevtoolsFrontend = function() { + if (typeof Host._isCustomDevtoolsFronend === 'undefined') + Host._isCustomDevtoolsFronend = window.location.toString().startsWith('chrome-devtools://devtools/custom/'); + return Host._isCustomDevtoolsFronend; }; /** * @return {string} */ -WebInspector.fontFamily = function() { - if (WebInspector._fontFamily) - return WebInspector._fontFamily; - switch (WebInspector.platform()) { +Host.fontFamily = function() { + if (Host._fontFamily) + return Host._fontFamily; + switch (Host.platform()) { case 'linux': - WebInspector._fontFamily = 'Ubuntu, Arial, sans-serif'; + Host._fontFamily = 'Ubuntu, Arial, sans-serif'; break; case 'mac': - WebInspector._fontFamily = '\'Lucida Grande\', sans-serif'; + Host._fontFamily = '\'Lucida Grande\', sans-serif'; break; case 'windows': - WebInspector._fontFamily = '\'Segoe UI\', Tahoma, sans-serif'; + Host._fontFamily = '\'Segoe UI\', Tahoma, sans-serif'; break; } - return WebInspector._fontFamily; + return Host._fontFamily; }; /** * @return {string} */ -WebInspector.monospaceFontFamily = function() { - if (WebInspector._monospaceFontFamily) - return WebInspector._monospaceFontFamily; - switch (WebInspector.platform()) { +Host.monospaceFontFamily = function() { + if (Host._monospaceFontFamily) + return Host._monospaceFontFamily; + switch (Host.platform()) { case 'linux': - WebInspector._monospaceFontFamily = 'dejavu sans mono, monospace'; + Host._monospaceFontFamily = 'dejavu sans mono, monospace'; break; case 'mac': - WebInspector._monospaceFontFamily = 'Menlo, monospace'; + Host._monospaceFontFamily = 'Menlo, monospace'; break; case 'windows': - WebInspector._monospaceFontFamily = 'Consolas, monospace'; + Host._monospaceFontFamily = 'Consolas, monospace'; break; } - return WebInspector._monospaceFontFamily; + return Host._monospaceFontFamily; };
diff --git a/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js b/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js index 309263f92..0cb90e65 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js +++ b/third_party/WebKit/Source/devtools/front_end/host/ResourceLoader.js
@@ -1,35 +1,35 @@ // Copyright (c) 2015 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. -WebInspector.ResourceLoader = {}; +Host.ResourceLoader = {}; -WebInspector.ResourceLoader._lastStreamId = 0; -/** @type {!Object.<number, !WebInspector.OutputStream>} */ -WebInspector.ResourceLoader._boundStreams = {}; +Host.ResourceLoader._lastStreamId = 0; +/** @type {!Object.<number, !Common.OutputStream>} */ +Host.ResourceLoader._boundStreams = {}; /** - * @param {!WebInspector.OutputStream} stream + * @param {!Common.OutputStream} stream * @return {number} */ -WebInspector.ResourceLoader._bindOutputStream = function(stream) { - WebInspector.ResourceLoader._boundStreams[++WebInspector.ResourceLoader._lastStreamId] = stream; - return WebInspector.ResourceLoader._lastStreamId; +Host.ResourceLoader._bindOutputStream = function(stream) { + Host.ResourceLoader._boundStreams[++Host.ResourceLoader._lastStreamId] = stream; + return Host.ResourceLoader._lastStreamId; }; /** * @param {number} id */ -WebInspector.ResourceLoader._discardOutputStream = function(id) { - WebInspector.ResourceLoader._boundStreams[id].close(); - delete WebInspector.ResourceLoader._boundStreams[id]; +Host.ResourceLoader._discardOutputStream = function(id) { + Host.ResourceLoader._boundStreams[id].close(); + delete Host.ResourceLoader._boundStreams[id]; }; /** * @param {number} id * @param {string} chunk */ -WebInspector.ResourceLoader.streamWrite = function(id, chunk) { - WebInspector.ResourceLoader._boundStreams[id].write(chunk); +Host.ResourceLoader.streamWrite = function(id, chunk) { + Host.ResourceLoader._boundStreams[id].write(chunk); }; /** @@ -37,9 +37,9 @@ * @param {?Object.<string, string>} headers * @param {function(number, !Object.<string, string>, string)} callback */ -WebInspector.ResourceLoader.load = function(url, headers, callback) { - var stream = new WebInspector.StringOutputStream(); - WebInspector.ResourceLoader.loadAsStream(url, headers, stream, mycallback); +Host.ResourceLoader.load = function(url, headers, callback) { + var stream = new Common.StringOutputStream(); + Host.ResourceLoader.loadAsStream(url, headers, stream, mycallback); /** * @param {number} statusCode @@ -53,12 +53,12 @@ /** * @param {string} url * @param {?Object.<string, string>} headers - * @param {!WebInspector.OutputStream} stream + * @param {!Common.OutputStream} stream * @param {function(number, !Object.<string, string>)=} callback */ -WebInspector.ResourceLoader.loadAsStream = function(url, headers, stream, callback) { - var streamId = WebInspector.ResourceLoader._bindOutputStream(stream); - var parsedURL = new WebInspector.ParsedURL(url); +Host.ResourceLoader.loadAsStream = function(url, headers, stream, callback) { + var streamId = Host.ResourceLoader._bindOutputStream(stream); + var parsedURL = new Common.ParsedURL(url); if (parsedURL.isDataURL()) { loadXHR(url).then(dataURLDecodeSuccessful).catch(dataURLDecodeFailed); return; @@ -77,14 +77,14 @@ function finishedCallback(response) { if (callback) callback(response.statusCode, response.headers || {}); - WebInspector.ResourceLoader._discardOutputStream(streamId); + Host.ResourceLoader._discardOutputStream(streamId); } /** * @param {string} text */ function dataURLDecodeSuccessful(text) { - WebInspector.ResourceLoader.streamWrite(streamId, text); + Host.ResourceLoader.streamWrite(streamId, text); finishedCallback(/** @type {!InspectorFrontendHostAPI.LoadNetworkResourceResult} */ ({statusCode: 200})); }
diff --git a/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js b/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js index af48f5b..185fc59 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js +++ b/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js
@@ -31,13 +31,13 @@ /** * @unrestricted */ -WebInspector.UserMetrics = class { +Host.UserMetrics = class { /** * @param {string} panelName */ panelShown(panelName) { - var code = WebInspector.UserMetrics._PanelCodes[panelName] || 0; - var size = Object.keys(WebInspector.UserMetrics._PanelCodes).length + 1; + var code = Host.UserMetrics._PanelCodes[panelName] || 0; + var size = Object.keys(Host.UserMetrics._PanelCodes).length + 1; InspectorFrontendHost.recordEnumeratedHistogram('DevTools.PanelShown', code, size); } @@ -49,10 +49,10 @@ } /** - * @param {!WebInspector.UserMetrics.Action} action + * @param {!Host.UserMetrics.Action} action */ actionTaken(action) { - var size = Object.keys(WebInspector.UserMetrics.Action).length + 1; + var size = Object.keys(Host.UserMetrics.Action).length + 1; InspectorFrontendHost.recordEnumeratedHistogram('DevTools.ActionTaken', action, size); } }; @@ -62,7 +62,7 @@ // in order to add more codes. /** @enum {number} */ -WebInspector.UserMetrics.Action = { +Host.UserMetrics.Action = { WindowDocked: 1, WindowUndocked: 2, ScriptsBreakpointSet: 3, @@ -82,7 +82,7 @@ ResizedViewInResponsiveMode: 17 }; -WebInspector.UserMetrics._PanelCodes = { +Host.UserMetrics._PanelCodes = { elements: 1, resources: 2, network: 3, @@ -101,5 +101,5 @@ security: 16 }; -/** @type {!WebInspector.UserMetrics} */ -WebInspector.userMetrics = new WebInspector.UserMetrics(); +/** @type {!Host.UserMetrics} */ +Host.userMetrics = new Host.UserMetrics();
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerDetailsView.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerDetailsView.js index 480a62d..43892b3 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerDetailsView.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerDetailsView.js
@@ -28,31 +28,31 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.LayerView} + * @implements {LayerViewer.LayerView} * @unrestricted */ -WebInspector.LayerDetailsView = class extends WebInspector.Widget { +LayerViewer.LayerDetailsView = class extends UI.Widget { /** - * @param {!WebInspector.LayerViewHost} layerViewHost + * @param {!LayerViewer.LayerViewHost} layerViewHost */ constructor(layerViewHost) { super(true); this.registerRequiredCSS('layer_viewer/layerDetailsView.css'); this._layerViewHost = layerViewHost; this._layerViewHost.registerView(this); - this._emptyWidget = new WebInspector.EmptyWidget(WebInspector.UIString('Select a layer to see its details')); + this._emptyWidget = new UI.EmptyWidget(Common.UIString('Select a layer to see its details')); this._buildContent(); } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ hoverObject(selection) { } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ selectObject(selection) { @@ -62,7 +62,7 @@ } /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree * @override */ setLayerTree(layerTree) { @@ -83,12 +83,12 @@ _onScrollRectClicked(index, event) { if (event.which !== 1) return; - this._layerViewHost.selectObject(new WebInspector.LayerView.ScrollRectSelection(this._selection.layer(), index)); + this._layerViewHost.selectObject(new LayerViewer.LayerView.ScrollRectSelection(this._selection.layer(), index)); } _onPaintProfilerButtonClicked() { - if (this._selection.type() === WebInspector.LayerView.Selection.Type.Snapshot || this._selection.layer()) - this.dispatchEventToListeners(WebInspector.LayerDetailsView.Events.PaintProfilerRequested, this._selection); + if (this._selection.type() === LayerViewer.LayerView.Selection.Type.Snapshot || this._selection.layer()) + this.dispatchEventToListeners(LayerViewer.LayerDetailsView.Events.PaintProfilerRequested, this._selection); } /** @@ -101,8 +101,8 @@ var element = this._scrollRectsCell.createChild('span', 'scroll-rect'); if (this._selection.scrollRectIndex === index) element.classList.add('active'); - element.textContent = WebInspector.UIString( - '%s (%s, %s, %s, %s)', WebInspector.LayerDetailsView._slowScrollRectNames.get(scrollRect.type), + element.textContent = Common.UIString( + '%s (%s, %s, %s, %s)', LayerViewer.LayerDetailsView._slowScrollRectNames.get(scrollRect.type), scrollRect.rect.x, scrollRect.rect.y, scrollRect.rect.width, scrollRect.rect.height); element.addEventListener('click', this._onScrollRectClicked.bind(this, index), false); } @@ -119,15 +119,15 @@ this.contentElement.appendChild(this._tableElement); this.contentElement.appendChild(this._paintProfilerButton); this._sizeCell.textContent = - WebInspector.UIString('%d × %d (at %d,%d)', layer.width(), layer.height(), layer.offsetX(), layer.offsetY()); + Common.UIString('%d × %d (at %d,%d)', layer.width(), layer.height(), layer.offsetX(), layer.offsetY()); this._paintCountCell.parentElement.classList.toggle('hidden', !layer.paintCount()); this._paintCountCell.textContent = layer.paintCount(); this._memoryEstimateCell.textContent = Number.bytesToString(layer.gpuMemoryUsage()); layer.requestCompositingReasons(this._updateCompositingReasons.bind(this)); this._scrollRectsCell.removeChildren(); layer.scrollRects().forEach(this._createScrollRectElement.bind(this)); - var snapshot = this._selection.type() === WebInspector.LayerView.Selection.Type.Snapshot ? - /** @type {!WebInspector.LayerView.SnapshotSelection} */ (this._selection).snapshot() : + var snapshot = this._selection.type() === LayerViewer.LayerView.Selection.Type.Snapshot ? + /** @type {!LayerViewer.LayerView.SnapshotSelection} */ (this._selection).snapshot() : null; this._paintProfilerButton.classList.toggle('hidden', !snapshot); } @@ -135,13 +135,13 @@ _buildContent() { this._tableElement = this.contentElement.createChild('table'); this._tbodyElement = this._tableElement.createChild('tbody'); - this._sizeCell = this._createRow(WebInspector.UIString('Size')); - this._compositingReasonsCell = this._createRow(WebInspector.UIString('Compositing Reasons')); - this._memoryEstimateCell = this._createRow(WebInspector.UIString('Memory estimate')); - this._paintCountCell = this._createRow(WebInspector.UIString('Paint count')); - this._scrollRectsCell = this._createRow(WebInspector.UIString('Slow scroll regions')); + this._sizeCell = this._createRow(Common.UIString('Size')); + this._compositingReasonsCell = this._createRow(Common.UIString('Compositing Reasons')); + this._memoryEstimateCell = this._createRow(Common.UIString('Memory estimate')); + this._paintCountCell = this._createRow(Common.UIString('Paint count')); + this._scrollRectsCell = this._createRow(Common.UIString('Slow scroll regions')); this._paintProfilerButton = this.contentElement.createChild('a', 'hidden link'); - this._paintProfilerButton.textContent = WebInspector.UIString('Paint Profiler'); + this._paintProfilerButton.textContent = Common.UIString('Paint Profiler'); this._paintProfilerButton.addEventListener('click', this._onPaintProfilerButtonClicked.bind(this)); } @@ -166,7 +166,7 @@ this._compositingReasonsCell.removeChildren(); var list = this._compositingReasonsCell.createChild('ul'); for (var i = 0; i < compositingReasons.length; ++i) { - var text = WebInspector.LayerDetailsView.CompositingReasonDetail[compositingReasons[i]] || compositingReasons[i]; + var text = LayerViewer.LayerDetailsView.CompositingReasonDetail[compositingReasons[i]] || compositingReasons[i]; // If the text is more than one word but does not terminate with period, add the period. if (/\s.*[^.]$/.test(text)) text += '.'; @@ -179,65 +179,65 @@ * @enum {string} */ /** @enum {symbol} */ -WebInspector.LayerDetailsView.Events = { +LayerViewer.LayerDetailsView.Events = { PaintProfilerRequested: Symbol('PaintProfilerRequested') }; /** * @type {!Object.<string, string>} */ -WebInspector.LayerDetailsView.CompositingReasonDetail = { - 'transform3D': WebInspector.UIString('Composition due to association with an element with a CSS 3D transform.'), - 'video': WebInspector.UIString('Composition due to association with a <video> element.'), - 'canvas': WebInspector.UIString('Composition due to the element being a <canvas> element.'), - 'plugin': WebInspector.UIString('Composition due to association with a plugin.'), - 'iFrame': WebInspector.UIString('Composition due to association with an <iframe> element.'), - 'backfaceVisibilityHidden': WebInspector.UIString( +LayerViewer.LayerDetailsView.CompositingReasonDetail = { + 'transform3D': Common.UIString('Composition due to association with an element with a CSS 3D transform.'), + 'video': Common.UIString('Composition due to association with a <video> element.'), + 'canvas': Common.UIString('Composition due to the element being a <canvas> element.'), + 'plugin': Common.UIString('Composition due to association with a plugin.'), + 'iFrame': Common.UIString('Composition due to association with an <iframe> element.'), + 'backfaceVisibilityHidden': Common.UIString( 'Composition due to association with an element with a "backface-visibility: hidden" style.'), - 'animation': WebInspector.UIString('Composition due to association with an animated element.'), - 'filters': WebInspector.UIString('Composition due to association with an element with CSS filters applied.'), - 'scrollDependentPosition': WebInspector.UIString( + 'animation': Common.UIString('Composition due to association with an animated element.'), + 'filters': Common.UIString('Composition due to association with an element with CSS filters applied.'), + 'scrollDependentPosition': Common.UIString( 'Composition due to association with an element with a "position: fixed" or "position: sticky" style.'), 'overflowScrollingTouch': - WebInspector.UIString('Composition due to association with an element with a "overflow-scrolling: touch" style.'), + Common.UIString('Composition due to association with an element with a "overflow-scrolling: touch" style.'), 'blending': - WebInspector.UIString('Composition due to association with an element that has blend mode other than "normal".'), - 'assumedOverlap': WebInspector.UIString( + Common.UIString('Composition due to association with an element that has blend mode other than "normal".'), + 'assumedOverlap': Common.UIString( 'Composition due to association with an element that may overlap other composited elements.'), 'overlap': - WebInspector.UIString('Composition due to association with an element overlapping other composited elements.'), - 'negativeZIndexChildren': WebInspector.UIString( + Common.UIString('Composition due to association with an element overlapping other composited elements.'), + 'negativeZIndexChildren': Common.UIString( 'Composition due to association with an element with descendants that have a negative z-index.'), 'transformWithCompositedDescendants': - WebInspector.UIString('Composition due to association with an element with composited descendants.'), - 'opacityWithCompositedDescendants': WebInspector.UIString( + Common.UIString('Composition due to association with an element with composited descendants.'), + 'opacityWithCompositedDescendants': Common.UIString( 'Composition due to association with an element with opacity applied and composited descendants.'), 'maskWithCompositedDescendants': - WebInspector.UIString('Composition due to association with a masked element and composited descendants.'), - 'reflectionWithCompositedDescendants': WebInspector.UIString( + Common.UIString('Composition due to association with a masked element and composited descendants.'), + 'reflectionWithCompositedDescendants': Common.UIString( 'Composition due to association with an element with a reflection and composited descendants.'), - 'filterWithCompositedDescendants': WebInspector.UIString( + 'filterWithCompositedDescendants': Common.UIString( 'Composition due to association with an element with CSS filters applied and composited descendants.'), - 'blendingWithCompositedDescendants': WebInspector.UIString( + 'blendingWithCompositedDescendants': Common.UIString( 'Composition due to association with an element with CSS blending applied and composited descendants.'), 'clipsCompositingDescendants': - WebInspector.UIString('Composition due to association with an element clipping compositing descendants.'), - 'perspective': WebInspector.UIString('Composition due to association with an element with perspective applied.'), - 'preserve3D': WebInspector.UIString( + Common.UIString('Composition due to association with an element clipping compositing descendants.'), + 'perspective': Common.UIString('Composition due to association with an element with perspective applied.'), + 'preserve3D': Common.UIString( 'Composition due to association with an element with a "transform-style: preserve-3d" style.'), - 'root': WebInspector.UIString('Root layer.'), - 'layerForClip': WebInspector.UIString('Layer for clip.'), - 'layerForScrollbar': WebInspector.UIString('Layer for scrollbar.'), - 'layerForScrollingContainer': WebInspector.UIString('Layer for scrolling container.'), - 'layerForForeground': WebInspector.UIString('Layer for foreground.'), - 'layerForBackground': WebInspector.UIString('Layer for background.'), - 'layerForMask': WebInspector.UIString('Layer for mask.'), - 'layerForVideoOverlay': WebInspector.UIString('Layer for video overlay.'), + 'root': Common.UIString('Root layer.'), + 'layerForClip': Common.UIString('Layer for clip.'), + 'layerForScrollbar': Common.UIString('Layer for scrollbar.'), + 'layerForScrollingContainer': Common.UIString('Layer for scrolling container.'), + 'layerForForeground': Common.UIString('Layer for foreground.'), + 'layerForBackground': Common.UIString('Layer for background.'), + 'layerForMask': Common.UIString('Layer for mask.'), + 'layerForVideoOverlay': Common.UIString('Layer for video overlay.'), }; -WebInspector.LayerDetailsView._slowScrollRectNames = new Map([ - [WebInspector.Layer.ScrollRectType.NonFastScrollable, WebInspector.UIString('Non fast scrollable')], - [WebInspector.Layer.ScrollRectType.TouchEventHandler, WebInspector.UIString('Touch event handler')], - [WebInspector.Layer.ScrollRectType.WheelEventHandler, WebInspector.UIString('Wheel event handler')], - [WebInspector.Layer.ScrollRectType.RepaintsOnScroll, WebInspector.UIString('Repaints on scroll')] +LayerViewer.LayerDetailsView._slowScrollRectNames = new Map([ + [SDK.Layer.ScrollRectType.NonFastScrollable, Common.UIString('Non fast scrollable')], + [SDK.Layer.ScrollRectType.TouchEventHandler, Common.UIString('Touch event handler')], + [SDK.Layer.ScrollRectType.WheelEventHandler, Common.UIString('Wheel event handler')], + [SDK.Layer.ScrollRectType.RepaintsOnScroll, Common.UIString('Repaints on scroll')] ]);
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerTreeOutline.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerTreeOutline.js index eb66dbc..eefff7a 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerTreeOutline.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerTreeOutline.js
@@ -28,12 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.LayerView} + * @implements {LayerViewer.LayerView} * @unrestricted */ -WebInspector.LayerTreeOutline = class extends WebInspector.Object { +LayerViewer.LayerTreeOutline = class extends Common.Object { /** - * @param {!WebInspector.LayerViewHost} layerViewHost + * @param {!LayerViewer.LayerViewHost} layerViewHost */ constructor(layerViewHost) { super(); @@ -56,13 +56,13 @@ } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ selectObject(selection) { this.hoverObject(null); var layer = selection && selection.layer(); - var node = layer && layer[WebInspector.LayerTreeElement._symbol]; + var node = layer && layer[LayerViewer.LayerTreeElement._symbol]; if (node) node.revealAndSelect(true); else if (this._treeOutline.selectedTreeElement) @@ -70,12 +70,12 @@ } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ hoverObject(selection) { var layer = selection && selection.layer(); - var node = layer && layer[WebInspector.LayerTreeElement._symbol]; + var node = layer && layer[LayerViewer.LayerTreeElement._symbol]; if (node === this._lastHoveredNode) return; if (this._lastHoveredNode) @@ -86,7 +86,7 @@ } /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree * @override */ setLayerTree(layerTree) { @@ -106,8 +106,8 @@ } /** - * @param {!WebInspector.Layer} layer - * @this {WebInspector.LayerTreeOutline} + * @param {!SDK.Layer} layer + * @this {LayerViewer.LayerTreeOutline} */ function updateLayer(layer) { if (!layer.drawsContent() && !showInternalLayers) @@ -115,19 +115,19 @@ if (seenLayers.get(layer)) console.assert(false, 'Duplicate layer: ' + layer.id()); seenLayers.set(layer, true); - var node = layer[WebInspector.LayerTreeElement._symbol]; + var node = layer[LayerViewer.LayerTreeElement._symbol]; var parentLayer = layer.parent(); // Skip till nearest visible ancestor. while (parentLayer && parentLayer !== root && !parentLayer.drawsContent() && !showInternalLayers) parentLayer = parentLayer.parent(); var parent = - layer === root ? this._treeOutline.rootElement() : parentLayer[WebInspector.LayerTreeElement._symbol]; + layer === root ? this._treeOutline.rootElement() : parentLayer[LayerViewer.LayerTreeElement._symbol]; if (!parent) { console.assert(false, 'Parent is not in the tree'); return; } if (!node) { - node = new WebInspector.LayerTreeElement(this, layer); + node = new LayerViewer.LayerTreeElement(this, layer); parent.appendChild(node); // Expand all new non-content layers to expose content layers better. if (!layer.drawsContent()) @@ -162,7 +162,7 @@ if (!this._treeOutline.selectedTreeElement) { var elementToSelect = this._layerTree.contentRoot() || this._layerTree.root(); if (elementToSelect) - elementToSelect[WebInspector.LayerTreeElement._symbol].revealAndSelect(true); + elementToSelect[LayerViewer.LayerTreeElement._symbol].revealAndSelect(true); } } @@ -177,7 +177,7 @@ } /** - * @param {!WebInspector.LayerTreeElement} node + * @param {!LayerViewer.LayerTreeElement} node */ _selectedNodeChanged(node) { this._layerViewHost.selectObject(this._selectionForNode(node)); @@ -188,41 +188,41 @@ */ _onContextMenu(event) { var selection = this._selectionForNode(this._treeOutline.treeElementFromEvent(event)); - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); this._layerViewHost.showContextMenu(contextMenu, selection); } /** * @param {?TreeElement} node - * @return {?WebInspector.LayerView.Selection} + * @return {?LayerViewer.LayerView.Selection} */ _selectionForNode(node) { - return node && node._layer ? new WebInspector.LayerView.LayerSelection(node._layer) : null; + return node && node._layer ? new LayerViewer.LayerView.LayerSelection(node._layer) : null; } }; /** * @unrestricted */ -WebInspector.LayerTreeElement = class extends TreeElement { +LayerViewer.LayerTreeElement = class extends TreeElement { /** - * @param {!WebInspector.LayerTreeOutline} tree - * @param {!WebInspector.Layer} layer + * @param {!LayerViewer.LayerTreeOutline} tree + * @param {!SDK.Layer} layer */ constructor(tree, layer) { super(); this._treeOutline = tree; this._layer = layer; - this._layer[WebInspector.LayerTreeElement._symbol] = this; + this._layer[LayerViewer.LayerTreeElement._symbol] = this; this._update(); } _update() { var node = this._layer.nodeForSelfOrAncestor(); var title = createDocumentFragment(); - title.createTextChild(node ? WebInspector.DOMPresentationUtils.simpleSelector(node) : '#' + this._layer.id()); + title.createTextChild(node ? Components.DOMPresentationUtils.simpleSelector(node) : '#' + this._layer.id()); var details = title.createChild('span', 'dimmed'); - details.textContent = WebInspector.UIString(' (%d × %d)', this._layer.width(), this._layer.height()); + details.textContent = Common.UIString(' (%d × %d)', this._layer.width(), this._layer.height()); this.title = title; } @@ -243,4 +243,4 @@ } }; -WebInspector.LayerTreeElement._symbol = Symbol('layer'); +LayerViewer.LayerTreeElement._symbol = Symbol('layer');
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerViewHost.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerViewHost.js index 2f63e60..73f00e1 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerViewHost.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/LayerViewHost.js
@@ -6,21 +6,21 @@ /** * @interface */ -WebInspector.LayerView = function() {}; +LayerViewer.LayerView = function() {}; -WebInspector.LayerView.prototype = { +LayerViewer.LayerView.prototype = { /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection */ hoverObject: function(selection) {}, /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection */ selectObject: function(selection) {}, /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree */ setLayerTree: function(layerTree) {} }; @@ -28,10 +28,10 @@ /** * @unrestricted */ -WebInspector.LayerView.Selection = class { +LayerViewer.LayerView.Selection = class { /** - * @param {!WebInspector.LayerView.Selection.Type} type - * @param {!WebInspector.Layer} layer + * @param {!LayerViewer.LayerView.Selection.Type} type + * @param {!SDK.Layer} layer */ constructor(type, layer) { this._type = type; @@ -39,8 +39,8 @@ } /** - * @param {?WebInspector.LayerView.Selection} a - * @param {?WebInspector.LayerView.Selection} b + * @param {?LayerViewer.LayerView.Selection} a + * @param {?LayerViewer.LayerView.Selection} b * @return {boolean} */ static isEqual(a, b) { @@ -48,21 +48,21 @@ } /** - * @return {!WebInspector.LayerView.Selection.Type} + * @return {!LayerViewer.LayerView.Selection.Type} */ type() { return this._type; } /** - * @return {!WebInspector.Layer} + * @return {!SDK.Layer} */ layer() { return this._layer; } /** - * @param {!WebInspector.LayerView.Selection} other + * @param {!LayerViewer.LayerView.Selection} other * @return {boolean} */ _isEqual(other) { @@ -73,7 +73,7 @@ /** * @enum {symbol} */ -WebInspector.LayerView.Selection.Type = { +LayerViewer.LayerView.Selection.Type = { Layer: Symbol('Layer'), ScrollRect: Symbol('ScrollRect'), Snapshot: Symbol('Snapshot') @@ -83,45 +83,45 @@ /** * @unrestricted */ -WebInspector.LayerView.LayerSelection = class extends WebInspector.LayerView.Selection { +LayerViewer.LayerView.LayerSelection = class extends LayerViewer.LayerView.Selection { /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ constructor(layer) { console.assert(layer, 'LayerSelection with empty layer'); - super(WebInspector.LayerView.Selection.Type.Layer, layer); + super(LayerViewer.LayerView.Selection.Type.Layer, layer); } /** * @override - * @param {!WebInspector.LayerView.Selection} other + * @param {!LayerViewer.LayerView.Selection} other * @return {boolean} */ _isEqual(other) { - return other._type === WebInspector.LayerView.Selection.Type.Layer && other.layer().id() === this.layer().id(); + return other._type === LayerViewer.LayerView.Selection.Type.Layer && other.layer().id() === this.layer().id(); } }; /** * @unrestricted */ -WebInspector.LayerView.ScrollRectSelection = class extends WebInspector.LayerView.Selection { +LayerViewer.LayerView.ScrollRectSelection = class extends LayerViewer.LayerView.Selection { /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @param {number} scrollRectIndex */ constructor(layer, scrollRectIndex) { - super(WebInspector.LayerView.Selection.Type.ScrollRect, layer); + super(LayerViewer.LayerView.Selection.Type.ScrollRect, layer); this.scrollRectIndex = scrollRectIndex; } /** * @override - * @param {!WebInspector.LayerView.Selection} other + * @param {!LayerViewer.LayerView.Selection} other * @return {boolean} */ _isEqual(other) { - return other._type === WebInspector.LayerView.Selection.Type.ScrollRect && + return other._type === LayerViewer.LayerView.Selection.Type.ScrollRect && this.layer().id() === other.layer().id() && this.scrollRectIndex === other.scrollRectIndex; } }; @@ -129,28 +129,28 @@ /** * @unrestricted */ -WebInspector.LayerView.SnapshotSelection = class extends WebInspector.LayerView.Selection { +LayerViewer.LayerView.SnapshotSelection = class extends LayerViewer.LayerView.Selection { /** - * @param {!WebInspector.Layer} layer - * @param {!WebInspector.SnapshotWithRect} snapshot + * @param {!SDK.Layer} layer + * @param {!SDK.SnapshotWithRect} snapshot */ constructor(layer, snapshot) { - super(WebInspector.LayerView.Selection.Type.Snapshot, layer); + super(LayerViewer.LayerView.Selection.Type.Snapshot, layer); this._snapshot = snapshot; } /** * @override - * @param {!WebInspector.LayerView.Selection} other + * @param {!LayerViewer.LayerView.Selection} other * @return {boolean} */ _isEqual(other) { - return other._type === WebInspector.LayerView.Selection.Type.Snapshot && this.layer().id() === other.layer().id() && + return other._type === LayerViewer.LayerView.Selection.Type.Snapshot && this.layer().id() === other.layer().id() && this._snapshot === other._snapshot; } /** - * @return {!WebInspector.SnapshotWithRect} + * @return {!SDK.SnapshotWithRect} */ snapshot() { return this._snapshot; @@ -160,24 +160,24 @@ /** * @unrestricted */ -WebInspector.LayerViewHost = class { +LayerViewer.LayerViewHost = class { constructor() { - /** @type {!Array.<!WebInspector.LayerView>} */ + /** @type {!Array.<!LayerViewer.LayerView>} */ this._views = []; this._selectedObject = null; this._hoveredObject = null; - this._showInternalLayersSetting = WebInspector.settings.createSetting('layersShowInternalLayers', false); + this._showInternalLayersSetting = Common.settings.createSetting('layersShowInternalLayers', false); } /** - * @param {!WebInspector.LayerView} layerView + * @param {!LayerViewer.LayerView} layerView */ registerView(layerView) { this._views.push(layerView); } /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree */ setLayerTree(layerTree) { this._target = layerTree.target(); @@ -192,10 +192,10 @@ } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection */ hoverObject(selection) { - if (WebInspector.LayerView.Selection.isEqual(this._hoveredObject, selection)) + if (LayerViewer.LayerView.Selection.isEqual(this._hoveredObject, selection)) return; this._hoveredObject = selection; var layer = selection && selection.layer(); @@ -205,10 +205,10 @@ } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection */ selectObject(selection) { - if (WebInspector.LayerView.Selection.isEqual(this._selectedObject, selection)) + if (LayerViewer.LayerView.Selection.isEqual(this._selectedObject, selection)) return; this._selectedObject = selection; for (var view of this._views) @@ -216,19 +216,19 @@ } /** - * @return {?WebInspector.LayerView.Selection} + * @return {?LayerViewer.LayerView.Selection} */ selection() { return this._selectedObject; } /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {?WebInspector.LayerView.Selection} selection + * @param {!UI.ContextMenu} contextMenu + * @param {?LayerViewer.LayerView.Selection} selection */ showContextMenu(contextMenu, selection) { contextMenu.appendCheckboxItem( - WebInspector.UIString('Show internal layers'), this._toggleShowInternalLayers.bind(this), + Common.UIString('Show internal layers'), this._toggleShowInternalLayers.bind(this), this._showInternalLayersSetting.get()); var node = selection && selection.layer() && selection.layer().nodeForSelfOrAncestor(); if (node) @@ -237,7 +237,7 @@ } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ showInternalLayersSetting() { return this._showInternalLayersSetting; @@ -248,13 +248,13 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ _toggleNodeHighlight(node) { if (node) { node.highlightForTwoSeconds(); return; } - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/Layers3DView.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/Layers3DView.js index 64ecbcc..fd7610d 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/Layers3DView.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/Layers3DView.js
@@ -28,27 +28,27 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.LayerView} + * @implements {LayerViewer.LayerView} * @unrestricted */ -WebInspector.Layers3DView = class extends WebInspector.VBox { +LayerViewer.Layers3DView = class extends UI.VBox { /** - * @param {!WebInspector.LayerViewHost} layerViewHost + * @param {!LayerViewer.LayerViewHost} layerViewHost */ constructor(layerViewHost) { super(true); this.registerRequiredCSS('layer_viewer/layers3DView.css'); this.contentElement.classList.add('layers-3d-view'); - this._failBanner = new WebInspector.VBox(); + this._failBanner = new UI.VBox(); this._failBanner.element.classList.add('full-widget-dimmed-banner'); - this._failBanner.element.createTextChild(WebInspector.UIString('Layer information is not yet available.')); + this._failBanner.element.createTextChild(Common.UIString('Layer information is not yet available.')); this._layerViewHost = layerViewHost; this._layerViewHost.registerView(this); - this._transformController = new WebInspector.TransformController(this.contentElement); + this._transformController = new LayerViewer.TransformController(this.contentElement); this._transformController.addEventListener( - WebInspector.TransformController.Events.TransformChanged, this._update, this); + LayerViewer.TransformController.Events.TransformChanged, this._update, this); this._initToolbar(); this._canvasElement = this.contentElement.createChild('canvas'); @@ -63,7 +63,7 @@ this._lastSelection = {}; this._layerTree = null; - this._textureManager = new WebInspector.LayerTextureManager(this._update.bind(this)); + this._textureManager = new LayerViewer.LayerTextureManager(this._update.bind(this)); /** @type Array.<!WebGLTexture|undefined> */ this._chromeTextures = []; @@ -73,7 +73,7 @@ } /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree * @override */ setLayerTree(layerTree) { @@ -86,7 +86,7 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @param {string=} imageURL */ showImageForLayer(layer, imageURL) { @@ -95,8 +95,8 @@ this._update(); return; } - WebInspector.loadImage(imageURL).then(image => { - var texture = image && WebInspector.LayerTextureManager._createTextureForImage(this._gl, image); + UI.loadImage(imageURL).then(image => { + var texture = image && LayerViewer.LayerTextureManager._createTextureForImage(this._gl, image); this._layerTexture = texture ? {layer: layer, texture: texture} : null; this._update(); }); @@ -129,15 +129,15 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ updateLayerSnapshot(layer) { this._textureManager.layerNeedsUpdate(layer); } /** - * @param {!WebInspector.Layers3DView.OutlineType} type - * @param {?WebInspector.LayerView.Selection} selection + * @param {!LayerViewer.Layers3DView.OutlineType} type + * @param {?LayerViewer.LayerView.Selection} selection */ _setOutline(type, selection) { this._lastSelection[type] = selection; @@ -145,38 +145,38 @@ } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ hoverObject(selection) { - this._setOutline(WebInspector.Layers3DView.OutlineType.Hovered, selection); + this._setOutline(LayerViewer.Layers3DView.OutlineType.Hovered, selection); } /** - * @param {?WebInspector.LayerView.Selection} selection + * @param {?LayerViewer.LayerView.Selection} selection * @override */ selectObject(selection) { - this._setOutline(WebInspector.Layers3DView.OutlineType.Hovered, null); - this._setOutline(WebInspector.Layers3DView.OutlineType.Selected, selection); + this._setOutline(LayerViewer.Layers3DView.OutlineType.Hovered, null); + this._setOutline(LayerViewer.Layers3DView.OutlineType.Selected, selection); } /** - * @param {!WebInspector.LayerView.Selection} selection - * @return {!Promise<?WebInspector.SnapshotWithRect>} + * @param {!LayerViewer.LayerView.Selection} selection + * @return {!Promise<?SDK.SnapshotWithRect>} */ snapshotForSelection(selection) { - if (selection.type() === WebInspector.LayerView.Selection.Type.Snapshot) { - var snapshotWithRect = /** @type {!WebInspector.LayerView.SnapshotSelection} */ (selection).snapshot(); + if (selection.type() === LayerViewer.LayerView.Selection.Type.Snapshot) { + var snapshotWithRect = /** @type {!LayerViewer.LayerView.SnapshotSelection} */ (selection).snapshot(); snapshotWithRect.snapshot.addReference(); - return /** @type {!Promise<?WebInspector.SnapshotWithRect>} */ (Promise.resolve(snapshotWithRect)); + return /** @type {!Promise<?SDK.SnapshotWithRect>} */ (Promise.resolve(snapshotWithRect)); } if (selection.layer()) { var promise = selection.layer().snapshots()[0]; if (promise) return promise; } - return /** @type {!Promise<?WebInspector.SnapshotWithRect>} */ (Promise.resolve(null)); + return /** @type {!Promise<?SDK.SnapshotWithRect>} */ (Promise.resolve(null)); } /** @@ -207,8 +207,8 @@ _initShaders() { this._shaderProgram = this._gl.createProgram(); - this._createShader(this._gl.FRAGMENT_SHADER, WebInspector.Layers3DView.FragmentShader); - this._createShader(this._gl.VERTEX_SHADER, WebInspector.Layers3DView.VertexShader); + this._createShader(this._gl.FRAGMENT_SHADER, LayerViewer.Layers3DView.FragmentShader); + this._createShader(this._gl.VERTEX_SHADER, LayerViewer.Layers3DView.VertexShader); this._gl.linkProgram(this._shaderProgram); this._gl.useProgram(this._shaderProgram); @@ -255,7 +255,7 @@ if (textureScale !== this._oldTextureScale) { this._oldTextureScale = textureScale; this._textureManager.setScale(textureScale); - this.dispatchEventToListeners(WebInspector.Layers3DView.Events.ScaleChanged, textureScale); + this.dispatchEventToListeners(LayerViewer.Layers3DView.Events.ScaleChanged, textureScale); } var scaleAndRotationMatrix = new WebKitCSSMatrix() .scale(scale, scale, scale) @@ -267,7 +267,7 @@ var bounds; for (var i = 0; i < this._rects.length; ++i) bounds = - WebInspector.Geometry.boundsForTransformedPoints(scaleAndRotationMatrix, this._rects[i].vertices, bounds); + Common.Geometry.boundsForTransformedPoints(scaleAndRotationMatrix, this._rects[i].vertices, bounds); this._transformController.clampOffsets( (paddingX - bounds.maxX) / window.devicePixelRatio, @@ -307,19 +307,19 @@ _initChromeTextures() { /** - * @this {WebInspector.Layers3DView} - * @param {!WebInspector.Layers3DView.ChromeTexture} index + * @this {LayerViewer.Layers3DView} + * @param {!LayerViewer.Layers3DView.ChromeTexture} index * @param {string} url */ function loadChromeTexture(index, url) { - WebInspector.loadImage(url).then(image => { + UI.loadImage(url).then(image => { this._chromeTextures[index] = - image && WebInspector.LayerTextureManager._createTextureForImage(this._gl, image) || undefined; + image && LayerViewer.LayerTextureManager._createTextureForImage(this._gl, image) || undefined; }); } - loadChromeTexture.call(this, WebInspector.Layers3DView.ChromeTexture.Left, 'Images/chromeLeft.png'); - loadChromeTexture.call(this, WebInspector.Layers3DView.ChromeTexture.Middle, 'Images/chromeMiddle.png'); - loadChromeTexture.call(this, WebInspector.Layers3DView.ChromeTexture.Right, 'Images/chromeRight.png'); + loadChromeTexture.call(this, LayerViewer.Layers3DView.ChromeTexture.Left, 'Images/chromeLeft.png'); + loadChromeTexture.call(this, LayerViewer.Layers3DView.ChromeTexture.Middle, 'Images/chromeMiddle.png'); + loadChromeTexture.call(this, LayerViewer.Layers3DView.ChromeTexture.Right, 'Images/chromeRight.png'); } /** @@ -345,7 +345,7 @@ var root = showInternalLayers ? this._layerTree.root() : (this._layerTree.contentRoot() || this._layerTree.root()); var queue = [root]; this._depthByLayerId[root.id()] = 0; - /** @type {!Set<!WebInspector.Layer>} */ + /** @type {!Set<!SDK.Layer>} */ this._visibleLayers = new Set(); while (queue.length > 0) { var layer = queue.shift(); @@ -361,24 +361,24 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @return {number} */ _depthForLayer(layer) { - return this._depthByLayerId[layer.id()] * WebInspector.Layers3DView.LayerSpacing; + return this._depthByLayerId[layer.id()] * LayerViewer.Layers3DView.LayerSpacing; } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @param {number} index * @return {number} */ _calculateScrollRectDepth(layer, index) { - return this._depthForLayer(layer) + index * WebInspector.Layers3DView.ScrollRectSpacing + 1; + return this._depthForLayer(layer) + index * LayerViewer.Layers3DView.ScrollRectSpacing + 1; } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ _updateDimensionsForAutoscale(layer) { // We don't want to be precise, but rather pick something least affected by @@ -390,60 +390,60 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ _calculateLayerRect(layer) { if (!this._visibleLayers.has(layer)) return; - var selection = new WebInspector.LayerView.LayerSelection(layer); - var rect = new WebInspector.Layers3DView.Rectangle(selection); + var selection = new LayerViewer.LayerView.LayerSelection(layer); + var rect = new LayerViewer.Layers3DView.Rectangle(selection); rect.setVertices(layer.quad(), this._depthForLayer(layer)); this._appendRect(rect); this._updateDimensionsForAutoscale(layer); } /** - * @param {!WebInspector.Layers3DView.Rectangle} rect + * @param {!LayerViewer.Layers3DView.Rectangle} rect */ _appendRect(rect) { var selection = rect.relatedObject; - var isSelected = WebInspector.LayerView.Selection.isEqual( - this._lastSelection[WebInspector.Layers3DView.OutlineType.Selected], selection); - var isHovered = WebInspector.LayerView.Selection.isEqual( - this._lastSelection[WebInspector.Layers3DView.OutlineType.Hovered], selection); + var isSelected = LayerViewer.LayerView.Selection.isEqual( + this._lastSelection[LayerViewer.Layers3DView.OutlineType.Selected], selection); + var isHovered = LayerViewer.LayerView.Selection.isEqual( + this._lastSelection[LayerViewer.Layers3DView.OutlineType.Hovered], selection); if (isSelected) { - rect.borderColor = WebInspector.Layers3DView.SelectedBorderColor; + rect.borderColor = LayerViewer.Layers3DView.SelectedBorderColor; } else if (isHovered) { - rect.borderColor = WebInspector.Layers3DView.HoveredBorderColor; + rect.borderColor = LayerViewer.Layers3DView.HoveredBorderColor; var fillColor = rect.fillColor || [255, 255, 255, 1]; - var maskColor = WebInspector.Layers3DView.HoveredImageMaskColor; + var maskColor = LayerViewer.Layers3DView.HoveredImageMaskColor; rect.fillColor = [ fillColor[0] * maskColor[0] / 255, fillColor[1] * maskColor[1] / 255, fillColor[2] * maskColor[2] / 255, fillColor[3] * maskColor[3] ]; } else { - rect.borderColor = WebInspector.Layers3DView.BorderColor; + rect.borderColor = LayerViewer.Layers3DView.BorderColor; } - rect.lineWidth = isSelected ? WebInspector.Layers3DView.SelectedBorderWidth : WebInspector.Layers3DView.BorderWidth; + rect.lineWidth = isSelected ? LayerViewer.Layers3DView.SelectedBorderWidth : LayerViewer.Layers3DView.BorderWidth; this._rects.push(rect); } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ _calculateLayerScrollRects(layer) { var scrollRects = layer.scrollRects(); for (var i = 0; i < scrollRects.length; ++i) { - var selection = new WebInspector.LayerView.ScrollRectSelection(layer, i); - var rect = new WebInspector.Layers3DView.Rectangle(selection); + var selection = new LayerViewer.LayerView.ScrollRectSelection(layer, i); + var rect = new LayerViewer.Layers3DView.Rectangle(selection); rect.calculateVerticesFromRect(layer, scrollRects[i].rect, this._calculateScrollRectDepth(layer, i)); - rect.fillColor = WebInspector.Layers3DView.ScrollRectBackgroundColor; + rect.fillColor = LayerViewer.Layers3DView.ScrollRectBackgroundColor; this._appendRect(rect); } } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ _calculateLayerTileRects(layer) { var tiles = this._textureManager.tilesForLayer(layer); @@ -451,8 +451,8 @@ var tile = tiles[i]; if (!tile.texture) continue; - var selection = new WebInspector.LayerView.SnapshotSelection(layer, {rect: tile.rect, snapshot: tile.snapshot}); - var rect = new WebInspector.Layers3DView.Rectangle(selection); + var selection = new LayerViewer.LayerView.SnapshotSelection(layer, {rect: tile.rect, snapshot: tile.snapshot}); + var rect = new LayerViewer.Layers3DView.Rectangle(selection); rect.calculateVerticesFromRect(layer, tile.rect, this._depthForLayer(layer) + 1); rect.texture = tile.texture; this._appendRect(rect); @@ -469,8 +469,8 @@ if (this._layerTexture && this._visibleLayers.has(this._layerTexture.layer)) { var layer = this._layerTexture.layer; - var selection = new WebInspector.LayerView.LayerSelection(layer); - var rect = new WebInspector.Layers3DView.Rectangle(selection); + var selection = new LayerViewer.LayerView.LayerSelection(layer); + var rect = new LayerViewer.Layers3DView.Rectangle(selection); rect.setVertices(layer.quad(), this._depthForLayer(layer)); rect.texture = this._layerTexture.texture; this._appendRect(rect); @@ -544,19 +544,19 @@ if (!viewport) return; - var drawChrome = !WebInspector.moduleSetting('frameViewerHideChromeWindow').get() && + var drawChrome = !Common.moduleSetting('frameViewerHideChromeWindow').get() && this._chromeTextures.length >= 3 && this._chromeTextures.indexOf(undefined) < 0; - var z = (this._maxDepth + 1) * WebInspector.Layers3DView.LayerSpacing; - var borderWidth = Math.ceil(WebInspector.Layers3DView.ViewportBorderWidth * this._scale); + var z = (this._maxDepth + 1) * LayerViewer.Layers3DView.LayerSpacing; + var borderWidth = Math.ceil(LayerViewer.Layers3DView.ViewportBorderWidth * this._scale); var vertices = [viewport.width, 0, z, viewport.width, viewport.height, z, 0, viewport.height, z, 0, 0, z]; this._gl.lineWidth(borderWidth); this._drawRectangle( - vertices, drawChrome ? this._gl.LINE_STRIP : this._gl.LINE_LOOP, WebInspector.Layers3DView.ViewportBorderColor); + vertices, drawChrome ? this._gl.LINE_STRIP : this._gl.LINE_LOOP, LayerViewer.Layers3DView.ViewportBorderColor); if (!drawChrome) return; - var borderAdjustment = WebInspector.Layers3DView.ViewportBorderWidth / 2; + var borderAdjustment = LayerViewer.Layers3DView.ViewportBorderWidth / 2; var viewportWidth = this._layerTree.viewportSize().width + 2 * borderAdjustment; var chromeHeight = this._chromeTextures[0].image.naturalHeight; var middleFragmentWidth = @@ -564,7 +564,7 @@ var x = -borderAdjustment; var y = -chromeHeight; for (var i = 0; i < this._chromeTextures.length; ++i) { - var width = i === WebInspector.Layers3DView.ChromeTexture.Middle ? middleFragmentWidth : + var width = i === LayerViewer.Layers3DView.ChromeTexture.Middle ? middleFragmentWidth : this._chromeTextures[i].image.naturalWidth; if (width < 0 || x + width > viewportWidth) break; @@ -575,7 +575,7 @@ } /** - * @param {!WebInspector.Layers3DView.Rectangle} rect + * @param {!LayerViewer.Layers3DView.Rectangle} rect */ _drawViewRect(rect) { var vertices = rect.vertices; @@ -624,16 +624,16 @@ */ _webglDisabledBanner() { var fragment = this.contentElement.ownerDocument.createDocumentFragment(); - fragment.createChild('div').textContent = WebInspector.UIString('Can\'t display layers,'); - fragment.createChild('div').textContent = WebInspector.UIString('WebGL support is disabled in your browser.'); - fragment.appendChild(WebInspector.formatLocalized( - 'Check %s for possible reasons.', [WebInspector.linkifyURLAsNode('about:gpu', undefined, undefined, true)])); + fragment.createChild('div').textContent = Common.UIString('Can\'t display layers,'); + fragment.createChild('div').textContent = Common.UIString('WebGL support is disabled in your browser.'); + fragment.appendChild(UI.formatLocalized( + 'Check %s for possible reasons.', [UI.linkifyURLAsNode('about:gpu', undefined, undefined, true)])); return fragment; } /** * @param {!Event} event - * @return {?WebInspector.LayerView.Selection} + * @return {?LayerViewer.LayerView.Selection} */ _selectionFromEventPoint(event) { if (!this._layerTree) @@ -645,7 +645,7 @@ var y0 = -(event.clientY - this._canvasElement.totalOffsetTop()) * window.devicePixelRatio; /** - * @param {!WebInspector.Layers3DView.Rectangle} rect + * @param {!LayerViewer.Layers3DView.Rectangle} rect */ function checkIntersection(rect) { if (!rect.relatedObject) @@ -665,14 +665,14 @@ * @param {string} caption * @param {string} name * @param {boolean} value - * @param {!WebInspector.Toolbar} toolbar - * @return {!WebInspector.Setting} + * @param {!UI.Toolbar} toolbar + * @return {!Common.Setting} */ _createVisibilitySetting(caption, name, value, toolbar) { - var checkbox = new WebInspector.ToolbarCheckbox(WebInspector.UIString(caption)); + var checkbox = new UI.ToolbarCheckbox(Common.UIString(caption)); toolbar.appendToolbarItem(checkbox); - var setting = WebInspector.settings.createSetting(name, value); - WebInspector.SettingsUI.bindCheckbox(checkbox.inputElement, setting); + var setting = Common.settings.createSetting(name, value); + UI.SettingsUI.bindCheckbox(checkbox.inputElement, setting); setting.addChangeListener(this._update, this); return setting; } @@ -685,23 +685,23 @@ this._showPaintsSetting = this._createVisibilitySetting('Paints', 'frameViewerShowPaints', true, this._panelToolbar); this._showPaintsSetting.addChangeListener(this._updatePaints, this); - WebInspector.moduleSetting('frameViewerHideChromeWindow').addChangeListener(this._update, this); + Common.moduleSetting('frameViewerHideChromeWindow').addChangeListener(this._update, this); } /** * @param {!Event} event */ _onContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendItem( - WebInspector.UIString('Reset View'), this._transformController.resetAndNotify.bind(this._transformController), + Common.UIString('Reset View'), this._transformController.resetAndNotify.bind(this._transformController), false); var selection = this._selectionFromEventPoint(event); - if (selection && selection.type() === WebInspector.LayerView.Selection.Type.Snapshot) + if (selection && selection.type() === LayerViewer.LayerView.Selection.Type.Snapshot) contextMenu.appendItem( - WebInspector.UIString('Show Paint Profiler'), + Common.UIString('Show Paint Profiler'), this.dispatchEventToListeners.bind( - this, WebInspector.Layers3DView.Events.PaintProfilerRequested, selection.snapshot()), + this, LayerViewer.Layers3DView.Events.PaintProfilerRequested, selection.snapshot()), false); this._layerViewHost.showContextMenu(contextMenu, selection); } @@ -740,8 +740,8 @@ */ _onDoubleClick(event) { var selection = this._selectionFromEventPoint(event); - if (selection && (selection.type() === WebInspector.LayerView.Selection.Type.Snapshot || selection.layer())) - this.dispatchEventToListeners(WebInspector.Layers3DView.Events.PaintProfilerRequested, selection); + if (selection && (selection.type() === LayerViewer.LayerView.Selection.Type.Snapshot || selection.layer())) + this.dispatchEventToListeners(LayerViewer.Layers3DView.Events.PaintProfilerRequested, selection); event.stopPropagation(); } @@ -764,12 +764,12 @@ }; /** @typedef {{borderColor: !Array<number>, borderWidth: number}} */ -WebInspector.Layers3DView.LayerStyle; +LayerViewer.Layers3DView.LayerStyle; /** * @enum {string} */ -WebInspector.Layers3DView.OutlineType = { +LayerViewer.Layers3DView.OutlineType = { Hovered: 'hovered', Selected: 'selected' }; @@ -778,7 +778,7 @@ * @enum {string} */ /** @enum {symbol} */ -WebInspector.Layers3DView.Events = { +LayerViewer.Layers3DView.Events = { PaintProfilerRequested: Symbol('PaintProfilerRequested'), ScaleChanged: Symbol('ScaleChanged') }; @@ -786,7 +786,7 @@ /** * @enum {number} */ -WebInspector.Layers3DView.ChromeTexture = { +LayerViewer.Layers3DView.ChromeTexture = { Left: 0, Middle: 1, Right: 2 @@ -795,13 +795,13 @@ /** * @enum {string} */ -WebInspector.Layers3DView.ScrollRectTitles = { - RepaintsOnScroll: WebInspector.UIString('repaints on scroll'), - TouchEventHandler: WebInspector.UIString('touch event listener'), - WheelEventHandler: WebInspector.UIString('mousewheel event listener') +LayerViewer.Layers3DView.ScrollRectTitles = { + RepaintsOnScroll: Common.UIString('repaints on scroll'), + TouchEventHandler: Common.UIString('touch event listener'), + WheelEventHandler: Common.UIString('mousewheel event listener') }; -WebInspector.Layers3DView.FragmentShader = '' + +LayerViewer.Layers3DView.FragmentShader = '' + 'precision mediump float;\n' + 'varying vec4 vColor;\n' + 'varying vec2 vTextureCoord;\n' + @@ -811,7 +811,7 @@ ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t)) * vColor;\n' + '}'; -WebInspector.Layers3DView.VertexShader = '' + +LayerViewer.Layers3DView.VertexShader = '' + 'attribute vec3 aVertexPosition;\n' + 'attribute vec2 aTextureCoord;\n' + 'attribute vec4 aVertexColor;\n' + @@ -825,29 +825,29 @@ 'vTextureCoord = aTextureCoord;\n' + '}'; -WebInspector.Layers3DView.HoveredBorderColor = [0, 0, 255, 1]; -WebInspector.Layers3DView.SelectedBorderColor = [0, 255, 0, 1]; -WebInspector.Layers3DView.BorderColor = [0, 0, 0, 1]; -WebInspector.Layers3DView.ViewportBorderColor = [160, 160, 160, 1]; -WebInspector.Layers3DView.ScrollRectBackgroundColor = [178, 100, 100, 0.6]; -WebInspector.Layers3DView.HoveredImageMaskColor = [200, 200, 255, 1]; -WebInspector.Layers3DView.BorderWidth = 1; -WebInspector.Layers3DView.SelectedBorderWidth = 2; -WebInspector.Layers3DView.ViewportBorderWidth = 3; +LayerViewer.Layers3DView.HoveredBorderColor = [0, 0, 255, 1]; +LayerViewer.Layers3DView.SelectedBorderColor = [0, 255, 0, 1]; +LayerViewer.Layers3DView.BorderColor = [0, 0, 0, 1]; +LayerViewer.Layers3DView.ViewportBorderColor = [160, 160, 160, 1]; +LayerViewer.Layers3DView.ScrollRectBackgroundColor = [178, 100, 100, 0.6]; +LayerViewer.Layers3DView.HoveredImageMaskColor = [200, 200, 255, 1]; +LayerViewer.Layers3DView.BorderWidth = 1; +LayerViewer.Layers3DView.SelectedBorderWidth = 2; +LayerViewer.Layers3DView.ViewportBorderWidth = 3; -WebInspector.Layers3DView.LayerSpacing = 20; -WebInspector.Layers3DView.ScrollRectSpacing = 4; +LayerViewer.Layers3DView.LayerSpacing = 20; +LayerViewer.Layers3DView.ScrollRectSpacing = 4; /** * @unrestricted */ -WebInspector.LayerTextureManager = class { +LayerViewer.LayerTextureManager = class { /** * @param {function()} textureUpdatedCallback */ constructor(textureUpdatedCallback) { this._textureUpdatedCallback = textureUpdatedCallback; - this._throttler = new WebInspector.Throttler(0); + this._throttler = new Common.Throttler(0); this._scale = 0; this._active = false; this.reset(); @@ -876,9 +876,9 @@ if (this._tilesByLayer) this.setLayerTree(null); - /** @type {!Map<!WebInspector.Layer, !Array<!WebInspector.LayerTextureManager.Tile>>} */ + /** @type {!Map<!SDK.Layer, !Array<!LayerViewer.LayerTextureManager.Tile>>} */ this._tilesByLayer = new Map(); - /** @type {!Array<!WebInspector.Layer>} */ + /** @type {!Array<!SDK.Layer>} */ this._queue = []; } @@ -902,7 +902,7 @@ } /** - * @param {?WebInspector.LayerTreeBase} layerTree + * @param {?SDK.LayerTreeBase} layerTree */ setLayerTree(layerTree) { var newLayers = new Set(); @@ -929,8 +929,8 @@ } /** - * @param {!WebInspector.Layer} layer - * @param {!Array<!WebInspector.SnapshotWithRect>} snapshots + * @param {!SDK.Layer} layer + * @param {!Array<!SDK.SnapshotWithRect>} snapshots * @return {!Promise} */ _setSnapshotsForLayer(layer, snapshots) { @@ -943,7 +943,7 @@ reusedTiles.push(oldTile); oldSnapshotsToTiles.delete(oldTile); } else { - newTiles.push(new WebInspector.LayerTextureManager.Tile(snapshot)); + newTiles.push(new LayerViewer.LayerTextureManager.Tile(snapshot)); } } this._tilesByLayer.set(layer, reusedTiles.concat(newTiles)); @@ -965,15 +965,15 @@ } /** - * @param {!WebInspector.Layer} layer - * @return {!Array<!WebInspector.LayerTextureManager.Tile>} + * @param {!SDK.Layer} layer + * @return {!Array<!LayerViewer.LayerTextureManager.Tile>} */ tilesForLayer(layer) { return this._tilesByLayer.get(layer) || []; } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer */ layerNeedsUpdate(layer) { if (this._queue.indexOf(layer) < 0) @@ -1001,7 +1001,7 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @return {!Promise} */ _updateLayer(layer) { @@ -1028,9 +1028,9 @@ /** * @unrestricted */ -WebInspector.Layers3DView.Rectangle = class { +LayerViewer.Layers3DView.Rectangle = class { /** - * @param {?WebInspector.LayerView.Selection} relatedObject + * @param {?LayerViewer.LayerView.Selection} relatedObject */ constructor(relatedObject) { this.relatedObject = relatedObject; @@ -1081,7 +1081,7 @@ } /** - * @param {!WebInspector.Layer} layer + * @param {!SDK.Layer} layer * @param {!Protocol.DOM.Rect} rect * @param {number} z */ @@ -1110,12 +1110,12 @@ // Vertices of the quad with transform matrix applied var points = []; for (i = 0; i < 4; ++i) - points[i] = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize( - new WebInspector.Geometry.Vector(this.vertices[i * 3], this.vertices[i * 3 + 1], this.vertices[i * 3 + 2]), + points[i] = Common.Geometry.multiplyVectorByMatrixAndNormalize( + new Common.Geometry.Vector(this.vertices[i * 3], this.vertices[i * 3 + 1], this.vertices[i * 3 + 2]), matrix); // Calculating quad plane normal - var normal = WebInspector.Geometry.crossProduct( - WebInspector.Geometry.subtract(points[1], points[0]), WebInspector.Geometry.subtract(points[2], points[1])); + var normal = Common.Geometry.crossProduct( + Common.Geometry.subtract(points[1], points[0]), Common.Geometry.subtract(points[2], points[1])); // General form of the equation of the quad plane: A * x + B * y + C * z + D = 0 var A = normal.x; var B = normal.y; @@ -1124,14 +1124,14 @@ // Finding t from the equation var t = -(D + A * x0 + B * y0) / C; // Point of the intersection - var pt = new WebInspector.Geometry.Vector(x0, y0, t); + var pt = new Common.Geometry.Vector(x0, y0, t); // Vectors from the intersection point to vertices of the quad - var tVects = points.map(WebInspector.Geometry.subtract.bind(null, pt)); + var tVects = points.map(Common.Geometry.subtract.bind(null, pt)); // Intersection point lies inside of the polygon if scalar products of normal of the plane and // cross products of successive tVects are all nonstrictly above or all nonstrictly below zero for (i = 0; i < tVects.length; ++i) { - var product = WebInspector.Geometry.scalarProduct( - normal, WebInspector.Geometry.crossProduct(tVects[i], tVects[(i + 1) % tVects.length])); + var product = Common.Geometry.scalarProduct( + normal, Common.Geometry.crossProduct(tVects[i], tVects[(i + 1) % tVects.length])); if (product < 0) return undefined; } @@ -1143,9 +1143,9 @@ /** * @unrestricted */ -WebInspector.LayerTextureManager.Tile = class { +LayerViewer.LayerTextureManager.Tile = class { /** - * @param {!WebInspector.SnapshotWithRect} snapshotWithRect + * @param {!SDK.SnapshotWithRect} snapshotWithRect */ constructor(snapshotWithRect) { this.snapshot = snapshotWithRect.snapshot; @@ -1183,9 +1183,9 @@ this._gl = glContext; this.scale = scale; return this.snapshot.replay(null, null, scale) - .then(imageURL => imageURL && WebInspector.loadImage(imageURL)) + .then(imageURL => imageURL && UI.loadImage(imageURL)) .then(image => { - this.texture = image && WebInspector.LayerTextureManager._createTextureForImage(glContext, image); + this.texture = image && LayerViewer.LayerTextureManager._createTextureForImage(glContext, image); }); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/PaintProfilerView.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/PaintProfilerView.js index e7315a9..c391b8a 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/PaintProfilerView.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/PaintProfilerView.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.PaintProfilerView = class extends WebInspector.HBox { +LayerViewer.PaintProfilerView = class extends UI.HBox { /** * @param {function(string=)} showImageCallback */ @@ -41,8 +41,8 @@ this.contentElement.classList.add('paint-profiler-overview'); this._canvasContainer = this.contentElement.createChild('div', 'paint-profiler-canvas-container'); this._progressBanner = this.contentElement.createChild('div', 'full-widget-dimmed-banner hidden'); - this._progressBanner.textContent = WebInspector.UIString('Profiling\u2026'); - this._pieChart = new WebInspector.PieChart(55, this._formatPieChartTime.bind(this), true); + this._progressBanner.textContent = Common.UIString('Profiling\u2026'); + this._pieChart = new UI.PieChart(55, this._formatPieChartTime.bind(this), true); this._pieChart.element.classList.add('paint-profiler-pie-chart'); this.contentElement.appendChild(this._pieChart.element); @@ -50,8 +50,8 @@ this._canvas = this._canvasContainer.createChild('canvas', 'fill'); this._context = this._canvas.getContext('2d'); - this._selectionWindow = new WebInspector.OverviewGrid.Window(this._canvasContainer); - this._selectionWindow.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); + this._selectionWindow = new UI.OverviewGrid.Window(this._canvasContainer); + this._selectionWindow.addEventListener(UI.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); this._innerBarWidth = 4 * window.devicePixelRatio; this._minBarHeight = window.devicePixelRatio; @@ -64,28 +64,28 @@ } /** - * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} + * @return {!Object.<string, !LayerViewer.PaintProfilerCategory>} */ static categories() { - if (WebInspector.PaintProfilerView._categories) - return WebInspector.PaintProfilerView._categories; - WebInspector.PaintProfilerView._categories = { - shapes: new WebInspector.PaintProfilerCategory('shapes', WebInspector.UIString('Shapes'), 'rgb(255, 161, 129)'), - bitmap: new WebInspector.PaintProfilerCategory('bitmap', WebInspector.UIString('Bitmap'), 'rgb(136, 196, 255)'), - text: new WebInspector.PaintProfilerCategory('text', WebInspector.UIString('Text'), 'rgb(180, 255, 137)'), - misc: new WebInspector.PaintProfilerCategory('misc', WebInspector.UIString('Misc'), 'rgb(206, 160, 255)') + if (LayerViewer.PaintProfilerView._categories) + return LayerViewer.PaintProfilerView._categories; + LayerViewer.PaintProfilerView._categories = { + shapes: new LayerViewer.PaintProfilerCategory('shapes', Common.UIString('Shapes'), 'rgb(255, 161, 129)'), + bitmap: new LayerViewer.PaintProfilerCategory('bitmap', Common.UIString('Bitmap'), 'rgb(136, 196, 255)'), + text: new LayerViewer.PaintProfilerCategory('text', Common.UIString('Text'), 'rgb(180, 255, 137)'), + misc: new LayerViewer.PaintProfilerCategory('misc', Common.UIString('Misc'), 'rgb(206, 160, 255)') }; - return WebInspector.PaintProfilerView._categories; + return LayerViewer.PaintProfilerView._categories; } /** - * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} + * @return {!Object.<string, !LayerViewer.PaintProfilerCategory>} */ static _initLogItemCategories() { - if (WebInspector.PaintProfilerView._logItemCategoriesMap) - return WebInspector.PaintProfilerView._logItemCategoriesMap; + if (LayerViewer.PaintProfilerView._logItemCategoriesMap) + return LayerViewer.PaintProfilerView._logItemCategoriesMap; - var categories = WebInspector.PaintProfilerView.categories(); + var categories = LayerViewer.PaintProfilerView.categories(); var logItemCategories = {}; logItemCategories['Clear'] = categories['misc']; @@ -125,21 +125,21 @@ logItemCategories['DrawPosTextH'] = categories['text']; logItemCategories['DrawTextOnPath'] = categories['text']; - WebInspector.PaintProfilerView._logItemCategoriesMap = logItemCategories; + LayerViewer.PaintProfilerView._logItemCategoriesMap = logItemCategories; return logItemCategories; } /** * @param {!Object} logItem - * @return {!WebInspector.PaintProfilerCategory} + * @return {!LayerViewer.PaintProfilerCategory} */ static _categoryForLogItem(logItem) { var method = logItem.method.toTitleCase(); - var logItemCategories = WebInspector.PaintProfilerView._initLogItemCategories(); + var logItemCategories = LayerViewer.PaintProfilerView._initLogItemCategories(); var result = logItemCategories[method]; if (!result) { - result = WebInspector.PaintProfilerView.categories()['misc']; + result = LayerViewer.PaintProfilerView.categories()['misc']; logItemCategories[method] = result; } return result; @@ -153,8 +153,8 @@ } /** - * @param {?WebInspector.PaintProfilerSnapshot} snapshot - * @param {!Array.<!WebInspector.PaintProfilerLogItem>} log + * @param {?SDK.PaintProfilerSnapshot} snapshot + * @param {!Array.<!SDK.PaintProfilerLogItem>} log * @param {?Protocol.DOM.Rect} clipRect */ setSnapshotAndLog(snapshot, log, clipRect) { @@ -163,7 +163,7 @@ if (this._snapshot) this._snapshot.addReference(); this._log = log; - this._logCategories = this._log.map(WebInspector.PaintProfilerView._categoryForLogItem); + this._logCategories = this._log.map(LayerViewer.PaintProfilerView._categoryForLogItem); if (!this._snapshot) { this._update(); @@ -177,7 +177,7 @@ snapshot.profile(clipRect, onProfileDone.bind(this)); /** * @param {!Array.<!Protocol.LayerTree.PaintProfile>=} profiles - * @this {WebInspector.PaintProfilerView} + * @this {LayerViewer.PaintProfilerView} */ function onProfileDone(profiles) { this._progressBanner.classList.add('hidden'); @@ -254,7 +254,7 @@ * @param {!Object.<string, number>} heightByCategory */ _renderBar(index, heightByCategory) { - var categories = WebInspector.PaintProfilerView.categories(); + var categories = LayerViewer.PaintProfilerView.categories(); var currentHeight = 0; var x = this._barPaddingWidth + index * this._outerBarWidth; for (var categoryName in categories) { @@ -268,7 +268,7 @@ } _onWindowChanged() { - this.dispatchEventToListeners(WebInspector.PaintProfilerView.Events.WindowChanged); + this.dispatchEventToListeners(LayerViewer.PaintProfilerView.Events.WindowChanged); this._updatePieChart(); if (this._updateImageTimer) return; @@ -283,7 +283,7 @@ var timeByCategory = {}; for (var i = window.left; i < window.right; ++i) { var logEntry = this._log[i]; - var category = WebInspector.PaintProfilerView._categoryForLogItem(logEntry); + var category = LayerViewer.PaintProfilerView._categoryForLogItem(logEntry); timeByCategory[category.color] = timeByCategory[category.color] || 0; for (var j = 0; j < this._profiles.length; ++j) { var time = this._profiles[j][logEntry.commandIndex]; @@ -350,14 +350,14 @@ }; /** @enum {symbol} */ -WebInspector.PaintProfilerView.Events = { +LayerViewer.PaintProfilerView.Events = { WindowChanged: Symbol('WindowChanged') }; /** * @unrestricted */ -WebInspector.PaintProfilerCommandLogView = class extends WebInspector.ThrottledWidget { +LayerViewer.PaintProfilerCommandLogView = class extends UI.ThrottledWidget { constructor() { super(); this.setMinimumSize(100, 25); @@ -370,24 +370,24 @@ } /** - * @param {?WebInspector.Target} target - * @param {!Array.<!WebInspector.PaintProfilerLogItem>} log + * @param {?SDK.Target} target + * @param {!Array.<!SDK.PaintProfilerLogItem>} log */ setCommandLog(target, log) { this._target = target; this._log = log; - /** @type {!Map<!WebInspector.PaintProfilerLogItem>} */ + /** @type {!Map<!SDK.PaintProfilerLogItem>} */ this._treeItemCache = new Map(); this.updateWindow({left: 0, right: this._log.length}); } /** - * @param {!WebInspector.PaintProfilerLogItem} logItem + * @param {!SDK.PaintProfilerLogItem} logItem */ _appendLogItem(logItem) { var treeElement = this._treeItemCache.get(logItem); if (!treeElement) { - treeElement = new WebInspector.LogTreeElement(this, logItem); + treeElement = new LayerViewer.LogTreeElement(this, logItem); this._treeItemCache.set(logItem, treeElement); } else if (treeElement.parent) { return; @@ -434,10 +434,10 @@ /** * @unrestricted */ -WebInspector.LogTreeElement = class extends TreeElement { +LayerViewer.LogTreeElement = class extends TreeElement { /** - * @param {!WebInspector.PaintProfilerCommandLogView} ownerView - * @param {!WebInspector.PaintProfilerLogItem} logItem + * @param {!LayerViewer.PaintProfilerCommandLogView} ownerView + * @param {!SDK.PaintProfilerLogItem} logItem */ constructor(ownerView, logItem) { super('', !!logItem.params); @@ -458,7 +458,7 @@ */ onpopulate() { for (var param in this._logItem.params) - WebInspector.LogPropertyTreeElement._appendLogPropertyItem(this, param, this._logItem.params[param]); + LayerViewer.LogPropertyTreeElement._appendLogPropertyItem(this, param, this._logItem.params[param]); } /** @@ -506,7 +506,7 @@ /** * @unrestricted */ -WebInspector.LogPropertyTreeElement = class extends TreeElement { +LayerViewer.LogPropertyTreeElement = class extends TreeElement { /** * @param {!{name: string, value}} property */ @@ -521,11 +521,11 @@ * @param {*} value */ static _appendLogPropertyItem(element, name, value) { - var treeElement = new WebInspector.LogPropertyTreeElement({name: name, value: value}); + var treeElement = new LayerViewer.LogPropertyTreeElement({name: name, value: value}); element.appendChild(treeElement); if (value && typeof value === 'object') { for (var property in value) - WebInspector.LogPropertyTreeElement._appendLogPropertyItem(treeElement, property, value[property]); + LayerViewer.LogPropertyTreeElement._appendLogPropertyItem(treeElement, property, value[property]); } } @@ -551,7 +551,7 @@ /** * @unrestricted */ -WebInspector.PaintProfilerCategory = class { +LayerViewer.PaintProfilerCategory = class { /** * @param {string} name * @param {string} title
diff --git a/third_party/WebKit/Source/devtools/front_end/layer_viewer/TransformController.js b/third_party/WebKit/Source/devtools/front_end/layer_viewer/TransformController.js index 60434d6..f4125cf 100644 --- a/third_party/WebKit/Source/devtools/front_end/layer_viewer/TransformController.js +++ b/third_party/WebKit/Source/devtools/front_end/layer_viewer/TransformController.js
@@ -7,7 +7,7 @@ /** * @unrestricted */ -WebInspector.TransformController = class extends WebInspector.Object { +LayerViewer.TransformController = class extends Common.Object { /** * @param {!Element} element * @param {boolean=} disableRotate @@ -19,7 +19,7 @@ if (this.element.tabIndex < 0) this.element.tabIndex = 0; this._registerShortcuts(); - WebInspector.installDragHandle( + UI.installDragHandle( element, this._onDragStart.bind(this), this._onDrag.bind(this), this._onDragEnd.bind(this), 'move', null); element.addEventListener('keydown', this._onKeyDown.bind(this), false); element.addEventListener('keyup', this._onKeyUp.bind(this), false); @@ -27,26 +27,26 @@ this._minScale = 0; this._maxScale = Infinity; - this._controlPanelToolbar = new WebInspector.Toolbar('transform-control-panel'); + this._controlPanelToolbar = new UI.Toolbar('transform-control-panel'); - /** @type {!Object<string, !WebInspector.ToolbarToggle>} */ + /** @type {!Object<string, !UI.ToolbarToggle>} */ this._modeButtons = {}; if (!disableRotate) { - var panModeButton = new WebInspector.ToolbarToggle(WebInspector.UIString('Pan mode (X)'), 'largeicon-pan'); - panModeButton.addEventListener('click', this._setMode.bind(this, WebInspector.TransformController.Modes.Pan)); - this._modeButtons[WebInspector.TransformController.Modes.Pan] = panModeButton; + var panModeButton = new UI.ToolbarToggle(Common.UIString('Pan mode (X)'), 'largeicon-pan'); + panModeButton.addEventListener('click', this._setMode.bind(this, LayerViewer.TransformController.Modes.Pan)); + this._modeButtons[LayerViewer.TransformController.Modes.Pan] = panModeButton; this._controlPanelToolbar.appendToolbarItem(panModeButton); var rotateModeButton = - new WebInspector.ToolbarToggle(WebInspector.UIString('Rotate mode (V)'), 'largeicon-rotate'); + new UI.ToolbarToggle(Common.UIString('Rotate mode (V)'), 'largeicon-rotate'); rotateModeButton.addEventListener( - 'click', this._setMode.bind(this, WebInspector.TransformController.Modes.Rotate)); - this._modeButtons[WebInspector.TransformController.Modes.Rotate] = rotateModeButton; + 'click', this._setMode.bind(this, LayerViewer.TransformController.Modes.Rotate)); + this._modeButtons[LayerViewer.TransformController.Modes.Rotate] = rotateModeButton; this._controlPanelToolbar.appendToolbarItem(rotateModeButton); } - this._setMode(WebInspector.TransformController.Modes.Pan); + this._setMode(LayerViewer.TransformController.Modes.Pan); var resetButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Reset transform (0)'), 'largeicon-center'); + new UI.ToolbarButton(Common.UIString('Reset transform (0)'), 'largeicon-center'); resetButton.addEventListener('click', this.resetAndNotify.bind(this, undefined)); this._controlPanelToolbar.appendToolbarItem(resetButton); @@ -54,26 +54,26 @@ } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ toolbar() { return this._controlPanelToolbar; } _onKeyDown(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Shift.code) { + if (event.keyCode === UI.KeyboardShortcut.Keys.Shift.code) { this._toggleMode(); return; } - var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEventIgnoringModifiers(event); + var shortcutKey = UI.KeyboardShortcut.makeKeyFromEventIgnoringModifiers(event); var handler = this._shortcuts[shortcutKey]; if (handler && handler(event)) event.consume(); } _onKeyUp(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Shift.code) + if (event.keyCode === UI.KeyboardShortcut.Keys.Shift.code) this._toggleMode(); } @@ -83,30 +83,30 @@ } _registerShortcuts() { - this._addShortcuts(WebInspector.ShortcutsScreen.LayersPanelShortcuts.ResetView, this.resetAndNotify.bind(this)); + this._addShortcuts(Components.ShortcutsScreen.LayersPanelShortcuts.ResetView, this.resetAndNotify.bind(this)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.PanMode, - this._setMode.bind(this, WebInspector.TransformController.Modes.Pan)); + Components.ShortcutsScreen.LayersPanelShortcuts.PanMode, + this._setMode.bind(this, LayerViewer.TransformController.Modes.Pan)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.RotateMode, - this._setMode.bind(this, WebInspector.TransformController.Modes.Rotate)); + Components.ShortcutsScreen.LayersPanelShortcuts.RotateMode, + this._setMode.bind(this, LayerViewer.TransformController.Modes.Rotate)); var zoomFactor = 1.1; this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, this._onKeyboardZoom.bind(this, zoomFactor)); + Components.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, this._onKeyboardZoom.bind(this, zoomFactor)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, this._onKeyboardZoom.bind(this, 1 / zoomFactor)); + Components.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, this._onKeyboardZoom.bind(this, 1 / zoomFactor)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Up, this._onKeyboardPanOrRotate.bind(this, 0, -1)); + Components.ShortcutsScreen.LayersPanelShortcuts.Up, this._onKeyboardPanOrRotate.bind(this, 0, -1)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down, this._onKeyboardPanOrRotate.bind(this, 0, 1)); + Components.ShortcutsScreen.LayersPanelShortcuts.Down, this._onKeyboardPanOrRotate.bind(this, 0, 1)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Left, this._onKeyboardPanOrRotate.bind(this, -1, 0)); + Components.ShortcutsScreen.LayersPanelShortcuts.Left, this._onKeyboardPanOrRotate.bind(this, -1, 0)); this._addShortcuts( - WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right, this._onKeyboardPanOrRotate.bind(this, 1, 0)); + Components.ShortcutsScreen.LayersPanelShortcuts.Right, this._onKeyboardPanOrRotate.bind(this, 1, 0)); } _postChangeEvent() { - this.dispatchEventToListeners(WebInspector.TransformController.Events.TransformChanged); + this.dispatchEventToListeners(LayerViewer.TransformController.Events.TransformChanged); } _reset() { @@ -119,12 +119,12 @@ _toggleMode() { this._setMode( - this._mode === WebInspector.TransformController.Modes.Pan ? WebInspector.TransformController.Modes.Rotate : - WebInspector.TransformController.Modes.Pan); + this._mode === LayerViewer.TransformController.Modes.Pan ? LayerViewer.TransformController.Modes.Rotate : + LayerViewer.TransformController.Modes.Pan); } /** - * @param {!WebInspector.TransformController.Modes} mode + * @param {!LayerViewer.TransformController.Modes} mode */ _setMode(mode) { if (this._mode === mode) @@ -254,7 +254,7 @@ var panStepInPixels = 6; var rotateStepInDegrees = 5; - if (this._mode === WebInspector.TransformController.Modes.Rotate) { + if (this._mode === LayerViewer.TransformController.Modes.Rotate) { // Sic! _onRotate treats X and Y as "rotate around X" and "rotate around Y", so swap X/Y multiplers. this._onRotate( this._rotateX + yMultiplier * rotateStepInDegrees, this._rotateY + xMultiplier * rotateStepInDegrees); @@ -280,7 +280,7 @@ * @param {!Event} event */ _onDrag(event) { - if (this._mode === WebInspector.TransformController.Modes.Rotate) { + if (this._mode === LayerViewer.TransformController.Modes.Rotate) { this._onRotate( this._oldRotateX + (this._originY - event.clientY) / this.element.clientHeight * 180, this._oldRotateY - (this._originX - event.clientX) / this.element.clientWidth * 180); @@ -312,14 +312,14 @@ }; /** @enum {symbol} */ -WebInspector.TransformController.Events = { +LayerViewer.TransformController.Events = { TransformChanged: Symbol('TransformChanged') }; /** * @enum {string} */ -WebInspector.TransformController.Modes = { +LayerViewer.TransformController.Modes = { Pan: 'Pan', Rotate: 'Rotate', };
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js b/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js index 7d96d29..cabbf298 100644 --- a/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js +++ b/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js
@@ -4,20 +4,20 @@ /** * @unrestricted */ -WebInspector.LayerPaintProfilerView = class extends WebInspector.SplitWidget { +Layers.LayerPaintProfilerView = class extends UI.SplitWidget { /** * @param {function(string=)} showImageCallback */ constructor(showImageCallback) { super(true, false); - this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); + this._logTreeView = new LayerViewer.PaintProfilerCommandLogView(); this.setSidebarWidget(this._logTreeView); - this._paintProfilerView = new WebInspector.PaintProfilerView(showImageCallback); + this._paintProfilerView = new LayerViewer.PaintProfilerView(showImageCallback); this.setMainWidget(this._paintProfilerView); this._paintProfilerView.addEventListener( - WebInspector.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this); + LayerViewer.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this); } reset() { @@ -25,16 +25,16 @@ } /** - * @param {!WebInspector.PaintProfilerSnapshot} snapshot + * @param {!SDK.PaintProfilerSnapshot} snapshot */ profile(snapshot) { this._showImageCallback = null; snapshot.commandLog().then(log => setSnapshotAndLog.call(this, snapshot, log)); /** - * @param {?WebInspector.PaintProfilerSnapshot} snapshot - * @param {?Array<!WebInspector.PaintProfilerLogItem>} log - * @this {WebInspector.LayerPaintProfilerView} + * @param {?SDK.PaintProfilerSnapshot} snapshot + * @param {?Array<!SDK.PaintProfilerLogItem>} log + * @this {Layers.LayerPaintProfilerView} */ function setSnapshotAndLog(snapshot, log) { this._logTreeView.setCommandLog(snapshot && snapshot.target(), log || []);
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/LayerTreeModel.js b/third_party/WebKit/Source/devtools/front_end/layers/LayerTreeModel.js index 0108002..38f5c91c 100644 --- a/third_party/WebKit/Source/devtools/front_end/layers/LayerTreeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/layers/LayerTreeModel.js
@@ -31,27 +31,27 @@ /** * @unrestricted */ -WebInspector.LayerTreeModel = class extends WebInspector.SDKModel { +Layers.LayerTreeModel = class extends SDK.SDKModel { constructor(target) { - super(WebInspector.LayerTreeModel, target); - target.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispatcher(this)); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.MainFrameNavigated, this._onMainFrameNavigated, this); - /** @type {?WebInspector.LayerTreeBase} */ + super(Layers.LayerTreeModel, target); + target.registerLayerTreeDispatcher(new Layers.LayerTreeDispatcher(this)); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.MainFrameNavigated, this._onMainFrameNavigated, this); + /** @type {?SDK.LayerTreeBase} */ this._layerTree = null; } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.LayerTreeModel} + * @param {!SDK.Target} target + * @return {?Layers.LayerTreeModel} */ static fromTarget(target) { if (!target.hasDOMCapability()) return null; - var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebInspector.LayerTreeModel)); + var model = /** @type {?Layers.LayerTreeModel} */ (target.model(Layers.LayerTreeModel)); if (!model) - model = new WebInspector.LayerTreeModel(target); + model = new Layers.LayerTreeModel(target); return model; } @@ -72,12 +72,12 @@ _forceEnable() { this._lastPaintRectByLayerId = {}; if (!this._layerTree) - this._layerTree = new WebInspector.AgentLayerTree(this.target()); + this._layerTree = new Layers.AgentLayerTree(this.target()); this.target().layerTreeAgent().enable(); } /** - * @return {?WebInspector.LayerTreeBase} + * @return {?SDK.LayerTreeBase} */ layerTree() { return this._layerTree; @@ -89,11 +89,11 @@ _layerTreeChanged(layers) { if (!this._enabled) return; - var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree); + var layerTree = /** @type {!Layers.AgentLayerTree} */ (this._layerTree); layerTree.setLayers(layers, onLayersSet.bind(this)); /** - * @this {WebInspector.LayerTreeModel} + * @this {Layers.LayerTreeModel} */ function onLayersSet() { for (var layerId in this._lastPaintRectByLayerId) { @@ -104,7 +104,7 @@ } this._lastPaintRectByLayerId = {}; - this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged); + this.dispatchEventToListeners(Layers.LayerTreeModel.Events.LayerTreeChanged); } } @@ -115,14 +115,14 @@ _layerPainted(layerId, clipRect) { if (!this._enabled) return; - var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree); + var layerTree = /** @type {!Layers.AgentLayerTree} */ (this._layerTree); var layer = layerTree.layerById(layerId); if (!layer) { this._lastPaintRectByLayerId[layerId] = clipRect; return; } layer._didPaint(clipRect); - this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerPainted, layer); + this.dispatchEventToListeners(Layers.LayerTreeModel.Events.LayerPainted, layer); } _onMainFrameNavigated() { @@ -133,7 +133,7 @@ }; /** @enum {symbol} */ -WebInspector.LayerTreeModel.Events = { +Layers.LayerTreeModel.Events = { LayerTreeChanged: Symbol('LayerTreeChanged'), LayerPainted: Symbol('LayerPainted'), }; @@ -141,9 +141,9 @@ /** * @unrestricted */ -WebInspector.AgentLayerTree = class extends WebInspector.LayerTreeBase { +Layers.AgentLayerTree = class extends SDK.LayerTreeBase { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ constructor(target) { super(target); @@ -169,7 +169,7 @@ this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this)); /** - * @this {WebInspector.AgentLayerTree} + * @this {Layers.AgentLayerTree} */ function onBackendNodeIdsResolved() { this._innerSetLayers(payload); @@ -195,7 +195,7 @@ if (layer) layer._reset(layers[i]); else - layer = new WebInspector.AgentLayer(this._target, layers[i]); + layer = new Layers.AgentLayer(this._target, layers[i]); this._layersById[layerId] = layer; var backendNodeId = layers[i].backendNodeId; if (backendNodeId) @@ -222,12 +222,12 @@ }; /** - * @implements {WebInspector.Layer} + * @implements {SDK.Layer} * @unrestricted */ -WebInspector.AgentLayer = class { +Layers.AgentLayer = class { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {!Protocol.LayerTree.Layer} layerPayload */ constructor(target, layerPayload) { @@ -253,7 +253,7 @@ /** * @override - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ parent() { return this._parent; @@ -269,7 +269,7 @@ /** * @override - * @return {!Array.<!WebInspector.Layer>} + * @return {!Array.<!SDK.Layer>} */ children() { return this._children; @@ -277,7 +277,7 @@ /** * @override - * @param {!WebInspector.Layer} child + * @param {!SDK.Layer} child */ addChild(child) { if (child._parent) @@ -287,7 +287,7 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ _setNode(node) { this._node = node; @@ -295,7 +295,7 @@ /** * @override - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._node; @@ -303,7 +303,7 @@ /** * @override - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ nodeForSelfOrAncestor() { for (var layer = this; layer; layer = layer._parent) { @@ -442,14 +442,14 @@ /** * @override - * @return {!Array<!Promise<?WebInspector.SnapshotWithRect>>} + * @return {!Array<!Promise<?SDK.SnapshotWithRect>>} */ snapshots() { var rect = {x: 0, y: 0, width: this.width(), height: this.height()}; var promise = this._target.layerTreeAgent().makeSnapshot( this.id(), (error, snapshotId) => error || !this._target ? null : - {rect: rect, snapshot: new WebInspector.PaintProfilerSnapshot(this._target, snapshotId)}); + {rect: rect, snapshot: new SDK.PaintProfilerSnapshot(this._target, snapshotId)}); return [promise]; } @@ -466,7 +466,7 @@ * @param {!Protocol.LayerTree.Layer} layerPayload */ _reset(layerPayload) { - /** @type {?WebInspector.DOMNode} */ + /** @type {?SDK.DOMNode} */ this._node = null; this._children = []; this._parent = null; @@ -497,10 +497,10 @@ if (this._layerPayload.transform) { var transformMatrix = this._matrixFromArray(this._layerPayload.transform); - var anchorVector = new WebInspector.Geometry.Vector( + var anchorVector = new Common.Geometry.Vector( this._layerPayload.width * this.anchorPoint()[0], this._layerPayload.height * this.anchorPoint()[1], this.anchorPoint()[2]); - var anchorPoint = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(anchorVector, matrix); + var anchorPoint = Common.Geometry.multiplyVectorByMatrixAndNormalize(anchorVector, matrix); var anchorMatrix = new WebKitCSSMatrix().translate(-anchorPoint.x, -anchorPoint.y, -anchorPoint.z); matrix = anchorMatrix.inverse().multiply(transformMatrix.multiply(anchorMatrix.multiply(matrix))); } @@ -526,8 +526,8 @@ this._quad = []; var vertices = this._createVertexArrayForRect(this._layerPayload.width, this._layerPayload.height); for (var i = 0; i < 4; ++i) { - var point = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize( - new WebInspector.Geometry.Vector(vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]), matrix); + var point = Common.Geometry.multiplyVectorByMatrixAndNormalize( + new Common.Geometry.Vector(vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]), matrix); this._quad.push(point.x, point.y); } @@ -543,9 +543,9 @@ * @implements {Protocol.LayerTreeDispatcher} * @unrestricted */ -WebInspector.LayerTreeDispatcher = class { +Layers.LayerTreeDispatcher = class { /** - * @param {!WebInspector.LayerTreeModel} layerTreeModel + * @param {!Layers.LayerTreeModel} layerTreeModel */ constructor(layerTreeModel) { this._layerTreeModel = layerTreeModel;
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js b/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js index 61a64d7..2fa6a56a 100644 --- a/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js
@@ -28,43 +28,43 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.LayersPanel = class extends WebInspector.PanelWithSidebar { +Layers.LayersPanel = class extends UI.PanelWithSidebar { constructor() { super('layers', 225); - /** @type {?WebInspector.LayerTreeModel} */ + /** @type {?Layers.LayerTreeModel} */ this._model = null; - WebInspector.targetManager.observeTargets(this); - this._layerViewHost = new WebInspector.LayerViewHost(); - this._layerTreeOutline = new WebInspector.LayerTreeOutline(this._layerViewHost); + SDK.targetManager.observeTargets(this); + this._layerViewHost = new LayerViewer.LayerViewHost(); + this._layerTreeOutline = new LayerViewer.LayerTreeOutline(this._layerViewHost); this.panelSidebarElement().appendChild(this._layerTreeOutline.element); this.setDefaultFocusedElement(this._layerTreeOutline.element); - this._rightSplitWidget = new WebInspector.SplitWidget(false, true, 'layerDetailsSplitViewState'); + this._rightSplitWidget = new UI.SplitWidget(false, true, 'layerDetailsSplitViewState'); this.splitWidget().setMainWidget(this._rightSplitWidget); - this._layers3DView = new WebInspector.Layers3DView(this._layerViewHost); + this._layers3DView = new LayerViewer.Layers3DView(this._layerViewHost); this._rightSplitWidget.setMainWidget(this._layers3DView); this._layers3DView.addEventListener( - WebInspector.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfileRequested, this); - this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ScaleChanged, this._onScaleChanged, this); + LayerViewer.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfileRequested, this); + this._layers3DView.addEventListener(LayerViewer.Layers3DView.Events.ScaleChanged, this._onScaleChanged, this); - this._tabbedPane = new WebInspector.TabbedPane(); + this._tabbedPane = new UI.TabbedPane(); this._rightSplitWidget.setSidebarWidget(this._tabbedPane); - this._layerDetailsView = new WebInspector.LayerDetailsView(this._layerViewHost); + this._layerDetailsView = new LayerViewer.LayerDetailsView(this._layerViewHost); this._layerDetailsView.addEventListener( - WebInspector.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfileRequested, this); + LayerViewer.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfileRequested, this); this._tabbedPane.appendTab( - WebInspector.LayersPanel.DetailsViewTabs.Details, WebInspector.UIString('Details'), this._layerDetailsView); + Layers.LayersPanel.DetailsViewTabs.Details, Common.UIString('Details'), this._layerDetailsView); - this._paintProfilerView = new WebInspector.LayerPaintProfilerView(this._showImage.bind(this)); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabClosed, this._onTabClosed, this); - this._updateThrottler = new WebInspector.Throttler(100); + this._paintProfilerView = new Layers.LayerPaintProfilerView(this._showImage.bind(this)); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabClosed, this._onTabClosed, this); + this._updateThrottler = new Common.Throttler(100); } /** @@ -95,30 +95,30 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._model) return; - this._model = WebInspector.LayerTreeModel.fromTarget(target); + this._model = Layers.LayerTreeModel.fromTarget(target); if (!this._model) return; - this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this); - this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this); + this._model.addEventListener(Layers.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this); + this._model.addEventListener(Layers.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this); if (this.isShowing()) this._model.enable(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (!this._model || this._model.target() !== target) return; this._model.removeEventListener( - WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this); - this._model.removeEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this); + Layers.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this); + this._model.removeEventListener(Layers.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this); this._model.disable(); this._model = null; } @@ -137,39 +137,39 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onLayerPainted(event) { if (!this._model) return; - var layer = /** @type {!WebInspector.Layer} */ (event.data); + var layer = /** @type {!SDK.Layer} */ (event.data); if (this._layerViewHost.selection() && this._layerViewHost.selection().layer() === layer) this._layerDetailsView.update(); this._layers3DView.updateLayerSnapshot(layer); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onPaintProfileRequested(event) { - var selection = /** @type {!WebInspector.LayerView.Selection} */ (event.data); + var selection = /** @type {!LayerViewer.LayerView.Selection} */ (event.data); this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect => { if (!snapshotWithRect) return; this._layerBeingProfiled = selection.layer(); this._tabbedPane.appendTab( - WebInspector.LayersPanel.DetailsViewTabs.Profiler, WebInspector.UIString('Profiler'), this._paintProfilerView, + Layers.LayersPanel.DetailsViewTabs.Profiler, Common.UIString('Profiler'), this._paintProfilerView, undefined, true, true); - this._tabbedPane.selectTab(WebInspector.LayersPanel.DetailsViewTabs.Profiler); + this._tabbedPane.selectTab(Layers.LayersPanel.DetailsViewTabs.Profiler); this._paintProfilerView.profile(snapshotWithRect.snapshot); }); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onTabClosed(event) { - if (event.data.tabId !== WebInspector.LayersPanel.DetailsViewTabs.Profiler || !this._layerBeingProfiled) + if (event.data.tabId !== Layers.LayersPanel.DetailsViewTabs.Profiler || !this._layerBeingProfiled) return; this._paintProfilerView.reset(); this._layers3DView.showImageForLayer(this._layerBeingProfiled, undefined); @@ -184,14 +184,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onScaleChanged(event) { this._paintProfilerView.setScale(/** @type {number} */ (event.data)); } }; -WebInspector.LayersPanel.DetailsViewTabs = { +Layers.LayersPanel.DetailsViewTabs = { Details: 'details', Profiler: 'profiler' };
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/module.json b/third_party/WebKit/Source/devtools/front_end/layers/module.json index e014a5f..754eedd 100644 --- a/third_party/WebKit/Source/devtools/front_end/layers/module.json +++ b/third_party/WebKit/Source/devtools/front_end/layers/module.json
@@ -7,7 +7,7 @@ "title": "Layers", "order": 100, "persistence": "closeable", - "className": "WebInspector.LayersPanel" + "className": "Layers.LayersPanel" } ], "dependencies": ["layer_viewer"],
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js index 23c08c33..3d7cac6 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -31,12 +31,12 @@ /** * @unrestricted */ -WebInspector.Main = class { +Main.Main = class { /** * @suppressGlobalPropertiesCheck */ constructor() { - WebInspector.Main._instanceForTest = this; + Main.Main._instanceForTest = this; runOnWindowLoad(this._loaded.bind(this)); } @@ -44,9 +44,9 @@ * @param {boolean} hard */ static _reloadPage(hard) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (mainTarget && mainTarget.hasBrowserCapability()) - WebInspector.targetManager.reloadPage(hard); + SDK.targetManager.reloadPage(hard); } _loaded() { @@ -54,7 +54,7 @@ if (InspectorFrontendHost.isUnderTest()) self.runtime.useTestBase(); - Runtime.setPlatform(WebInspector.platform()); + Runtime.setPlatform(Host.platform()); InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this)); } @@ -73,17 +73,17 @@ */ _createSettings(prefs) { this._initializeExperiments(prefs); - var storagePrefix = WebInspector.isCustomDevtoolsFrontend() ? '__custom__' : ''; + var storagePrefix = Host.isCustomDevtoolsFrontend() ? '__custom__' : ''; var clearLocalStorage = window.localStorage ? window.localStorage.clear.bind(window.localStorage) : undefined; var localStorage = - new WebInspector.SettingsStorage(window.localStorage || {}, undefined, undefined, clearLocalStorage, storagePrefix); - var globalStorage = new WebInspector.SettingsStorage( + new Common.SettingsStorage(window.localStorage || {}, undefined, undefined, clearLocalStorage, storagePrefix); + var globalStorage = new Common.SettingsStorage( prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference, InspectorFrontendHost.clearPreferences, storagePrefix); - WebInspector.settings = new WebInspector.Settings(globalStorage, localStorage); + Common.settings = new Common.Settings(globalStorage, localStorage); if (!InspectorFrontendHost.isUnderTest()) - new WebInspector.VersionController().updateVersion(); + new Common.VersionController().updateVersion(); } /** @@ -145,89 +145,89 @@ _createAppUI() { console.time('Main._createAppUI'); - WebInspector.viewManager = new WebInspector.ViewManager(); + UI.viewManager = new UI.ViewManager(); // Request filesystems early, we won't create connections until callback is fired. Things will happen in parallel. - WebInspector.isolatedFileSystemManager = new WebInspector.IsolatedFileSystemManager(); + Workspace.isolatedFileSystemManager = new Workspace.IsolatedFileSystemManager(); - var themeSetting = WebInspector.settings.createSetting('uiTheme', 'default'); - WebInspector.initializeUIUtils(document, themeSetting); - themeSetting.addChangeListener(WebInspector.reload.bind(WebInspector)); + var themeSetting = Common.settings.createSetting('uiTheme', 'default'); + UI.initializeUIUtils(document, themeSetting); + themeSetting.addChangeListener(Components.reload.bind(Components)); - WebInspector.installComponentRootStyles(/** @type {!Element} */ (document.body)); + UI.installComponentRootStyles(/** @type {!Element} */ (document.body)); this._addMainEventListeners(document); var canDock = !!Runtime.queryParam('can_dock'); - WebInspector.zoomManager = new WebInspector.ZoomManager(window, InspectorFrontendHost); - WebInspector.inspectorView = WebInspector.InspectorView.instance(); - WebInspector.ContextMenu.initialize(); - WebInspector.ContextMenu.installHandler(document); - WebInspector.Tooltip.installHandler(document); - WebInspector.dockController = new WebInspector.DockController(canDock); - WebInspector.multitargetConsoleModel = new WebInspector.MultitargetConsoleModel(); - WebInspector.multitargetNetworkManager = new WebInspector.MultitargetNetworkManager(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged.bind(this)); + UI.zoomManager = new UI.ZoomManager(window, InspectorFrontendHost); + UI.inspectorView = UI.InspectorView.instance(); + UI.ContextMenu.initialize(); + UI.ContextMenu.installHandler(document); + UI.Tooltip.installHandler(document); + Components.dockController = new Components.DockController(canDock); + SDK.multitargetConsoleModel = new SDK.MultitargetConsoleModel(); + SDK.multitargetNetworkManager = new SDK.MultitargetNetworkManager(); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged.bind(this)); - WebInspector.shortcutsScreen = new WebInspector.ShortcutsScreen(); + Components.shortcutsScreen = new Components.ShortcutsScreen(); // set order of some sections explicitly - WebInspector.shortcutsScreen.section(WebInspector.UIString('Elements Panel')); - WebInspector.shortcutsScreen.section(WebInspector.UIString('Styles Pane')); - WebInspector.shortcutsScreen.section(WebInspector.UIString('Debugger')); - WebInspector.shortcutsScreen.section(WebInspector.UIString('Console')); + Components.shortcutsScreen.section(Common.UIString('Elements Panel')); + Components.shortcutsScreen.section(Common.UIString('Styles Pane')); + Components.shortcutsScreen.section(Common.UIString('Debugger')); + Components.shortcutsScreen.section(Common.UIString('Console')); - WebInspector.fileManager = new WebInspector.FileManager(); - WebInspector.workspace = new WebInspector.Workspace(); - WebInspector.formatterWorkerPool = new WebInspector.FormatterWorkerPool(); - WebInspector.fileSystemMapping = new WebInspector.FileSystemMapping(); + Workspace.fileManager = new Workspace.FileManager(); + Workspace.workspace = new Workspace.Workspace(); + Common.formatterWorkerPool = new Common.FormatterWorkerPool(); + Workspace.fileSystemMapping = new Workspace.FileSystemMapping(); var fileSystemWorkspaceBinding = - new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager, WebInspector.workspace); - WebInspector.networkMapping = new WebInspector.NetworkMapping( - WebInspector.targetManager, WebInspector.workspace, fileSystemWorkspaceBinding, WebInspector.fileSystemMapping); - WebInspector.networkProjectManager = - new WebInspector.NetworkProjectManager(WebInspector.targetManager, WebInspector.workspace); - WebInspector.presentationConsoleMessageHelper = - new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace); - WebInspector.cssWorkspaceBinding = new WebInspector.CSSWorkspaceBinding( - WebInspector.targetManager, WebInspector.workspace, WebInspector.networkMapping); - WebInspector.debuggerWorkspaceBinding = new WebInspector.DebuggerWorkspaceBinding( - WebInspector.targetManager, WebInspector.workspace, WebInspector.networkMapping); - WebInspector.breakpointManager = new WebInspector.BreakpointManager( - null, WebInspector.workspace, WebInspector.targetManager, WebInspector.debuggerWorkspaceBinding); - WebInspector.extensionServer = new WebInspector.ExtensionServer(); + new Bindings.FileSystemWorkspaceBinding(Workspace.isolatedFileSystemManager, Workspace.workspace); + Bindings.networkMapping = new Bindings.NetworkMapping( + SDK.targetManager, Workspace.workspace, fileSystemWorkspaceBinding, Workspace.fileSystemMapping); + Main.networkProjectManager = + new Bindings.NetworkProjectManager(SDK.targetManager, Workspace.workspace); + Bindings.presentationConsoleMessageHelper = + new Bindings.PresentationConsoleMessageHelper(Workspace.workspace); + Bindings.cssWorkspaceBinding = new Bindings.CSSWorkspaceBinding( + SDK.targetManager, Workspace.workspace, Bindings.networkMapping); + Bindings.debuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceBinding( + SDK.targetManager, Workspace.workspace, Bindings.networkMapping); + Bindings.breakpointManager = new Bindings.BreakpointManager( + null, Workspace.workspace, SDK.targetManager, Bindings.debuggerWorkspaceBinding); + Extensions.extensionServer = new Extensions.ExtensionServer(); - WebInspector.persistence = new WebInspector.Persistence( - WebInspector.workspace, WebInspector.breakpointManager, WebInspector.fileSystemMapping); + Persistence.persistence = new Persistence.Persistence( + Workspace.workspace, Bindings.breakpointManager, Workspace.fileSystemMapping); - new WebInspector.OverlayController(); - new WebInspector.ExecutionContextSelector(WebInspector.targetManager, WebInspector.context); - WebInspector.blackboxManager = new WebInspector.BlackboxManager(WebInspector.debuggerWorkspaceBinding); + new Main.OverlayController(); + new Components.ExecutionContextSelector(SDK.targetManager, UI.context); + Bindings.blackboxManager = new Bindings.BlackboxManager(Bindings.debuggerWorkspaceBinding); - var autoselectPanel = WebInspector.UIString('auto'); - var openAnchorLocationSetting = WebInspector.settings.createSetting('openLinkHandler', autoselectPanel); - WebInspector.openAnchorLocationRegistry = new WebInspector.HandlerRegistry(openAnchorLocationSetting); - WebInspector.openAnchorLocationRegistry.registerHandler(autoselectPanel, function() { + var autoselectPanel = Common.UIString('auto'); + var openAnchorLocationSetting = Common.settings.createSetting('openLinkHandler', autoselectPanel); + Components.openAnchorLocationRegistry = new Components.HandlerRegistry(openAnchorLocationSetting); + Components.openAnchorLocationRegistry.registerHandler(autoselectPanel, function() { return false; }); - WebInspector.Linkifier.setLinkHandler(new WebInspector.HandlerRegistry.LinkHandler()); + Components.Linkifier.setLinkHandler(new Components.HandlerRegistry.LinkHandler()); - new WebInspector.Main.PauseListener(); - new WebInspector.Main.InspectedNodeRevealer(); - new WebInspector.NetworkPanelIndicator(); - new WebInspector.SourcesPanelIndicator(); - new WebInspector.BackendSettingsSync(); - WebInspector.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane(); + new Main.Main.PauseListener(); + new Main.Main.InspectedNodeRevealer(); + new Main.NetworkPanelIndicator(); + new Main.SourcesPanelIndicator(); + new Main.BackendSettingsSync(); + Components.domBreakpointsSidebarPane = new Components.DOMBreakpointsSidebarPane(); - WebInspector.actionRegistry = new WebInspector.ActionRegistry(); - WebInspector.shortcutRegistry = new WebInspector.ShortcutRegistry(WebInspector.actionRegistry, document); - WebInspector.ShortcutsScreen.registerShortcuts(); + UI.actionRegistry = new UI.ActionRegistry(); + UI.shortcutRegistry = new UI.ShortcutRegistry(UI.actionRegistry, document); + Components.ShortcutsScreen.registerShortcuts(); this._registerForwardedShortcuts(); this._registerMessageSinkListener(); - new WebInspector.Main.InspectorDomainObserver(); + new Main.Main.InspectorDomainObserver(); - self.runtime.extension(WebInspector.AppProvider).instance().then(this._showAppUI.bind(this)); + self.runtime.extension(Common.AppProvider).instance().then(this._showAppUI.bind(this)); console.timeEnd('Main._createAppUI'); } @@ -237,24 +237,24 @@ */ _showAppUI(appProvider) { console.time('Main._showAppUI'); - var app = /** @type {!WebInspector.AppProvider} */ (appProvider).createApp(); + var app = /** @type {!Common.AppProvider} */ (appProvider).createApp(); // It is important to kick controller lifetime after apps are instantiated. - WebInspector.dockController.initialize(); + Components.dockController.initialize(); app.presentUI(document); - var toggleSearchNodeAction = WebInspector.actionRegistry.action('elements.toggle-element-search'); + var toggleSearchNodeAction = UI.actionRegistry.action('elements.toggle-element-search'); // TODO: we should not access actions from other modules. if (toggleSearchNodeAction) InspectorFrontendHost.events.addEventListener( InspectorFrontendHostAPI.Events.EnterInspectElementMode, toggleSearchNodeAction.execute.bind(toggleSearchNodeAction), this); - WebInspector.inspectorView.createToolbars(); + UI.inspectorView.createToolbars(); InspectorFrontendHost.loadCompleted(); InspectorFrontendHost.events.addEventListener( InspectorFrontendHostAPI.Events.ReloadInspectedPage, this._reloadInspectedPage, this); - var extensions = self.runtime.extensions(WebInspector.QueryParamHandler); + var extensions = self.runtime.extensions(Common.QueryParamHandler); for (var extension of extensions) { var value = Runtime.queryParam(extension.descriptor()['name']); if (value !== null) @@ -263,7 +263,7 @@ /** * @param {string} value - * @param {!WebInspector.QueryParamHandler} handler + * @param {!Common.QueryParamHandler} handler */ function handleQueryParam(value, handler) { handler.handleQueryParam(value); @@ -276,7 +276,7 @@ _initializeTarget() { console.time('Main._initializeTarget'); - WebInspector.targetManager.connectToMainTarget(webSocketConnectionLost); + SDK.targetManager.connectToMainTarget(webSocketConnectionLost); InspectorFrontendHost.readyForTest(); // Asynchronously run the extensions. @@ -284,35 +284,35 @@ console.timeEnd('Main._initializeTarget'); function webSocketConnectionLost() { - if (!WebInspector._disconnectedScreenWithReasonWasShown) - WebInspector.RemoteDebuggingTerminatedScreen.show('WebSocket disconnected'); + if (!Main._disconnectedScreenWithReasonWasShown) + Main.RemoteDebuggingTerminatedScreen.show('WebSocket disconnected'); } } _lateInitialization() { console.timeStamp('Main._lateInitialization'); this._registerShortcuts(); - WebInspector.extensionServer.initializeExtensions(); + Extensions.extensionServer.initializeExtensions(); } _registerForwardedShortcuts() { /** @const */ var forwardedActions = ['main.toggle-dock', 'debugger.toggle-breakpoints-active', 'debugger.toggle-pause', 'commandMenu.show']; - var actionKeys = WebInspector.shortcutRegistry.keysForActions(forwardedActions) - .map(WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey); + var actionKeys = UI.shortcutRegistry.keysForActions(forwardedActions) + .map(UI.KeyboardShortcut.keyCodeAndModifiersFromKey); InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys)); } _registerMessageSinkListener() { - WebInspector.console.addEventListener(WebInspector.Console.Events.MessageAdded, messageAdded); + Common.console.addEventListener(Common.Console.Events.MessageAdded, messageAdded); /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ function messageAdded(event) { - var message = /** @type {!WebInspector.Console.Message} */ (event.data); + var message = /** @type {!Common.Console.Message} */ (event.data); if (message.show) - WebInspector.console.show(); + Common.console.show(); } } @@ -334,39 +334,39 @@ return; function followLink() { - if (WebInspector.isBeingEdited(target)) + if (UI.isBeingEdited(target)) return; - if (WebInspector.openAnchorLocationRegistry.dispatch({url: anchor.href, lineNumber: anchor.lineNumber})) + if (Components.openAnchorLocationRegistry.dispatch({url: anchor.href, lineNumber: anchor.lineNumber})) return; - var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(anchor.href); + var uiSourceCode = Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(anchor.href); if (uiSourceCode) { - WebInspector.Revealer.reveal(uiSourceCode.uiLocation(anchor.lineNumber || 0, anchor.columnNumber || 0)); + Common.Revealer.reveal(uiSourceCode.uiLocation(anchor.lineNumber || 0, anchor.columnNumber || 0)); return; } - var resource = WebInspector.resourceForURL(anchor.href); + var resource = Bindings.resourceForURL(anchor.href); if (resource) { - WebInspector.Revealer.reveal(resource); + Common.Revealer.reveal(resource); return; } - var request = WebInspector.NetworkLog.requestForURL(anchor.href); + var request = SDK.NetworkLog.requestForURL(anchor.href); if (request) { - WebInspector.Revealer.reveal(request); + Common.Revealer.reveal(request); return; } InspectorFrontendHost.openInNewTab(anchor.href); } - if (WebInspector.followLinkTimeout) - clearTimeout(WebInspector.followLinkTimeout); + if (Main.followLinkTimeout) + clearTimeout(Main.followLinkTimeout); if (anchor.preventFollowOnDoubleClick) { // Start a timeout if this is the first click, if the timeout is canceled // before it fires, then a double clicked happened or another link was clicked. if (event.detail === 1) - WebInspector.followLinkTimeout = setTimeout(followLink, 333); + Main.followLinkTimeout = setTimeout(followLink, 333); return; } @@ -377,54 +377,54 @@ } _registerShortcuts() { - var shortcut = WebInspector.KeyboardShortcut; - var section = WebInspector.shortcutsScreen.section(WebInspector.UIString('All Panels')); + var shortcut = UI.KeyboardShortcut; + var section = Components.shortcutsScreen.section(Common.UIString('All Panels')); var keys = [ shortcut.makeDescriptor('[', shortcut.Modifiers.CtrlOrMeta), shortcut.makeDescriptor(']', shortcut.Modifiers.CtrlOrMeta) ]; - section.addRelatedKeys(keys, WebInspector.UIString('Go to the panel to the left/right')); + section.addRelatedKeys(keys, Common.UIString('Go to the panel to the left/right')); keys = [ shortcut.makeDescriptor('[', shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt), shortcut.makeDescriptor(']', shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Alt) ]; - section.addRelatedKeys(keys, WebInspector.UIString('Go back/forward in panel history')); + section.addRelatedKeys(keys, Common.UIString('Go back/forward in panel history')); - var toggleConsoleLabel = WebInspector.UIString('Show console'); + var toggleConsoleLabel = Common.UIString('Show console'); section.addKey(shortcut.makeDescriptor(shortcut.Keys.Tilde, shortcut.Modifiers.Ctrl), toggleConsoleLabel); - section.addKey(shortcut.makeDescriptor(shortcut.Keys.Esc), WebInspector.UIString('Toggle drawer')); - if (WebInspector.dockController.canDock()) { + section.addKey(shortcut.makeDescriptor(shortcut.Keys.Esc), Common.UIString('Toggle drawer')); + if (Components.dockController.canDock()) { section.addKey( shortcut.makeDescriptor('M', shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Shift), - WebInspector.UIString('Toggle device mode')); + Common.UIString('Toggle device mode')); section.addKey( shortcut.makeDescriptor('D', shortcut.Modifiers.CtrlOrMeta | shortcut.Modifiers.Shift), - WebInspector.UIString('Toggle dock side')); + Common.UIString('Toggle dock side')); } - section.addKey(shortcut.makeDescriptor('f', shortcut.Modifiers.CtrlOrMeta), WebInspector.UIString('Search')); + section.addKey(shortcut.makeDescriptor('f', shortcut.Modifiers.CtrlOrMeta), Common.UIString('Search')); - var advancedSearchShortcutModifier = WebInspector.isMac() ? - WebInspector.KeyboardShortcut.Modifiers.Meta | WebInspector.KeyboardShortcut.Modifiers.Alt : - WebInspector.KeyboardShortcut.Modifiers.Ctrl | WebInspector.KeyboardShortcut.Modifiers.Shift; + var advancedSearchShortcutModifier = Host.isMac() ? + UI.KeyboardShortcut.Modifiers.Meta | UI.KeyboardShortcut.Modifiers.Alt : + UI.KeyboardShortcut.Modifiers.Ctrl | UI.KeyboardShortcut.Modifiers.Shift; var advancedSearchShortcut = shortcut.makeDescriptor('f', advancedSearchShortcutModifier); - section.addKey(advancedSearchShortcut, WebInspector.UIString('Search across all sources')); + section.addKey(advancedSearchShortcut, Common.UIString('Search across all sources')); var inspectElementModeShortcuts = - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('elements.toggle-element-search'); + UI.shortcutRegistry.shortcutDescriptorsForAction('elements.toggle-element-search'); if (inspectElementModeShortcuts.length) - section.addKey(inspectElementModeShortcuts[0], WebInspector.UIString('Select node to inspect')); + section.addKey(inspectElementModeShortcuts[0], Common.UIString('Select node to inspect')); var openResourceShortcut = - WebInspector.KeyboardShortcut.makeDescriptor('p', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); - section.addKey(openResourceShortcut, WebInspector.UIString('Go to source')); + UI.KeyboardShortcut.makeDescriptor('p', UI.KeyboardShortcut.Modifiers.CtrlOrMeta); + section.addKey(openResourceShortcut, Common.UIString('Go to source')); - if (WebInspector.isMac()) { + if (Host.isMac()) { keys = [ shortcut.makeDescriptor('g', shortcut.Modifiers.Meta), shortcut.makeDescriptor('g', shortcut.Modifiers.Meta | shortcut.Modifiers.Shift) ]; - section.addRelatedKeys(keys, WebInspector.UIString('Find next/previous')); + section.addRelatedKeys(keys, Common.UIString('Find next/previous')); } } @@ -440,15 +440,15 @@ event.preventDefault(); } - if (!WebInspector.Dialog.hasInstance() && WebInspector.inspectorView.currentPanelDeprecated()) { - WebInspector.inspectorView.currentPanelDeprecated().handleShortcut(event); + if (!UI.Dialog.hasInstance() && UI.inspectorView.currentPanelDeprecated()) { + UI.inspectorView.currentPanelDeprecated().handleShortcut(event); if (event.handled) { event.consume(true); return; } } - WebInspector.shortcutRegistry.handleShortcut(event); + UI.shortcutRegistry.handleShortcut(event); } /** @@ -484,40 +484,40 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _reloadInspectedPage(event) { var hard = /** @type {boolean} */ (event.data); - WebInspector.Main._reloadPage(hard); + Main.Main._reloadPage(hard); } _onSuspendStateChanged() { - var suspended = WebInspector.targetManager.allTargetsSuspended(); - WebInspector.inspectorView.onSuspendStateChanged(suspended); + var suspended = SDK.targetManager.allTargetsSuspended(); + UI.inspectorView.onSuspendStateChanged(suspended); } }; /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.Main.InspectorDomainObserver = class { +Main.Main.InspectorDomainObserver = class { constructor() { - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - target.registerInspectorDispatcher(new WebInspector.Main.InspectorDomainDispatcher(target)); + target.registerInspectorDispatcher(new Main.Main.InspectorDomainDispatcher(target)); target.inspectorAgent().enable(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } @@ -527,9 +527,9 @@ * @implements {Protocol.InspectorDispatcher} * @unrestricted */ -WebInspector.Main.InspectorDomainDispatcher = class { +Main.Main.InspectorDomainDispatcher = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { this._target = target; @@ -540,41 +540,41 @@ * @param {string} reason */ detached(reason) { - WebInspector._disconnectedScreenWithReasonWasShown = true; - WebInspector.RemoteDebuggingTerminatedScreen.show(reason); + Main._disconnectedScreenWithReasonWasShown = true; + Main.RemoteDebuggingTerminatedScreen.show(reason); } /** * @override */ targetCrashed() { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(this._target); + var debuggerModel = SDK.DebuggerModel.fromTarget(this._target); if (debuggerModel) - WebInspector.TargetCrashedScreen.show(debuggerModel); + Main.TargetCrashedScreen.show(debuggerModel); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.Main.ReloadActionDelegate = class { +Main.Main.ReloadActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { switch (actionId) { case 'main.reload': - WebInspector.Main._reloadPage(false); + Main.Main._reloadPage(false); return true; case 'main.hard-reload': - WebInspector.Main._reloadPage(true); + Main.Main._reloadPage(true); return true; case 'main.debug-reload': - WebInspector.reload(); + Components.reload(); return true; } return false; @@ -582,13 +582,13 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.Main.ZoomActionDelegate = class { +Main.Main.ZoomActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ @@ -612,20 +612,20 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.Main.SearchActionDelegate = class { +Main.Main.SearchActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} * @suppressGlobalPropertiesCheck */ handleAction(context, actionId) { - var searchableView = WebInspector.SearchableView.fromElement(document.deepActiveElement()) || - WebInspector.inspectorView.currentPanelDeprecated().searchableView(); + var searchableView = UI.SearchableView.fromElement(document.deepActiveElement()) || + UI.inspectorView.currentPanelDeprecated().searchableView(); if (!searchableView) return false; switch (actionId) { @@ -644,29 +644,29 @@ /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.Main.WarningErrorCounter = class { +Main.Main.WarningErrorCounter = class { constructor() { - WebInspector.Main.WarningErrorCounter._instanceForTest = this; + Main.Main.WarningErrorCounter._instanceForTest = this; this._counter = createElement('div'); - this._counter.addEventListener('click', WebInspector.console.show.bind(WebInspector.console), false); - this._toolbarItem = new WebInspector.ToolbarItem(this._counter); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(this._counter, 'main/errorWarningCounter.css'); + this._counter.addEventListener('click', Common.console.show.bind(Common.console), false); + this._toolbarItem = new UI.ToolbarItem(this._counter); + var shadowRoot = UI.createShadowRootWithCoreStyles(this._counter, 'main/errorWarningCounter.css'); this._errors = this._createItem(shadowRoot, 'smallicon-error'); this._revokedErrors = this._createItem(shadowRoot, 'smallicon-revoked-error'); this._warnings = this._createItem(shadowRoot, 'smallicon-warning'); this._titles = []; - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.ConsoleCleared, this._update, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageAdded, this._update, this); - WebInspector.multitargetConsoleModel.addEventListener( - WebInspector.ConsoleModel.Events.MessageUpdated, this._update, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.ConsoleCleared, this._update, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageAdded, this._update, this); + SDK.multitargetConsoleModel.addEventListener( + SDK.ConsoleModel.Events.MessageUpdated, this._update, this); this._update(); } @@ -702,7 +702,7 @@ var errors = 0; var revokedErrors = 0; var warnings = 0; - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); for (var i = 0; i < targets.length; ++i) { errors += targets[i].consoleModel.errors(); revokedErrors += targets[i].consoleModel.revokedErrors(); @@ -712,21 +712,21 @@ this._titles = []; this._toolbarItem.setVisible(!!(errors || revokedErrors || warnings)); this._updateItem( - this._errors, errors, false, WebInspector.UIString(errors === 1 ? '%d error' : '%d errors', errors)); + this._errors, errors, false, Common.UIString(errors === 1 ? '%d error' : '%d errors', errors)); this._updateItem( this._revokedErrors, revokedErrors, !errors, - WebInspector.UIString( + Common.UIString( revokedErrors === 1 ? '%d handled promise rejection' : '%d handled promise rejections', revokedErrors)); this._updateItem( this._warnings, warnings, !errors && !revokedErrors, - WebInspector.UIString(warnings === 1 ? '%d warning' : '%d warnings', warnings)); + Common.UIString(warnings === 1 ? '%d warning' : '%d warnings', warnings)); this._counter.title = this._titles.join(', '); - WebInspector.inspectorView.toolbarItemResized(); + UI.inspectorView.toolbarItemResized(); } /** * @override - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item() { return this._toolbarItem; @@ -734,52 +734,52 @@ }; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.Main.MainMenuItem = class { +Main.Main.MainMenuItem = class { constructor() { this._item = - new WebInspector.ToolbarButton(WebInspector.UIString('Customize and control DevTools'), 'largeicon-menu'); + new UI.ToolbarButton(Common.UIString('Customize and control DevTools'), 'largeicon-menu'); this._item.addEventListener('mousedown', this._mouseDown, this); } /** * @override - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item() { return this._item; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _mouseDown(event) { - var contextMenu = new WebInspector.ContextMenu( + var contextMenu = new UI.ContextMenu( /** @type {!Event} */ (event.data), true, this._item.element.totalOffsetLeft(), this._item.element.totalOffsetTop() + this._item.element.offsetHeight); - if (WebInspector.dockController.canDock()) { + if (Components.dockController.canDock()) { var dockItemElement = createElementWithClass('div', 'flex-centered flex-auto'); var titleElement = dockItemElement.createChild('span', 'flex-auto'); - titleElement.textContent = WebInspector.UIString('Dock side'); - var toggleDockSideShorcuts = WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.toggle-dock'); - titleElement.title = WebInspector.UIString( + titleElement.textContent = Common.UIString('Dock side'); + var toggleDockSideShorcuts = UI.shortcutRegistry.shortcutDescriptorsForAction('main.toggle-dock'); + titleElement.title = Common.UIString( 'Placement of DevTools relative to the page. (%s to restore last position)', toggleDockSideShorcuts[0].name); dockItemElement.appendChild(titleElement); - var dockItemToolbar = new WebInspector.Toolbar('', dockItemElement); + var dockItemToolbar = new UI.Toolbar('', dockItemElement); dockItemToolbar.makeBlueOnHover(); - var undock = new WebInspector.ToolbarToggle( - WebInspector.UIString('Undock into separate window'), 'largeicon-undock'); - var bottom = new WebInspector.ToolbarToggle(WebInspector.UIString('Dock to bottom'), 'largeicon-dock-to-bottom'); - var right = new WebInspector.ToolbarToggle(WebInspector.UIString('Dock to right'), 'largeicon-dock-to-right'); - undock.addEventListener('mouseup', setDockSide.bind(null, WebInspector.DockController.State.Undocked)); - bottom.addEventListener('mouseup', setDockSide.bind(null, WebInspector.DockController.State.DockedToBottom)); - right.addEventListener('mouseup', setDockSide.bind(null, WebInspector.DockController.State.DockedToRight)); - undock.setToggled(WebInspector.dockController.dockSide() === WebInspector.DockController.State.Undocked); - bottom.setToggled(WebInspector.dockController.dockSide() === WebInspector.DockController.State.DockedToBottom); - right.setToggled(WebInspector.dockController.dockSide() === WebInspector.DockController.State.DockedToRight); + var undock = new UI.ToolbarToggle( + Common.UIString('Undock into separate window'), 'largeicon-undock'); + var bottom = new UI.ToolbarToggle(Common.UIString('Dock to bottom'), 'largeicon-dock-to-bottom'); + var right = new UI.ToolbarToggle(Common.UIString('Dock to right'), 'largeicon-dock-to-right'); + undock.addEventListener('mouseup', setDockSide.bind(null, Components.DockController.State.Undocked)); + bottom.addEventListener('mouseup', setDockSide.bind(null, Components.DockController.State.DockedToBottom)); + right.addEventListener('mouseup', setDockSide.bind(null, Components.DockController.State.DockedToRight)); + undock.setToggled(Components.dockController.dockSide() === Components.DockController.State.Undocked); + bottom.setToggled(Components.dockController.dockSide() === Components.DockController.State.DockedToBottom); + right.setToggled(Components.dockController.dockSide() === Components.DockController.State.DockedToRight); dockItemToolbar.appendToolbarItem(undock); dockItemToolbar.appendToolbarItem(bottom); dockItemToolbar.appendToolbarItem(right); @@ -791,14 +791,14 @@ * @param {string} side */ function setDockSide(side) { - WebInspector.dockController.setDockSide(side); + Components.dockController.setDockSide(side); contextMenu.discard(); } contextMenu.appendAction( - 'main.toggle-drawer', WebInspector.inspectorView.drawerVisible() ? - WebInspector.UIString('Hide console drawer') : - WebInspector.UIString('Show console drawer')); + 'main.toggle-drawer', UI.inspectorView.drawerVisible() ? + Common.UIString('Hide console drawer') : + Common.UIString('Show console drawer')); contextMenu.appendItemsAtLocation('mainMenu'); var moreTools = contextMenu.namedSubMenu('mainMenuMoreTools'); var extensions = self.runtime.extensions('view', undefined, true); @@ -809,7 +809,7 @@ if (descriptor['location'] !== 'drawer-view' && descriptor['location'] !== 'panel') continue; moreTools.appendItem( - extension.title(), WebInspector.viewManager.showView.bind(WebInspector.viewManager, descriptor['id'])); + extension.title(), UI.viewManager.showView.bind(UI.viewManager, descriptor['id'])); } contextMenu.show(); @@ -819,26 +819,26 @@ /** * @unrestricted */ -WebInspector.NetworkPanelIndicator = class { +Main.NetworkPanelIndicator = class { constructor() { // TODO: we should not access network from other modules. - if (!WebInspector.inspectorView.hasPanel('network')) + if (!UI.inspectorView.hasPanel('network')) return; - var manager = WebInspector.multitargetNetworkManager; - manager.addEventListener(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged, updateVisibility); - var blockedURLsSetting = WebInspector.moduleSetting('blockedURLs'); + var manager = SDK.multitargetNetworkManager; + manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChanged, updateVisibility); + var blockedURLsSetting = Common.moduleSetting('blockedURLs'); blockedURLsSetting.addChangeListener(updateVisibility); updateVisibility(); function updateVisibility() { if (manager.isThrottling()) { - WebInspector.inspectorView.setPanelIcon( - 'network', 'smallicon-warning', WebInspector.UIString('Network throttling is enabled')); + UI.inspectorView.setPanelIcon( + 'network', 'smallicon-warning', Common.UIString('Network throttling is enabled')); } else if (blockedURLsSetting.get().length) { - WebInspector.inspectorView.setPanelIcon( - 'network', 'smallicon-warning', WebInspector.UIString('Requests may be blocked')); + UI.inspectorView.setPanelIcon( + 'network', 'smallicon-warning', Common.UIString('Requests may be blocked')); } else { - WebInspector.inspectorView.setPanelIcon('network', '', ''); + UI.inspectorView.setPanelIcon('network', '', ''); } } } @@ -847,18 +847,18 @@ /** * @unrestricted */ -WebInspector.SourcesPanelIndicator = class { +Main.SourcesPanelIndicator = class { constructor() { - WebInspector.moduleSetting('javaScriptDisabled').addChangeListener(javaScriptDisabledChanged); + Common.moduleSetting('javaScriptDisabled').addChangeListener(javaScriptDisabledChanged); javaScriptDisabledChanged(); function javaScriptDisabledChanged() { - var javaScriptDisabled = WebInspector.moduleSetting('javaScriptDisabled').get(); + var javaScriptDisabled = Common.moduleSetting('javaScriptDisabled').get(); if (javaScriptDisabled) { - WebInspector.inspectorView.setPanelIcon( - 'sources', 'smallicon-warning', WebInspector.UIString('JavaScript is disabled')); + UI.inspectorView.setPanelIcon( + 'sources', 'smallicon-warning', Common.UIString('JavaScript is disabled')); } else { - WebInspector.inspectorView.setPanelIcon('sources', '', ''); + UI.inspectorView.setPanelIcon('sources', '', ''); } } } @@ -867,40 +867,40 @@ /** * @unrestricted */ -WebInspector.Main.PauseListener = class { +Main.Main.PauseListener = class { constructor() { - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerPaused(event) { - WebInspector.targetManager.removeModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); - var debuggerPausedDetails = /** @type {!WebInspector.DebuggerPausedDetails} */ (event.data); - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); - WebInspector.context.setFlavor(WebInspector.Target, debuggerModel.target()); - WebInspector.Revealer.reveal(debuggerPausedDetails); + SDK.targetManager.removeModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); + var debuggerPausedDetails = /** @type {!SDK.DebuggerPausedDetails} */ (event.data); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); + UI.context.setFlavor(SDK.Target, debuggerModel.target()); + Common.Revealer.reveal(debuggerPausedDetails); } }; /** * @unrestricted */ -WebInspector.Main.InspectedNodeRevealer = class { +Main.Main.InspectedNodeRevealer = class { constructor() { - WebInspector.targetManager.addModelListener( - WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeInspected, this._inspectNode, this); + SDK.targetManager.addModelListener( + SDK.DOMModel, SDK.DOMModel.Events.NodeInspected, this._inspectNode, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _inspectNode(event) { - var deferredNode = /** @type {!WebInspector.DeferredDOMNode} */ (event.data); - WebInspector.Revealer.reveal(deferredNode); + var deferredNode = /** @type {!SDK.DeferredDOMNode} */ (event.data); + Common.Revealer.reveal(deferredNode); } }; @@ -909,7 +909,7 @@ * @param {?Object} params * @return {!Promise} */ -WebInspector.sendOverProtocol = function(method, params) { +Main.sendOverProtocol = function(method, params) { return new Promise((resolve, reject) => { InspectorBackendClass.sendRawMessageForTesting(method, params, (err, result) => { if (err) @@ -922,7 +922,7 @@ /** * @unrestricted */ -WebInspector.RemoteDebuggingTerminatedScreen = class extends WebInspector.VBox { +Main.RemoteDebuggingTerminatedScreen = class extends UI.VBox { /** * @param {string} reason */ @@ -930,11 +930,11 @@ super(true); this.registerRequiredCSS('main/remoteDebuggingTerminatedScreen.css'); var message = this.contentElement.createChild('div', 'message'); - message.createChild('span').textContent = WebInspector.UIString('Debugging connection was closed. Reason: '); + message.createChild('span').textContent = Common.UIString('Debugging connection was closed. Reason: '); message.createChild('span', 'reason').textContent = reason; this.contentElement.createChild('div', 'message').textContent = - WebInspector.UIString('Reconnect when ready by reopening DevTools.'); - var button = createTextButton(WebInspector.UIString('Reconnect DevTools'), () => window.location.reload()); + Common.UIString('Reconnect when ready by reopening DevTools.'); + var button = createTextButton(Common.UIString('Reconnect DevTools'), () => window.location.reload()); this.contentElement.createChild('div', 'button').appendChild(button); } @@ -942,11 +942,11 @@ * @param {string} reason */ static show(reason) { - var dialog = new WebInspector.Dialog(); + var dialog = new UI.Dialog(); dialog.setWrapsContent(true); dialog.addCloseButton(); dialog.setDimmed(true); - new WebInspector.RemoteDebuggingTerminatedScreen(reason).show(dialog.element); + new Main.RemoteDebuggingTerminatedScreen(reason).show(dialog.element); dialog.show(); } }; @@ -955,7 +955,7 @@ /** * @unrestricted */ -WebInspector.TargetCrashedScreen = class extends WebInspector.VBox { +Main.TargetCrashedScreen = class extends UI.VBox { /** * @param {function()} hideCallback */ @@ -963,28 +963,28 @@ super(true); this.registerRequiredCSS('main/targetCrashedScreen.css'); this.contentElement.createChild('div', 'message').textContent = - WebInspector.UIString('DevTools was disconnected from the page.'); + Common.UIString('DevTools was disconnected from the page.'); this.contentElement.createChild('div', 'message').textContent = - WebInspector.UIString('Once page is reloaded, DevTools will automatically reconnect.'); + Common.UIString('Once page is reloaded, DevTools will automatically reconnect.'); this._hideCallback = hideCallback; } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel */ static show(debuggerModel) { - var dialog = new WebInspector.Dialog(); + var dialog = new UI.Dialog(); dialog.setWrapsContent(true); dialog.addCloseButton(); dialog.setDimmed(true); var hideBound = dialog.detach.bind(dialog); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, hideBound); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, hideBound); - new WebInspector.TargetCrashedScreen(onHide).show(dialog.element); + new Main.TargetCrashedScreen(onHide).show(dialog.element); dialog.show(); function onHide() { - debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, hideBound); + debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, hideBound); } } @@ -998,20 +998,20 @@ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.BackendSettingsSync = class { +Main.BackendSettingsSync = class { constructor() { - this._autoAttachSetting = WebInspector.settings.moduleSetting('autoAttachToCreatedPages'); + this._autoAttachSetting = Common.settings.moduleSetting('autoAttachToCreatedPages'); this._autoAttachSetting.addChangeListener(this._update, this); - this._disableJavascriptSetting = WebInspector.settings.moduleSetting('javaScriptDisabled'); + this._disableJavascriptSetting = Common.settings.moduleSetting('javaScriptDisabled'); this._disableJavascriptSetting.addChangeListener(this._update, this); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _updateTarget(target) { target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get()); @@ -1019,11 +1019,11 @@ } _update() { - WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser).forEach(this._updateTarget, this); + SDK.targetManager.targets(SDK.Target.Capability.Browser).forEach(this._updateTarget, this); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @override */ targetAdded(target) { @@ -1032,7 +1032,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @override */ targetRemoved(target) { @@ -1040,18 +1040,18 @@ }; /** - * @implements {WebInspector.SettingUI} + * @implements {UI.SettingUI} * @unrestricted */ -WebInspector.ShowMetricsRulersSettingUI = class { +Main.ShowMetricsRulersSettingUI = class { /** * @override * @return {?Element} */ settingElement() { - return WebInspector.SettingsUI.createSettingCheckbox( - WebInspector.UIString('Show rulers'), WebInspector.moduleSetting('showMetricsRulers')); + return UI.SettingsUI.createSettingCheckbox( + Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers')); } }; -new WebInspector.Main(); +new Main.Main();
diff --git a/third_party/WebKit/Source/devtools/front_end/main/OverlayController.js b/third_party/WebKit/Source/devtools/front_end/main/OverlayController.js index 85cca5c7..480f3b9 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/OverlayController.js +++ b/third_party/WebKit/Source/devtools/front_end/main/OverlayController.js
@@ -4,42 +4,42 @@ /** * @unrestricted */ -WebInspector.OverlayController = class { +Main.OverlayController = class { constructor() { - WebInspector.moduleSetting('disablePausedStateOverlay').addChangeListener(this._updateAllOverlays, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._updateOverlay, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._updateOverlay, this); + Common.moduleSetting('disablePausedStateOverlay').addChangeListener(this._updateAllOverlays, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._updateOverlay, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._updateOverlay, this); // TODO(dgozman): we should get DebuggerResumed on navigations instead of listening to GlobalObjectCleared. - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._updateOverlay, this); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._updateAllOverlays, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._updateOverlay, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._updateAllOverlays, this); } _updateAllOverlays() { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) this._updateTargetOverlay( - /** @type {!WebInspector.DebuggerModel} */ (WebInspector.DebuggerModel.fromTarget(target))); + /** @type {!SDK.DebuggerModel} */ (SDK.DebuggerModel.fromTarget(target))); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _updateOverlay(event) { - this._updateTargetOverlay(/** @type {!WebInspector.DebuggerModel} */ (event.target)); + this._updateTargetOverlay(/** @type {!SDK.DebuggerModel} */ (event.target)); } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel */ _updateTargetOverlay(debuggerModel) { if (!debuggerModel.target().hasBrowserCapability()) return; - var message = debuggerModel.isPaused() && !WebInspector.moduleSetting('disablePausedStateOverlay').get() ? - WebInspector.UIString('Paused in debugger') : + var message = debuggerModel.isPaused() && !Common.moduleSetting('disablePausedStateOverlay').get() ? + Common.UIString('Paused in debugger') : undefined; - debuggerModel.target().pageAgent().configureOverlay(WebInspector.targetManager.allTargetsSuspended(), message); + debuggerModel.target().pageAgent().configureOverlay(SDK.targetManager.allTargetsSuspended(), message); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/main/RenderingOptions.js b/third_party/WebKit/Source/devtools/front_end/main/RenderingOptions.js index 9f60849..c24678b 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/RenderingOptions.js +++ b/third_party/WebKit/Source/devtools/front_end/main/RenderingOptions.js
@@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.RenderingOptionsView = class extends WebInspector.VBox { +Main.RenderingOptionsView = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('main/renderingOptions.css'); @@ -41,23 +41,23 @@ var options = [ { - label: WebInspector.UIString('Paint Flashing'), - subtitle: WebInspector.UIString('Highlights areas of the page that need to be repainted'), + label: Common.UIString('Paint Flashing'), + subtitle: Common.UIString('Highlights areas of the page that need to be repainted'), setterName: 'setShowPaintRects' }, { - label: WebInspector.UIString('Layer Borders'), - subtitle: WebInspector.UIString('Shows layer borders (orange/olive) and tiles (cyan)'), + label: Common.UIString('Layer Borders'), + subtitle: Common.UIString('Shows layer borders (orange/olive) and tiles (cyan)'), setterName: 'setShowDebugBorders' }, { - label: WebInspector.UIString('FPS Meter'), - subtitle: WebInspector.UIString('Plots frames per second, frame rate distribution, and GPU memory'), + label: Common.UIString('FPS Meter'), + subtitle: Common.UIString('Plots frames per second, frame rate distribution, and GPU memory'), setterName: 'setShowFPSCounter' }, { - label: WebInspector.UIString('Scrolling Performance Issues'), - subtitle: WebInspector.UIString('Shows areas of the page that slow down scrolling'), + label: Common.UIString('Scrolling Performance Issues'), + subtitle: Common.UIString('Shows areas of the page that slow down scrolling'), setterName: 'setShowScrollBottleneckRects', tooltip: 'Touch and mousewheel event listeners can delay scrolling.\nSome areas need to repaint their content when scrolled.' @@ -68,29 +68,29 @@ this.contentElement.createChild('div').classList.add('panel-section-separator'); - var cssMediaSubtitle = WebInspector.UIString('Forces media type for testing print and screen styles'); - var checkboxLabel = createCheckboxLabel(WebInspector.UIString('Emulate CSS Media'), false, cssMediaSubtitle); + var cssMediaSubtitle = Common.UIString('Forces media type for testing print and screen styles'); + var checkboxLabel = createCheckboxLabel(Common.UIString('Emulate CSS Media'), false, cssMediaSubtitle); this._mediaCheckbox = checkboxLabel.checkboxElement; this._mediaCheckbox.addEventListener('click', this._mediaToggled.bind(this), false); this.contentElement.appendChild(checkboxLabel); var mediaRow = this.contentElement.createChild('div', 'media-row'); this._mediaSelect = mediaRow.createChild('select', 'chrome-select'); - this._mediaSelect.appendChild(new Option(WebInspector.UIString('print'), 'print')); - this._mediaSelect.appendChild(new Option(WebInspector.UIString('screen'), 'screen')); + this._mediaSelect.appendChild(new Option(Common.UIString('print'), 'print')); + this._mediaSelect.appendChild(new Option(Common.UIString('screen'), 'screen')); this._mediaSelect.addEventListener('change', this._mediaToggled.bind(this), false); this._mediaSelect.disabled = true; - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** - * @return {!WebInspector.RenderingOptionsView} + * @return {!Main.RenderingOptionsView} */ static instance() { - if (!WebInspector.RenderingOptionsView._instanceObject) - WebInspector.RenderingOptionsView._instanceObject = new WebInspector.RenderingOptionsView(); - return WebInspector.RenderingOptionsView._instanceObject; + if (!Main.RenderingOptionsView._instanceObject) + Main.RenderingOptionsView._instanceObject = new Main.RenderingOptionsView(); + return Main.RenderingOptionsView._instanceObject; } /** @@ -113,13 +113,13 @@ */ _settingToggled(setterName) { var enabled = this._settings.get(setterName).checked; - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Browser)) target.renderingAgent()[setterName](enabled); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { for (var setterName of this._settings.keysArray()) { @@ -132,24 +132,24 @@ _mediaToggled() { this._mediaSelect.disabled = !this._mediaCheckbox.checked; - var targets = WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser); + var targets = SDK.targetManager.targets(SDK.Target.Capability.Browser); for (var target of targets) this._applyPrintMediaOverride(target); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _applyPrintMediaOverride(target) { target.emulationAgent().setEmulatedMedia(this._mediaCheckbox.checked ? this._mediaSelect.value : ''); - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (cssModel) cssModel.mediaQueryResultChanged(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { }
diff --git a/third_party/WebKit/Source/devtools/front_end/main/SimpleApp.js b/third_party/WebKit/Source/devtools/front_end/main/SimpleApp.js index 9488a34..0fe00c1 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/SimpleApp.js +++ b/third_party/WebKit/Source/devtools/front_end/main/SimpleApp.js
@@ -2,31 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.App} + * @implements {Common.App} * @unrestricted */ -WebInspector.SimpleApp = class { +Main.SimpleApp = class { /** * @override * @param {!Document} document */ presentUI(document) { - var rootView = new WebInspector.RootView(); - WebInspector.inspectorView.show(rootView.element); + var rootView = new UI.RootView(); + UI.inspectorView.show(rootView.element); rootView.attachToDocument(document); } }; /** - * @implements {WebInspector.AppProvider} + * @implements {Common.AppProvider} * @unrestricted */ -WebInspector.SimpleAppProvider = class { +Main.SimpleAppProvider = class { /** * @override - * @return {!WebInspector.App} + * @return {!Common.App} */ createApp() { - return new WebInspector.SimpleApp(); + return new Main.SimpleApp(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/main/module.json b/third_party/WebKit/Source/devtools/front_end/main/module.json index 6eab8b0c..d2569b4b 100644 --- a/third_party/WebKit/Source/devtools/front_end/main/module.json +++ b/third_party/WebKit/Source/devtools/front_end/main/module.json
@@ -1,20 +1,20 @@ { "extensions": [ { - "type": "@WebInspector.AppProvider", - "className": "WebInspector.SimpleAppProvider", + "type": "@Common.AppProvider", + "className": "Main.SimpleAppProvider", "order": 10 }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.UISourceCode", "WebInspector.Resource", "WebInspector.NetworkRequest", "Node"], - "className": "WebInspector.HandlerRegistry.ContextMenuProvider" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["Workspace.UISourceCode", "SDK.Resource", "SDK.NetworkRequest", "Node"], + "className": "Components.HandlerRegistry.ContextMenuProvider" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Navigation", "actionId": "main.reload", - "className": "WebInspector.Main.ReloadActionDelegate", + "className": "Main.Main.ReloadActionDelegate", "title": "Reload page", "bindings": [ { @@ -28,10 +28,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Navigation", "actionId": "main.hard-reload", - "className": "WebInspector.Main.ReloadActionDelegate", + "className": "Main.Main.ReloadActionDelegate", "title": "Hard reload page", "bindings": [ { @@ -45,10 +45,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Drawer", "actionId": "main.toggle-drawer", - "className": "WebInspector.InspectorView.DrawerToggleActionDelegate", + "className": "UI.InspectorView.DrawerToggleActionDelegate", "order": 100, "title": "Toggle drawer", "bindings": [ @@ -58,9 +58,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.debug-reload", - "className": "WebInspector.Main.ReloadActionDelegate", + "className": "Main.Main.ReloadActionDelegate", "bindings": [ { "shortcut": "Alt+R" @@ -68,11 +68,11 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "DevTools", "title": "Restore last dock position", "actionId": "main.toggle-dock", - "className": "WebInspector.DockController.ToggleDockActionDelegate", + "className": "Components.DockController.ToggleDockActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -85,9 +85,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.zoom-in", - "className": "WebInspector.Main.ZoomActionDelegate", + "className": "Main.Main.ZoomActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -100,9 +100,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.zoom-out", - "className": "WebInspector.Main.ZoomActionDelegate", + "className": "Main.Main.ZoomActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -115,9 +115,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.zoom-reset", - "className": "WebInspector.Main.ZoomActionDelegate", + "className": "Main.Main.ZoomActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -130,9 +130,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.search-in-panel.find", - "className": "WebInspector.Main.SearchActionDelegate", + "className": "Main.Main.SearchActionDelegate", "bindings": [ { "platform": "windows,linux", @@ -145,9 +145,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.search-in-panel.cancel", - "className": "WebInspector.Main.SearchActionDelegate", + "className": "Main.Main.SearchActionDelegate", "order": 10, "bindings": [ { @@ -156,9 +156,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.search-in-panel.find-next", - "className": "WebInspector.Main.SearchActionDelegate", + "className": "Main.Main.SearchActionDelegate", "bindings": [ { "platform": "mac", @@ -167,9 +167,9 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "main.search-in-panel.find-previous", - "className": "WebInspector.Main.SearchActionDelegate", + "className": "Main.Main.SearchActionDelegate", "bindings": [ { "platform": "mac", @@ -178,32 +178,32 @@ ] }, { - "type": "@WebInspector.ToolbarItem.Provider", + "type": "@UI.ToolbarItem.Provider", "separator": true, "location": "main-toolbar-left", "order": 100 }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.Main.WarningErrorCounter", + "type": "@UI.ToolbarItem.Provider", + "className": "Main.Main.WarningErrorCounter", "order": 1, "location": "main-toolbar-right" }, { - "type": "@WebInspector.ToolbarItem.Provider", + "type": "@UI.ToolbarItem.Provider", "separator": true, "order": 98, "location": "main-toolbar-right" }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.Main.MainMenuItem", + "type": "@UI.ToolbarItem.Provider", + "className": "Main.Main.MainMenuItem", "order": 99, "location": "main-toolbar-right" }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.DockController.CloseButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Components.DockController.CloseButtonProvider", "order": 100, "location": "main-toolbar-right" }, @@ -297,15 +297,15 @@ "defaultValue": false }, { - "type": "@WebInspector.SettingUI", + "type": "@UI.SettingUI", "category": "Extensions", - "className": "WebInspector.HandlerRegistry.OpenAnchorLocationSettingUI" + "className": "Components.HandlerRegistry.OpenAnchorLocationSettingUI" }, { - "type": "@WebInspector.SettingUI", + "type": "@UI.SettingUI", "category": "Elements", "order": 3, - "className": "WebInspector.ShowMetricsRulersSettingUI" + "className": "Main.ShowMetricsRulersSettingUI" }, { "type": "context-menu-item", @@ -321,7 +321,7 @@ "title": "Rendering", "persistence": "closeable", "order": 50, - "className": "WebInspector.RenderingOptionsView" + "className": "Main.RenderingOptionsView" }, { "type": "setting", @@ -336,9 +336,9 @@ ] }, { - "type": "@WebInspector.ViewLocationResolver", + "type": "@UI.ViewLocationResolver", "name": "drawer-view", - "className": "WebInspector.InspectorView" + "className": "UI.InspectorView" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js b/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js index 690b95a..d63ac03 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js +++ b/third_party/WebKit/Source/devtools/front_end/network/BlockedURLsPane.js
@@ -4,30 +4,30 @@ /** * @unrestricted */ -WebInspector.BlockedURLsPane = class extends WebInspector.VBox { +Network.BlockedURLsPane = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('network/blockedURLsPane.css'); this.contentElement.classList.add('blocked-urls-pane'); - WebInspector.BlockedURLsPane._instance = this; + Network.BlockedURLsPane._instance = this; - this._blockedURLsSetting = WebInspector.moduleSetting('blockedURLs'); + this._blockedURLsSetting = Common.moduleSetting('blockedURLs'); this._blockedURLsSetting.addChangeListener(this._update, this); - this._toolbar = new WebInspector.Toolbar('', this.contentElement); + this._toolbar = new UI.Toolbar('', this.contentElement); this._toolbar.element.addEventListener('click', (e) => e.consume()); - var addButton = new WebInspector.ToolbarButton(WebInspector.UIString('Add pattern'), 'largeicon-add'); + var addButton = new UI.ToolbarButton(Common.UIString('Add pattern'), 'largeicon-add'); addButton.addEventListener('click', this._addButtonClicked.bind(this)); this._toolbar.appendToolbarItem(addButton); - var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString('Remove all'), 'largeicon-clear'); + var clearButton = new UI.ToolbarButton(Common.UIString('Remove all'), 'largeicon-clear'); clearButton.addEventListener('click', this._removeAll.bind(this)); this._toolbar.appendToolbarItem(clearButton); this._emptyElement = this.contentElement.createChild('div', 'no-blocked-urls'); - this._emptyElement.createChild('span').textContent = WebInspector.UIString('Requests are not blocked. '); + this._emptyElement.createChild('span').textContent = Common.UIString('Requests are not blocked. '); var addLink = this._emptyElement.createChild('span', 'link'); - addLink.textContent = WebInspector.UIString('Add pattern.'); + addLink.textContent = Common.UIString('Add pattern.'); addLink.href = ''; addLink.addEventListener('click', this._addButtonClicked.bind(this), false); this._emptyElement.addEventListener('contextmenu', this._emptyElementContextMenu.bind(this), true); @@ -36,25 +36,25 @@ /** @type {!Map<string, number>} */ this._blockedCountForUrl = new Map(); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); - this._updateThrottler = new WebInspector.Throttler(200); + this._updateThrottler = new Common.Throttler(200); this._update(); } static reset() { - if (WebInspector.BlockedURLsPane._instance) - WebInspector.BlockedURLsPane._instance.reset(); + if (Network.BlockedURLsPane._instance) + Network.BlockedURLsPane._instance.reset(); } /** * @param {!Event} event */ _emptyElementContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString.capitalize('Add ^pattern'), this._addButtonClicked.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString.capitalize('Add ^pattern'), this._addButtonClicked.bind(this)); contextMenu.show(); } @@ -79,13 +79,13 @@ var input = element.createChild('input'); input.setAttribute('type', 'text'); input.value = content; - input.placeholder = WebInspector.UIString('Text pattern to block matching requests; use * for wildcard'); + input.placeholder = Common.UIString('Text pattern to block matching requests; use * for wildcard'); input.addEventListener('blur', commit.bind(this), false); input.addEventListener('keydown', keydown.bind(this), false); input.focus(); /** - * @this {WebInspector.BlockedURLsPane} + * @this {Network.BlockedURLsPane} */ function finish() { this._editing = false; @@ -94,7 +94,7 @@ } /** - * @this {WebInspector.BlockedURLsPane} + * @this {Network.BlockedURLsPane} */ function commit() { if (!this._editing) @@ -108,14 +108,14 @@ } /** - * @this {WebInspector.BlockedURLsPane} + * @this {Network.BlockedURLsPane} * @param {!Event} event */ function keydown(event) { if (isEnterKey(event)) { event.consume(); commit.call(this); - } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') { + } else if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') { event.consume(); finish.call(this); this._update(); @@ -160,11 +160,11 @@ * @param {!Event} event */ _contextMenu(index, event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString.capitalize('Add ^pattern'), this._addButtonClicked.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString.capitalize('Add ^pattern'), this._addButtonClicked.bind(this)); contextMenu.appendItem( - WebInspector.UIString.capitalize('Remove ^pattern'), this._removeBlockedURL.bind(this, index)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Remove ^all'), this._removeAll.bind(this)); + Common.UIString.capitalize('Remove ^pattern'), this._removeBlockedURL.bind(this, index)); + contextMenu.appendItem(Common.UIString.capitalize('Remove ^all'), this._removeAll.bind(this)); contextMenu.show(); } @@ -198,11 +198,11 @@ var count = this._blockedRequestsCount(url); var countElement = element.createChild('div', 'blocked-count monospace'); countElement.textContent = String.sprintf('[%d]', count); - countElement.title = WebInspector.UIString( + countElement.title = Common.UIString( count === 1 ? '%d request blocked by this pattern' : '%d requests blocked by this pattern', count); var removeButton = element.createChild('div', 'remove-button'); - removeButton.title = WebInspector.UIString('Remove'); + removeButton.title = Common.UIString('Remove'); removeButton.addEventListener('click', this._removeBlockedURL.bind(this, index), false); element.addEventListener('contextmenu', this._contextMenu.bind(this, index), true); @@ -252,10 +252,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestFinished(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); if (request.wasBlocked()) { var count = this._blockedCountForUrl.get(request.url) || 0; this._blockedCountForUrl.set(request.url, count + 1); @@ -264,23 +264,23 @@ } }; -/** @type {?WebInspector.BlockedURLsPane} */ -WebInspector.BlockedURLsPane._instance = null; +/** @type {?Network.BlockedURLsPane} */ +Network.BlockedURLsPane._instance = null; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.BlockedURLsPane.ActionDelegate = class { +Network.BlockedURLsPane.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - WebInspector.viewManager.showView('network.blocked-urls'); + UI.viewManager.showView('network.blocked-urls'); return true; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/EventSourceMessagesView.js b/third_party/WebKit/Source/devtools/front_end/network/EventSourceMessagesView.js index 14e3419..eabfc4e0 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/EventSourceMessagesView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/EventSourceMessagesView.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.EventSourceMessagesView = class extends WebInspector.VBox { +Network.EventSourceMessagesView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(); @@ -14,18 +14,18 @@ this.element.classList.add('event-source-messages-view'); this._request = request; - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'id', title: WebInspector.UIString('Id'), sortable: true, weight: 8}, - {id: 'type', title: WebInspector.UIString('Type'), sortable: true, weight: 8}, - {id: 'data', title: WebInspector.UIString('Data'), sortable: false, weight: 88}, - {id: 'time', title: WebInspector.UIString('Time'), sortable: true, weight: 8} + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'id', title: Common.UIString('Id'), sortable: true, weight: 8}, + {id: 'type', title: Common.UIString('Type'), sortable: true, weight: 8}, + {id: 'data', title: Common.UIString('Data'), sortable: false, weight: 88}, + {id: 'time', title: Common.UIString('Time'), sortable: true, weight: 8} ]); - this._dataGrid = new WebInspector.SortableDataGrid(columns); + this._dataGrid = new UI.SortableDataGrid(columns); this._dataGrid.setStickToBottom(true); - this._dataGrid.markColumnAsSortedBy('time', WebInspector.DataGrid.Order.Ascending); + this._dataGrid.markColumnAsSortedBy('time', UI.DataGrid.Order.Ascending); this._sortItems(); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortItems, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortItems, this); this._dataGrid.setName('EventSourceMessagesView'); this._dataGrid.asWidget().show(this.element); @@ -38,10 +38,10 @@ this._dataGrid.rootNode().removeChildren(); var messages = this._request.eventSourceMessages(); for (var i = 0; i < messages.length; ++i) - this._dataGrid.insertChild(new WebInspector.EventSourceMessageNode(messages[i])); + this._dataGrid.insertChild(new Network.EventSourceMessageNode(messages[i])); this._request.addEventListener( - WebInspector.NetworkRequest.Events.EventSourceMessageAdded, this._messageAdded, this); + SDK.NetworkRequest.Events.EventSourceMessageAdded, this._messageAdded, this); } /** @@ -49,22 +49,22 @@ */ willHide() { this._request.removeEventListener( - WebInspector.NetworkRequest.Events.EventSourceMessageAdded, this._messageAdded, this); + SDK.NetworkRequest.Events.EventSourceMessageAdded, this._messageAdded, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _messageAdded(event) { - var message = /** @type {!WebInspector.NetworkRequest.EventSourceMessage} */ (event.data); - this._dataGrid.insertChild(new WebInspector.EventSourceMessageNode(message)); + var message = /** @type {!SDK.NetworkRequest.EventSourceMessage} */ (event.data); + this._dataGrid.insertChild(new Network.EventSourceMessageNode(message)); } _sortItems() { var sortColumnId = this._dataGrid.sortColumnId(); if (!sortColumnId) return; - var comparator = WebInspector.EventSourceMessageNode.Comparators[sortColumnId]; + var comparator = Network.EventSourceMessageNode.Comparators[sortColumnId]; if (!comparator) return; this._dataGrid.sortNodes(comparator, !this._dataGrid.isSortOrderAscending()); @@ -74,9 +74,9 @@ /** * @unrestricted */ -WebInspector.EventSourceMessageNode = class extends WebInspector.SortableDataGridNode { +Network.EventSourceMessageNode = class extends UI.SortableDataGridNode { /** - * @param {!WebInspector.NetworkRequest.EventSourceMessage} message + * @param {!SDK.NetworkRequest.EventSourceMessage} message */ constructor(message) { var time = new Date(message.time * 1000); @@ -92,19 +92,19 @@ /** * @param {string} field - * @param {!WebInspector.EventSourceMessageNode} a - * @param {!WebInspector.EventSourceMessageNode} b + * @param {!Network.EventSourceMessageNode} a + * @param {!Network.EventSourceMessageNode} b * @return {number} */ -WebInspector.EventSourceMessageNodeComparator = function(field, a, b) { +Network.EventSourceMessageNodeComparator = function(field, a, b) { var aValue = a._message[field]; var bValue = b._message[field]; return aValue < bValue ? -1 : aValue > bValue ? 1 : 0; }; -/** @type {!Object.<string, !WebInspector.SortableDataGrid.NodeComparator>} */ -WebInspector.EventSourceMessageNode.Comparators = { - 'id': WebInspector.EventSourceMessageNodeComparator.bind(null, 'eventId'), - 'type': WebInspector.EventSourceMessageNodeComparator.bind(null, 'eventName'), - 'time': WebInspector.EventSourceMessageNodeComparator.bind(null, 'time') +/** @type {!Object.<string, !UI.SortableDataGrid.NodeComparator>} */ +Network.EventSourceMessageNode.Comparators = { + 'id': Network.EventSourceMessageNodeComparator.bind(null, 'eventId'), + 'type': Network.EventSourceMessageNodeComparator.bind(null, 'eventName'), + 'time': Network.EventSourceMessageNodeComparator.bind(null, 'time') };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js b/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js index cd347ab..eed67b4 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js +++ b/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js
@@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TextFilterUI.SuggestionBuilder} + * @implements {UI.TextFilterUI.SuggestionBuilder} * @unrestricted */ -WebInspector.FilterSuggestionBuilder = class { +Network.FilterSuggestionBuilder = class { /** * @param {!Array.<string>} keys */ @@ -161,7 +161,7 @@ /** * @param {string} query - * @return {{text: !Array.<string>, filters: !Array.<!WebInspector.FilterSuggestionBuilder.Filter>}} + * @return {{text: !Array.<string>, filters: !Array.<!Network.FilterSuggestionBuilder.Filter>}} */ parseQuery(query) { var filters = []; @@ -192,4 +192,4 @@ }; /** @typedef {{type: string, data: string, negative: boolean}} */ -WebInspector.FilterSuggestionBuilder.Filter; +Network.FilterSuggestionBuilder.Filter;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/HARWriter.js b/third_party/WebKit/Source/devtools/front_end/network/HARWriter.js index 1d5111f..634b71832 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/HARWriter.js +++ b/third_party/WebKit/Source/devtools/front_end/network/HARWriter.js
@@ -31,15 +31,15 @@ /** * @unrestricted */ -WebInspector.HARWriter = class { +Network.HARWriter = class { /** - * @param {!WebInspector.OutputStream} stream - * @param {!Array.<!WebInspector.NetworkRequest>} requests - * @param {!WebInspector.Progress} progress + * @param {!Common.OutputStream} stream + * @param {!Array.<!SDK.NetworkRequest>} requests + * @param {!Common.Progress} progress */ write(stream, requests, progress) { this._stream = stream; - this._harLog = (new WebInspector.HARLog(requests)).build(); + this._harLog = (new SDK.HARLog(requests)).build(); this._pendingRequests = 1; // Guard against completing resource transfer before all requests are made. var entries = this._harLog.entries; for (var i = 0; i < entries.length; ++i) { @@ -50,11 +50,11 @@ } else if (content !== null) this._setEntryContent(entries[i], requests[i]); } - var compositeProgress = new WebInspector.CompositeProgress(progress); + var compositeProgress = new Common.CompositeProgress(progress); this._writeProgress = compositeProgress.createSubProgress(); if (--this._pendingRequests) { this._requestsProgress = compositeProgress.createSubProgress(); - this._requestsProgress.setTitle(WebInspector.UIString('Collecting content…')); + this._requestsProgress.setTitle(Common.UIString('Collecting content…')); this._requestsProgress.setTotalWork(this._pendingRequests); } else this._beginWrite(); @@ -62,7 +62,7 @@ /** * @param {!Object} entry - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _setEntryContent(entry, request) { if (request.content !== null) @@ -73,7 +73,7 @@ /** * @param {!Object} entry - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {?string} content */ _onContentAvailable(entry, request, content) { @@ -89,14 +89,14 @@ _beginWrite() { const jsonIndent = 2; this._text = JSON.stringify({log: this._harLog}, null, jsonIndent); - this._writeProgress.setTitle(WebInspector.UIString('Writing file…')); + this._writeProgress.setTitle(Common.UIString('Writing file…')); this._writeProgress.setTotalWork(this._text.length); this._bytesWritten = 0; this._writeNextChunk(this._stream); } /** - * @param {!WebInspector.OutputStream} stream + * @param {!Common.OutputStream} stream * @param {string=} error */ _writeNextChunk(stream, error) {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/JSONView.js b/third_party/WebKit/Source/devtools/front_end/network/JSONView.js index dafb969..a6ef0576 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/JSONView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
@@ -28,21 +28,21 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.JSONView = class extends WebInspector.VBox { +Network.JSONView = class extends UI.VBox { /** - * @param {!WebInspector.ParsedJSON} parsedJSON + * @param {!Network.ParsedJSON} parsedJSON */ constructor(parsedJSON) { super(); this._parsedJSON = parsedJSON; this.element.classList.add('json-view'); - /** @type {?WebInspector.SearchableView} */ + /** @type {?UI.SearchableView} */ this._searchableView; - /** @type {!WebInspector.ObjectPropertiesSection} */ + /** @type {!Components.ObjectPropertiesSection} */ this._treeOutline; /** @type {number} */ this._currentSearchFocusIndex = 0; @@ -53,13 +53,13 @@ } /** - * @param {!WebInspector.ParsedJSON} parsedJSON - * @return {!WebInspector.SearchableView} + * @param {!Network.ParsedJSON} parsedJSON + * @return {!UI.SearchableView} */ static createSearchableView(parsedJSON) { - var jsonView = new WebInspector.JSONView(parsedJSON); - var searchableView = new WebInspector.SearchableView(jsonView); - searchableView.setPlaceholder(WebInspector.UIString('Find')); + var jsonView = new Network.JSONView(parsedJSON); + var searchableView = new UI.SearchableView(jsonView); + searchableView.setPlaceholder(Common.UIString('Find')); jsonView._searchableView = searchableView; jsonView.show(searchableView.element); jsonView.element.setAttribute('tabIndex', 0); @@ -68,20 +68,20 @@ /** * @param {?string} text - * @return {!Promise<?WebInspector.ParsedJSON>} + * @return {!Promise<?Network.ParsedJSON>} */ static parseJSON(text) { var returnObj = null; if (text) - returnObj = WebInspector.JSONView._extractJSON(/** @type {string} */ (text)); + returnObj = Network.JSONView._extractJSON(/** @type {string} */ (text)); if (!returnObj) - return Promise.resolve(/** @type {?WebInspector.ParsedJSON} */ (null)); - return WebInspector.formatterWorkerPool.runTask('relaxedJSONParser', {content: returnObj.data}) + return Promise.resolve(/** @type {?Network.ParsedJSON} */ (null)); + return Common.formatterWorkerPool.runTask('relaxedJSONParser', {content: returnObj.data}) .then(handleReturnedJSON); /** * @param {?MessageEvent} event - * @return {?WebInspector.ParsedJSON} + * @return {?Network.ParsedJSON} */ function handleReturnedJSON(event) { if (!event || !event.data) @@ -93,14 +93,14 @@ /** * @param {string} text - * @return {?WebInspector.ParsedJSON} + * @return {?Network.ParsedJSON} */ static _extractJSON(text) { // Do not treat HTML as JSON. if (text.startsWith('<')) return null; - var inner = WebInspector.JSONView._findBrackets(text, '{', '}'); - var inner2 = WebInspector.JSONView._findBrackets(text, '[', ']'); + var inner = Network.JSONView._findBrackets(text, '{', '}'); + var inner2 = Network.JSONView._findBrackets(text, '[', ']'); inner = inner2.length > inner.length ? inner2 : inner; // Return on blank payloads or on payloads significantly smaller than original text. @@ -115,7 +115,7 @@ if (suffix.trim().length && !(suffix.trim().startsWith(')') && prefix.trim().endsWith('('))) return null; - return new WebInspector.ParsedJSON(text, prefix, suffix); + return new Network.ParsedJSON(text, prefix, suffix); } /** @@ -145,9 +145,9 @@ return; this._initialized = true; - var obj = WebInspector.RemoteObject.fromLocalObject(this._parsedJSON.data); + var obj = SDK.RemoteObject.fromLocalObject(this._parsedJSON.data); var title = this._parsedJSON.prefix + obj.description + this._parsedJSON.suffix; - this._treeOutline = new WebInspector.ObjectPropertiesSection(obj, title); + this._treeOutline = new Components.ObjectPropertiesSection(obj, title); this._treeOutline.setEditable(false); this._treeOutline.expand(); this.element.appendChild(this._treeOutline.element); @@ -166,7 +166,7 @@ var newFocusElement = this._currentSearchTreeElements[index]; if (newFocusElement) { this._updateSearchIndex(index); - newFocusElement.setSearchRegex(this._searchRegex, WebInspector.highlightedCurrentSearchResultClassName); + newFocusElement.setSearchRegex(this._searchRegex, UI.highlightedCurrentSearchResultClassName); newFocusElement.reveal(); } else { this._updateSearchIndex(0); @@ -200,7 +200,7 @@ this._currentSearchTreeElements = []; for (var element = this._treeOutline.rootElement(); element; element = element.traverseNextTreeElement(false)) { - if (!(element instanceof WebInspector.ObjectPropertyTreeElement)) + if (!(element instanceof Components.ObjectPropertyTreeElement)) continue; element.revertHighlightChanges(); } @@ -210,7 +210,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -221,7 +221,7 @@ this._searchRegex = searchConfig.toSearchRegex(true); for (var element = this._treeOutline.rootElement(); element; element = element.traverseNextTreeElement(false)) { - if (!(element instanceof WebInspector.ObjectPropertyTreeElement)) + if (!(element instanceof Components.ObjectPropertyTreeElement)) continue; var hasMatch = element.setSearchRegex(this._searchRegex); if (hasMatch) @@ -286,7 +286,7 @@ /** * @unrestricted */ -WebInspector.ParsedJSON = class { +Network.ParsedJSON = class { /** * @param {*} data * @param {string} prefix
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkConfigView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkConfigView.js index 5c5ef986..d9d3a41 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkConfigView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkConfigView.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.NetworkConfigView = class extends WebInspector.VBox { +Network.NetworkConfigView = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('network/networkConfigView.css'); @@ -21,19 +21,19 @@ * @return {{select: !Element, input: !Element}} */ static createUserAgentSelectAndInput() { - var userAgentSetting = WebInspector.settings.createSetting('customUserAgent', ''); + var userAgentSetting = Common.settings.createSetting('customUserAgent', ''); var userAgentSelectElement = createElement('select'); - const customOverride = {title: WebInspector.UIString('Custom...'), value: 'custom'}; + const customOverride = {title: Common.UIString('Custom...'), value: 'custom'}; userAgentSelectElement.appendChild(new Option(customOverride.title, customOverride.value)); - var groups = WebInspector.NetworkConfigView._userAgentGroups; + var groups = Network.NetworkConfigView._userAgentGroups; for (var userAgentDescriptor of groups) { var groupElement = userAgentSelectElement.createChild('optgroup'); groupElement.label = userAgentDescriptor.title; for (var userAgentVersion of userAgentDescriptor.values) { var userAgentValue = - WebInspector.MultitargetNetworkManager.patchUserAgentWithChromeVersion(userAgentVersion.value); + SDK.MultitargetNetworkManager.patchUserAgentWithChromeVersion(userAgentVersion.value); groupElement.appendChild(new Option(userAgentVersion.title, userAgentValue)); } } @@ -44,7 +44,7 @@ otherUserAgentElement.type = 'text'; otherUserAgentElement.value = userAgentSetting.get(); otherUserAgentElement.title = userAgentSetting.get(); - otherUserAgentElement.placeholder = WebInspector.UIString('Enter a custom user agent'); + otherUserAgentElement.placeholder = Common.UIString('Enter a custom user agent'); otherUserAgentElement.required = true; settingChanged(); @@ -103,29 +103,29 @@ } _createCacheSection() { - var section = this._createSection(WebInspector.UIString('Caching'), 'network-config-disable-cache'); - section.appendChild(WebInspector.SettingsUI.createSettingCheckbox( - WebInspector.UIString('Disable cache'), WebInspector.moduleSetting('cacheDisabled'), true)); + var section = this._createSection(Common.UIString('Caching'), 'network-config-disable-cache'); + section.appendChild(UI.SettingsUI.createSettingCheckbox( + Common.UIString('Disable cache'), Common.moduleSetting('cacheDisabled'), true)); } _createNetworkThrottlingSection() { - var section = this._createSection(WebInspector.UIString('Network throttling'), 'network-config-throttling'); - WebInspector.NetworkConditionsSelector.decorateSelect( + var section = this._createSection(Common.UIString('Network throttling'), 'network-config-throttling'); + Components.NetworkConditionsSelector.decorateSelect( /** @type {!HTMLSelectElement} */ (section.createChild('select', 'chrome-select'))); } _createUserAgentSection() { - var section = this._createSection(WebInspector.UIString('User agent'), 'network-config-ua'); - var checkboxLabel = createCheckboxLabel(WebInspector.UIString('Select automatically'), true); + var section = this._createSection(Common.UIString('User agent'), 'network-config-ua'); + var checkboxLabel = createCheckboxLabel(Common.UIString('Select automatically'), true); section.appendChild(checkboxLabel); this._autoCheckbox = checkboxLabel.checkboxElement; this._autoCheckbox.addEventListener('change', this._userAgentTypeChanged.bind(this)); - this._customUserAgentSetting = WebInspector.settings.createSetting('customUserAgent', ''); + this._customUserAgentSetting = Common.settings.createSetting('customUserAgent', ''); this._customUserAgentSetting.addChangeListener(this._customUserAgentChanged, this); this._customUserAgent = section.createChild('div', 'network-config-ua-custom'); - this._customSelectAndInput = WebInspector.NetworkConfigView.createUserAgentSelectAndInput(); + this._customSelectAndInput = Network.NetworkConfigView.createUserAgentSelectAndInput(); this._customSelectAndInput.select.classList.add('chrome-select'); this._customUserAgent.appendChild(this._customSelectAndInput.select); this._customUserAgent.appendChild(this._customSelectAndInput.input); @@ -135,7 +135,7 @@ _customUserAgentChanged() { if (this._autoCheckbox.checked) return; - WebInspector.multitargetNetworkManager.setCustomUserAgentOverride(this._customUserAgentSetting.get()); + SDK.multitargetNetworkManager.setCustomUserAgentOverride(this._customUserAgentSetting.get()); } _userAgentTypeChanged() { @@ -144,13 +144,13 @@ this._customSelectAndInput.select.disabled = !useCustomUA; this._customSelectAndInput.input.disabled = !useCustomUA; var customUA = useCustomUA ? this._customUserAgentSetting.get() : ''; - WebInspector.multitargetNetworkManager.setCustomUserAgentOverride(customUA); + SDK.multitargetNetworkManager.setCustomUserAgentOverride(customUA); } }; /** @type {!Array.<{title: string, values: !Array.<{title: string, value: string}>}>} */ -WebInspector.NetworkConfigView._userAgentGroups = [ +Network.NetworkConfigView._userAgentGroups = [ { title: 'Android', values: [
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js index 408cad54..890413a 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.NetworkDataGridNode = class extends WebInspector.SortableDataGridNode { +Network.NetworkDataGridNode = class extends UI.SortableDataGridNode { /** - * @param {!WebInspector.NetworkLogView} parentView - * @param {!WebInspector.NetworkRequest} request + * @param {!Network.NetworkLogView} parentView + * @param {!SDK.NetworkRequest} request */ constructor(parentView, request) { super({}); @@ -45,8 +45,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static NameComparator(a, b) { @@ -60,8 +60,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static RemoteAddressComparator(a, b) { @@ -75,8 +75,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static SizeComparator(a, b) { @@ -88,8 +88,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static TypeComparator(a, b) { @@ -104,8 +104,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static InitiatorComparator(a, b) { @@ -118,9 +118,9 @@ return 1; if (typeof aInitiator.__source === 'undefined') - aInitiator.__source = WebInspector.displayNameForURL(aInitiator.url); + aInitiator.__source = Bindings.displayNameForURL(aInitiator.url); if (typeof bInitiator.__source === 'undefined') - bInitiator.__source = WebInspector.displayNameForURL(bInitiator.url); + bInitiator.__source = Bindings.displayNameForURL(bInitiator.url); if (aInitiator.__source < bInitiator.__source) return -1; @@ -141,8 +141,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static RequestCookiesCountComparator(a, b) { @@ -152,8 +152,8 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static ResponseCookiesCountComparator(a, b) { @@ -163,15 +163,15 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static InitialPriorityComparator(a, b) { - var priorityMap = WebInspector.NetworkDataGridNode._symbolicToNumericPriority; + var priorityMap = Network.NetworkDataGridNode._symbolicToNumericPriority; if (!priorityMap) { - WebInspector.NetworkDataGridNode._symbolicToNumericPriority = new Map(); - priorityMap = WebInspector.NetworkDataGridNode._symbolicToNumericPriority; + Network.NetworkDataGridNode._symbolicToNumericPriority = new Map(); + priorityMap = Network.NetworkDataGridNode._symbolicToNumericPriority; priorityMap.set(Protocol.Network.ResourcePriority.VeryLow, 1); priorityMap.set(Protocol.Network.ResourcePriority.Low, 2); priorityMap.set(Protocol.Network.ResourcePriority.Medium, 3); @@ -186,8 +186,8 @@ /** * @param {string} propertyName - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static RequestPropertyComparator(propertyName, a, b) { @@ -200,8 +200,8 @@ /** * @param {string} propertyName - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static ResponseHeaderStringComparator(propertyName, a, b) { @@ -212,8 +212,8 @@ /** * @param {string} propertyName - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static ResponseHeaderNumberComparator(propertyName, a, b) { @@ -230,8 +230,8 @@ /** * @param {string} propertyName - * @param {!WebInspector.NetworkDataGridNode} a - * @param {!WebInspector.NetworkDataGridNode} b + * @param {!Network.NetworkDataGridNode} a + * @param {!Network.NetworkDataGridNode} b * @return {number} */ static ResponseHeaderDateComparator(propertyName, a, b) { @@ -252,14 +252,14 @@ var resourceType = this._request.resourceType(); var simpleType = resourceType.name(); - if (resourceType === WebInspector.resourceTypes.Other || resourceType === WebInspector.resourceTypes.Image) + if (resourceType === Common.resourceTypes.Other || resourceType === Common.resourceTypes.Image) simpleType = mimeType.replace(/^(application|image)\//, ''); return simpleType; } /** - * @return {!WebInspector.NetworkRequest} + * @return {!SDK.NetworkRequest} */ request() { return this._request; @@ -342,7 +342,7 @@ this._setTextAndTitle(cell, this._arrayLength(this._request.responseCookies)); break; case 'priority': - this._setTextAndTitle(cell, WebInspector.uiLabelForPriority(this._request.initialPriority())); + this._setTextAndTitle(cell, Components.uiLabelForPriority(this._request.initialPriority())); break; case 'connectionid': this._setTextAndTitle(cell, this._request.connectionId); @@ -383,7 +383,7 @@ * @protected */ willAttach() { - if (this._initiatorCell && this._request.initiatorInfo().type === WebInspector.NetworkRequest.InitiatorType.Script) + if (this._initiatorCell && this._request.initiatorInfo().type === SDK.NetworkRequest.InitiatorType.Script) this._initiatorCell.insertBefore(this._linkifiedInitiatorAnchor, this._initiatorCell.firstChild); } @@ -406,7 +406,7 @@ */ select(supressSelectedEvent) { super.select(supressSelectedEvent); - this._parentView.dispatchEventToListeners(WebInspector.NetworkLogView.Events.RequestSelected, this._request); + this._parentView.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, this._request); } /** @@ -419,7 +419,7 @@ var domChanges = []; var matchInfo = this._nameCell.textContent.match(regexp); if (matchInfo) - WebInspector.highlightSearchResult(this._nameCell, matchInfo.index, matchInfo[0].length, domChanges); + UI.highlightSearchResult(this._nameCell, matchInfo.index, matchInfo[0].length, domChanges); return domChanges; } @@ -441,7 +441,7 @@ this._nameCell = cell; cell.addEventListener('dblclick', this._openInNewTab.bind(this), false); var iconElement; - if (this._request.resourceType() === WebInspector.resourceTypes.Image) { + if (this._request.resourceType() === Common.resourceTypes.Image) { var previewImage = createElementWithClass('img', 'image-network-icon-preview'); this._request.populateImageSource(previewImage); @@ -466,7 +466,7 @@ 'network-dim-cell', !this._isFailed() && (this._request.cached() || !this._request.statusCode)); if (this._request.failed && !this._request.canceled && !this._request.wasBlocked()) { - var failText = WebInspector.UIString('(failed)'); + var failText = Common.UIString('(failed)'); if (this._request.localizedFailDescription) { cell.createTextChild(failText); this._appendSubtitle(cell, this._request.localizedFailDescription); @@ -478,33 +478,33 @@ this._appendSubtitle(cell, this._request.statusText); cell.title = this._request.statusCode + ' ' + this._request.statusText; } else if (this._request.parsedURL.isDataURL()) { - this._setTextAndTitle(cell, WebInspector.UIString('(data)')); + this._setTextAndTitle(cell, Common.UIString('(data)')); } else if (this._request.canceled) { - this._setTextAndTitle(cell, WebInspector.UIString('(canceled)')); + this._setTextAndTitle(cell, Common.UIString('(canceled)')); } else if (this._request.wasBlocked()) { - var reason = WebInspector.UIString('other'); + var reason = Common.UIString('other'); switch (this._request.blockedReason()) { case Protocol.Network.BlockedReason.Csp: - reason = WebInspector.UIString('csp'); + reason = Common.UIString('csp'); break; case Protocol.Network.BlockedReason.MixedContent: - reason = WebInspector.UIString('mixed-content'); + reason = Common.UIString('mixed-content'); break; case Protocol.Network.BlockedReason.Origin: - reason = WebInspector.UIString('origin'); + reason = Common.UIString('origin'); break; case Protocol.Network.BlockedReason.Inspector: - reason = WebInspector.UIString('devtools'); + reason = Common.UIString('devtools'); break; case Protocol.Network.BlockedReason.Other: - reason = WebInspector.UIString('other'); + reason = Common.UIString('other'); break; } - this._setTextAndTitle(cell, WebInspector.UIString('(blocked:%s)', reason)); + this._setTextAndTitle(cell, Common.UIString('(blocked:%s)', reason)); } else if (this._request.finished) { - this._setTextAndTitle(cell, WebInspector.UIString('Finished')); + this._setTextAndTitle(cell, Common.UIString('Finished')); } else { - this._setTextAndTitle(cell, WebInspector.UIString('(pending)')); + this._setTextAndTitle(cell, Common.UIString('(pending)')); } } @@ -517,41 +517,41 @@ var initiator = request.initiatorInfo(); if (request.timing && request.timing.pushStart) - cell.appendChild(createTextNode(WebInspector.UIString('Push / '))); + cell.appendChild(createTextNode(Common.UIString('Push / '))); switch (initiator.type) { - case WebInspector.NetworkRequest.InitiatorType.Parser: + case SDK.NetworkRequest.InitiatorType.Parser: cell.title = initiator.url + ':' + (initiator.lineNumber + 1); - var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(initiator.url); - cell.appendChild(WebInspector.linkifyResourceAsNode( + var uiSourceCode = Bindings.networkMapping.uiSourceCodeForURLForAnyTarget(initiator.url); + cell.appendChild(Components.linkifyResourceAsNode( initiator.url, initiator.lineNumber, initiator.columnNumber, undefined, undefined, uiSourceCode ? uiSourceCode.displayName() : undefined)); - this._appendSubtitle(cell, WebInspector.UIString('Parser')); + this._appendSubtitle(cell, Common.UIString('Parser')); break; - case WebInspector.NetworkRequest.InitiatorType.Redirect: + case SDK.NetworkRequest.InitiatorType.Redirect: cell.title = initiator.url; console.assert(request.redirectSource); - var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (request.redirectSource); - cell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource)); - this._appendSubtitle(cell, WebInspector.UIString('Redirect')); + var redirectSource = /** @type {!SDK.NetworkRequest} */ (request.redirectSource); + cell.appendChild(Components.linkifyRequestAsNode(redirectSource)); + this._appendSubtitle(cell, Common.UIString('Redirect')); break; - case WebInspector.NetworkRequest.InitiatorType.Script: + case SDK.NetworkRequest.InitiatorType.Script: if (!this._linkifiedInitiatorAnchor) { this._linkifiedInitiatorAnchor = this._parentView.linkifier.linkifyScriptLocation( request.target(), initiator.scriptId, initiator.url, initiator.lineNumber, initiator.columnNumber); this._linkifiedInitiatorAnchor.title = ''; } cell.appendChild(this._linkifiedInitiatorAnchor); - this._appendSubtitle(cell, WebInspector.UIString('Script')); + this._appendSubtitle(cell, Common.UIString('Script')); cell.classList.add('network-script-initiated'); cell.request = request; break; default: - cell.title = WebInspector.UIString('Other'); + cell.title = Common.UIString('Other'); cell.classList.add('network-dim-cell'); - cell.appendChild(createTextNode(WebInspector.UIString('Other'))); + cell.appendChild(createTextNode(Common.UIString('Other'))); } } @@ -560,13 +560,13 @@ */ _renderSizeCell(cell) { if (this._request.fetchedViaServiceWorker) { - this._setTextAndTitle(cell, WebInspector.UIString('(from ServiceWorker)')); + this._setTextAndTitle(cell, Common.UIString('(from ServiceWorker)')); cell.classList.add('network-dim-cell'); } else if (this._request.cached()) { if (this._request.cachedInMemory()) - this._setTextAndTitle(cell, WebInspector.UIString('(from memory cache)')); + this._setTextAndTitle(cell, Common.UIString('(from memory cache)')); else - this._setTextAndTitle(cell, WebInspector.UIString('(from disk cache)')); + this._setTextAndTitle(cell, Common.UIString('(from disk cache)')); cell.classList.add('network-dim-cell'); } else { var resourceSize = Number.bytesToString(this._request.resourceSize); @@ -585,7 +585,7 @@ this._appendSubtitle(cell, Number.secondsToString(this._request.latency)); } else { cell.classList.add('network-dim-cell'); - this._setTextAndTitle(cell, WebInspector.UIString('Pending')); + this._setTextAndTitle(cell, Common.UIString('Pending')); } }
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkItemView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkItemView.js index a77faaa7..f92c857b2 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkItemView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkItemView.js
@@ -31,42 +31,42 @@ /** * @unrestricted */ -WebInspector.NetworkItemView = class extends WebInspector.TabbedPane { +Network.NetworkItemView = class extends UI.TabbedPane { /** - * @param {!WebInspector.NetworkRequest} request - * @param {!WebInspector.NetworkTimeCalculator} calculator + * @param {!SDK.NetworkRequest} request + * @param {!Network.NetworkTimeCalculator} calculator */ constructor(request, calculator) { super(); this.renderWithNoHeaderBackground(); this.element.classList.add('network-item-view'); - this._resourceViewTabSetting = WebInspector.settings.createSetting('resourceViewTab', 'preview'); + this._resourceViewTabSetting = Common.settings.createSetting('resourceViewTab', 'preview'); - var headersView = new WebInspector.RequestHeadersView(request); - this.appendTab('headers', WebInspector.UIString('Headers'), headersView); + var headersView = new Network.RequestHeadersView(request); + this.appendTab('headers', Common.UIString('Headers'), headersView); - this.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabSelected, this); + this.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); - if (request.resourceType() === WebInspector.resourceTypes.WebSocket) { - var frameView = new WebInspector.ResourceWebSocketFrameView(request); - this.appendTab('webSocketFrames', WebInspector.UIString('Frames'), frameView); + if (request.resourceType() === Common.resourceTypes.WebSocket) { + var frameView = new Network.ResourceWebSocketFrameView(request); + this.appendTab('webSocketFrames', Common.UIString('Frames'), frameView); } else if (request.mimeType === 'text/event-stream') { this.appendTab( - 'eventSource', WebInspector.UIString('EventStream'), new WebInspector.EventSourceMessagesView(request)); + 'eventSource', Common.UIString('EventStream'), new Network.EventSourceMessagesView(request)); } else { - var responseView = new WebInspector.RequestResponseView(request); - var previewView = new WebInspector.RequestPreviewView(request, responseView); - this.appendTab('preview', WebInspector.UIString('Preview'), previewView); - this.appendTab('response', WebInspector.UIString('Response'), responseView); + var responseView = new Network.RequestResponseView(request); + var previewView = new Network.RequestPreviewView(request, responseView); + this.appendTab('preview', Common.UIString('Preview'), previewView); + this.appendTab('response', Common.UIString('Response'), responseView); } if (request.requestCookies || request.responseCookies) { - this._cookiesView = new WebInspector.RequestCookiesView(request); - this.appendTab('cookies', WebInspector.UIString('Cookies'), this._cookiesView); + this._cookiesView = new Network.RequestCookiesView(request); + this.appendTab('cookies', Common.UIString('Cookies'), this._cookiesView); } - this.appendTab('timing', WebInspector.UIString('Timing'), new WebInspector.RequestTimingView(request, calculator)); + this.appendTab('timing', Common.UIString('Timing'), new Network.RequestTimingView(request, calculator)); this._request = request; } @@ -98,7 +98,7 @@ } /** - * @return {!WebInspector.NetworkRequest} + * @return {!SDK.NetworkRequest} */ request() { return this._request; @@ -108,9 +108,9 @@ /** * @unrestricted */ -WebInspector.RequestContentView = class extends WebInspector.RequestView { +Network.RequestContentView = class extends Network.RequestView { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(request); @@ -130,7 +130,7 @@ /** * @param {?string} content - * @this {WebInspector.RequestContentView} + * @this {Network.RequestContentView} */ function callback(content) { this._innerViewShowRequested = false;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js index bbb887c..a354065 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -28,39 +28,39 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} - * @implements {WebInspector.TargetManager.Observer} + * @implements {UI.Searchable} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.NetworkLogView = class extends WebInspector.VBox { +Network.NetworkLogView = class extends UI.VBox { /** - * @param {!WebInspector.FilterBar} filterBar + * @param {!UI.FilterBar} filterBar * @param {!Element} progressBarContainer - * @param {!WebInspector.Setting} networkLogLargeRowsSetting + * @param {!Common.Setting} networkLogLargeRowsSetting */ constructor(filterBar, progressBarContainer, networkLogLargeRowsSetting) { super(); this.setMinimumSize(50, 64); this.registerRequiredCSS('network/networkLogView.css'); - this._networkHideDataURLSetting = WebInspector.settings.createSetting('networkHideDataURL', false); - this._networkResourceTypeFiltersSetting = WebInspector.settings.createSetting('networkResourceTypeFilters', {}); + this._networkHideDataURLSetting = Common.settings.createSetting('networkHideDataURL', false); + this._networkResourceTypeFiltersSetting = Common.settings.createSetting('networkResourceTypeFilters', {}); this._networkShowPrimaryLoadWaterfallSetting = - WebInspector.settings.createSetting('networkShowPrimaryLoadWaterfall', false); + Common.settings.createSetting('networkShowPrimaryLoadWaterfall', false); this._filterBar = filterBar; this._progressBarContainer = progressBarContainer; this._networkLogLargeRowsSetting = networkLogLargeRowsSetting; this._networkLogLargeRowsSetting.addChangeListener(updateRowHeight.bind(this), this); - /** @type {!WebInspector.NetworkTransferTimeCalculator} */ - this._timeCalculator = new WebInspector.NetworkTransferTimeCalculator(); - /** @type {!WebInspector.NetworkTransferDurationCalculator} */ - this._durationCalculator = new WebInspector.NetworkTransferDurationCalculator(); + /** @type {!Network.NetworkTransferTimeCalculator} */ + this._timeCalculator = new Network.NetworkTransferTimeCalculator(); + /** @type {!Network.NetworkTransferDurationCalculator} */ + this._durationCalculator = new Network.NetworkTransferDurationCalculator(); this._calculator = this._timeCalculator; /** - * @this {WebInspector.NetworkLogView} + * @this {Network.NetworkLogView} */ function updateRowHeight() { /** @type {number} */ @@ -68,10 +68,10 @@ } updateRowHeight.call(this); - this._columns = new WebInspector.NetworkLogViewColumns( + this._columns = new Network.NetworkLogViewColumns( this, this._timeCalculator, this._durationCalculator, networkLogLargeRowsSetting); - /** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */ + /** @type {!Map.<string, !Network.NetworkDataGridNode>} */ this._nodesByRequestId = new Map(); /** @type {!Object.<string, boolean>} */ this._staleRequestIds = {}; @@ -82,16 +82,16 @@ this._matchedRequestCount = 0; this._highlightedSubstringChanges = []; - /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ + /** @type {!Array.<!Network.NetworkLogView.Filter>} */ this._filters = []; - /** @type {?WebInspector.NetworkLogView.Filter} */ + /** @type {?Network.NetworkLogView.Filter} */ this._timeFilter = null; this._currentMatchedRequestNode = null; this._currentMatchedRequestIndex = -1; - /** @type {!WebInspector.Linkifier} */ - this.linkifier = new WebInspector.Linkifier(); + /** @type {!Components.Linkifier} */ + this.linkifier = new Components.Linkifier(); this._recording = false; this._preserveLog = false; @@ -102,20 +102,20 @@ this._resetSuggestionBuilder(); this._initializeView(); - WebInspector.moduleSetting('networkColorCodeResourceTypes').addChangeListener(this._invalidateAllItems, this); + Common.moduleSetting('networkColorCodeResourceTypes').addChangeListener(this._invalidateAllItems, this); - WebInspector.targetManager.observeTargets(this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestUpdated, this._onRequestUpdated, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestFinished, this._onRequestUpdated, this); + SDK.targetManager.observeTargets(this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestUpdated, this._onRequestUpdated, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onRequestUpdated, this); } /** - * @param {!WebInspector.NetworkLogView.Filter} filter - * @param {!WebInspector.NetworkRequest} request + * @param {!Network.NetworkLogView.Filter} filter + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _negativeFilter(filter, request) { @@ -124,7 +124,7 @@ /** * @param {?RegExp} regex - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestPathFilter(regex, request) { @@ -150,7 +150,7 @@ /** * @param {string} value - * @return {!WebInspector.NetworkLogView.Filter} + * @return {!Network.NetworkLogView.Filter} */ static _createRequestDomainFilter(value) { /** @@ -161,12 +161,12 @@ return string.escapeForRegExp(); } var escapedPattern = value.split('*').map(escapeForRegExp).join('.*'); - return WebInspector.NetworkLogView._requestDomainFilter.bind(null, new RegExp('^' + escapedPattern + '$', 'i')); + return Network.NetworkLogView._requestDomainFilter.bind(null, new RegExp('^' + escapedPattern + '$', 'i')); } /** * @param {!RegExp} regex - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestDomainFilter(regex, request) { @@ -174,7 +174,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _runningRequestFilter(request) { @@ -183,7 +183,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestResponseHeaderFilter(value, request) { @@ -192,7 +192,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestMethodFilter(value, request) { @@ -201,7 +201,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestMimeTypeFilter(value, request) { @@ -209,18 +209,18 @@ } /** - * @param {!WebInspector.NetworkLogView.MixedContentFilterValues} value - * @param {!WebInspector.NetworkRequest} request + * @param {!Network.NetworkLogView.MixedContentFilterValues} value + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestMixedContentFilter(value, request) { - if (value === WebInspector.NetworkLogView.MixedContentFilterValues.Displayed) { + if (value === Network.NetworkLogView.MixedContentFilterValues.Displayed) { return request.mixedContentType === 'optionally-blockable'; - } else if (value === WebInspector.NetworkLogView.MixedContentFilterValues.Blocked) { + } else if (value === Network.NetworkLogView.MixedContentFilterValues.Blocked) { return request.mixedContentType === 'blockable' && request.wasBlocked(); - } else if (value === WebInspector.NetworkLogView.MixedContentFilterValues.BlockOverridden) { + } else if (value === Network.NetworkLogView.MixedContentFilterValues.BlockOverridden) { return request.mixedContentType === 'blockable' && !request.wasBlocked(); - } else if (value === WebInspector.NetworkLogView.MixedContentFilterValues.All) { + } else if (value === Network.NetworkLogView.MixedContentFilterValues.All) { return request.mixedContentType !== 'none'; } return false; @@ -228,7 +228,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestSchemeFilter(value, request) { @@ -237,7 +237,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestSetCookieDomainFilter(value, request) { @@ -251,7 +251,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestSetCookieNameFilter(value, request) { @@ -265,7 +265,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestSetCookieValueFilter(value, request) { @@ -279,7 +279,7 @@ /** * @param {number} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestSizeLargerThanFilter(value, request) { @@ -288,7 +288,7 @@ /** * @param {string} value - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _statusCodeFilter(value, request) { @@ -296,15 +296,15 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static HTTPRequestsFilter(request) { - return request.parsedURL.isValid && (request.scheme in WebInspector.NetworkLogView.HTTPSchemas); + return request.parsedURL.isValid && (request.scheme in Network.NetworkLogView.HTTPSchemas); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static FinishedRequestsFilter(request) { @@ -314,7 +314,7 @@ /** * @param {number} windowStart * @param {number} windowEnd - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static _requestTimeFilter(windowStart, windowEnd, request) { @@ -349,37 +349,37 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (!target.parentTarget()) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) { resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Load, this._loadEventFired, this); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, this._loadEventFired, this); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.DOMContentLoaded, this._domContentLoadedEventFired, this); + SDK.ResourceTreeModel.Events.DOMContentLoaded, this._domContentLoadedEventFired, this); } } - var networkLog = WebInspector.NetworkLog.fromTarget(target); + var networkLog = SDK.NetworkLog.fromTarget(target); if (networkLog) networkLog.requests().forEach(this._appendRequest.bind(this)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (!target.parentTarget()) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) { resourceTreeModel.removeEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this); - resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.Events.Load, this._loadEventFired, this); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this); + resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.Load, this._loadEventFired, this); resourceTreeModel.removeEventListener( - WebInspector.ResourceTreeModel.Events.DOMContentLoaded, this._domContentLoadedEventFired, this); + SDK.ResourceTreeModel.Events.DOMContentLoaded, this._domContentLoadedEventFired, this); } } } @@ -393,8 +393,8 @@ this._timeFilter = null; this._timeCalculator.setWindow(null); } else { - this._timeFilter = WebInspector.NetworkLogView._requestTimeFilter.bind(null, start, end); - this._timeCalculator.setWindow(new WebInspector.NetworkTimeBoundary(start, end)); + this._timeFilter = Network.NetworkLogView._requestTimeFilter.bind(null, start, end); + this._timeCalculator.setWindow(new Network.NetworkTimeBoundary(start, end)); } this._filterRequests(); } @@ -405,41 +405,41 @@ } _addFilters() { - this._textFilterUI = new WebInspector.TextFilterUI(true); - this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._filterChanged, this); + this._textFilterUI = new UI.TextFilterUI(true); + this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._filterChanged, this); this._filterBar.addFilter(this._textFilterUI); var dataURLSetting = this._networkHideDataURLSetting; - this._dataURLFilterUI = new WebInspector.CheckboxFilterUI( - 'hide-data-url', WebInspector.UIString('Hide data URLs'), true, dataURLSetting); + this._dataURLFilterUI = new UI.CheckboxFilterUI( + 'hide-data-url', Common.UIString('Hide data URLs'), true, dataURLSetting); this._dataURLFilterUI.addEventListener( - WebInspector.FilterUI.Events.FilterChanged, this._filterChanged.bind(this), this); + UI.FilterUI.Events.FilterChanged, this._filterChanged.bind(this), this); this._filterBar.addFilter(this._dataURLFilterUI); var filterItems = []; - for (var categoryId in WebInspector.resourceCategories) { - var category = WebInspector.resourceCategories[categoryId]; + for (var categoryId in Common.resourceCategories) { + var category = Common.resourceCategories[categoryId]; filterItems.push({name: category.title, label: category.shortTitle, title: category.title}); } this._resourceCategoryFilterUI = - new WebInspector.NamedBitSetFilterUI(filterItems, this._networkResourceTypeFiltersSetting); + new UI.NamedBitSetFilterUI(filterItems, this._networkResourceTypeFiltersSetting); this._resourceCategoryFilterUI.addEventListener( - WebInspector.FilterUI.Events.FilterChanged, this._filterChanged.bind(this), this); + UI.FilterUI.Events.FilterChanged, this._filterChanged.bind(this), this); this._filterBar.addFilter(this._resourceCategoryFilterUI); } _resetSuggestionBuilder() { - this._suggestionBuilder = new WebInspector.FilterSuggestionBuilder(WebInspector.NetworkLogView._searchKeys); + this._suggestionBuilder = new Network.FilterSuggestionBuilder(Network.NetworkLogView._searchKeys); this._suggestionBuilder.addItem( - WebInspector.NetworkLogView.FilterType.Is, WebInspector.NetworkLogView.IsFilterType.Running); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.LargerThan, '100'); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.LargerThan, '10k'); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.LargerThan, '1M'); + Network.NetworkLogView.FilterType.Is, Network.NetworkLogView.IsFilterType.Running); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.LargerThan, '100'); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.LargerThan, '10k'); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.LargerThan, '1M'); this._textFilterUI.setSuggestionBuilder(this._suggestionBuilder); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _filterChanged(event) { this.removeAllNodeHighlights(); @@ -463,18 +463,18 @@ this._recordingHint = this.element.createChild('div', 'network-status-pane fill'); var hintText = this._recordingHint.createChild('div', 'recording-hint'); var reloadShortcutNode = this._recordingHint.createChild('b'); - reloadShortcutNode.textContent = WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name; + reloadShortcutNode.textContent = UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name; if (this._recording) { var recordingText = hintText.createChild('span'); - recordingText.textContent = WebInspector.UIString('Recording network activity\u2026'); + recordingText.textContent = Common.UIString('Recording network activity\u2026'); hintText.createChild('br'); hintText.appendChild( - WebInspector.formatLocalized('Perform a request or hit %s to record the reload.', [reloadShortcutNode])); + UI.formatLocalized('Perform a request or hit %s to record the reload.', [reloadShortcutNode])); } else { var recordNode = hintText.createChild('b'); - recordNode.textContent = WebInspector.shortcutRegistry.shortcutTitleForAction('network.toggle-recording'); - hintText.appendChild(WebInspector.formatLocalized( + recordNode.textContent = UI.shortcutRegistry.shortcutTitleForAction('network.toggle-recording'); + hintText.appendChild(UI.formatLocalized( 'Record (%s) or reload (%s) to display network activity.', [recordNode, reloadShortcutNode])); } } @@ -501,7 +501,7 @@ (contextMenu, node) => this.handleContextMenuForRequest(contextMenu, node.request())); this._dataGrid.setStickToBottom(true); this._dataGrid.setName('networkLog'); - this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); + this._dataGrid.setResizeMethod(UI.DataGrid.ResizeMethod.Last); this._dataGrid.element.classList.add('network-log-grid'); this._dataGrid.element.addEventListener('mousedown', this._dataGridMouseDown.bind(this), true); this._dataGrid.element.addEventListener('mousemove', this._dataGridMouseMove.bind(this), true); @@ -524,7 +524,7 @@ } /** - * @param {?WebInspector.NetworkRequest} request + * @param {?SDK.NetworkRequest} request * @param {boolean} highlightInitiatorChain */ setHoveredRequest(request, highlightInitiatorChain) { @@ -533,7 +533,7 @@ } /** - * @param {?WebInspector.NetworkDataGridNode} node + * @param {?Network.NetworkDataGridNode} node * @param {boolean=} highlightInitiatorChain */ _setHoveredNode(node, highlightInitiatorChain) { @@ -554,7 +554,7 @@ } /** - * @param {?WebInspector.NetworkRequest} request + * @param {?SDK.NetworkRequest} request */ _highlightInitiatorChain(request) { if (this._requestWithHighlightedInitiators === request) @@ -601,12 +601,12 @@ var request = nodes[i].request(); var requestTransferSize = request.transferSize; transferSize += requestTransferSize; - if (!nodes[i][WebInspector.NetworkLogView._isFilteredOutSymbol]) { + if (!nodes[i][Network.NetworkLogView._isFilteredOutSymbol]) { selectedRequestsNumber++; selectedTransferSize += requestTransferSize; } if (request.url === request.target().inspectedURL() && - request.resourceType() === WebInspector.resourceTypes.Document) + request.resourceType() === Common.resourceTypes.Document) baseTime = request.startTime; if (request.endTime > maxTime) maxTime = request.endTime; @@ -628,27 +628,27 @@ } if (selectedRequestsNumber !== requestsNumber) { - appendChunk(WebInspector.UIString('%d / %d requests', selectedRequestsNumber, requestsNumber)); + appendChunk(Common.UIString('%d / %d requests', selectedRequestsNumber, requestsNumber)); appendChunk(separator); - appendChunk(WebInspector.UIString( + appendChunk(Common.UIString( '%s / %s transferred', Number.bytesToString(selectedTransferSize), Number.bytesToString(transferSize))); } else { - appendChunk(WebInspector.UIString('%d requests', requestsNumber)); + appendChunk(Common.UIString('%d requests', requestsNumber)); appendChunk(separator); - appendChunk(WebInspector.UIString('%s transferred', Number.bytesToString(transferSize))); + appendChunk(Common.UIString('%s transferred', Number.bytesToString(transferSize))); } if (baseTime !== -1 && maxTime !== -1) { appendChunk(separator); - appendChunk(WebInspector.UIString('Finish: %s', Number.secondsToString(maxTime - baseTime))); + appendChunk(Common.UIString('Finish: %s', Number.secondsToString(maxTime - baseTime))); if (this._mainRequestDOMContentLoadedTime !== -1 && this._mainRequestDOMContentLoadedTime > baseTime) { appendChunk(separator); - var domContentLoadedText = WebInspector.UIString( + var domContentLoadedText = Common.UIString( 'DOMContentLoaded: %s', Number.secondsToString(this._mainRequestDOMContentLoadedTime - baseTime)); appendChunk(domContentLoadedText).classList.add('summary-blue'); } if (this._mainRequestLoadTime !== -1) { appendChunk(separator); - var loadText = WebInspector.UIString('Load: %s', Number.secondsToString(this._mainRequestLoadTime - baseTime)); + var loadText = Common.UIString('Load: %s', Number.secondsToString(this._mainRequestLoadTime - baseTime)); appendChunk(loadText).classList.add('summary-red'); } } @@ -696,21 +696,21 @@ } /** - * @return {!WebInspector.NetworkTimeCalculator} + * @return {!Network.NetworkTimeCalculator} */ timeCalculator() { return this._timeCalculator; } /** - * @return {!WebInspector.NetworkTimeCalculator} + * @return {!Network.NetworkTimeCalculator} */ calculator() { return this._calculator; } /** - * @param {!WebInspector.NetworkTimeCalculator} x + * @param {!Network.NetworkTimeCalculator} x */ setCalculator(x) { if (!x || this._calculator === x) @@ -731,7 +731,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _loadEventFired(event) { if (!this._recording) @@ -745,7 +745,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domContentLoadedEventFired(event) { if (!this._recording) @@ -783,9 +783,9 @@ var dataGrid = this._dataGrid; var rootNode = dataGrid.rootNode(); - /** @type {!Array<!WebInspector.NetworkDataGridNode> } */ + /** @type {!Array<!Network.NetworkDataGridNode> } */ var nodesToInsert = []; - /** @type {!Array<!WebInspector.NetworkDataGridNode> } */ + /** @type {!Array<!Network.NetworkDataGridNode> } */ var nodesToRefresh = []; for (var requestId in this._staleRequestIds) { var node = this._nodesByRequestId.get(requestId); @@ -794,13 +794,13 @@ var isFilteredOut = !this._applyFilter(node); if (isFilteredOut && node === this._hoveredNode) this._setHoveredNode(null); - if (node[WebInspector.NetworkLogView._isFilteredOutSymbol] !== isFilteredOut) { - if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol]) + if (node[Network.NetworkLogView._isFilteredOutSymbol] !== isFilteredOut) { + if (!node[Network.NetworkLogView._isFilteredOutSymbol]) rootNode.removeChild(node); - node[WebInspector.NetworkLogView._isFilteredOutSymbol] = isFilteredOut; + node[Network.NetworkLogView._isFilteredOutSymbol] = isFilteredOut; - if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol]) + if (!node[Network.NetworkLogView._isFilteredOutSymbol]) nodesToInsert.push(node); } if (!isFilteredOut) @@ -814,7 +814,7 @@ var node = nodesToInsert[i]; var request = node.request(); dataGrid.insertChild(node); - node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(request); + node[Network.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(request); } for (var node of nodesToRefresh) @@ -831,7 +831,7 @@ reset() { this._requestWithHighlightedInitiators = null; - this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.RequestSelected, null); + this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null); this._clearSearchMatchedList(); @@ -871,22 +871,22 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestStarted(event) { if (!this._recording) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._appendRequest(request); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _appendRequest(request) { - var node = new WebInspector.NetworkDataGridNode(this, request); - node[WebInspector.NetworkLogView._isFilteredOutSymbol] = true; - node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = false; + var node = new Network.NetworkDataGridNode(this, request); + node[Network.NetworkLogView._isFilteredOutSymbol] = true; + node[Network.NetworkLogView._isMatchingSearchQuerySymbol] = false; // In case of redirect request id is reassigned to a redirected // request and we need to update _nodesByRequestId and search results. @@ -905,76 +905,76 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestUpdated(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._refreshRequest(request); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _refreshRequest(request) { if (!this._nodesByRequestId.get(request.requestId)) return; - WebInspector.NetworkLogView._subdomains(request.domain) + Network.NetworkLogView._subdomains(request.domain) .forEach(this._suggestionBuilder.addItem.bind( - this._suggestionBuilder, WebInspector.NetworkLogView.FilterType.Domain)); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.Method, request.requestMethod); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.MimeType, request.mimeType); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.Scheme, '' + request.scheme); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.StatusCode, '' + request.statusCode); + this._suggestionBuilder, Network.NetworkLogView.FilterType.Domain)); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, request.requestMethod); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode, '' + request.statusCode); if (request.mixedContentType !== 'none') { this._suggestionBuilder.addItem( - WebInspector.NetworkLogView.FilterType.MixedContent, - WebInspector.NetworkLogView.MixedContentFilterValues.All); + Network.NetworkLogView.FilterType.MixedContent, + Network.NetworkLogView.MixedContentFilterValues.All); } if (request.mixedContentType === 'optionally-blockable') { this._suggestionBuilder.addItem( - WebInspector.NetworkLogView.FilterType.MixedContent, - WebInspector.NetworkLogView.MixedContentFilterValues.Displayed); + Network.NetworkLogView.FilterType.MixedContent, + Network.NetworkLogView.MixedContentFilterValues.Displayed); } if (request.mixedContentType === 'blockable') { - var suggestion = request.wasBlocked() ? WebInspector.NetworkLogView.MixedContentFilterValues.Blocked : - WebInspector.NetworkLogView.MixedContentFilterValues.BlockOverridden; - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.MixedContent, suggestion); + var suggestion = request.wasBlocked() ? Network.NetworkLogView.MixedContentFilterValues.Blocked : + Network.NetworkLogView.MixedContentFilterValues.BlockOverridden; + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MixedContent, suggestion); } var responseHeaders = request.responseHeaders; for (var i = 0, l = responseHeaders.length; i < l; ++i) this._suggestionBuilder.addItem( - WebInspector.NetworkLogView.FilterType.HasResponseHeader, responseHeaders[i].name); + Network.NetworkLogView.FilterType.HasResponseHeader, responseHeaders[i].name); var cookies = request.responseCookies; for (var i = 0, l = cookies ? cookies.length : 0; i < l; ++i) { var cookie = cookies[i]; - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.SetCookieDomain, cookie.domain()); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.SetCookieName, cookie.name()); - this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.SetCookieValue, cookie.value()); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.SetCookieDomain, cookie.domain()); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.SetCookieName, cookie.name()); + this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.SetCookieValue, cookie.value()); } this._staleRequestIds[request.requestId] = true; - this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.UpdateRequest, request); + this.dispatchEventToListeners(Network.NetworkLogView.Events.UpdateRequest, request); this.scheduleRefresh(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _mainFrameNavigated(event) { if (!this._recording) return; - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); var loaderId = frame.loaderId; // Pick provisional load requests. var requestsToPick = []; - var networkLog = WebInspector.NetworkLog.fromTarget(frame.target()); + var networkLog = SDK.NetworkLog.fromTarget(frame.target()); var requests = networkLog ? networkLog.requests() : []; for (var i = 0; i < requests.length; ++i) { var request = requests[i]; @@ -1012,79 +1012,79 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {!WebInspector.NetworkRequest} request + * @param {!UI.ContextMenu} contextMenu + * @param {!SDK.NetworkRequest} request */ handleContextMenuForRequest(contextMenu, request) { contextMenu.appendApplicableItems(request); - var copyMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Copy')); + var copyMenu = contextMenu.appendSubMenuItem(Common.UIString('Copy')); if (request) { copyMenu.appendItem( - WebInspector.copyLinkAddressLabel(), + UI.copyLinkAddressLabel(), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, request.contentURL())); copyMenu.appendSeparator(); if (request.requestHeadersText()) copyMenu.appendItem( - WebInspector.UIString.capitalize('Copy ^request ^headers'), this._copyRequestHeaders.bind(this, request)); + Common.UIString.capitalize('Copy ^request ^headers'), this._copyRequestHeaders.bind(this, request)); if (request.responseHeadersText) copyMenu.appendItem( - WebInspector.UIString.capitalize('Copy ^response ^headers'), this._copyResponseHeaders.bind(this, request)); + Common.UIString.capitalize('Copy ^response ^headers'), this._copyResponseHeaders.bind(this, request)); if (request.finished) - copyMenu.appendItem(WebInspector.UIString.capitalize('Copy ^response'), this._copyResponse.bind(this, request)); + copyMenu.appendItem(Common.UIString.capitalize('Copy ^response'), this._copyResponse.bind(this, request)); - if (WebInspector.isWin()) { + if (Host.isWin()) { copyMenu.appendItem( - WebInspector.UIString('Copy as cURL (cmd)'), this._copyCurlCommand.bind(this, request, 'win')); + Common.UIString('Copy as cURL (cmd)'), this._copyCurlCommand.bind(this, request, 'win')); copyMenu.appendItem( - WebInspector.UIString('Copy as cURL (bash)'), this._copyCurlCommand.bind(this, request, 'unix')); + Common.UIString('Copy as cURL (bash)'), this._copyCurlCommand.bind(this, request, 'unix')); copyMenu.appendItem( - WebInspector.UIString('Copy All as cURL (cmd)'), this._copyAllCurlCommand.bind(this, 'win')); + Common.UIString('Copy All as cURL (cmd)'), this._copyAllCurlCommand.bind(this, 'win')); copyMenu.appendItem( - WebInspector.UIString('Copy All as cURL (bash)'), this._copyAllCurlCommand.bind(this, 'unix')); + Common.UIString('Copy All as cURL (bash)'), this._copyAllCurlCommand.bind(this, 'unix')); } else { - copyMenu.appendItem(WebInspector.UIString('Copy as cURL'), this._copyCurlCommand.bind(this, request, 'unix')); - copyMenu.appendItem(WebInspector.UIString('Copy All as cURL'), this._copyAllCurlCommand.bind(this, 'unix')); + copyMenu.appendItem(Common.UIString('Copy as cURL'), this._copyCurlCommand.bind(this, request, 'unix')); + copyMenu.appendItem(Common.UIString('Copy All as cURL'), this._copyAllCurlCommand.bind(this, 'unix')); } } else { - copyMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Copy')); + copyMenu = contextMenu.appendSubMenuItem(Common.UIString('Copy')); } - copyMenu.appendItem(WebInspector.UIString.capitalize('Copy ^all as HAR'), this._copyAll.bind(this)); + copyMenu.appendItem(Common.UIString.capitalize('Copy ^all as HAR'), this._copyAll.bind(this)); contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString.capitalize('Save as HAR with ^content'), this._exportAll.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Save as HAR with ^content'), this._exportAll.bind(this)); contextMenu.appendSeparator(); contextMenu.appendItem( - WebInspector.UIString.capitalize('Clear ^browser ^cache'), this._clearBrowserCache.bind(this)); + Common.UIString.capitalize('Clear ^browser ^cache'), this._clearBrowserCache.bind(this)); contextMenu.appendItem( - WebInspector.UIString.capitalize('Clear ^browser ^cookies'), this._clearBrowserCookies.bind(this)); + Common.UIString.capitalize('Clear ^browser ^cookies'), this._clearBrowserCookies.bind(this)); - var blockedSetting = WebInspector.moduleSetting('blockedURLs'); + var blockedSetting = Common.moduleSetting('blockedURLs'); if (request && Runtime.experiments.isEnabled('requestBlocking')) { // Disabled until ready. contextMenu.appendSeparator(); var urlWithoutScheme = request.parsedURL.urlWithoutScheme(); if (urlWithoutScheme && blockedSetting.get().indexOf(urlWithoutScheme) === -1) contextMenu.appendItem( - WebInspector.UIString.capitalize('Block ^request URL'), addBlockedURL.bind(null, urlWithoutScheme)); + Common.UIString.capitalize('Block ^request URL'), addBlockedURL.bind(null, urlWithoutScheme)); var domain = request.parsedURL.domain(); if (domain && blockedSetting.get().indexOf(domain) === -1) contextMenu.appendItem( - WebInspector.UIString.capitalize('Block ^request ^domain'), addBlockedURL.bind(null, domain)); + Common.UIString.capitalize('Block ^request ^domain'), addBlockedURL.bind(null, domain)); function addBlockedURL(url) { var list = blockedSetting.get(); list.push(url); blockedSetting.set(list); - WebInspector.viewManager.showView('network.blocked-urls'); + UI.viewManager.showView('network.blocked-urls'); } } - if (request && request.resourceType() === WebInspector.resourceTypes.XHR) { + if (request && request.resourceType() === Common.resourceTypes.XHR) { contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Replay XHR'), request.replayXHR.bind(request)); + contextMenu.appendItem(Common.UIString('Replay XHR'), request.replayXHR.bind(request)); contextMenu.appendSeparator(); } } @@ -1093,24 +1093,24 @@ var requests = this._nodesByRequestId.valuesArray().map(function(node) { return node.request(); }); - var httpRequests = requests.filter(WebInspector.NetworkLogView.HTTPRequestsFilter); - return httpRequests.filter(WebInspector.NetworkLogView.FinishedRequestsFilter); + var httpRequests = requests.filter(Network.NetworkLogView.HTTPRequestsFilter); + return httpRequests.filter(Network.NetworkLogView.FinishedRequestsFilter); } _copyAll() { - var harArchive = {log: (new WebInspector.HARLog(this._harRequests())).build()}; + var harArchive = {log: (new SDK.HARLog(this._harRequests())).build()}; InspectorFrontendHost.copyText(JSON.stringify(harArchive, null, 2)); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _copyRequestHeaders(request) { InspectorFrontendHost.copyText(request.requestHeadersText()); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _copyResponse(request) { /** @@ -1125,14 +1125,14 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _copyResponseHeaders(request) { InspectorFrontendHost.copyText(request.responseHeadersText); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} platform */ _copyCurlCommand(request, platform) { @@ -1154,38 +1154,38 @@ } _exportAll() { - var url = WebInspector.targetManager.mainTarget().inspectedURL(); + var url = SDK.targetManager.mainTarget().inspectedURL(); var parsedURL = url.asParsedURL(); var filename = parsedURL ? parsedURL.host : 'network-log'; - var stream = new WebInspector.FileOutputStream(); + var stream = new Bindings.FileOutputStream(); stream.open(filename + '.har', openCallback.bind(this)); /** * @param {boolean} accepted - * @this {WebInspector.NetworkLogView} + * @this {Network.NetworkLogView} */ function openCallback(accepted) { if (!accepted) return; - var progressIndicator = new WebInspector.ProgressIndicator(); + var progressIndicator = new UI.ProgressIndicator(); this._progressBarContainer.appendChild(progressIndicator.element); - var harWriter = new WebInspector.HARWriter(); + var harWriter = new Network.HARWriter(); harWriter.write(stream, this._harRequests(), progressIndicator); } } _clearBrowserCache() { - if (confirm(WebInspector.UIString('Are you sure you want to clear browser cache?'))) - WebInspector.multitargetNetworkManager.clearBrowserCache(); + if (confirm(Common.UIString('Are you sure you want to clear browser cache?'))) + SDK.multitargetNetworkManager.clearBrowserCache(); } _clearBrowserCookies() { - if (confirm(WebInspector.UIString('Are you sure you want to clear browser cookies?'))) - WebInspector.multitargetNetworkManager.clearBrowserCookies(); + if (confirm(Common.UIString('Are you sure you want to clear browser cookies?'))) + SDK.multitargetNetworkManager.clearBrowserCookies(); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ _matchRequest(request) { @@ -1206,7 +1206,7 @@ _removeAllHighlights() { this.removeAllNodeHighlights(); for (var i = 0; i < this._highlightedSubstringChanges.length; ++i) - WebInspector.revertDomChanges(this._highlightedSubstringChanges[i]); + UI.revertDomChanges(this._highlightedSubstringChanges[i]); this._highlightedSubstringChanges = []; } @@ -1222,12 +1222,12 @@ _highlightNthMatchedRequestForSearch(n, reveal) { this._removeAllHighlights(); - /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ + /** @type {!Array.<!Network.NetworkDataGridNode>} */ var nodes = this._dataGrid.rootNode().children; var matchCount = 0; var node = null; for (var i = 0; i < nodes.length; ++i) { - if (nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymbol]) { + if (nodes[i][Network.NetworkLogView._isMatchingSearchQuerySymbol]) { if (matchCount === n) { node = nodes[i]; break; @@ -1242,18 +1242,18 @@ var request = node.request(); if (reveal) - WebInspector.Revealer.reveal(request); + Common.Revealer.reveal(request); var highlightedSubstringChanges = node.highlightMatchedSubstring(this._searchRegex); this._highlightedSubstringChanges.push(highlightedSubstringChanges); this._currentMatchedRequestNode = node; this._currentMatchedRequestIndex = n; - this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.SearchIndexUpdated, n); + this.dispatchEventToListeners(Network.NetworkLogView.Events.SearchIndexUpdated, n); } /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -1263,10 +1263,10 @@ this._clearSearchMatchedList(); this._searchRegex = createPlainTextSearchRegex(query, 'i'); - /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ + /** @type {!Array.<!Network.NetworkDataGridNode>} */ var nodes = this._dataGrid.rootNode().children; for (var i = 0; i < nodes.length; ++i) - nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(nodes[i].request()); + nodes[i][Network.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(nodes[i].request()); var newMatchedRequestIndex = this._updateMatchCountAndFindMatchIndex(currentMatchedRequestNode); if (!newMatchedRequestIndex && jumpBackwards) newMatchedRequestIndex = this._matchedRequestCount - 1; @@ -1290,16 +1290,16 @@ } /** - * @param {?WebInspector.NetworkDataGridNode} node + * @param {?Network.NetworkDataGridNode} node * @return {number} */ _updateMatchCountAndFindMatchIndex(node) { - /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ + /** @type {!Array.<!Network.NetworkDataGridNode>} */ var nodes = this._dataGrid.rootNode().children; var matchCount = 0; var matchIndex = 0; for (var i = 0; i < nodes.length; ++i) { - if (!nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymbol]) + if (!nodes[i][Network.NetworkLogView._isMatchingSearchQuerySymbol]) continue; if (node === nodes[i]) matchIndex = matchCount; @@ -1307,7 +1307,7 @@ } if (this._matchedRequestCount !== matchCount) { this._matchedRequestCount = matchCount; - this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.SearchCountUpdated, matchCount); + this.dispatchEventToListeners(Network.NetworkLogView.Events.SearchCountUpdated, matchCount); } return matchIndex; } @@ -1321,7 +1321,7 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} node + * @param {!Network.NetworkDataGridNode} node * @return {boolean} */ _applyFilter(node) { @@ -1357,14 +1357,14 @@ var n = parsedQuery.filters.length; for (var i = 0; i < n; ++i) { var filter = parsedQuery.filters[i]; - var filterType = /** @type {!WebInspector.NetworkLogView.FilterType} */ (filter.type.toLowerCase()); + var filterType = /** @type {!Network.NetworkLogView.FilterType} */ (filter.type.toLowerCase()); this._filters.push(this._createFilter(filterType, filter.data, filter.negative)); } } /** * @param {string} text - * @return {!WebInspector.NetworkLogView.Filter} + * @return {!Network.NetworkLogView.Filter} */ _createTextFilter(text) { var negative = false; @@ -1378,79 +1378,79 @@ regex = this._textFilterUI.regex(); } - var filter = WebInspector.NetworkLogView._requestPathFilter.bind(null, regex); + var filter = Network.NetworkLogView._requestPathFilter.bind(null, regex); if (negative) - filter = WebInspector.NetworkLogView._negativeFilter.bind(null, filter); + filter = Network.NetworkLogView._negativeFilter.bind(null, filter); return filter; } /** - * @param {!WebInspector.NetworkLogView.FilterType} type + * @param {!Network.NetworkLogView.FilterType} type * @param {string} value * @param {boolean} negative - * @return {!WebInspector.NetworkLogView.Filter} + * @return {!Network.NetworkLogView.Filter} */ _createFilter(type, value, negative) { var filter = this._createSpecialFilter(type, value); if (!filter) return this._createTextFilter((negative ? '-' : '') + type + ':' + value); if (negative) - return WebInspector.NetworkLogView._negativeFilter.bind(null, filter); + return Network.NetworkLogView._negativeFilter.bind(null, filter); return filter; } /** - * @param {!WebInspector.NetworkLogView.FilterType} type + * @param {!Network.NetworkLogView.FilterType} type * @param {string} value - * @return {?WebInspector.NetworkLogView.Filter} + * @return {?Network.NetworkLogView.Filter} */ _createSpecialFilter(type, value) { switch (type) { - case WebInspector.NetworkLogView.FilterType.Domain: - return WebInspector.NetworkLogView._createRequestDomainFilter(value); + case Network.NetworkLogView.FilterType.Domain: + return Network.NetworkLogView._createRequestDomainFilter(value); - case WebInspector.NetworkLogView.FilterType.HasResponseHeader: - return WebInspector.NetworkLogView._requestResponseHeaderFilter.bind(null, value); + case Network.NetworkLogView.FilterType.HasResponseHeader: + return Network.NetworkLogView._requestResponseHeaderFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.Is: - if (value.toLowerCase() === WebInspector.NetworkLogView.IsFilterType.Running) - return WebInspector.NetworkLogView._runningRequestFilter; + case Network.NetworkLogView.FilterType.Is: + if (value.toLowerCase() === Network.NetworkLogView.IsFilterType.Running) + return Network.NetworkLogView._runningRequestFilter; break; - case WebInspector.NetworkLogView.FilterType.LargerThan: + case Network.NetworkLogView.FilterType.LargerThan: return this._createSizeFilter(value.toLowerCase()); - case WebInspector.NetworkLogView.FilterType.Method: - return WebInspector.NetworkLogView._requestMethodFilter.bind(null, value); + case Network.NetworkLogView.FilterType.Method: + return Network.NetworkLogView._requestMethodFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.MimeType: - return WebInspector.NetworkLogView._requestMimeTypeFilter.bind(null, value); + case Network.NetworkLogView.FilterType.MimeType: + return Network.NetworkLogView._requestMimeTypeFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.MixedContent: - return WebInspector.NetworkLogView._requestMixedContentFilter.bind( - null, /** @type {!WebInspector.NetworkLogView.MixedContentFilterValues} */ (value)); + case Network.NetworkLogView.FilterType.MixedContent: + return Network.NetworkLogView._requestMixedContentFilter.bind( + null, /** @type {!Network.NetworkLogView.MixedContentFilterValues} */ (value)); - case WebInspector.NetworkLogView.FilterType.Scheme: - return WebInspector.NetworkLogView._requestSchemeFilter.bind(null, value); + case Network.NetworkLogView.FilterType.Scheme: + return Network.NetworkLogView._requestSchemeFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.SetCookieDomain: - return WebInspector.NetworkLogView._requestSetCookieDomainFilter.bind(null, value); + case Network.NetworkLogView.FilterType.SetCookieDomain: + return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.SetCookieName: - return WebInspector.NetworkLogView._requestSetCookieNameFilter.bind(null, value); + case Network.NetworkLogView.FilterType.SetCookieName: + return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.SetCookieValue: - return WebInspector.NetworkLogView._requestSetCookieValueFilter.bind(null, value); + case Network.NetworkLogView.FilterType.SetCookieValue: + return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, value); - case WebInspector.NetworkLogView.FilterType.StatusCode: - return WebInspector.NetworkLogView._statusCodeFilter.bind(null, value); + case Network.NetworkLogView.FilterType.StatusCode: + return Network.NetworkLogView._statusCodeFilter.bind(null, value); } return null; } /** * @param {string} value - * @return {?WebInspector.NetworkLogView.Filter} + * @return {?Network.NetworkLogView.Filter} */ _createSizeFilter(value) { var multiplier = 1; @@ -1464,7 +1464,7 @@ var quantity = Number(value); if (isNaN(quantity)) return null; - return WebInspector.NetworkLogView._requestSizeLargerThanFilter.bind(null, quantity * multiplier); + return Network.NetworkLogView._requestSizeLargerThanFilter.bind(null, quantity * multiplier); } _filterRequests() { @@ -1498,11 +1498,11 @@ searchCanceled() { delete this._searchRegex; this._clearSearchMatchedList(); - this.dispatchEventToListeners(WebInspector.NetworkLogView.Events.SearchCountUpdated, 0); + this.dispatchEventToListeners(Network.NetworkLogView.Events.SearchCountUpdated, 0); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ revealAndHighlightRequest(request) { this.removeAllNodeHighlights(); @@ -1522,15 +1522,15 @@ } /** - * @param {!WebInspector.NetworkDataGridNode} node + * @param {!Network.NetworkDataGridNode} node */ _highlightNode(node) { - WebInspector.runCSSAnimationOnce(node.element(), 'highlighted-row'); + UI.runCSSAnimationOnce(node.element(), 'highlighted-row'); this._highlightedNode = node; } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} platform * @return {string} */ @@ -1648,21 +1648,21 @@ } }; -WebInspector.NetworkLogView._isFilteredOutSymbol = Symbol('isFilteredOut'); -WebInspector.NetworkLogView._isMatchingSearchQuerySymbol = Symbol('isMatchingSearchQuery'); +Network.NetworkLogView._isFilteredOutSymbol = Symbol('isFilteredOut'); +Network.NetworkLogView._isMatchingSearchQuerySymbol = Symbol('isMatchingSearchQuery'); -WebInspector.NetworkLogView.HTTPSchemas = { +Network.NetworkLogView.HTTPSchemas = { 'http': true, 'https': true, 'ws': true, 'wss': true }; -WebInspector.NetworkLogView._waterfallMinOvertime = 1; -WebInspector.NetworkLogView._waterfallMaxOvertime = 3; +Network.NetworkLogView._waterfallMinOvertime = 1; +Network.NetworkLogView._waterfallMaxOvertime = 3; /** @enum {symbol} */ -WebInspector.NetworkLogView.Events = { +Network.NetworkLogView.Events = { RequestSelected: Symbol('RequestSelected'), SearchCountUpdated: Symbol('SearchCountUpdated'), SearchIndexUpdated: Symbol('SearchIndexUpdated'), @@ -1670,7 +1670,7 @@ }; /** @enum {string} */ -WebInspector.NetworkLogView.FilterType = { +Network.NetworkLogView.FilterType = { Domain: 'domain', HasResponseHeader: 'has-response-header', Is: 'is', @@ -1686,7 +1686,7 @@ }; /** @enum {string} */ -WebInspector.NetworkLogView.MixedContentFilterValues = { +Network.NetworkLogView.MixedContentFilterValues = { All: 'all', Displayed: 'displayed', Blocked: 'blocked', @@ -1694,13 +1694,13 @@ }; /** @enum {string} */ -WebInspector.NetworkLogView.IsFilterType = { +Network.NetworkLogView.IsFilterType = { Running: 'running' }; /** @type {!Array<string>} */ -WebInspector.NetworkLogView._searchKeys = - Object.keys(WebInspector.NetworkLogView.FilterType).map(key => WebInspector.NetworkLogView.FilterType[key]); +Network.NetworkLogView._searchKeys = + Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLogView.FilterType[key]); -/** @typedef {function(!WebInspector.NetworkRequest): boolean} */ -WebInspector.NetworkLogView.Filter; +/** @typedef {function(!SDK.NetworkRequest): boolean} */ +Network.NetworkLogView.Filter;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js index 07ae7c6..cc072188 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js
@@ -4,18 +4,18 @@ /** * @unrestricted */ -WebInspector.NetworkLogViewColumns = class { +Network.NetworkLogViewColumns = class { /** - * @param {!WebInspector.NetworkLogView} networkLogView - * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator - * @param {!WebInspector.NetworkTransferDurationCalculator} durationCalculator - * @param {!WebInspector.Setting} networkLogLargeRowsSetting + * @param {!Network.NetworkLogView} networkLogView + * @param {!Network.NetworkTransferTimeCalculator} timeCalculator + * @param {!Network.NetworkTransferDurationCalculator} durationCalculator + * @param {!Common.Setting} networkLogLargeRowsSetting */ constructor(networkLogView, timeCalculator, durationCalculator, networkLogLargeRowsSetting) { this._networkLogView = networkLogView; - /** @type {!WebInspector.Setting} */ - this._persistantSettings = WebInspector.settings.createSetting('networkLogColumns', {}); + /** @type {!Common.Setting} */ + this._persistantSettings = Common.settings.createSetting('networkLogColumns', {}); this._networkLogLargeRowsSetting = networkLogLargeRowsSetting; this._networkLogLargeRowsSetting.addChangeListener(this._updateRowsSize, this); @@ -26,30 +26,30 @@ this._gridMode = true; - /** @type {!Array.<!WebInspector.NetworkLogViewColumns.Descriptor>} */ + /** @type {!Array.<!Network.NetworkLogViewColumns.Descriptor>} */ this._columns = []; this._waterfallRequestsAreStale = false; this._waterfallScrollerWidthIsStale = true; - /** @type {!WebInspector.Linkifier} */ - this._popupLinkifier = new WebInspector.Linkifier(); + /** @type {!Components.Linkifier} */ + this._popupLinkifier = new Components.Linkifier(); - /** @type {!Map<string, !WebInspector.NetworkTimeCalculator>} */ + /** @type {!Map<string, !Network.NetworkTimeCalculator>} */ this._calculatorsMap = new Map(); - this._calculatorsMap.set(WebInspector.NetworkLogViewColumns._calculatorTypes.Time, timeCalculator); - this._calculatorsMap.set(WebInspector.NetworkLogViewColumns._calculatorTypes.Duration, durationCalculator); + this._calculatorsMap.set(Network.NetworkLogViewColumns._calculatorTypes.Time, timeCalculator); + this._calculatorsMap.set(Network.NetworkLogViewColumns._calculatorTypes.Duration, durationCalculator); this._setupDataGrid(); this._setupWaterfall(); } /** - * @param {!WebInspector.NetworkLogViewColumns.Descriptor} columnConfig - * @return {!WebInspector.DataGrid.ColumnDescriptor} + * @param {!Network.NetworkLogViewColumns.Descriptor} columnConfig + * @return {!UI.DataGrid.ColumnDescriptor} */ static _convertToDataGridDescriptor(columnConfig) { - return /** @type {!WebInspector.DataGrid.ColumnDescriptor} */ ({ + return /** @type {!UI.DataGrid.ColumnDescriptor} */ ({ id: columnConfig.id, title: columnConfig.title, sortable: columnConfig.sortable, @@ -74,12 +74,12 @@ } _setupDataGrid() { - var defaultColumns = WebInspector.NetworkLogViewColumns._defaultColumns; - var defaultColumnConfig = WebInspector.NetworkLogViewColumns._defaultColumnConfig; + var defaultColumns = Network.NetworkLogViewColumns._defaultColumns; + var defaultColumnConfig = Network.NetworkLogViewColumns._defaultColumnConfig; - this._columns = /** @type {!Array<!WebInspector.NetworkLogViewColumns.Descriptor>} */ ([]); + this._columns = /** @type {!Array<!Network.NetworkLogViewColumns.Descriptor>} */ ([]); for (var currentConfigColumn of defaultColumns) { - var columnConfig = /** @type {!WebInspector.NetworkLogViewColumns.Descriptor} */ ( + var columnConfig = /** @type {!Network.NetworkLogViewColumns.Descriptor} */ ( Object.assign(/** @type {!Object} */ ({}), defaultColumnConfig, currentConfigColumn)); columnConfig.id = columnConfig.id; if (columnConfig.subtitle) @@ -88,12 +88,12 @@ } this._loadColumns(); - this._popoverHelper = new WebInspector.PopoverHelper(this._networkLogView.element); + this._popoverHelper = new UI.PopoverHelper(this._networkLogView.element); this._popoverHelper.initializeCallbacks( this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.bind(this)); - this._dataGrid = new WebInspector.SortableDataGrid( - this._columns.map(WebInspector.NetworkLogViewColumns._convertToDataGridDescriptor)); + this._dataGrid = new UI.SortableDataGrid( + this._columns.map(Network.NetworkLogViewColumns._convertToDataGridDescriptor)); this._dataGrid.element.addEventListener('mousedown', event => { if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosingNodeOrSelfWithNodeName('a')) event.consume(); @@ -102,14 +102,14 @@ this._dataGridScroller = this._dataGrid.scrollContainer; this._updateColumns(); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortHandler, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortHandler, this); this._dataGrid.setHeaderContextMenuCallback(this._innerHeaderContextMenu.bind(this)); - this._activeWaterfallSortId = WebInspector.NetworkLogViewColumns.WaterfallSortIds.StartTime; + this._activeWaterfallSortId = Network.NetworkLogViewColumns.WaterfallSortIds.StartTime; this._dataGrid.markColumnAsSortedBy( - WebInspector.NetworkLogViewColumns._initialSortColumn, WebInspector.DataGrid.Order.Ascending); + Network.NetworkLogViewColumns._initialSortColumn, UI.DataGrid.Order.Ascending); - this._splitWidget = new WebInspector.SplitWidget(true, true, 'networkPanelSplitViewWaterfall', 200); + this._splitWidget = new UI.SplitWidget(true, true, 'networkPanelSplitViewWaterfall', 200); var widget = this._dataGrid.asWidget(); widget.setMinimumSize(150, 0); this._splitWidget.setMainWidget(widget); @@ -117,7 +117,7 @@ _setupWaterfall() { this._waterfallColumn = - new WebInspector.NetworkWaterfallColumn(this._networkLogView.rowHeight(), this._networkLogView.calculator()); + new Network.NetworkWaterfallColumn(this._networkLogView.rowHeight(), this._networkLogView.calculator()); this._waterfallColumn.element.addEventListener('contextmenu', handleContextMenu.bind(this)); this._waterfallColumn.element.addEventListener('mousewheel', this._onMouseWheel.bind(this, false), {passive: true}); @@ -136,12 +136,12 @@ this._waterfallScroller.addEventListener('scroll', this._syncScrollers.bind(this), {passive: true}); this._waterfallScrollerContent = this._waterfallScroller.createChild('div', 'network-waterfall-v-scroll-content'); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChanged, () => { + this._dataGrid.addEventListener(UI.DataGrid.Events.PaddingChanged, () => { this._waterfallScrollerWidthIsStale = true; this._syncScrollers(); }); this._dataGrid.addEventListener( - WebInspector.ViewportDataGrid.Events.ViewportCalculated, this._redrawWaterfallColumn.bind(this)); + UI.ViewportDataGrid.Events.ViewportCalculated, this._redrawWaterfallColumn.bind(this)); this._createWaterfallHeader(); this._waterfallColumn.contentElement.classList.add('network-waterfall-view'); @@ -153,13 +153,13 @@ /** * @param {!Event} event - * @this {WebInspector.NetworkLogViewColumns} + * @this {Network.NetworkLogViewColumns} */ function handleContextMenu(event) { var request = this._waterfallColumn.getRequestFromPoint(event.offsetX, event.offsetY); if (!request) return; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); this._networkLogView.handleContextMenuForRequest(contextMenu, request); contextMenu.show(); } @@ -202,7 +202,7 @@ return; } var currentNode = this._dataGrid.rootNode(); - /** @type {!WebInspector.NetworkWaterfallColumn.RequestData} */ + /** @type {!Network.NetworkWaterfallColumn.RequestData} */ var requestData = {requests: [], navigationRequest: null}; while (currentNode = currentNode.traverseNextNode(true)) { if (currentNode.isNavigationRequest()) @@ -213,7 +213,7 @@ } /** - * @param {?WebInspector.NetworkRequest} request + * @param {?SDK.NetworkRequest} request * @param {boolean} highlightInitiatorChain */ setHoveredRequest(request, highlightInitiatorChain) { @@ -224,17 +224,17 @@ this._waterfallHeaderElement = this._waterfallColumn.contentElement.createChild('div', 'network-waterfall-header'); this._waterfallHeaderElement.addEventListener('click', waterfallHeaderClicked.bind(this)); this._waterfallHeaderElement.addEventListener( - 'contextmenu', event => this._innerHeaderContextMenu(new WebInspector.ContextMenu(event))); + 'contextmenu', event => this._innerHeaderContextMenu(new UI.ContextMenu(event))); var innerElement = this._waterfallHeaderElement.createChild('div'); - innerElement.textContent = WebInspector.UIString('Waterfall'); + innerElement.textContent = Common.UIString('Waterfall'); this._waterfallColumnSortIcon = this._waterfallHeaderElement.createChild('div', 'sort-order-icon-container') .createChild('div', 'sort-order-icon'); /** - * @this {WebInspector.NetworkLogViewColumns} + * @this {Network.NetworkLogViewColumns} */ function waterfallHeaderClicked() { - var sortOrders = WebInspector.DataGrid.Order; + var sortOrders = UI.DataGrid.Order; var sortOrder = this._dataGrid.sortOrder() === sortOrders.Ascending ? sortOrders.Descending : sortOrders.Ascending; this._dataGrid.markColumnAsSortedBy('waterfall', sortOrder); @@ -243,7 +243,7 @@ } /** - * @param {!WebInspector.NetworkTimeCalculator} x + * @param {!Network.NetworkTimeCalculator} x */ setCalculator(x) { this._waterfallColumn.setCalculator(x); @@ -273,7 +273,7 @@ } /** - * @return {!WebInspector.SortableDataGrid} dataGrid + * @return {!UI.SortableDataGrid} dataGrid */ dataGrid() { return this._dataGrid; @@ -289,14 +289,14 @@ if (columnId === 'waterfall') { this._waterfallColumnSortIcon.classList.remove('sort-ascending', 'sort-descending'); - if (this._dataGrid.sortOrder() === WebInspector.DataGrid.Order.Ascending) + if (this._dataGrid.sortOrder() === UI.DataGrid.Order.Ascending) this._waterfallColumnSortIcon.classList.add('sort-ascending'); else this._waterfallColumnSortIcon.classList.add('sort-descending'); this._waterfallRequestsAreStale = true; var sortFunction = - WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, this._activeWaterfallSortId); + Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, this._activeWaterfallSortId); this._dataGrid.sortNodes(sortFunction, !this._dataGrid.isSortOrderAscending()); return; } @@ -348,7 +348,7 @@ } /** - * @param {!WebInspector.NetworkLogViewColumns.Descriptor} columnConfig + * @param {!Network.NetworkLogViewColumns.Descriptor} columnConfig */ _toggleColumnVisibility(columnConfig) { this._loadColumns(); @@ -394,7 +394,7 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _innerHeaderContextMenu(contextMenu) { var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideable); @@ -406,7 +406,7 @@ contextMenu.appendSeparator(); - var responseSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Response Headers')); + var responseSubMenu = contextMenu.appendSubMenuItem(Common.UIString('Response Headers')); var responseHeaders = columnConfigs.filter(columnConfig => columnConfig.isResponseHeader); for (var columnConfig of responseHeaders) { responseSubMenu.appendCheckboxItem( @@ -415,43 +415,43 @@ responseSubMenu.appendSeparator(); responseSubMenu.appendItem( - WebInspector.UIString('Manage Header Columns\u2026'), this._manageCustomHeaderDialog.bind(this)); + Common.UIString('Manage Header Columns\u2026'), this._manageCustomHeaderDialog.bind(this)); contextMenu.appendSeparator(); - var waterfallSortIds = WebInspector.NetworkLogViewColumns.WaterfallSortIds; - var waterfallSubMenu = contextMenu.appendSubMenuItem(WebInspector.UIString('Waterfall')); + var waterfallSortIds = Network.NetworkLogViewColumns.WaterfallSortIds; + var waterfallSubMenu = contextMenu.appendSubMenuItem(Common.UIString('Waterfall')); waterfallSubMenu.appendCheckboxItem( - WebInspector.UIString('Start Time'), setWaterfallMode.bind(this, waterfallSortIds.StartTime), + Common.UIString('Start Time'), setWaterfallMode.bind(this, waterfallSortIds.StartTime), this._activeWaterfallSortId === waterfallSortIds.StartTime); waterfallSubMenu.appendCheckboxItem( - WebInspector.UIString('Response Time'), setWaterfallMode.bind(this, waterfallSortIds.ResponseTime), + Common.UIString('Response Time'), setWaterfallMode.bind(this, waterfallSortIds.ResponseTime), this._activeWaterfallSortId === waterfallSortIds.ResponseTime); waterfallSubMenu.appendCheckboxItem( - WebInspector.UIString('End Time'), setWaterfallMode.bind(this, waterfallSortIds.EndTime), + Common.UIString('End Time'), setWaterfallMode.bind(this, waterfallSortIds.EndTime), this._activeWaterfallSortId === waterfallSortIds.EndTime); waterfallSubMenu.appendCheckboxItem( - WebInspector.UIString('Total Duration'), setWaterfallMode.bind(this, waterfallSortIds.Duration), + Common.UIString('Total Duration'), setWaterfallMode.bind(this, waterfallSortIds.Duration), this._activeWaterfallSortId === waterfallSortIds.Duration); waterfallSubMenu.appendCheckboxItem( - WebInspector.UIString('Latency'), setWaterfallMode.bind(this, waterfallSortIds.Latency), + Common.UIString('Latency'), setWaterfallMode.bind(this, waterfallSortIds.Latency), this._activeWaterfallSortId === waterfallSortIds.Latency); contextMenu.show(); /** - * @param {!WebInspector.NetworkLogViewColumns.WaterfallSortIds} sortId - * @this {WebInspector.NetworkLogViewColumns} + * @param {!Network.NetworkLogViewColumns.WaterfallSortIds} sortId + * @this {Network.NetworkLogViewColumns} */ function setWaterfallMode(sortId) { - var calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColumns._calculatorTypes.Time); - var waterfallSortIds = WebInspector.NetworkLogViewColumns.WaterfallSortIds; + var calculator = this._calculatorsMap.get(Network.NetworkLogViewColumns._calculatorTypes.Time); + var waterfallSortIds = Network.NetworkLogViewColumns.WaterfallSortIds; if (sortId === waterfallSortIds.Duration || sortId === waterfallSortIds.Latency) - calculator = this._calculatorsMap.get(WebInspector.NetworkLogViewColumns._calculatorTypes.Duration); + calculator = this._calculatorsMap.get(Network.NetworkLogViewColumns._calculatorTypes.Duration); this._networkLogView.setCalculator(calculator); this._activeWaterfallSortId = sortId; - this._dataGrid.markColumnAsSortedBy('waterfall', WebInspector.DataGrid.Order.Ascending); + this._dataGrid.markColumnAsSortedBy('waterfall', UI.DataGrid.Order.Ascending); this._sortHandler(); } } @@ -462,10 +462,10 @@ if (columnConfig.isResponseHeader) customHeaders.push({title: columnConfig.title, editable: columnConfig.isCustomHeader}); } - var manageCustomHeaders = new WebInspector.NetworkManageCustomHeadersView( + var manageCustomHeaders = new Network.NetworkManageCustomHeadersView( customHeaders, headerTitle => !!this._addCustomHeader(headerTitle), this._changeCustomHeader.bind(this), this._removeCustomHeader.bind(this)); - var dialog = new WebInspector.Dialog(); + var dialog = new UI.Dialog(); manageCustomHeaders.show(dialog.element); dialog.setWrapsContent(true); dialog.show(); @@ -491,7 +491,7 @@ * @param {string} headerTitle * @param {string=} headerId * @param {number=} index - * @return {?WebInspector.NetworkLogViewColumns.Descriptor} + * @return {?Network.NetworkLogViewColumns.Descriptor} */ _addCustomHeader(headerTitle, headerId, index) { if (!headerId) @@ -503,18 +503,18 @@ if (currentColumnConfig) return null; - var columnConfig = /** @type {!WebInspector.NetworkLogViewColumns.Descriptor} */ ( - Object.assign(/** @type {!Object} */ ({}), WebInspector.NetworkLogViewColumns._defaultColumnConfig, { + var columnConfig = /** @type {!Network.NetworkLogViewColumns.Descriptor} */ ( + Object.assign(/** @type {!Object} */ ({}), Network.NetworkLogViewColumns._defaultColumnConfig, { id: headerId, title: headerTitle, isResponseHeader: true, isCustomHeader: true, visible: true, - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, headerId) + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, headerId) })); this._columns.splice(index, 0, columnConfig); if (this._dataGrid) - this._dataGrid.addColumn(WebInspector.NetworkLogViewColumns._convertToDataGridDescriptor(columnConfig), index); + this._dataGrid.addColumn(Network.NetworkLogViewColumns._convertToDataGridDescriptor(columnConfig), index); this._saveColumns(); this._updateColumns(); return columnConfig; @@ -552,7 +552,7 @@ return; var anchor = element.enclosingNodeOrSelfWithClass('network-script-initiated'); if (anchor && anchor.request) { - var initiator = /** @type {!WebInspector.NetworkRequest} */ (anchor.request).initiator(); + var initiator = /** @type {!SDK.NetworkRequest} */ (anchor.request).initiator(); if (initiator && initiator.stack) return anchor; } @@ -560,12 +560,12 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { - var request = /** @type {!WebInspector.NetworkRequest} */ (anchor.request); + var request = /** @type {!SDK.NetworkRequest} */ (anchor.request); var initiator = /** @type {!Protocol.Network.Initiator} */ (request.initiator()); - var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewContents( + var content = Components.DOMPresentationUtils.buildStackTracePreviewContents( request.target(), this._popupLinkifier, initiator.stack); popover.setCanShrink(true); popover.showForAnchor(content, anchor); @@ -611,17 +611,17 @@ * @param {number} time */ selectFilmStripFrame(time) { - this._eventDividers.set(WebInspector.NetworkLogViewColumns._filmStripDividerColor, [time]); + this._eventDividers.set(Network.NetworkLogViewColumns._filmStripDividerColor, [time]); this._redrawWaterfallColumn(); } clearFilmStripFrame() { - this._eventDividers.delete(WebInspector.NetworkLogViewColumns._filmStripDividerColor); + this._eventDividers.delete(Network.NetworkLogViewColumns._filmStripDividerColor); this._redrawWaterfallColumn(); } }; -WebInspector.NetworkLogViewColumns._initialSortColumn = 'waterfall'; +Network.NetworkLogViewColumns._initialSortColumn = 'waterfall'; /** * @typedef {{ @@ -634,16 +634,16 @@ * hideable: boolean, * nonSelectable: boolean, * sortable: boolean, - * align: (?WebInspector.DataGrid.Align|undefined), + * align: (?UI.DataGrid.Align|undefined), * isResponseHeader: boolean, - * sortingFunction: (!function(!WebInspector.NetworkDataGridNode, !WebInspector.NetworkDataGridNode):number|undefined), + * sortingFunction: (!function(!Network.NetworkDataGridNode, !Network.NetworkDataGridNode):number|undefined), * isCustomHeader: boolean * }} */ -WebInspector.NetworkLogViewColumns.Descriptor; +Network.NetworkLogViewColumns.Descriptor; /** @enum {string} */ -WebInspector.NetworkLogViewColumns._calculatorTypes = { +Network.NetworkLogViewColumns._calculatorTypes = { Duration: 'Duration', Time: 'Time' }; @@ -651,7 +651,7 @@ /** * @type {!Object} column */ -WebInspector.NetworkLogViewColumns._defaultColumnConfig = { +Network.NetworkLogViewColumns._defaultColumnConfig = { subtitle: null, visible: false, weight: 6, @@ -664,170 +664,170 @@ }; /** - * @type {!Array.<!WebInspector.NetworkLogViewColumns.Descriptor>} column + * @type {!Array.<!Network.NetworkLogViewColumns.Descriptor>} column */ -WebInspector.NetworkLogViewColumns._defaultColumns = [ +Network.NetworkLogViewColumns._defaultColumns = [ { id: 'name', - title: WebInspector.UIString('Name'), - subtitle: WebInspector.UIString('Path'), + title: Common.UIString('Name'), + subtitle: Common.UIString('Path'), visible: true, weight: 20, hideable: false, nonSelectable: false, alwaysVisible: true, - sortingFunction: WebInspector.NetworkDataGridNode.NameComparator + sortingFunction: Network.NetworkDataGridNode.NameComparator }, { id: 'method', - title: WebInspector.UIString('Method'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'requestMethod') + title: Common.UIString('Method'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'requestMethod') }, { id: 'status', - title: WebInspector.UIString('Status'), + title: Common.UIString('Status'), visible: true, - subtitle: WebInspector.UIString('Text'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'statusCode') + subtitle: Common.UIString('Text'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'statusCode') }, { id: 'protocol', - title: WebInspector.UIString('Protocol'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'protocol') + title: Common.UIString('Protocol'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'protocol') }, { id: 'scheme', - title: WebInspector.UIString('Scheme'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'scheme') + title: Common.UIString('Scheme'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'scheme') }, { id: 'domain', - title: WebInspector.UIString('Domain'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'domain') + title: Common.UIString('Domain'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'domain') }, { id: 'remoteaddress', - title: WebInspector.UIString('Remote Address'), + title: Common.UIString('Remote Address'), weight: 10, - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.RemoteAddressComparator + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.RemoteAddressComparator }, { id: 'type', - title: WebInspector.UIString('Type'), + title: Common.UIString('Type'), visible: true, - sortingFunction: WebInspector.NetworkDataGridNode.TypeComparator + sortingFunction: Network.NetworkDataGridNode.TypeComparator }, { id: 'initiator', - title: WebInspector.UIString('Initiator'), + title: Common.UIString('Initiator'), visible: true, weight: 10, - sortingFunction: WebInspector.NetworkDataGridNode.InitiatorComparator + sortingFunction: Network.NetworkDataGridNode.InitiatorComparator }, { id: 'cookies', - title: WebInspector.UIString('Cookies'), - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.RequestCookiesCountComparator + title: Common.UIString('Cookies'), + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.RequestCookiesCountComparator }, { id: 'setcookies', - title: WebInspector.UIString('Set Cookies'), - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator + title: Common.UIString('Set Cookies'), + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.ResponseCookiesCountComparator }, { id: 'size', - title: WebInspector.UIString('Size'), + title: Common.UIString('Size'), visible: true, - subtitle: WebInspector.UIString('Content'), - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.SizeComparator + subtitle: Common.UIString('Content'), + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.SizeComparator }, { id: 'time', - title: WebInspector.UIString('Time'), + title: Common.UIString('Time'), visible: true, - subtitle: WebInspector.UIString('Latency'), - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'duration') + subtitle: Common.UIString('Latency'), + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'duration') }, { id: 'priority', - title: WebInspector.UIString('Priority'), - sortingFunction: WebInspector.NetworkDataGridNode.InitialPriorityComparator + title: Common.UIString('Priority'), + sortingFunction: Network.NetworkDataGridNode.InitialPriorityComparator }, { id: 'connectionid', - title: WebInspector.UIString('Connection ID'), - sortingFunction: WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'connectionId') + title: Common.UIString('Connection ID'), + sortingFunction: Network.NetworkDataGridNode.RequestPropertyComparator.bind(null, 'connectionId') }, { id: 'cache-control', isResponseHeader: true, - title: WebInspector.UIString('Cache-Control'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'cache-control') + title: Common.UIString('Cache-Control'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'cache-control') }, { id: 'connection', isResponseHeader: true, - title: WebInspector.UIString('Connection'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'connection') + title: Common.UIString('Connection'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'connection') }, { id: 'content-encoding', isResponseHeader: true, - title: WebInspector.UIString('Content-Encoding'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'content-encoding') + title: Common.UIString('Content-Encoding'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'content-encoding') }, { id: 'content-length', isResponseHeader: true, - title: WebInspector.UIString('Content-Length'), - align: WebInspector.DataGrid.Align.Right, - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderNumberComparator.bind(null, 'content-length') + title: Common.UIString('Content-Length'), + align: UI.DataGrid.Align.Right, + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderNumberComparator.bind(null, 'content-length') }, { id: 'etag', isResponseHeader: true, - title: WebInspector.UIString('ETag'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'etag') + title: Common.UIString('ETag'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'etag') }, { id: 'keep-alive', isResponseHeader: true, - title: WebInspector.UIString('Keep-Alive'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'keep-alive') + title: Common.UIString('Keep-Alive'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'keep-alive') }, { id: 'last-modified', isResponseHeader: true, - title: WebInspector.UIString('Last-Modified'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderDateComparator.bind(null, 'last-modified') + title: Common.UIString('Last-Modified'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderDateComparator.bind(null, 'last-modified') }, { id: 'server', isResponseHeader: true, - title: WebInspector.UIString('Server'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'server') + title: Common.UIString('Server'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'server') }, { id: 'vary', isResponseHeader: true, - title: WebInspector.UIString('Vary'), - sortingFunction: WebInspector.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'vary') + title: Common.UIString('Vary'), + sortingFunction: Network.NetworkDataGridNode.ResponseHeaderStringComparator.bind(null, 'vary') }, // This header is a placeholder to let datagrid know that it can be sorted by this column, but never shown. {id: 'waterfall', title: '', visible: false, hideable: false} ]; -WebInspector.NetworkLogViewColumns._filmStripDividerColor = '#fccc49'; +Network.NetworkLogViewColumns._filmStripDividerColor = '#fccc49'; /** * @enum {string} */ -WebInspector.NetworkLogViewColumns.WaterfallSortIds = { +Network.NetworkLogViewColumns.WaterfallSortIds = { StartTime: 'startTime', ResponseTime: 'responseReceivedTime', EndTime: 'endTime',
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkManageCustomHeadersView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkManageCustomHeadersView.js index 3c0aa0f..26c9df5 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkManageCustomHeadersView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkManageCustomHeadersView.js
@@ -4,10 +4,10 @@ * found in the LICENSE file. */ /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.NetworkManageCustomHeadersView = class extends WebInspector.VBox { +Network.NetworkManageCustomHeadersView = class extends UI.VBox { /** * @param {!Array.<!{title: string, editable: boolean}>} columnData * @param {function(string) : boolean} addHeaderColumnCallback @@ -19,18 +19,18 @@ this.registerRequiredCSS('network/networkManageCustomHeadersView.css'); this.contentElement.classList.add('custom-headers-wrapper'); - this.contentElement.createChild('div', 'header').textContent = WebInspector.UIString('Manage Header Columns'); + this.contentElement.createChild('div', 'header').textContent = Common.UIString('Manage Header Columns'); - this._list = new WebInspector.ListWidget(this); + this._list = new UI.ListWidget(this); this._list.element.classList.add('custom-headers-list'); this._list.registerRequiredCSS('network/networkManageCustomHeadersView.css'); var placeholder = createElementWithClass('div', 'custom-headers-list-list-empty'); - placeholder.textContent = WebInspector.UIString('No custom headers'); + placeholder.textContent = Common.UIString('No custom headers'); this._list.setEmptyPlaceholder(placeholder); this._list.show(this.contentElement); this.contentElement.appendChild(createTextButton( - WebInspector.UIString('Add custom header\u2026'), this._addButtonClicked.bind(this), 'add-button')); + Common.UIString('Add custom header\u2026'), this._addButtonClicked.bind(this), 'add-button')); /** @type {!Map.<string, !{title: string, editable: boolean}>} */ this._columnConfigs = new Map(); @@ -87,7 +87,7 @@ /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { @@ -109,7 +109,7 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { var editor = this._createEditor(); @@ -118,18 +118,18 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createEditor() { if (this._editor) return this._editor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._editor = editor; var content = editor.contentElement(); var titles = content.createChild('div', 'custom-headers-edit-row'); - titles.createChild('div', 'custom-headers-header').textContent = WebInspector.UIString('Header Name'); + titles.createChild('div', 'custom-headers-header').textContent = Common.UIString('Header Name'); var fields = content.createChild('div', 'custom-headers-edit-row'); fields.createChild('div', 'custom-headers-header') @@ -141,7 +141,7 @@ * @param {*} item * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input - * @this {WebInspector.NetworkManageCustomHeadersView} + * @this {Network.NetworkManageCustomHeadersView} * @return {boolean} */ function validateHeader(item, index, input) {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js index c57796d8..983ac96 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkOverview.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.NetworkOverview = class extends WebInspector.TimelineOverviewBase { +Network.NetworkOverview = class extends UI.TimelineOverviewBase { constructor() { super(); this.element.classList.add('network-overview'); @@ -24,17 +24,17 @@ /** @type {number} */ this._canvasHeight = 0; - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.Load, this._loadEventFired, this); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.DOMContentLoaded, + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._loadEventFired, this); + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.DOMContentLoaded, this._domContentLoadedEventFired, this); this.reset(); } /** - * @param {?WebInspector.FilmStripModel} filmStripModel + * @param {?Components.FilmStripModel} filmStripModel */ setFilmStripModel(filmStripModel) { this._filmStripModel = filmStripModel; @@ -55,7 +55,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _loadEventFired(event) { var data = /** @type {number} */ (event.data); @@ -65,7 +65,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domContentLoadedEventFired(event) { var data = /** @type {number} */ (event.data); @@ -89,7 +89,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ updateRequest(request) { if (!this._requestsSet.has(request)) { @@ -114,7 +114,7 @@ var height = this.element.offsetHeight; this._calculator.setDisplayWindow(width); this.resetCanvas(); - var numBands = (((height - 1) / WebInspector.NetworkOverview._bandHeight) - 1) | 0; + var numBands = (((height - 1) / Network.NetworkOverview._bandHeight) - 1) | 0; this._numBands = (numBands > 0) ? numBands : 1; this.scheduleUpdate(); } @@ -125,20 +125,20 @@ reset() { this._windowStart = 0; this._windowEnd = 0; - /** @type {?WebInspector.FilmStripModel} */ + /** @type {?Components.FilmStripModel} */ this._filmStripModel = null; /** @type {number} */ this._span = 1; - /** @type {?WebInspector.NetworkTimeBoundary} */ + /** @type {?Network.NetworkTimeBoundary} */ this._lastBoundary = null; /** @type {number} */ this._nextBand = 0; /** @type {!Map.<string, number>} */ this._bandMap = new Map(); - /** @type {!Array.<!WebInspector.NetworkRequest>} */ + /** @type {!Array.<!SDK.NetworkRequest>} */ this._requestsList = []; - /** @type {!Set.<!WebInspector.NetworkRequest>} */ + /** @type {!Set.<!SDK.NetworkRequest>} */ this._requestsSet = new Set(); /** @type {!Array.<number>} */ this._loadEvents = []; @@ -166,14 +166,14 @@ this._updateScheduled = false; var newBoundary = - new WebInspector.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary()); + new Network.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary()); if (!this._lastBoundary || !newBoundary.equals(this._lastBoundary)) { var span = this._calculator.boundarySpan(); while (this._span < span) this._span *= 1.25; this._calculator.setBounds(this._calculator.minimumBoundary(), this._calculator.minimumBoundary() + this._span); this._lastBoundary = - new WebInspector.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary()); + new Network.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary()); if (this._windowStart || this._windowEnd) { this._restoringWindow = true; var startTime = this._calculator.minimumBoundary(); @@ -201,7 +201,7 @@ context.beginPath(); context.strokeStyle = strokeStyle; for (var i = 0; i < n;) { - var y = lines[i++] * WebInspector.NetworkOverview._bandHeight + paddingTop; + var y = lines[i++] * Network.NetworkOverview._bandHeight + paddingTop; var startTime = lines[i++]; var endTime = lines[i++]; if (endTime === Number.MAX_VALUE) @@ -234,10 +234,10 @@ var band = this._bandId(request.connectionId); var y = (band === -1) ? 0 : (band % this._numBands + 1); var timeRanges = - WebInspector.RequestTimingView.calculateRequestTimeRanges(request, this._calculator.minimumBoundary()); + Network.RequestTimingView.calculateRequestTimeRanges(request, this._calculator.minimumBoundary()); for (var j = 0; j < timeRanges.length; ++j) { var type = timeRanges[j].name; - if (band !== -1 || type === WebInspector.RequestTimeRangeNames.Total) + if (band !== -1 || type === Network.RequestTimeRangeNames.Total) addLine(type, y, timeRanges[j].start * 1000, timeRanges[j].end * 1000); } } @@ -246,18 +246,18 @@ context.save(); context.scale(window.devicePixelRatio, window.devicePixelRatio); context.lineWidth = 2; - drawLines(WebInspector.RequestTimeRangeNames.Total, '#CCCCCC'); - drawLines(WebInspector.RequestTimeRangeNames.Blocking, '#AAAAAA'); - drawLines(WebInspector.RequestTimeRangeNames.Connecting, '#FF9800'); - drawLines(WebInspector.RequestTimeRangeNames.ServiceWorker, '#FF9800'); - drawLines(WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, '#FF9800'); - drawLines(WebInspector.RequestTimeRangeNames.Push, '#8CDBff'); - drawLines(WebInspector.RequestTimeRangeNames.Proxy, '#A1887F'); - drawLines(WebInspector.RequestTimeRangeNames.DNS, '#009688'); - drawLines(WebInspector.RequestTimeRangeNames.SSL, '#9C27B0'); - drawLines(WebInspector.RequestTimeRangeNames.Sending, '#B0BEC5'); - drawLines(WebInspector.RequestTimeRangeNames.Waiting, '#00C853'); - drawLines(WebInspector.RequestTimeRangeNames.Receiving, '#03A9F4'); + drawLines(Network.RequestTimeRangeNames.Total, '#CCCCCC'); + drawLines(Network.RequestTimeRangeNames.Blocking, '#AAAAAA'); + drawLines(Network.RequestTimeRangeNames.Connecting, '#FF9800'); + drawLines(Network.RequestTimeRangeNames.ServiceWorker, '#FF9800'); + drawLines(Network.RequestTimeRangeNames.ServiceWorkerPreparation, '#FF9800'); + drawLines(Network.RequestTimeRangeNames.Push, '#8CDBff'); + drawLines(Network.RequestTimeRangeNames.Proxy, '#A1887F'); + drawLines(Network.RequestTimeRangeNames.DNS, '#009688'); + drawLines(Network.RequestTimeRangeNames.SSL, '#9C27B0'); + drawLines(Network.RequestTimeRangeNames.Sending, '#B0BEC5'); + drawLines(Network.RequestTimeRangeNames.Waiting, '#00C853'); + drawLines(Network.RequestTimeRangeNames.Receiving, '#03A9F4'); var height = this.element.offsetHeight; context.lineWidth = 1; @@ -293,7 +293,7 @@ }; /** @type {number} */ -WebInspector.NetworkOverview._bandHeight = 3; +Network.NetworkOverview._bandHeight = 3; /** @typedef {{start: number, end: number}} */ -WebInspector.NetworkOverview.Window; +Network.NetworkOverview.Window;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js index 321ddd37..464b4b60 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js
@@ -28,40 +28,40 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContextMenu.Provider} - * @implements {WebInspector.Searchable} + * @implements {UI.ContextMenu.Provider} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.NetworkPanel = class extends WebInspector.Panel { +Network.NetworkPanel = class extends UI.Panel { constructor() { super('network'); this.registerRequiredCSS('network/networkPanel.css'); - this._networkLogShowOverviewSetting = WebInspector.settings.createSetting('networkLogShowOverview', true); - this._networkLogLargeRowsSetting = WebInspector.settings.createSetting('networkLogLargeRows', false); - this._networkRecordFilmStripSetting = WebInspector.settings.createSetting('networkRecordFilmStripSetting', false); + this._networkLogShowOverviewSetting = Common.settings.createSetting('networkLogShowOverview', true); + this._networkLogLargeRowsSetting = Common.settings.createSetting('networkLogLargeRows', false); + this._networkRecordFilmStripSetting = Common.settings.createSetting('networkRecordFilmStripSetting', false); this._toggleRecordAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('network.toggle-recording')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('network.toggle-recording')); - /** @type {?WebInspector.FilmStripView} */ + /** @type {?Components.FilmStripView} */ this._filmStripView = null; - /** @type {?WebInspector.NetworkPanel.FilmStripRecorder} */ + /** @type {?Network.NetworkPanel.FilmStripRecorder} */ this._filmStripRecorder = null; - this._panelToolbar = new WebInspector.Toolbar('', this.element); - this._filterBar = new WebInspector.FilterBar('networkPanel', true); + this._panelToolbar = new UI.Toolbar('', this.element); + this._filterBar = new UI.FilterBar('networkPanel', true); this._filterBar.show(this.element); // Create top overview component. - this._overviewPane = new WebInspector.TimelineOverviewPane('network'); + this._overviewPane = new UI.TimelineOverviewPane('network'); this._overviewPane.addEventListener( - WebInspector.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged.bind(this)); + UI.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged.bind(this)); this._overviewPane.element.id = 'network-overview-panel'; - this._networkOverview = new WebInspector.NetworkOverview(); + this._networkOverview = new Network.NetworkOverview(); this._overviewPane.setOverviewControls([this._networkOverview]); - this._calculator = new WebInspector.NetworkTransferTimeCalculator(); + this._calculator = new Network.NetworkTransferTimeCalculator(); - this._splitWidget = new WebInspector.SplitWidget(true, false, 'networkPanelSplitViewState'); + this._splitWidget = new UI.SplitWidget(true, false, 'networkPanelSplitViewState'); this._splitWidget.hideMain(); this._splitWidget.show(this.element); @@ -69,17 +69,17 @@ this._progressBarContainer = createElement('div'); this._createToolbarButtons(); - this._searchableView = new WebInspector.SearchableView(this); - this._searchableView.setPlaceholder(WebInspector.UIString('Find by filename or path')); + this._searchableView = new UI.SearchableView(this); + this._searchableView.setPlaceholder(Common.UIString('Find by filename or path')); - /** @type {!WebInspector.NetworkLogView} */ + /** @type {!Network.NetworkLogView} */ this._networkLogView = - new WebInspector.NetworkLogView(this._filterBar, this._progressBarContainer, this._networkLogLargeRowsSetting); + new Network.NetworkLogView(this._filterBar, this._progressBarContainer, this._networkLogLargeRowsSetting); this._networkLogView.show(this._searchableView.element); this._splitWidget.setSidebarWidget(this._searchableView); - this._detailsWidget = new WebInspector.VBox(); + this._detailsWidget = new UI.VBox(); this._detailsWidget.element.classList.add('network-details-view'); this._splitWidget.setMainWidget(this._detailsWidget); @@ -96,44 +96,44 @@ this._toggleRecordFilmStrip(); this._updateUI(); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.WillReloadPage, this._willReloadPage, this); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.Load, this._load, this); + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._load, this); this._networkLogView.addEventListener( - WebInspector.NetworkLogView.Events.RequestSelected, this._onRequestSelected, this); + Network.NetworkLogView.Events.RequestSelected, this._onRequestSelected, this); this._networkLogView.addEventListener( - WebInspector.NetworkLogView.Events.SearchCountUpdated, this._onSearchCountUpdated, this); + Network.NetworkLogView.Events.SearchCountUpdated, this._onSearchCountUpdated, this); this._networkLogView.addEventListener( - WebInspector.NetworkLogView.Events.SearchIndexUpdated, this._onSearchIndexUpdated, this); + Network.NetworkLogView.Events.SearchIndexUpdated, this._onSearchIndexUpdated, this); this._networkLogView.addEventListener( - WebInspector.NetworkLogView.Events.UpdateRequest, this._onUpdateRequest, this); + Network.NetworkLogView.Events.UpdateRequest, this._onUpdateRequest, this); - WebInspector.DataSaverInfobar.maybeShowInPanel(this); + Components.DataSaverInfobar.maybeShowInPanel(this); } /** - * @param {!Array<{filterType: !WebInspector.NetworkLogView.FilterType, filterValue: string}>} filters + * @param {!Array<{filterType: !Network.NetworkLogView.FilterType, filterValue: string}>} filters */ static revealAndFilter(filters) { - var panel = WebInspector.NetworkPanel._instance(); + var panel = Network.NetworkPanel._instance(); var filterString = ''; for (var filter of filters) filterString += `${filter.filterType}:${filter.filterValue} `; panel._networkLogView.setTextFilterValue(filterString); - WebInspector.viewManager.showView('network'); + UI.viewManager.showView('network'); } /** - * @return {!WebInspector.NetworkPanel} + * @return {!Network.NetworkPanel} */ static _instance() { - return /** @type {!WebInspector.NetworkPanel} */ (self.runtime.sharedInstance(WebInspector.NetworkPanel)); + return /** @type {!Network.NetworkPanel} */ (self.runtime.sharedInstance(Network.NetworkPanel)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWindowChanged(event) { var startTime = Math.max(this._calculator.minimumBoundary(), event.data.startTime / 1000); @@ -142,58 +142,58 @@ } _createToolbarButtons() { - this._panelToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._toggleRecordAction)); + this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._toggleRecordAction)); - this._clearButton = new WebInspector.ToolbarButton(WebInspector.UIString('Clear'), 'largeicon-clear'); + this._clearButton = new UI.ToolbarButton(Common.UIString('Clear'), 'largeicon-clear'); this._clearButton.addEventListener('click', this._onClearButtonClicked, this); this._panelToolbar.appendToolbarItem(this._clearButton); this._panelToolbar.appendSeparator(); - var recordFilmStripButton = new WebInspector.ToolbarSettingToggle( - this._networkRecordFilmStripSetting, 'largeicon-camera', WebInspector.UIString('Capture screenshots')); + var recordFilmStripButton = new UI.ToolbarSettingToggle( + this._networkRecordFilmStripSetting, 'largeicon-camera', Common.UIString('Capture screenshots')); this._panelToolbar.appendToolbarItem(recordFilmStripButton); this._panelToolbar.appendToolbarItem(this._filterBar.filterButton()); this._panelToolbar.appendSeparator(); - this._panelToolbar.appendText(WebInspector.UIString('View:')); + this._panelToolbar.appendText(Common.UIString('View:')); - var largerRequestsButton = new WebInspector.ToolbarSettingToggle( - this._networkLogLargeRowsSetting, 'largeicon-large-list', WebInspector.UIString('Use large request rows'), - WebInspector.UIString('Use small request rows')); + var largerRequestsButton = new UI.ToolbarSettingToggle( + this._networkLogLargeRowsSetting, 'largeicon-large-list', Common.UIString('Use large request rows'), + Common.UIString('Use small request rows')); this._panelToolbar.appendToolbarItem(largerRequestsButton); - var showOverviewButton = new WebInspector.ToolbarSettingToggle( - this._networkLogShowOverviewSetting, 'largeicon-waterfall', WebInspector.UIString('Show overview'), - WebInspector.UIString('Hide overview')); + var showOverviewButton = new UI.ToolbarSettingToggle( + this._networkLogShowOverviewSetting, 'largeicon-waterfall', Common.UIString('Show overview'), + Common.UIString('Hide overview')); this._panelToolbar.appendToolbarItem(showOverviewButton); this._panelToolbar.appendSeparator(); - this._preserveLogCheckbox = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Preserve log'), WebInspector.UIString('Do not clear log on page reload / navigation')); + this._preserveLogCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Preserve log'), Common.UIString('Do not clear log on page reload / navigation')); this._preserveLogCheckbox.inputElement.addEventListener( 'change', this._onPreserveLogCheckboxChanged.bind(this), false); this._panelToolbar.appendToolbarItem(this._preserveLogCheckbox); - this._disableCacheCheckbox = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Disable cache'), WebInspector.UIString('Disable cache (while DevTools is open)'), - WebInspector.moduleSetting('cacheDisabled')); + this._disableCacheCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Disable cache'), Common.UIString('Disable cache (while DevTools is open)'), + Common.moduleSetting('cacheDisabled')); this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); this._panelToolbar.appendSeparator(); this._panelToolbar.appendToolbarItem(this._createBlockedURLsButton()); - this._panelToolbar.appendToolbarItem(WebInspector.NetworkConditionsSelector.createOfflineToolbarCheckbox()); + this._panelToolbar.appendToolbarItem(Components.NetworkConditionsSelector.createOfflineToolbarCheckbox()); this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); - this._panelToolbar.appendToolbarItem(new WebInspector.ToolbarItem(this._progressBarContainer)); + this._panelToolbar.appendToolbarItem(new UI.ToolbarItem(this._progressBarContainer)); } /** - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ _createBlockedURLsButton() { - var setting = WebInspector.moduleSetting('blockedURLs'); + var setting = Common.moduleSetting('blockedURLs'); setting.addChangeListener(updateAction); - var action = /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('network.blocked-urls.show')); - var button = WebInspector.Toolbar.createActionButton(action); + var action = /** @type {!UI.Action }*/ (UI.actionRegistry.action('network.blocked-urls.show')); + var button = UI.Toolbar.createActionButton(action); button.setVisible(Runtime.experiments.isEnabled('requestBlocking')); updateAction(); return button; @@ -204,12 +204,12 @@ } /** - * @return {!WebInspector.ToolbarComboBox} + * @return {!UI.ToolbarComboBox} */ _createNetworkConditionsSelect() { - var toolbarItem = new WebInspector.ToolbarComboBox(null); + var toolbarItem = new UI.ToolbarComboBox(null); toolbarItem.setMaxWidth(140); - WebInspector.NetworkConditionsSelector.decorateSelect(toolbarItem.selectElement()); + Components.NetworkConditionsSelector.decorateSelect(toolbarItem.selectElement()); return toolbarItem; } @@ -230,7 +230,7 @@ } /** - * @param {?WebInspector.FilmStripModel} filmStripModel + * @param {?Components.FilmStripModel} filmStripModel */ _filmStripAvailable(filmStripModel) { if (!filmStripModel) @@ -241,7 +241,7 @@ var timestamps = filmStripModel.frames().map(mapTimestamp); /** - * @param {!WebInspector.FilmStripModel.Frame} frame + * @param {!Components.FilmStripModel.Frame} frame * @return {number} */ function mapTimestamp(frame) { @@ -259,7 +259,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onClearButtonClicked(event) { this._reset(); @@ -269,13 +269,13 @@ this._calculator.reset(); this._overviewPane.reset(); this._networkLogView.reset(); - WebInspector.BlockedURLsPane.reset(); + Network.BlockedURLsPane.reset(); if (this._filmStripView) this._resetFilmStripView(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _willReloadPage(event) { if (!this._preserveLogCheckbox.checked()) @@ -290,12 +290,12 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _load(event) { if (this._filmStripRecorder && this._filmStripRecorder.isRecording()) this._pendingStopTimer = - setTimeout(this._stopFilmStripRecording.bind(this), WebInspector.NetworkPanel.displayScreenshotDelay); + setTimeout(this._stopFilmStripRecording.bind(this), Network.NetworkPanel.displayScreenshotDelay); } _stopFilmStripRecording() { @@ -319,16 +319,16 @@ _toggleRecordFilmStrip() { var toggled = this._networkRecordFilmStripSetting.get(); if (toggled && !this._filmStripRecorder) { - this._filmStripView = new WebInspector.FilmStripView(); - this._filmStripView.setMode(WebInspector.FilmStripView.Modes.FrameBased); + this._filmStripView = new Components.FilmStripView(); + this._filmStripView.setMode(Components.FilmStripView.Modes.FrameBased); this._filmStripView.element.classList.add('network-film-strip'); this._filmStripRecorder = - new WebInspector.NetworkPanel.FilmStripRecorder(this._networkLogView.timeCalculator(), this._filmStripView); + new Network.NetworkPanel.FilmStripRecorder(this._networkLogView.timeCalculator(), this._filmStripView); this._filmStripView.show(this.element, this.element.firstElementChild); this._filmStripView.addEventListener( - WebInspector.FilmStripView.Events.FrameSelected, this._onFilmFrameSelected, this); - this._filmStripView.addEventListener(WebInspector.FilmStripView.Events.FrameEnter, this._onFilmFrameEnter, this); - this._filmStripView.addEventListener(WebInspector.FilmStripView.Events.FrameExit, this._onFilmFrameExit, this); + Components.FilmStripView.Events.FrameSelected, this._onFilmFrameSelected, this); + this._filmStripView.addEventListener(Components.FilmStripView.Events.FrameEnter, this._onFilmFrameEnter, this); + this._filmStripView.addEventListener(Components.FilmStripView.Events.FrameExit, this._onFilmFrameExit, this); this._resetFilmStripView(); } @@ -341,9 +341,9 @@ _resetFilmStripView() { this._filmStripView.reset(); - this._filmStripView.setStatusText(WebInspector.UIString( + this._filmStripView.setStatusText(Common.UIString( 'Hit %s to reload and capture filmstrip.', - WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name)); + UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name)); } /** @@ -356,7 +356,7 @@ /** * @override - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -367,7 +367,7 @@ * @param {!KeyboardEvent} event */ handleShortcut(event) { - if (this._networkItemView && event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) { + if (this._networkItemView && event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) { this._showRequest(null); event.handled = true; return; @@ -380,18 +380,18 @@ * @override */ wasShown() { - WebInspector.context.setFlavor(WebInspector.NetworkPanel, this); + UI.context.setFlavor(Network.NetworkPanel, this); } /** * @override */ willHide() { - WebInspector.context.setFlavor(WebInspector.NetworkPanel, null); + UI.context.setFlavor(Network.NetworkPanel, null); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ revealAndHighlightRequest(request) { this._showRequest(null); @@ -400,14 +400,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRowSizeChanged(event) { this._updateUI(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSearchCountUpdated(event) { var count = /** @type {number} */ (event.data); @@ -415,7 +415,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSearchIndexUpdated(event) { var index = /** @type {number} */ (event.data); @@ -423,15 +423,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestSelected(event) { - var request = /** @type {?WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {?SDK.NetworkRequest} */ (event.data); this._showRequest(request); } /** - * @param {?WebInspector.NetworkRequest} request + * @param {?SDK.NetworkRequest} request */ _showRequest(request) { if (this._networkItemView) { @@ -440,8 +440,8 @@ } if (request) { - this._networkItemView = new WebInspector.NetworkItemView(request, this._networkLogView.timeCalculator()); - this._networkItemView.leftToolbar().appendToolbarItem(new WebInspector.ToolbarItem(this._closeButtonElement)); + this._networkItemView = new Network.NetworkItemView(request, this._networkLogView.timeCalculator()); + this._networkItemView.leftToolbar().appendToolbarItem(new UI.ToolbarItem(this._closeButtonElement)); this._networkItemView.show(this._detailsWidget.element); this._splitWidget.showBoth(); } else { @@ -459,7 +459,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -507,45 +507,45 @@ /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target - * @this {WebInspector.NetworkPanel} + * @this {Network.NetworkPanel} */ appendApplicableItems(event, contextMenu, target) { /** - * @this {WebInspector.NetworkPanel} + * @this {Network.NetworkPanel} */ function reveal(request) { - WebInspector.viewManager.showView('network').then(this.revealAndHighlightRequest.bind(this, request)); + UI.viewManager.showView('network').then(this.revealAndHighlightRequest.bind(this, request)); } /** - * @this {WebInspector.NetworkPanel} + * @this {Network.NetworkPanel} */ function appendRevealItem(request) { - contextMenu.appendItem(WebInspector.UIString.capitalize('Reveal in Network ^panel'), reveal.bind(this, request)); + contextMenu.appendItem(Common.UIString.capitalize('Reveal in Network ^panel'), reveal.bind(this, request)); } if (event.target.isSelfOrDescendant(this.element)) return; - if (target instanceof WebInspector.Resource) { - var resource = /** @type {!WebInspector.Resource} */ (target); + if (target instanceof SDK.Resource) { + var resource = /** @type {!SDK.Resource} */ (target); if (resource.request) appendRevealItem.call(this, resource.request); return; } - if (target instanceof WebInspector.UISourceCode) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target); - var resource = WebInspector.resourceForURL(uiSourceCode.url()); + if (target instanceof Workspace.UISourceCode) { + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (target); + var resource = Bindings.resourceForURL(uiSourceCode.url()); if (resource && resource.request) appendRevealItem.call(this, resource.request); return; } - if (!(target instanceof WebInspector.NetworkRequest)) + if (!(target instanceof SDK.NetworkRequest)) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (target); + var request = /** @type {!SDK.NetworkRequest} */ (target); if (this._networkItemView && this._networkItemView.isShowing() && this._networkItemView.request() === request) return; @@ -553,7 +553,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFilmFrameSelected(event) { var timestamp = /** @type {number} */ (event.data); @@ -561,7 +561,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFilmFrameEnter(event) { var timestamp = /** @type {number} */ (event.data); @@ -570,7 +570,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFilmFrameExit(event) { this._networkOverview.clearFilmStripFrame(); @@ -578,10 +578,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onUpdateRequest(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._calculator.updateBoundaries(request); // FIXME: Unify all time units across the frontend! this._overviewPane.setBounds(this._calculator.minimumBoundary() * 1000, this._calculator.maximumBoundary() * 1000); @@ -590,51 +590,51 @@ } }; -WebInspector.NetworkPanel.displayScreenshotDelay = 1000; +Network.NetworkPanel.displayScreenshotDelay = 1000; /** - * @implements {WebInspector.ContextMenu.Provider} + * @implements {UI.ContextMenu.Provider} * @unrestricted */ -WebInspector.NetworkPanel.ContextMenuProvider = class { +Network.NetworkPanel.ContextMenuProvider = class { /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { - WebInspector.NetworkPanel._instance().appendApplicableItems(event, contextMenu, target); + Network.NetworkPanel._instance().appendApplicableItems(event, contextMenu, target); } }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.NetworkPanel.RequestRevealer = class { +Network.NetworkPanel.RequestRevealer = class { /** * @override * @param {!Object} request * @return {!Promise} */ reveal(request) { - if (!(request instanceof WebInspector.NetworkRequest)) + if (!(request instanceof SDK.NetworkRequest)) return Promise.reject(new Error('Internal error: not a network request')); - var panel = WebInspector.NetworkPanel._instance(); - return WebInspector.viewManager.showView('network').then(panel.revealAndHighlightRequest.bind(panel, request)); + var panel = Network.NetworkPanel._instance(); + return UI.viewManager.showView('network').then(panel.revealAndHighlightRequest.bind(panel, request)); } }; /** - * @implements {WebInspector.TracingManagerClient} + * @implements {SDK.TracingManagerClient} * @unrestricted */ -WebInspector.NetworkPanel.FilmStripRecorder = class { +Network.NetworkPanel.FilmStripRecorder = class { /** - * @param {!WebInspector.NetworkTimeCalculator} timeCalculator - * @param {!WebInspector.FilmStripView} filmStripView + * @param {!Network.NetworkTimeCalculator} timeCalculator + * @param {!Components.FilmStripView} filmStripView */ constructor(timeCalculator, filmStripView) { this._timeCalculator = timeCalculator; @@ -649,7 +649,7 @@ /** * @override - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events */ traceEventsCollected(events) { if (this._tracingModel) @@ -663,9 +663,9 @@ if (!this._tracingModel) return; this._tracingModel.tracingComplete(); - WebInspector.targetManager.resumeReload(this._target); + SDK.targetManager.resumeReload(this._target); this._target = null; - this._callback(new WebInspector.FilmStripModel(this._tracingModel, this._timeCalculator.minimumBoundary() * 1000)); + this._callback(new Components.FilmStripModel(this._tracingModel, this._timeCalculator.minimumBoundary() * 1000)); delete this._callback; } @@ -684,15 +684,15 @@ startRecording() { this._filmStripView.reset(); - this._filmStripView.setStatusText(WebInspector.UIString('Recording frames...')); + this._filmStripView.setStatusText(Common.UIString('Recording frames...')); if (this._target) return; - this._target = WebInspector.targetManager.mainTarget(); + this._target = SDK.targetManager.mainTarget(); if (this._tracingModel) this._tracingModel.reset(); else - this._tracingModel = new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage('tracing')); + this._tracingModel = new SDK.TracingModel(new Bindings.TempFileBackingStorage('tracing')); this._target.tracingManager.start(this, '-*,disabled-by-default-devtools.screenshot', ''); } @@ -704,33 +704,33 @@ } /** - * @param {function(?WebInspector.FilmStripModel)} callback + * @param {function(?Components.FilmStripModel)} callback */ stopRecording(callback) { if (!this._target) return; this._target.tracingManager.stop(); - WebInspector.targetManager.suspendReload(this._target); + SDK.targetManager.suspendReload(this._target); this._callback = callback; - this._filmStripView.setStatusText(WebInspector.UIString('Fetching frames...')); + this._filmStripView.setStatusText(Common.UIString('Fetching frames...')); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.NetworkPanel.RecordActionDelegate = class { +Network.NetworkPanel.RecordActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); - console.assert(panel && panel instanceof WebInspector.NetworkPanel); + var panel = UI.context.flavor(Network.NetworkPanel); + console.assert(panel && panel instanceof Network.NetworkPanel); panel._toggleRecording(); return true; }
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimeCalculator.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimeCalculator.js index a3886c60..e666b495 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimeCalculator.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimeCalculator.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.NetworkTimeBoundary = class { +Network.NetworkTimeBoundary = class { /** * @param {number} minimum * @param {number} maximum @@ -42,7 +42,7 @@ } /** - * @param {!WebInspector.NetworkTimeBoundary} other + * @param {!Network.NetworkTimeBoundary} other * @return {boolean} */ equals(other) { @@ -51,20 +51,20 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.NetworkTimeCalculator = class extends WebInspector.Object { +Network.NetworkTimeCalculator = class extends Common.Object { constructor(startAtZero) { super(); this.startAtZero = startAtZero; - this._boundryChangedEventThrottler = new WebInspector.Throttler(0); - /** @type {?WebInspector.NetworkTimeBoundary} */ + this._boundryChangedEventThrottler = new Common.Throttler(0); + /** @type {?Network.NetworkTimeBoundary} */ this._window = null; } /** - * @param {?WebInspector.NetworkTimeBoundary} window + * @param {?Network.NetworkTimeBoundary} window */ setWindow(window) { this._window = window; @@ -128,10 +128,10 @@ } /** - * @return {!WebInspector.NetworkTimeBoundary} + * @return {!Network.NetworkTimeBoundary} */ boundary() { - return new WebInspector.NetworkTimeBoundary(this.minimumBoundary(), this.maximumBoundary()); + return new Network.NetworkTimeBoundary(this.minimumBoundary(), this.maximumBoundary()); } /** @@ -163,7 +163,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {!{start: number, middle: number, end: number}} */ computeBarGraphPercentages(request) { @@ -218,10 +218,10 @@ /** * @return {!Promise.<undefined>} - * @this {WebInspector.NetworkTimeCalculator} + * @this {Network.NetworkTimeCalculator} */ function dispatchEvent() { - this.dispatchEventToListeners(WebInspector.NetworkTimeCalculator.Events.BoundariesChanged); + this.dispatchEventToListeners(Network.NetworkTimeCalculator.Events.BoundariesChanged); return Promise.resolve(); } } @@ -240,7 +240,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {!{left: string, right: string, tooltip: (string|undefined)}} */ computeBarGraphLabels(request) { @@ -259,22 +259,22 @@ if (hasLatency && rightLabel) { var total = Number.secondsToString(request.duration); - var tooltip = WebInspector.NetworkTimeCalculator._latencyDownloadTotalFormat.format(leftLabel, rightLabel, total); + var tooltip = Network.NetworkTimeCalculator._latencyDownloadTotalFormat.format(leftLabel, rightLabel, total); } else if (hasLatency) { - var tooltip = WebInspector.NetworkTimeCalculator._latencyFormat.format(leftLabel); + var tooltip = Network.NetworkTimeCalculator._latencyFormat.format(leftLabel); } else if (rightLabel) { - var tooltip = WebInspector.NetworkTimeCalculator._downloadFormat.format(rightLabel); + var tooltip = Network.NetworkTimeCalculator._downloadFormat.format(rightLabel); } if (request.fetchedViaServiceWorker) - tooltip = WebInspector.NetworkTimeCalculator._fromServiceWorkerFormat.format(tooltip); + tooltip = Network.NetworkTimeCalculator._fromServiceWorkerFormat.format(tooltip); else if (request.cached()) - tooltip = WebInspector.NetworkTimeCalculator._fromCacheFormat.format(tooltip); + tooltip = Network.NetworkTimeCalculator._fromCacheFormat.format(tooltip); return {left: leftLabel, right: rightLabel, tooltip: tooltip}; } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ updateBoundaries(request) { var lowerBound = this._lowerBound(request); @@ -295,7 +295,7 @@ _extendBoundariesToIncludeTimestamp(timestamp) { var previousMinimumBoundary = this._minimumBoundary; var previousMaximumBoundary = this._maximumBoundary; - const minOffset = WebInspector.NetworkTimeCalculator._minimumSpread; + const minOffset = Network.NetworkTimeCalculator._minimumSpread; if (typeof this._minimumBoundary === 'undefined' || typeof this._maximumBoundary === 'undefined') { this._minimumBoundary = timestamp; this._maximumBoundary = timestamp + minOffset; @@ -307,7 +307,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {number} */ _lowerBound(request) { @@ -315,7 +315,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {number} */ _upperBound(request) { @@ -323,34 +323,34 @@ } }; -WebInspector.NetworkTimeCalculator._minimumSpread = 0.1; +Network.NetworkTimeCalculator._minimumSpread = 0.1; /** @enum {symbol} */ -WebInspector.NetworkTimeCalculator.Events = { +Network.NetworkTimeCalculator.Events = { BoundariesChanged: Symbol('BoundariesChanged') }; -/** @type {!WebInspector.UIStringFormat} */ -WebInspector.NetworkTimeCalculator._latencyDownloadTotalFormat = - new WebInspector.UIStringFormat('%s latency, %s download (%s total)'); +/** @type {!Common.UIStringFormat} */ +Network.NetworkTimeCalculator._latencyDownloadTotalFormat = + new Common.UIStringFormat('%s latency, %s download (%s total)'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector.NetworkTimeCalculator._latencyFormat = new WebInspector.UIStringFormat('%s latency'); +/** @type {!Common.UIStringFormat} */ +Network.NetworkTimeCalculator._latencyFormat = new Common.UIStringFormat('%s latency'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector.NetworkTimeCalculator._downloadFormat = new WebInspector.UIStringFormat('%s download'); +/** @type {!Common.UIStringFormat} */ +Network.NetworkTimeCalculator._downloadFormat = new Common.UIStringFormat('%s download'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector.NetworkTimeCalculator._fromServiceWorkerFormat = - new WebInspector.UIStringFormat('%s (from ServiceWorker)'); +/** @type {!Common.UIStringFormat} */ +Network.NetworkTimeCalculator._fromServiceWorkerFormat = + new Common.UIStringFormat('%s (from ServiceWorker)'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector.NetworkTimeCalculator._fromCacheFormat = new WebInspector.UIStringFormat('%s (from cache)'); +/** @type {!Common.UIStringFormat} */ +Network.NetworkTimeCalculator._fromCacheFormat = new Common.UIStringFormat('%s (from cache)'); /** * @unrestricted */ -WebInspector.NetworkTransferTimeCalculator = class extends WebInspector.NetworkTimeCalculator { +Network.NetworkTransferTimeCalculator = class extends Network.NetworkTimeCalculator { constructor() { super(false); } @@ -367,7 +367,7 @@ /** * @override - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {number} */ _lowerBound(request) { @@ -376,7 +376,7 @@ /** * @override - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {number} */ _upperBound(request) { @@ -387,7 +387,7 @@ /** * @unrestricted */ -WebInspector.NetworkTransferDurationCalculator = class extends WebInspector.NetworkTimeCalculator { +Network.NetworkTransferDurationCalculator = class extends Network.NetworkTimeCalculator { constructor() { super(true); } @@ -404,7 +404,7 @@ /** * @override - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {number} */ _upperBound(request) {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js index 43c9529..1819cfb 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js
@@ -4,10 +4,10 @@ /** * @unrestricted */ -WebInspector.NetworkWaterfallColumn = class extends WebInspector.VBox { +Network.NetworkWaterfallColumn = class extends UI.VBox { /** * @param {number} rowHeight - * @param {!WebInspector.NetworkTimeCalculator} calculator + * @param {!Network.NetworkTimeCalculator} calculator */ constructor(rowHeight, calculator) { // TODO(allada) Make this a shadowDOM when the NetworkWaterfallColumn gets moved into NetworkLogViewColumns. @@ -30,34 +30,34 @@ this._headerHeight = 0; this._calculator = calculator; - this._popoverHelper = new WebInspector.PopoverHelper(this.element); + this._popoverHelper = new UI.PopoverHelper(this.element); this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), this._showPopover.bind(this)); this._popoverHelper.setTimeout(300, 300); - /** @type {!Array<!WebInspector.NetworkRequest>} */ + /** @type {!Array<!SDK.NetworkRequest>} */ this._requestData = []; - /** @type {?WebInspector.NetworkRequest} */ + /** @type {?SDK.NetworkRequest} */ this._hoveredRequest = null; - /** @type {?WebInspector.NetworkRequest.InitiatorGraph} */ + /** @type {?SDK.NetworkRequest.InitiatorGraph} */ this._initiatorGraph = null; - /** @type {?WebInspector.NetworkRequest} */ + /** @type {?SDK.NetworkRequest} */ this._navigationRequest = null; /** @type {!Map<string, !Array<number>>} */ this._eventDividers = new Map(); - var colorUsage = WebInspector.ThemeSupport.ColorUsage; - this._rowNavigationRequestColor = WebInspector.themeSupport.patchColor('#def', colorUsage.Background); - this._rowStripeColor = WebInspector.themeSupport.patchColor('#f5f5f5', colorUsage.Background); - this._rowHoverColor = WebInspector.themeSupport.patchColor( - '#ebf2fc', /** @type {!WebInspector.ThemeSupport.ColorUsage} */ (colorUsage.Background | colorUsage.Selection)); + var colorUsage = UI.ThemeSupport.ColorUsage; + this._rowNavigationRequestColor = UI.themeSupport.patchColor('#def', colorUsage.Background); + this._rowStripeColor = UI.themeSupport.patchColor('#f5f5f5', colorUsage.Background); + this._rowHoverColor = UI.themeSupport.patchColor( + '#ebf2fc', /** @type {!UI.ThemeSupport.ColorUsage} */ (colorUsage.Background | colorUsage.Selection)); this._parentInitiatorColor = - WebInspector.themeSupport.patchColor('hsla(120, 68%, 54%, 0.2)', colorUsage.Background); - this._initiatedColor = WebInspector.themeSupport.patchColor('hsla(0, 68%, 54%, 0.2)', colorUsage.Background); + UI.themeSupport.patchColor('hsla(120, 68%, 54%, 0.2)', colorUsage.Background); + this._initiatedColor = UI.themeSupport.patchColor('hsla(0, 68%, 54%, 0.2)', colorUsage.Background); - /** @type {!Map<!WebInspector.ResourceType, string>} */ + /** @type {!Map<!Common.ResourceType, string>} */ this._borderColorsForResourceTypeCache = new Map(); /** @type {!Map<string, !CanvasGradient>} */ this._colorsForResourceTypeCache = new Map(); @@ -86,10 +86,10 @@ if (!this._hoveredRequest) return; var useTimingBars = - !WebInspector.moduleSetting('networkColorCodeResourceTypes').get() && !this._calculator.startAtZero; + !Common.moduleSetting('networkColorCodeResourceTypes').get() && !this._calculator.startAtZero; if (useTimingBars) { - var range = WebInspector.RequestTimingView.calculateRequestTimeRanges(this._hoveredRequest, 0) - .find(data => data.name === WebInspector.RequestTimeRangeNames.Total); + var range = Network.RequestTimingView.calculateRequestTimeRanges(this._hoveredRequest, 0) + .find(data => data.name === Network.RequestTimeRangeNames.Total); var start = this._timeToPosition(range.start); var end = this._timeToPosition(range.end); } else { @@ -124,18 +124,18 @@ /** * @param {!Element|!AnchorBox} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { if (!this._hoveredRequest) return; var content = - WebInspector.RequestTimingView.createTimingTable(this._hoveredRequest, this._calculator.minimumBoundary()); + Network.RequestTimingView.createTimingTable(this._hoveredRequest, this._calculator.minimumBoundary()); popover.showForAnchor(content, anchor); } /** - * @param {?WebInspector.NetworkRequest} request + * @param {?SDK.NetworkRequest} request * @param {boolean} highlightInitiatorChain */ setHoveredRequest(request, highlightInitiatorChain) { @@ -167,7 +167,7 @@ } /** - * @param {!WebInspector.NetworkTimeCalculator} calculator + * @param {!Network.NetworkTimeCalculator} calculator */ setCalculator(calculator) { this._calculator = calculator; @@ -176,7 +176,7 @@ /** * @param {number} x * @param {number} y - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ getRequestFromPoint(x, y) { return this._requestData[Math.floor((this._scrollTop + y - this._headerHeight) / this._rowHeight)] || null; @@ -191,7 +191,7 @@ /** * @param {number=} scrollTop * @param {!Map<string, !Array<number>>=} eventDividers - * @param {!WebInspector.NetworkWaterfallColumn.RequestData=} requestData + * @param {!Network.NetworkWaterfallColumn.RequestData=} requestData */ update(scrollTop, eventDividers, requestData) { if (scrollTop !== undefined) @@ -237,11 +237,11 @@ } /** - * @param {!WebInspector.RequestTimeRangeNames} type + * @param {!Network.RequestTimeRangeNames} type * @return {string} */ _colorForType(type) { - var types = WebInspector.RequestTimeRangeNames; + var types = Network.RequestTimeRangeNames; switch (type) { case types.Receiving: case types.ReceivingPush: @@ -281,7 +281,7 @@ _draw() { var useTimingBars = - !WebInspector.moduleSetting('networkColorCodeResourceTypes').get() && !this._calculator.startAtZero; + !Common.moduleSetting('networkColorCodeResourceTypes').get() && !this._calculator.startAtZero; var requests = this._requestData; var context = this._canvas.getContext('2d'); context.save(); @@ -305,7 +305,7 @@ context.restore(); const freeZoneAtLeft = 75; - WebInspector.TimelineGrid.drawCanvasGrid(context, this._calculator, this._fontSize, freeZoneAtLeft); + UI.TimelineGrid.drawCanvasGrid(context, this._calculator, this._fontSize, freeZoneAtLeft); } /** @@ -335,11 +335,11 @@ } /** - * @param {!WebInspector.RequestTimeRangeNames=} type + * @param {!Network.RequestTimeRangeNames=} type * @return {number} */ _getBarHeight(type) { - var types = WebInspector.RequestTimeRangeNames; + var types = Network.RequestTimeRangeNames; switch (type) { case types.Connecting: case types.SSL: @@ -355,16 +355,16 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {string} */ _borderColorForResourceType(request) { var resourceType = request.resourceType(); if (this._borderColorsForResourceTypeCache.has(resourceType)) return this._borderColorsForResourceTypeCache.get(resourceType); - var colorsForResourceType = WebInspector.NetworkWaterfallColumn._colorsForResourceType; + var colorsForResourceType = Network.NetworkWaterfallColumn._colorsForResourceType; var color = colorsForResourceType[resourceType] || colorsForResourceType.Other; - var parsedColor = WebInspector.Color.parse(color); + var parsedColor = Common.Color.parse(color); var hsla = parsedColor.hsla(); hsla[1] /= 2; hsla[2] -= Math.min(hsla[2], 0.2); @@ -375,11 +375,11 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {string|!CanvasGradient} */ _colorForResourceType(context, request) { - var colorsForResourceType = WebInspector.NetworkWaterfallColumn._colorsForResourceType; + var colorsForResourceType = Network.NetworkWaterfallColumn._colorsForResourceType; var resourceType = request.resourceType(); var color = colorsForResourceType[resourceType] || colorsForResourceType.Other; if (request.cached()) @@ -387,7 +387,7 @@ if (this._colorsForResourceTypeCache.has(color)) return this._colorsForResourceTypeCache.get(color); - var parsedColor = WebInspector.Color.parse(color); + var parsedColor = Common.Color.parse(color); var hsla = parsedColor.hsla(); hsla[1] -= Math.min(hsla[1], 0.28); hsla[2] -= Math.min(hsla[2], 0.15); @@ -399,7 +399,7 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} borderOffset * @return {!{start: number, mid: number, end: number}} */ @@ -415,7 +415,7 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} y */ _drawSimplifiedBars(context, request, y) { @@ -454,8 +454,8 @@ } if (!this._calculator.startAtZero) { - var queueingRange = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, 0) - .find(data => data.name === WebInspector.RequestTimeRangeNames.Total); + var queueingRange = Network.RequestTimingView.calculateRequestTimeRanges(request, 0) + .find(data => data.name === Network.RequestTimeRangeNames.Total); var leftLabelWidth = labels ? context.measureText(labels.left).width : 0; var leftTextPlacedInBar = leftLabelWidth < ranges.mid - ranges.start; const wiskerTextPadding = 13; @@ -464,8 +464,8 @@ if (ranges.start - textOffset > queueingStart) { context.beginPath(); context.globalAlpha = 1; - context.strokeStyle = WebInspector.themeSupport.patchColor( - '#a5a5a5', WebInspector.ThemeSupport.ColorUsage.Foreground); + context.strokeStyle = UI.themeSupport.patchColor( + '#a5a5a5', UI.ThemeSupport.ColorUsage.Foreground); context.moveTo(queueingStart, Math.floor(height / 2)); context.lineTo(ranges.start - textOffset, Math.floor(height / 2)); @@ -495,8 +495,8 @@ var height = this._getBarHeight(); var leftLabelWidth = context.measureText(leftText).width; var rightLabelWidth = context.measureText(rightText).width; - context.fillStyle = WebInspector.themeSupport.patchColor('#444', WebInspector.ThemeSupport.ColorUsage.Foreground); - context.strokeStyle = WebInspector.themeSupport.patchColor('#444', WebInspector.ThemeSupport.ColorUsage.Foreground); + context.fillStyle = UI.themeSupport.patchColor('#444', UI.ThemeSupport.ColorUsage.Foreground); + context.strokeStyle = UI.themeSupport.patchColor('#444', UI.ThemeSupport.ColorUsage.Foreground); if (leftLabelWidth < midX - startX) { var midBarX = startX + (midX - startX) / 2 - leftLabelWidth / 2; context.fillText(leftText, midBarX, this._fontSize); @@ -531,25 +531,25 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} y */ _drawTimingBars(context, request, y) { context.save(); - var ranges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, 0); + var ranges = Network.RequestTimingView.calculateRequestTimeRanges(request, 0); for (var range of ranges) { - if (range.name === WebInspector.RequestTimeRangeNames.Total || - range.name === WebInspector.RequestTimeRangeNames.Sending || range.end - range.start === 0) + if (range.name === Network.RequestTimeRangeNames.Total || + range.name === Network.RequestTimeRangeNames.Sending || range.end - range.start === 0) continue; context.beginPath(); var lineWidth = 0; var color = this._colorForType(range.name); var borderColor = color; - if (range.name === WebInspector.RequestTimeRangeNames.Queueing) { + if (range.name === Network.RequestTimeRangeNames.Queueing) { borderColor = 'lightgrey'; lineWidth = 2; } - if (range.name === WebInspector.RequestTimeRangeNames.Receiving) + if (range.name === Network.RequestTimeRangeNames.Receiving) lineWidth = 2; context.fillStyle = color; var height = this._getBarHeight(range.name); @@ -569,7 +569,7 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} rowNumber * @param {number} y */ @@ -590,7 +590,7 @@ /** * @return {string} - * @this {WebInspector.NetworkWaterfallColumn} + * @this {Network.NetworkWaterfallColumn} */ function getRowColor() { if (this._hoveredRequest === request) @@ -611,11 +611,11 @@ }; /** - * @typedef {{requests: !Array<!WebInspector.NetworkRequest>, navigationRequest: ?WebInspector.NetworkRequest}} + * @typedef {{requests: !Array<!SDK.NetworkRequest>, navigationRequest: ?SDK.NetworkRequest}} */ -WebInspector.NetworkWaterfallColumn.RequestData; +Network.NetworkWaterfallColumn.RequestData; -WebInspector.NetworkWaterfallColumn._colorsForResourceType = { +Network.NetworkWaterfallColumn._colorsForResourceType = { document: 'hsl(215, 100%, 80%)', font: 'hsl(8, 100%, 80%)', media: 'hsl(272, 64%, 80%)',
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js index db6373a..af770d0 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestCookiesView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.RequestCookiesView = class extends WebInspector.VBox { +Network.RequestCookiesView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(); @@ -48,13 +48,13 @@ */ wasShown() { this._request.addEventListener( - WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this); + SDK.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this); this._request.addEventListener( - WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this); + SDK.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this); if (!this._gotCookies) { if (!this._emptyWidget) { - this._emptyWidget = new WebInspector.EmptyWidget(WebInspector.UIString('This request has no cookies.')); + this._emptyWidget = new UI.EmptyWidget(Common.UIString('This request has no cookies.')); this._emptyWidget.show(this.element); } return; @@ -69,9 +69,9 @@ */ willHide() { this._request.removeEventListener( - WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this); + SDK.NetworkRequest.Events.RequestHeadersChanged, this._refreshCookies, this); this._request.removeEventListener( - WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this); + SDK.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this); } get _gotCookies() { @@ -82,10 +82,10 @@ _buildCookiesTable() { this.detachChildWidgets(); - this._cookiesTable = new WebInspector.CookiesTable(true); + this._cookiesTable = new Components.CookiesTable(true); this._cookiesTable.setCookieFolders([ - {folderName: WebInspector.UIString('Request Cookies'), cookies: this._request.requestCookies}, - {folderName: WebInspector.UIString('Response Cookies'), cookies: this._request.responseCookies} + {folderName: Common.UIString('Request Cookies'), cookies: this._request.requestCookies}, + {folderName: Common.UIString('Response Cookies'), cookies: this._request.responseCookies} ]); this._cookiesTable.show(this.element); }
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestHTMLView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestHTMLView.js index 42320f23..c3d5cd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestHTMLView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestHTMLView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.RequestHTMLView = class extends WebInspector.RequestView { +Network.RequestHTMLView = class extends Network.RequestView { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {string} dataURL */ constructor(request, dataURL) {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js index c286a3f..054dc2a 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.RequestHeadersView = class extends WebInspector.VBox { +Network.RequestHeadersView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(); @@ -54,7 +54,7 @@ this.element.appendChild(root.element); var generalCategory = - new WebInspector.RequestHeadersView.Category(root, 'general', WebInspector.UIString('General')); + new Network.RequestHeadersView.Category(root, 'general', Common.UIString('General')); generalCategory.hidden = false; this._urlItem = generalCategory.createLeaf(); this._requestMethodItem = generalCategory.createLeaf(); @@ -62,12 +62,12 @@ this._remoteAddressItem = generalCategory.createLeaf(); this._remoteAddressItem.hidden = true; - this._responseHeadersCategory = new WebInspector.RequestHeadersView.Category(root, 'responseHeaders', ''); - this._requestHeadersCategory = new WebInspector.RequestHeadersView.Category(root, 'requestHeaders', ''); - this._queryStringCategory = new WebInspector.RequestHeadersView.Category(root, 'queryString', ''); - this._formDataCategory = new WebInspector.RequestHeadersView.Category(root, 'formData', ''); + this._responseHeadersCategory = new Network.RequestHeadersView.Category(root, 'responseHeaders', ''); + this._requestHeadersCategory = new Network.RequestHeadersView.Category(root, 'requestHeaders', ''); + this._queryStringCategory = new Network.RequestHeadersView.Category(root, 'queryString', ''); + this._formDataCategory = new Network.RequestHeadersView.Category(root, 'formData', ''); this._requestPayloadCategory = - new WebInspector.RequestHeadersView.Category(root, 'requestPayload', WebInspector.UIString('Request Payload')); + new Network.RequestHeadersView.Category(root, 'requestPayload', Common.UIString('Request Payload')); } /** @@ -75,13 +75,13 @@ */ wasShown() { this._request.addEventListener( - WebInspector.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this); + SDK.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this); this._request.addEventListener( - WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this); + SDK.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this); this._request.addEventListener( - WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this); + SDK.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this); this._request.addEventListener( - WebInspector.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this); + SDK.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this); this._refreshURL(); this._refreshQueryString(); @@ -96,13 +96,13 @@ */ willHide() { this._request.removeEventListener( - WebInspector.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this); + SDK.NetworkRequest.Events.RemoteAddressChanged, this._refreshRemoteAddress, this); this._request.removeEventListener( - WebInspector.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this); + SDK.NetworkRequest.Events.RequestHeadersChanged, this._refreshRequestHeaders, this); this._request.removeEventListener( - WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this); + SDK.NetworkRequest.Events.ResponseHeadersChanged, this._refreshResponseHeaders, this); this._request.removeEventListener( - WebInspector.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this); + SDK.NetworkRequest.Events.FinishedLoading, this._refreshHTTPInformation, this); } /** @@ -141,14 +141,14 @@ if (value === '') div.classList.add('empty-value'); if (errorDecoding) - div.createChild('span', 'header-decode-error').textContent = WebInspector.UIString('(unable to decode value)'); + div.createChild('span', 'header-decode-error').textContent = Common.UIString('(unable to decode value)'); else div.textContent = value; return div; } _refreshURL() { - this._urlItem.title = this._formatHeader(WebInspector.UIString('Request URL'), this._request.url); + this._urlItem.title = this._formatHeader(Common.UIString('Request URL'), this._request.url); } _refreshQueryString() { @@ -157,7 +157,7 @@ this._queryStringCategory.hidden = !queryParameters; if (queryParameters) this._refreshParams( - WebInspector.UIString('Query String Parameters'), queryParameters, queryString, this._queryStringCategory); + Common.UIString('Query String Parameters'), queryParameters, queryString, this._queryStringCategory); } _refreshFormData() { @@ -171,7 +171,7 @@ var formParameters = this._request.formParameters; if (formParameters) { this._formDataCategory.hidden = false; - this._refreshParams(WebInspector.UIString('Form Data'), formParameters, formData, this._formDataCategory); + this._refreshParams(Common.UIString('Form Data'), formParameters, formData, this._formDataCategory); } else { this._requestPayloadCategory.hidden = false; try { @@ -199,7 +199,7 @@ /** * @param {string} title - * @param {?Array.<!WebInspector.NetworkRequest.NameValue>} params + * @param {?Array.<!SDK.NetworkRequest.NameValue>} params * @param {?string} sourceText * @param {!TreeElement} paramsTreeElement */ @@ -210,12 +210,12 @@ paramsTreeElement.listItemElement.createTextChild(title); var headerCount = createElementWithClass('span', 'header-count'); - headerCount.textContent = WebInspector.UIString('\u00A0(%d)', params.length); + headerCount.textContent = Common.UIString('\u00A0(%d)', params.length); paramsTreeElement.listItemElement.appendChild(headerCount); /** * @param {!Event} event - * @this {WebInspector.RequestHeadersView} + * @this {Network.RequestHeadersView} */ function toggleViewSource(event) { paramsTreeElement._viewSource = !paramsTreeElement._viewSource; @@ -231,8 +231,8 @@ return; } - var toggleTitle = this._decodeRequestParameters ? WebInspector.UIString('view URL encoded') : - WebInspector.UIString('view decoded'); + var toggleTitle = this._decodeRequestParameters ? Common.UIString('view URL encoded') : + Common.UIString('view decoded'); var toggleButton = this._createToggleButton(toggleTitle); toggleButton.addEventListener('click', this._toggleURLDecoding.bind(this), false); paramsTreeElement.listItemElement.appendChild(toggleButton); @@ -246,7 +246,7 @@ paramNameValue.appendChild(value); } else { paramNameValue.appendChild(this._formatParameter( - WebInspector.UIString('(empty)'), 'empty-request-header', this._decodeRequestParameters)); + Common.UIString('(empty)'), 'empty-request-header', this._decodeRequestParameters)); } var paramTreeElement = new TreeElement(paramNameValue); @@ -269,7 +269,7 @@ /** * @param {!Event} event - * @this {WebInspector.RequestHeadersView} + * @this {Network.RequestHeadersView} */ function toggleViewSource(event) { treeElement._viewSource = !treeElement._viewSource; @@ -281,8 +281,8 @@ if (treeElement._viewSource) { this._populateTreeElementWithSourceText(this._requestPayloadCategory, sourceText); } else { - var object = WebInspector.RemoteObject.fromLocalObject(parsedObject); - var section = new WebInspector.ObjectPropertiesSection(object, object.description); + var object = SDK.RemoteObject.fromLocalObject(parsedObject); + var section = new Components.ObjectPropertiesSection(object, object.description); section.expand(); section.editable = false; treeElement.appendChild(new TreeElement(section.element)); @@ -296,7 +296,7 @@ */ _createViewSourceToggle(viewSource, handler) { var viewSourceToggleTitle = - viewSource ? WebInspector.UIString('view parsed') : WebInspector.UIString('view source'); + viewSource ? Common.UIString('view parsed') : Common.UIString('view source'); var viewSourceToggleButton = this._createToggleButton(viewSourceToggleTitle); viewSourceToggleButton.addEventListener('click', handler, false); return viewSourceToggleButton; @@ -321,9 +321,9 @@ var headersText = this._request.requestHeadersText(); if (this._showRequestHeadersText && headersText) - this._refreshHeadersText(WebInspector.UIString('Request Headers'), headers.length, headersText, treeElement); + this._refreshHeadersText(Common.UIString('Request Headers'), headers.length, headersText, treeElement); else - this._refreshHeaders(WebInspector.UIString('Request Headers'), headers, treeElement, headersText === undefined); + this._refreshHeaders(Common.UIString('Request Headers'), headers, treeElement, headersText === undefined); if (headersText) { var toggleButton = this._createHeadersToggleButton(this._showRequestHeadersText); @@ -340,9 +340,9 @@ var headersText = this._request.responseHeadersText; if (this._showResponseHeadersText) - this._refreshHeadersText(WebInspector.UIString('Response Headers'), headers.length, headersText, treeElement); + this._refreshHeadersText(Common.UIString('Response Headers'), headers.length, headersText, treeElement); else - this._refreshHeaders(WebInspector.UIString('Response Headers'), headers, treeElement); + this._refreshHeaders(Common.UIString('Response Headers'), headers, treeElement); if (headersText) { var toggleButton = this._createHeadersToggleButton(this._showResponseHeadersText); @@ -359,7 +359,7 @@ if (this._request.statusCode) { var statusCodeFragment = createDocumentFragment(); - statusCodeFragment.createChild('div', 'header-name').textContent = WebInspector.UIString('Status Code') + ':'; + statusCodeFragment.createChild('div', 'header-name').textContent = Common.UIString('Status Code') + ':'; var statusCodeImage = statusCodeFragment.createChild('label', 'resource-status-image', 'dt-icon-label'); statusCodeImage.title = this._request.statusCode + ' ' + this._request.statusText; @@ -372,18 +372,18 @@ statusCodeImage.type = 'smallicon-red-ball'; requestMethodElement.title = - this._formatHeader(WebInspector.UIString('Request Method'), this._request.requestMethod); + this._formatHeader(Common.UIString('Request Method'), this._request.requestMethod); var statusTextElement = statusCodeFragment.createChild('div', 'header-value source-code'); var statusText = this._request.statusCode + ' ' + this._request.statusText; if (this._request.fetchedViaServiceWorker) { - statusText += ' ' + WebInspector.UIString('(from ServiceWorker)'); + statusText += ' ' + Common.UIString('(from ServiceWorker)'); statusTextElement.classList.add('status-from-cache'); } else if (this._request.cached()) { if (this._request.cachedInMemory()) - statusText += ' ' + WebInspector.UIString('(from memory cache)'); + statusText += ' ' + Common.UIString('(from memory cache)'); else - statusText += ' ' + WebInspector.UIString('(from disk cache)'); + statusText += ' ' + Common.UIString('(from disk cache)'); statusTextElement.classList.add('status-from-cache'); } statusTextElement.textContent = statusText; @@ -401,13 +401,13 @@ headersTreeElement.listItemElement.removeChildren(); headersTreeElement.listItemElement.createTextChild(title); - var headerCount = WebInspector.UIString('\u00A0(%d)', headersLength); + var headerCount = Common.UIString('\u00A0(%d)', headersLength); headersTreeElement.listItemElement.createChild('span', 'header-count').textContent = headerCount; } /** * @param {string} title - * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} headers + * @param {!Array.<!SDK.NetworkRequest.NameValue>} headers * @param {!TreeElement} headersTreeElement * @param {boolean=} provisionalHeaders */ @@ -418,7 +418,7 @@ this._refreshHeadersTitle(title, headersTreeElement, length); if (provisionalHeaders) { - var cautionText = WebInspector.UIString('Provisional headers are shown'); + var cautionText = Common.UIString('Provisional headers are shown'); var cautionFragment = createDocumentFragment(); cautionFragment.createChild('label', '', 'dt-icon-label').type = 'smallicon-warning'; cautionFragment.createChild('div', 'caution').textContent = cautionText; @@ -451,7 +451,7 @@ var treeElement = this._remoteAddressItem; treeElement.hidden = !remoteAddress; if (remoteAddress) - treeElement.title = this._formatHeader(WebInspector.UIString('Remote Address'), remoteAddress); + treeElement.title = this._formatHeader(Common.UIString('Remote Address'), remoteAddress); } /** @@ -487,7 +487,7 @@ * @return {!Element} */ _createHeadersToggleButton(isHeadersTextShown) { - var toggleTitle = isHeadersTextShown ? WebInspector.UIString('view parsed') : WebInspector.UIString('view source'); + var toggleTitle = isHeadersTextShown ? Common.UIString('view parsed') : Common.UIString('view source'); return this._createToggleButton(toggleTitle); } }; @@ -495,7 +495,7 @@ /** * @unrestricted */ -WebInspector.RequestHeadersView.Category = class extends TreeElement { +Network.RequestHeadersView.Category = class extends TreeElement { /** * @param {!TreeOutline} root * @param {string} name @@ -506,7 +506,7 @@ this.selectable = false; this.toggleOnClick = true; this.hidden = true; - this._expandedSetting = WebInspector.settings.createSetting('request-info-' + name + '-category-expanded', true); + this._expandedSetting = Common.settings.createSetting('request-info-' + name + '-category-expanded', true); this.expanded = this._expandedSetting.get(); root.appendChild(this); }
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js index f9deac0..ef1cad37 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
@@ -31,15 +31,15 @@ /** * @unrestricted */ -WebInspector.RequestPreviewView = class extends WebInspector.RequestContentView { +Network.RequestPreviewView = class extends Network.RequestContentView { /** - * @param {!WebInspector.NetworkRequest} request - * @param {!WebInspector.Widget} responseView + * @param {!SDK.NetworkRequest} request + * @param {!UI.Widget} responseView */ constructor(request, responseView) { super(request); this._responseView = responseView; - /** @type {?WebInspector.Widget} */ + /** @type {?UI.Widget} */ this._previewView = null; } @@ -67,15 +67,15 @@ this._previewView.show(this.element); /** - * @param {!WebInspector.Widget} view - * @this {WebInspector.RequestPreviewView} + * @param {!UI.Widget} view + * @this {Network.RequestPreviewView} */ function handlePreviewView(view) { this._previewView = view; view.show(this.element); - if (view instanceof WebInspector.SimpleView) { - var toolbar = new WebInspector.Toolbar('network-item-preview-toolbar', this.element); - for (var item of /** @type {!WebInspector.SimpleView} */ (this._previewView).syncToolbarItems()) + if (view instanceof UI.SimpleView) { + var toolbar = new UI.Toolbar('network-item-preview-toolbar', this.element); + for (var item of /** @type {!UI.SimpleView} */ (this._previewView).syncToolbarItems()) toolbar.appendToolbarItem(item); } this._previewViewHandledForTest(view); @@ -83,24 +83,24 @@ } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ _previewViewHandledForTest(view) { } /** - * @return {!WebInspector.EmptyWidget} + * @return {!UI.EmptyWidget} */ _createEmptyWidget() { - return this._createMessageView(WebInspector.UIString('This request has no preview available.')); + return this._createMessageView(Common.UIString('This request has no preview available.')); } /** * @param {string} message - * @return {!WebInspector.EmptyWidget} + * @return {!UI.EmptyWidget} */ _createMessageView(message) { - return new WebInspector.EmptyWidget(message); + return new UI.EmptyWidget(message); } /** @@ -112,25 +112,25 @@ } /** - * @param {?WebInspector.ParsedJSON} parsedJSON - * @return {?WebInspector.SearchableView} + * @param {?Network.ParsedJSON} parsedJSON + * @return {?UI.SearchableView} */ _jsonView(parsedJSON) { if (!parsedJSON || typeof parsedJSON.data !== 'object') return null; - return WebInspector.JSONView.createSearchableView(/** @type {!WebInspector.ParsedJSON} */ (parsedJSON)); + return Network.JSONView.createSearchableView(/** @type {!Network.ParsedJSON} */ (parsedJSON)); } /** - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ _xmlView() { - var parsedXML = WebInspector.XMLView.parseXML(this._requestContent(), this.request.mimeType); - return parsedXML ? WebInspector.XMLView.createSearchableView(parsedXML) : null; + var parsedXML = Network.XMLView.parseXML(this._requestContent(), this.request.mimeType); + return parsedXML ? Network.XMLView.createSearchableView(parsedXML) : null; } /** - * @return {?WebInspector.RequestHTMLView} + * @return {?Network.RequestHTMLView} */ _htmlErrorPreview() { var whitelist = ['text/html', 'text/plain', 'application/xhtml+xml']; @@ -141,15 +141,15 @@ if (dataURL === null) return null; - return new WebInspector.RequestHTMLView(this.request, dataURL); + return new Network.RequestHTMLView(this.request, dataURL); } /** - * @param {function(!WebInspector.Widget)} callback + * @param {function(!UI.Widget)} callback */ _createPreviewView(callback) { if (this.request.contentError()) { - callback(this._createMessageView(WebInspector.UIString('Failed to load response data'))); + callback(this._createMessageView(Common.UIString('Failed to load response data'))); return; } @@ -159,12 +159,12 @@ return; } - WebInspector.JSONView.parseJSON(this._requestContent()).then(chooseView.bind(this)).then(callback); + Network.JSONView.parseJSON(this._requestContent()).then(chooseView.bind(this)).then(callback); /** - * @this {WebInspector.RequestPreviewView} - * @param {?WebInspector.ParsedJSON} jsonData - * @return {!WebInspector.Widget} + * @this {Network.RequestPreviewView} + * @param {?Network.ParsedJSON} jsonData + * @return {!UI.Widget} */ function chooseView(jsonData) { if (jsonData) { @@ -173,7 +173,7 @@ return jsonView; } - if (this.request.hasErrorStatusCode() || this.request.resourceType() === WebInspector.resourceTypes.XHR) { + if (this.request.hasErrorStatusCode() || this.request.resourceType() === Common.resourceTypes.XHR) { var htmlErrorPreview = this._htmlErrorPreview(); if (htmlErrorPreview) return htmlErrorPreview; @@ -182,10 +182,10 @@ if (this._responseView.sourceView) return this._responseView.sourceView; - if (this.request.resourceType() === WebInspector.resourceTypes.Other) + if (this.request.resourceType() === Common.resourceTypes.Other) return this._createEmptyWidget(); - return WebInspector.RequestView.nonSourceViewForRequest(this.request); + return Network.RequestView.nonSourceViewForRequest(this.request); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js index f32b14d1..fbd73d86 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestResponseView.js
@@ -31,30 +31,30 @@ /** * @unrestricted */ -WebInspector.RequestResponseView = class extends WebInspector.RequestContentView { +Network.RequestResponseView = class extends Network.RequestContentView { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(request); } get sourceView() { - if (this._sourceView || !WebInspector.RequestView.hasTextContent(this.request)) + if (this._sourceView || !Network.RequestView.hasTextContent(this.request)) return this._sourceView; - var contentProvider = new WebInspector.RequestResponseView.ContentProvider(this.request); + var contentProvider = new Network.RequestResponseView.ContentProvider(this.request); var highlighterType = this.request.resourceType().canonicalMimeType() || this.request.mimeType; - this._sourceView = WebInspector.ResourceSourceFrame.createSearchableView(contentProvider, highlighterType); + this._sourceView = SourceFrame.ResourceSourceFrame.createSearchableView(contentProvider, highlighterType); return this._sourceView; } /** * @param {string} message - * @return {!WebInspector.EmptyWidget} + * @return {!UI.EmptyWidget} */ _createMessageView(message) { - return new WebInspector.EmptyWidget(message); + return new UI.EmptyWidget(message); } /** @@ -64,7 +64,7 @@ if ((!this.request.content || !this.sourceView) && !this.request.contentError()) { if (!this._emptyWidget) { this._emptyWidget = - this._createMessageView(WebInspector.UIString('This request has no response data available.')); + this._createMessageView(Common.UIString('This request has no response data available.')); this._emptyWidget.show(this.element); } } else { @@ -77,7 +77,7 @@ this.sourceView.show(this.element); } else { if (!this._errorView) - this._errorView = this._createMessageView(WebInspector.UIString('Failed to load response data')); + this._errorView = this._createMessageView(Common.UIString('Failed to load response data')); this._errorView.show(this.element); } } @@ -85,12 +85,12 @@ }; /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.RequestResponseView.ContentProvider = class { +Network.RequestResponseView.ContentProvider = class { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { this._request = request; @@ -106,7 +106,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._request.resourceType(); @@ -119,7 +119,7 @@ requestContent() { /** * @param {?string} content - * @this {WebInspector.RequestResponseView.ContentProvider} + * @this {Network.RequestResponseView.ContentProvider} */ function decodeContent(content) { return this._request.contentEncoded ? window.atob(content || '') : content; @@ -133,7 +133,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { this._request.searchInContent(query, caseSensitive, isRegex, callback);
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js index 2bde321..24d6aff 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestTimingView.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.RequestTimingView = class extends WebInspector.VBox { +Network.RequestTimingView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request - * @param {!WebInspector.NetworkTimeCalculator} calculator + * @param {!SDK.NetworkRequest} request + * @param {!Network.NetworkTimeCalculator} calculator */ constructor(request, calculator) { super(); @@ -45,53 +45,53 @@ } /** - * @param {!WebInspector.RequestTimeRangeNames} name + * @param {!Network.RequestTimeRangeNames} name * @return {string} */ static _timeRangeTitle(name) { switch (name) { - case WebInspector.RequestTimeRangeNames.Push: - return WebInspector.UIString('Receiving Push'); - case WebInspector.RequestTimeRangeNames.Queueing: - return WebInspector.UIString('Queueing'); - case WebInspector.RequestTimeRangeNames.Blocking: - return WebInspector.UIString('Stalled'); - case WebInspector.RequestTimeRangeNames.Connecting: - return WebInspector.UIString('Initial connection'); - case WebInspector.RequestTimeRangeNames.DNS: - return WebInspector.UIString('DNS Lookup'); - case WebInspector.RequestTimeRangeNames.Proxy: - return WebInspector.UIString('Proxy negotiation'); - case WebInspector.RequestTimeRangeNames.ReceivingPush: - return WebInspector.UIString('Reading Push'); - case WebInspector.RequestTimeRangeNames.Receiving: - return WebInspector.UIString('Content Download'); - case WebInspector.RequestTimeRangeNames.Sending: - return WebInspector.UIString('Request sent'); - case WebInspector.RequestTimeRangeNames.ServiceWorker: - return WebInspector.UIString('Request to ServiceWorker'); - case WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation: - return WebInspector.UIString('ServiceWorker Preparation'); - case WebInspector.RequestTimeRangeNames.SSL: - return WebInspector.UIString('SSL'); - case WebInspector.RequestTimeRangeNames.Total: - return WebInspector.UIString('Total'); - case WebInspector.RequestTimeRangeNames.Waiting: - return WebInspector.UIString('Waiting (TTFB)'); + case Network.RequestTimeRangeNames.Push: + return Common.UIString('Receiving Push'); + case Network.RequestTimeRangeNames.Queueing: + return Common.UIString('Queueing'); + case Network.RequestTimeRangeNames.Blocking: + return Common.UIString('Stalled'); + case Network.RequestTimeRangeNames.Connecting: + return Common.UIString('Initial connection'); + case Network.RequestTimeRangeNames.DNS: + return Common.UIString('DNS Lookup'); + case Network.RequestTimeRangeNames.Proxy: + return Common.UIString('Proxy negotiation'); + case Network.RequestTimeRangeNames.ReceivingPush: + return Common.UIString('Reading Push'); + case Network.RequestTimeRangeNames.Receiving: + return Common.UIString('Content Download'); + case Network.RequestTimeRangeNames.Sending: + return Common.UIString('Request sent'); + case Network.RequestTimeRangeNames.ServiceWorker: + return Common.UIString('Request to ServiceWorker'); + case Network.RequestTimeRangeNames.ServiceWorkerPreparation: + return Common.UIString('ServiceWorker Preparation'); + case Network.RequestTimeRangeNames.SSL: + return Common.UIString('SSL'); + case Network.RequestTimeRangeNames.Total: + return Common.UIString('Total'); + case Network.RequestTimeRangeNames.Waiting: + return Common.UIString('Waiting (TTFB)'); default: - return WebInspector.UIString(name); + return Common.UIString(name); } } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} navigationStart - * @return {!Array.<!WebInspector.RequestTimeRange>} + * @return {!Array.<!Network.RequestTimeRange>} */ static calculateRequestTimeRanges(request, navigationStart) { var result = []; /** - * @param {!WebInspector.RequestTimeRangeNames} name + * @param {!Network.RequestTimeRangeNames} name * @param {number} start * @param {number} end */ @@ -113,7 +113,7 @@ } /** - * @param {!WebInspector.RequestTimeRangeNames} name + * @param {!Network.RequestTimeRangeNames} name * @param {number} start * @param {number} end */ @@ -127,9 +127,9 @@ var start = request.issueTime() !== -1 ? request.issueTime() : request.startTime !== -1 ? request.startTime : 0; var middle = (request.responseReceivedTime === -1) ? Number.MAX_VALUE : request.responseReceivedTime; var end = (request.endTime === -1) ? Number.MAX_VALUE : request.endTime; - addRange(WebInspector.RequestTimeRangeNames.Total, start, end); - addRange(WebInspector.RequestTimeRangeNames.Blocking, start, middle); - addRange(WebInspector.RequestTimeRangeNames.Receiving, middle, end); + addRange(Network.RequestTimeRangeNames.Total, start, end); + addRange(Network.RequestTimeRangeNames.Blocking, start, middle); + addRange(Network.RequestTimeRangeNames.Receiving, middle, end); return result; } @@ -137,45 +137,45 @@ var startTime = timing.requestTime; var endTime = firstPositive([request.endTime, request.responseReceivedTime]) || startTime; - addRange(WebInspector.RequestTimeRangeNames.Total, issueTime < startTime ? issueTime : startTime, endTime); + addRange(Network.RequestTimeRangeNames.Total, issueTime < startTime ? issueTime : startTime, endTime); if (timing.pushStart) { var pushEnd = timing.pushEnd || endTime; // Only show the part of push that happened after the navigation/reload. // Pushes that happened on the same connection before we started main request will not be shown. if (pushEnd > navigationStart) - addRange(WebInspector.RequestTimeRangeNames.Push, Math.max(timing.pushStart, navigationStart), pushEnd); + addRange(Network.RequestTimeRangeNames.Push, Math.max(timing.pushStart, navigationStart), pushEnd); } if (issueTime < startTime) - addRange(WebInspector.RequestTimeRangeNames.Queueing, issueTime, startTime); + addRange(Network.RequestTimeRangeNames.Queueing, issueTime, startTime); if (request.fetchedViaServiceWorker) { - addOffsetRange(WebInspector.RequestTimeRangeNames.Blocking, 0, timing.workerStart); + addOffsetRange(Network.RequestTimeRangeNames.Blocking, 0, timing.workerStart); addOffsetRange( - WebInspector.RequestTimeRangeNames.ServiceWorkerPreparation, timing.workerStart, timing.workerReady); - addOffsetRange(WebInspector.RequestTimeRangeNames.ServiceWorker, timing.workerReady, timing.sendEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.Waiting, timing.sendEnd, timing.receiveHeadersEnd); + Network.RequestTimeRangeNames.ServiceWorkerPreparation, timing.workerStart, timing.workerReady); + addOffsetRange(Network.RequestTimeRangeNames.ServiceWorker, timing.workerReady, timing.sendEnd); + addOffsetRange(Network.RequestTimeRangeNames.Waiting, timing.sendEnd, timing.receiveHeadersEnd); } else if (!timing.pushStart) { var blocking = firstPositive([timing.dnsStart, timing.connectStart, timing.sendStart]) || 0; - addOffsetRange(WebInspector.RequestTimeRangeNames.Blocking, 0, blocking); - addOffsetRange(WebInspector.RequestTimeRangeNames.Proxy, timing.proxyStart, timing.proxyEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.DNS, timing.dnsStart, timing.dnsEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.Connecting, timing.connectStart, timing.connectEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.SSL, timing.sslStart, timing.sslEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.Sending, timing.sendStart, timing.sendEnd); - addOffsetRange(WebInspector.RequestTimeRangeNames.Waiting, timing.sendEnd, timing.receiveHeadersEnd); + addOffsetRange(Network.RequestTimeRangeNames.Blocking, 0, blocking); + addOffsetRange(Network.RequestTimeRangeNames.Proxy, timing.proxyStart, timing.proxyEnd); + addOffsetRange(Network.RequestTimeRangeNames.DNS, timing.dnsStart, timing.dnsEnd); + addOffsetRange(Network.RequestTimeRangeNames.Connecting, timing.connectStart, timing.connectEnd); + addOffsetRange(Network.RequestTimeRangeNames.SSL, timing.sslStart, timing.sslEnd); + addOffsetRange(Network.RequestTimeRangeNames.Sending, timing.sendStart, timing.sendEnd); + addOffsetRange(Network.RequestTimeRangeNames.Waiting, timing.sendEnd, timing.receiveHeadersEnd); } if (request.endTime !== -1) addRange( - timing.pushStart ? WebInspector.RequestTimeRangeNames.ReceivingPush : - WebInspector.RequestTimeRangeNames.Receiving, + timing.pushStart ? Network.RequestTimeRangeNames.ReceivingPush : + Network.RequestTimeRangeNames.Receiving, request.responseReceivedTime, endTime); return result; } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} navigationStart * @return {!Element} */ @@ -186,7 +186,7 @@ colgroup.createChild('col', 'bars'); colgroup.createChild('col', 'duration'); - var timeRanges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, navigationStart); + var timeRanges = Network.RequestTimingView.calculateRequestTimeRanges(request, navigationStart); var startTime = timeRanges.map(r => r.start).reduce((a, b) => Math.min(a, b)); var endTime = timeRanges.map(r => r.end).reduce((a, b) => Math.max(a, b)); var scale = 100 / (endTime - startTime); @@ -198,18 +198,18 @@ for (var i = 0; i < timeRanges.length; ++i) { var range = timeRanges[i]; var rangeName = range.name; - if (rangeName === WebInspector.RequestTimeRangeNames.Total) { + if (rangeName === Network.RequestTimeRangeNames.Total) { totalDuration = range.end - range.start; continue; } - if (rangeName === WebInspector.RequestTimeRangeNames.Push) { - createHeader(WebInspector.UIString('Server Push')); - } else if (WebInspector.RequestTimingView.ConnectionSetupRangeNames.has(rangeName)) { + if (rangeName === Network.RequestTimeRangeNames.Push) { + createHeader(Common.UIString('Server Push')); + } else if (Network.RequestTimingView.ConnectionSetupRangeNames.has(rangeName)) { if (!connectionHeader) - connectionHeader = createHeader(WebInspector.UIString('Connection Setup')); + connectionHeader = createHeader(Common.UIString('Connection Setup')); } else { if (!dataHeader) - dataHeader = createHeader(WebInspector.UIString('Request/Response')); + dataHeader = createHeader(Common.UIString('Request/Response')); } var left = (scale * (range.start - startTime)); @@ -217,7 +217,7 @@ var duration = range.end - range.start; var tr = tableElement.createChild('tr'); - tr.createChild('td').createTextChild(WebInspector.RequestTimingView._timeRangeTitle(rangeName)); + tr.createChild('td').createTextChild(Network.RequestTimingView._timeRangeTitle(rangeName)); var row = tr.createChild('td').createChild('div', 'network-timing-row'); var bar = row.createChild('span', 'network-timing-bar ' + rangeName); @@ -231,15 +231,15 @@ if (!request.finished) { var cell = tableElement.createChild('tr').createChild('td', 'caution'); cell.colSpan = 3; - cell.createTextChild(WebInspector.UIString('CAUTION: request is not finished yet!')); + cell.createTextChild(Common.UIString('CAUTION: request is not finished yet!')); } var footer = tableElement.createChild('tr', 'network-timing-footer'); var note = footer.createChild('td'); note.colSpan = 2; - note.appendChild(WebInspector.linkifyDocumentationURLAsNode( + note.appendChild(UI.linkifyDocumentationURLAsNode( 'profile/network-performance/resource-loading#view-network-timing-details-for-a-specific-resource', - WebInspector.UIString('Explanation'))); + Common.UIString('Explanation'))); footer.createChild('td').createTextChild(Number.secondsToString(totalDuration, true)); var serverTimings = request.serverTimings; @@ -253,9 +253,9 @@ breakElement.createChild('hr', 'break'); var serverHeader = tableElement.createChild('tr', 'network-timing-table-header'); - serverHeader.createChild('td').createTextChild(WebInspector.UIString('Server Timing')); + serverHeader.createChild('td').createTextChild(Common.UIString('Server Timing')); serverHeader.createChild('td'); - serverHeader.createChild('td').createTextChild(WebInspector.UIString('TIME')); + serverHeader.createChild('td').createTextChild(Common.UIString('TIME')); serverTimings.filter(item => item.metric.toLowerCase() !== 'total') .forEach(item => addTiming(item, lastTimingRightEdge)); @@ -265,12 +265,12 @@ return tableElement; /** - * @param {!WebInspector.ServerTiming} serverTiming + * @param {!SDK.ServerTiming} serverTiming * @param {number} right */ function addTiming(serverTiming, right) { var colorGenerator = - new WebInspector.FlameChart.ColorGenerator({min: 0, max: 360, count: 36}, {min: 50, max: 80}, 80); + new UI.FlameChart.ColorGenerator({min: 0, max: 360, count: 36}, {min: 50, max: 80}, 80); var isTotal = serverTiming.metric.toLowerCase() === 'total'; var tr = tableElement.createChild('tr', isTotal ? 'network-timing-footer' : ''); var metric = tr.createChild('td', 'network-timing-metric'); @@ -297,7 +297,7 @@ var dataHeader = tableElement.createChild('tr', 'network-timing-table-header'); dataHeader.createChild('td').createTextChild(title); dataHeader.createChild('td').createTextChild(''); - dataHeader.createChild('td').createTextChild(WebInspector.UIString('TIME')); + dataHeader.createChild('td').createTextChild(Common.UIString('TIME')); return dataHeader; } } @@ -306,9 +306,9 @@ * @override */ wasShown() { - this._request.addEventListener(WebInspector.NetworkRequest.Events.TimingChanged, this._refresh, this); - this._request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._refresh, this); - this._calculator.addEventListener(WebInspector.NetworkTimeCalculator.Events.BoundariesChanged, this._refresh, this); + this._request.addEventListener(SDK.NetworkRequest.Events.TimingChanged, this._refresh, this); + this._request.addEventListener(SDK.NetworkRequest.Events.FinishedLoading, this._refresh, this); + this._calculator.addEventListener(Network.NetworkTimeCalculator.Events.BoundariesChanged, this._refresh, this); this._refresh(); } @@ -316,10 +316,10 @@ * @override */ willHide() { - this._request.removeEventListener(WebInspector.NetworkRequest.Events.TimingChanged, this._refresh, this); - this._request.removeEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._refresh, this); + this._request.removeEventListener(SDK.NetworkRequest.Events.TimingChanged, this._refresh, this); + this._request.removeEventListener(SDK.NetworkRequest.Events.FinishedLoading, this._refresh, this); this._calculator.removeEventListener( - WebInspector.NetworkTimeCalculator.Events.BoundariesChanged, this._refresh, this); + Network.NetworkTimeCalculator.Events.BoundariesChanged, this._refresh, this); } _refresh() { @@ -327,13 +327,13 @@ this._tableElement.remove(); this._tableElement = - WebInspector.RequestTimingView.createTimingTable(this._request, this._calculator.minimumBoundary()); + Network.RequestTimingView.createTimingTable(this._request, this._calculator.minimumBoundary()); this.element.appendChild(this._tableElement); } }; /** @enum {string} */ -WebInspector.RequestTimeRangeNames = { +Network.RequestTimeRangeNames = { Push: 'push', Queueing: 'queueing', Blocking: 'blocking', @@ -350,11 +350,11 @@ Waiting: 'waiting' }; -WebInspector.RequestTimingView.ConnectionSetupRangeNames = new Set([ - WebInspector.RequestTimeRangeNames.Queueing, WebInspector.RequestTimeRangeNames.Blocking, - WebInspector.RequestTimeRangeNames.Connecting, WebInspector.RequestTimeRangeNames.DNS, - WebInspector.RequestTimeRangeNames.Proxy, WebInspector.RequestTimeRangeNames.SSL +Network.RequestTimingView.ConnectionSetupRangeNames = new Set([ + Network.RequestTimeRangeNames.Queueing, Network.RequestTimeRangeNames.Blocking, + Network.RequestTimeRangeNames.Connecting, Network.RequestTimeRangeNames.DNS, + Network.RequestTimeRangeNames.Proxy, Network.RequestTimeRangeNames.SSL ]); -/** @typedef {{name: !WebInspector.RequestTimeRangeNames, start: number, end: number}} */ -WebInspector.RequestTimeRange; +/** @typedef {{name: !Network.RequestTimeRangeNames, start: number, end: number}} */ +Network.RequestTimeRange;
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestView.js index f2c2177..4c20859 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestView.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.RequestView = class extends WebInspector.VBox { +Network.RequestView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(); @@ -43,29 +43,29 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {boolean} */ static hasTextContent(request) { if (request.resourceType().isTextType()) return true; - if (request.resourceType() === WebInspector.resourceTypes.Other || request.hasErrorStatusCode()) + if (request.resourceType() === Common.resourceTypes.Other || request.hasErrorStatusCode()) return !!request.content && !request.contentEncoded; return false; } /** - * @param {!WebInspector.NetworkRequest} request - * @return {!WebInspector.Widget} + * @param {!SDK.NetworkRequest} request + * @return {!UI.Widget} */ static nonSourceViewForRequest(request) { switch (request.resourceType()) { - case WebInspector.resourceTypes.Image: - return new WebInspector.ImageView(request.mimeType, request); - case WebInspector.resourceTypes.Font: - return new WebInspector.FontView(request.mimeType, request); + case Common.resourceTypes.Image: + return new SourceFrame.ImageView(request.mimeType, request); + case Common.resourceTypes.Font: + return new SourceFrame.FontView(request.mimeType, request); default: - return new WebInspector.RequestView(request); + return new Network.RequestView(request); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js index 8069127..4d740102 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
@@ -19,9 +19,9 @@ /** * @unrestricted */ -WebInspector.ResourceWebSocketFrameView = class extends WebInspector.VBox { +Network.ResourceWebSocketFrameView = class extends UI.VBox { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { super(); @@ -29,48 +29,48 @@ this.element.classList.add('websocket-frame-view'); this._request = request; - this._splitWidget = new WebInspector.SplitWidget(false, true, 'resourceWebSocketFrameSplitViewState'); + this._splitWidget = new UI.SplitWidget(false, true, 'resourceWebSocketFrameSplitViewState'); this._splitWidget.show(this.element); - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'data', title: WebInspector.UIString('Data'), sortable: false, weight: 88}, { + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'data', title: Common.UIString('Data'), sortable: false, weight: 88}, { id: 'length', - title: WebInspector.UIString('Length'), + title: Common.UIString('Length'), sortable: false, - align: WebInspector.DataGrid.Align.Right, + align: UI.DataGrid.Align.Right, weight: 5 }, - {id: 'time', title: WebInspector.UIString('Time'), sortable: true, weight: 7} + {id: 'time', title: Common.UIString('Time'), sortable: true, weight: 7} ]); - this._dataGrid = new WebInspector.SortableDataGrid(columns); + this._dataGrid = new UI.SortableDataGrid(columns); this._dataGrid.setRowContextMenuCallback(onRowContextMenu); this._dataGrid.setStickToBottom(true); this._dataGrid.setCellClass('websocket-frame-view-td'); - this._timeComparator = /** @type {!WebInspector.SortableDataGrid.NodeComparator} */ ( - WebInspector.ResourceWebSocketFrameNodeTimeComparator); + this._timeComparator = /** @type {!UI.SortableDataGrid.NodeComparator} */ ( + Network.ResourceWebSocketFrameNodeTimeComparator); this._dataGrid.sortNodes(this._timeComparator, false); - this._dataGrid.markColumnAsSortedBy('time', WebInspector.DataGrid.Order.Ascending); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortItems, this); + this._dataGrid.markColumnAsSortedBy('time', UI.DataGrid.Order.Ascending); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortItems, this); this._dataGrid.setName('ResourceWebSocketFrameView'); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._onFrameSelected, this); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.DeselectedNode, this._onFrameDeselected, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._onFrameSelected, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.DeselectedNode, this._onFrameDeselected, this); this._splitWidget.setMainWidget(this._dataGrid.asWidget()); - var view = new WebInspector.EmptyWidget('Select frame to browse its content.'); + var view = new UI.EmptyWidget('Select frame to browse its content.'); this._splitWidget.setSidebarWidget(view); - /** @type {?WebInspector.ResourceWebSocketFrameNode} */ + /** @type {?Network.ResourceWebSocketFrameNode} */ this._selectedNode = null; /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {!WebInspector.DataGridNode} node + * @param {!UI.ContextMenu} contextMenu + * @param {!UI.DataGridNode} node */ function onRowContextMenu(contextMenu, node) { contextMenu.appendItem( - WebInspector.UIString.capitalize('Copy ^message'), + Common.UIString.capitalize('Copy ^message'), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, node.data.data)); } } @@ -81,9 +81,9 @@ * @return {string} */ static opCodeDescription(opCode, mask) { - var rawDescription = WebInspector.ResourceWebSocketFrameView.opCodeDescriptions[opCode] || ''; - var localizedDescription = WebInspector.UIString(rawDescription); - return WebInspector.UIString('%s (Opcode %d%s)', localizedDescription, opCode, (mask ? ', mask' : '')); + var rawDescription = Network.ResourceWebSocketFrameView.opCodeDescriptions[opCode] || ''; + var localizedDescription = Common.UIString(rawDescription); + return Common.UIString('%s (Opcode %d%s)', localizedDescription, opCode, (mask ? ', mask' : '')); } /** @@ -91,59 +91,59 @@ */ wasShown() { this.refresh(); - this._request.addEventListener(WebInspector.NetworkRequest.Events.WebsocketFrameAdded, this._frameAdded, this); + this._request.addEventListener(SDK.NetworkRequest.Events.WebsocketFrameAdded, this._frameAdded, this); } /** * @override */ willHide() { - this._request.removeEventListener(WebInspector.NetworkRequest.Events.WebsocketFrameAdded, this._frameAdded, this); + this._request.removeEventListener(SDK.NetworkRequest.Events.WebsocketFrameAdded, this._frameAdded, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _frameAdded(event) { - var frame = /** @type {!WebInspector.NetworkRequest.WebSocketFrame} */ (event.data); - this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(this._request.url, frame)); + var frame = /** @type {!SDK.NetworkRequest.WebSocketFrame} */ (event.data); + this._dataGrid.insertChild(new Network.ResourceWebSocketFrameNode(this._request.url, frame)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFrameSelected(event) { - var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode); + var selectedNode = /** @type {!Network.ResourceWebSocketFrameNode} */ (event.target.selectedNode); this._currentSelectedNode = selectedNode; var contentProvider = selectedNode.contentProvider(); contentProvider.requestContent().then(contentHandler.bind(this)); /** * @param {(string|null)} content - * @this {WebInspector.ResourceWebSocketFrameView} + * @this {Network.ResourceWebSocketFrameView} */ function contentHandler(content) { if (this._currentSelectedNode !== selectedNode) return; - WebInspector.JSONView.parseJSON(content).then(handleJSONData.bind(this)); + Network.JSONView.parseJSON(content).then(handleJSONData.bind(this)); } /** - * @param {?WebInspector.ParsedJSON} parsedJSON - * @this {WebInspector.ResourceWebSocketFrameView} + * @param {?Network.ParsedJSON} parsedJSON + * @this {Network.ResourceWebSocketFrameView} */ function handleJSONData(parsedJSON) { if (this._currentSelectedNode !== selectedNode) return; if (parsedJSON) - this._splitWidget.setSidebarWidget(WebInspector.JSONView.createSearchableView(parsedJSON)); + this._splitWidget.setSidebarWidget(Network.JSONView.createSearchableView(parsedJSON)); else - this._splitWidget.setSidebarWidget(new WebInspector.ResourceSourceFrame(contentProvider)); + this._splitWidget.setSidebarWidget(new SourceFrame.ResourceSourceFrame(contentProvider)); } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFrameDeselected(event) { this._currentSelectedNode = null; @@ -153,7 +153,7 @@ this._dataGrid.rootNode().removeChildren(); var frames = this._request.frames(); for (var i = 0; i < frames.length; ++i) - this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(this._request.url, frames[i])); + this._dataGrid.insertChild(new Network.ResourceWebSocketFrameNode(this._request.url, frames[i])); } _sortItems() { @@ -162,7 +162,7 @@ }; /** @enum {number} */ -WebInspector.ResourceWebSocketFrameView.OpCodes = { +Network.ResourceWebSocketFrameView.OpCodes = { ContinuationFrame: 0, TextFrame: 1, BinaryFrame: 2, @@ -172,8 +172,8 @@ }; /** @type {!Array.<string> } */ -WebInspector.ResourceWebSocketFrameView.opCodeDescriptions = (function() { - var opCodes = WebInspector.ResourceWebSocketFrameView.OpCodes; +Network.ResourceWebSocketFrameView.opCodeDescriptions = (function() { + var opCodes = Network.ResourceWebSocketFrameView.OpCodes; var map = []; map[opCodes.ContinuationFrame] = 'Continuation Frame'; map[opCodes.TextFrame] = 'Text Frame'; @@ -188,10 +188,10 @@ /** * @unrestricted */ -WebInspector.ResourceWebSocketFrameNode = class extends WebInspector.SortableDataGridNode { +Network.ResourceWebSocketFrameNode = class extends UI.SortableDataGridNode { /** * @param {string} url - * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame + * @param {!SDK.NetworkRequest.WebSocketFrame} frame */ constructor(url, frame) { var dataText = frame.text; @@ -203,9 +203,9 @@ timeNode.createTextChild(timeText); timeNode.title = time.toLocaleString(); - var isTextFrame = frame.opCode === WebInspector.ResourceWebSocketFrameView.OpCodes.TextFrame; + var isTextFrame = frame.opCode === Network.ResourceWebSocketFrameView.OpCodes.TextFrame; if (!isTextFrame) - dataText = WebInspector.ResourceWebSocketFrameView.opCodeDescription(frame.opCode, frame.mask); + dataText = Network.ResourceWebSocketFrameView.opCodeDescription(frame.opCode, frame.mask); super({data: dataText, length: length, time: timeNode}); @@ -221,9 +221,9 @@ createCells() { var element = this._element; element.classList.toggle( - 'websocket-frame-view-row-error', this._frame.type === WebInspector.NetworkRequest.WebSocketFrameType.Error); + 'websocket-frame-view-row-error', this._frame.type === SDK.NetworkRequest.WebSocketFrameType.Error); element.classList.toggle( - 'websocket-frame-view-row-outcoming', this._frame.type === WebInspector.NetworkRequest.WebSocketFrameType.Send); + 'websocket-frame-view-row-outcoming', this._frame.type === SDK.NetworkRequest.WebSocketFrameType.Send); element.classList.toggle('websocket-frame-view-row-opcode', !this._isTextFrame); super.createCells(); } @@ -237,19 +237,19 @@ } /** - * @return {!WebInspector.ContentProvider} + * @return {!Common.ContentProvider} */ contentProvider() { - return WebInspector.StaticContentProvider.fromString( - this._url, WebInspector.resourceTypes.WebSocket, this._dataText); + return Common.StaticContentProvider.fromString( + this._url, Common.resourceTypes.WebSocket, this._dataText); } }; /** - * @param {!WebInspector.ResourceWebSocketFrameNode} a - * @param {!WebInspector.ResourceWebSocketFrameNode} b + * @param {!Network.ResourceWebSocketFrameNode} a + * @param {!Network.ResourceWebSocketFrameNode} b * @return {number} */ -WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) { +Network.ResourceWebSocketFrameNodeTimeComparator = function(a, b) { return a._frame.time - b._frame.time; };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/XMLView.js b/third_party/WebKit/Source/devtools/front_end/network/XMLView.js index fbbcdb2d..53047bc4 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/XMLView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/XMLView.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.XMLView = class extends WebInspector.Widget { +Network.XMLView = class extends UI.Widget { /** * @param {!Document} parsedXML */ @@ -17,26 +17,26 @@ this._treeOutline.registerRequiredCSS('network/xmlTree.css'); this.contentElement.appendChild(this._treeOutline.element); - /** @type {?WebInspector.SearchableView} */ + /** @type {?UI.SearchableView} */ this._searchableView; /** @type {number} */ this._currentSearchFocusIndex = 0; /** @type {!Array.<!TreeElement>} */ this._currentSearchTreeElements = []; - /** @type {?WebInspector.SearchableView.SearchConfig} */ + /** @type {?UI.SearchableView.SearchConfig} */ this._searchConfig; - WebInspector.XMLView.Node.populate(this._treeOutline, parsedXML, this); + Network.XMLView.Node.populate(this._treeOutline, parsedXML, this); } /** * @param {!Document} parsedXML - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ static createSearchableView(parsedXML) { - var xmlView = new WebInspector.XMLView(parsedXML); - var searchableView = new WebInspector.SearchableView(xmlView); - searchableView.setPlaceholder(WebInspector.UIString('Find')); + var xmlView = new Network.XMLView(parsedXML); + var searchableView = new UI.SearchableView(xmlView); + searchableView.setPlaceholder(Common.UIString('Find')); xmlView._searchableView = searchableView; xmlView.show(searchableView.element); xmlView.contentElement.setAttribute('tabIndex', 0); @@ -77,7 +77,7 @@ this._updateSearchIndex(index); if (shouldJump) newFocusElement.reveal(true); - newFocusElement.setSearchRegex(regex, WebInspector.highlightedCurrentSearchResultClassName); + newFocusElement.setSearchRegex(regex, UI.highlightedCurrentSearchResultClassName); } else { this._updateSearchIndex(0); } @@ -116,7 +116,7 @@ var regex = this._searchConfig.toSearchRegex(true); for (var element = this._treeOutline.rootElement(); element; element = element.traverseNextTreeElement(false)) { - if (!(element instanceof WebInspector.XMLView.Node)) + if (!(element instanceof Network.XMLView.Node)) continue; var hasMatch = element.setSearchRegex(regex); if (hasMatch) @@ -142,7 +142,7 @@ _innerSearchCanceled() { for (var element = this._treeOutline.rootElement(); element; element = element.traverseNextTreeElement(false)) { - if (!(element instanceof WebInspector.XMLView.Node)) + if (!(element instanceof Network.XMLView.Node)) continue; element.revertHighlightChanges(); } @@ -161,7 +161,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -213,11 +213,11 @@ /** * @unrestricted */ -WebInspector.XMLView.Node = class extends TreeElement { +Network.XMLView.Node = class extends TreeElement { /** * @param {!Node} node * @param {boolean} closeTag - * @param {!WebInspector.XMLView} xmlView + * @param {!Network.XMLView} xmlView */ constructor(node, closeTag, xmlView) { super('', !closeTag && !!node.childElementCount); @@ -233,7 +233,7 @@ /** * @param {!TreeOutline|!TreeElement} root * @param {!Node} xmlNode - * @param {!WebInspector.XMLView} xmlView + * @param {!Network.XMLView} xmlView */ static populate(root, xmlNode, xmlView) { var node = xmlNode.firstChild; @@ -247,7 +247,7 @@ // ignore ATTRIBUTE, ENTITY_REFERENCE, ENTITY, DOCUMENT, DOCUMENT_TYPE, DOCUMENT_FRAGMENT, NOTATION if ((nodeType !== 1) && (nodeType !== 3) && (nodeType !== 4) && (nodeType !== 7) && (nodeType !== 8)) continue; - root.appendChild(new WebInspector.XMLView.Node(currentNode, false, xmlView)); + root.appendChild(new Network.XMLView.Node(currentNode, false, xmlView)); } } @@ -263,23 +263,23 @@ if (this._closeTag && this.parent && !this.parent.expanded) return false; regex.lastIndex = 0; - var cssClasses = WebInspector.highlightedSearchResultClassName; + var cssClasses = UI.highlightedSearchResultClassName; if (additionalCssClassName) cssClasses += ' ' + additionalCssClassName; var content = this.listItemElement.textContent.replace(/\xA0/g, ' '); var match = regex.exec(content); var ranges = []; while (match) { - ranges.push(new WebInspector.SourceRange(match.index, match[0].length)); + ranges.push(new Common.SourceRange(match.index, match[0].length)); match = regex.exec(content); } if (ranges.length) - WebInspector.highlightRangesWithStyleClass(this.listItemElement, ranges, cssClasses, this._highlightChanges); + UI.highlightRangesWithStyleClass(this.listItemElement, ranges, cssClasses, this._highlightChanges); return !!this._highlightChanges.length; } revertHighlightChanges() { - WebInspector.revertDomChanges(this._highlightChanges); + UI.revertDomChanges(this._highlightChanges); this._highlightChanges = []; } @@ -369,7 +369,7 @@ * @override */ onpopulate() { - WebInspector.XMLView.Node.populate(this, this._node, this._xmlView); - this.appendChild(new WebInspector.XMLView.Node(this._node, true, this._xmlView)); + Network.XMLView.Node.populate(this, this._node, this._xmlView); + this.appendChild(new Network.XMLView.Node(this._node, true, this._xmlView)); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/network/module.json b/third_party/WebKit/Source/devtools/front_end/network/module.json index eb51a0a..1209c399 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/module.json +++ b/third_party/WebKit/Source/devtools/front_end/network/module.json
@@ -6,17 +6,17 @@ "id": "network", "title": "Network", "order": 40, - "className": "WebInspector.NetworkPanel" + "className": "Network.NetworkPanel" }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.NetworkRequest", "WebInspector.Resource", "WebInspector.UISourceCode"], - "className": "WebInspector.NetworkPanel.ContextMenuProvider" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["SDK.NetworkRequest", "SDK.Resource", "Workspace.UISourceCode"], + "className": "Network.NetworkPanel.ContextMenuProvider" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.NetworkRequest"], - "className": "WebInspector.NetworkPanel.RequestRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.NetworkRequest"], + "className": "Network.NetworkPanel.RequestRevealer" }, { "type": "setting", @@ -32,20 +32,20 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "network.blocked-urls.show", - "className": "WebInspector.BlockedURLsPane.ActionDelegate", + "className": "Network.BlockedURLsPane.ActionDelegate", "iconClass": "largeicon-block", "title": "Block network requests" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "network.toggle-recording", "iconClass": "largeicon-start-recording", "toggledIconClass": "largeicon-stop-recording", "toggleWithRedColor": true, - "contextTypes": ["WebInspector.NetworkPanel"], - "className": "WebInspector.NetworkPanel.RecordActionDelegate", + "contextTypes": ["Network.NetworkPanel"], + "className": "Network.NetworkPanel.RecordActionDelegate", "options": [ { "value": true, "title": "Record network log" }, { "value": false, "title": "Stop recording network log" } @@ -68,7 +68,7 @@ "title": "Request blocking", "persistence": "closeable", "order": 60, - "className": "WebInspector.BlockedURLsPane", + "className": "Network.BlockedURLsPane", "experiment": "requestBlocking" }, { @@ -78,7 +78,7 @@ "title": "Network conditions", "persistence": "closeable", "order": 40, - "className": "WebInspector.NetworkConfigView", + "className": "Network.NetworkConfigView", "tags": "disk cache, network throttling, useragent, user agent" } ],
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js b/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js index e1df48b..9cfb094 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js
@@ -4,42 +4,42 @@ /** * @unrestricted */ -WebInspector.Automapping = class { +Persistence.Automapping = class { /** - * @param {!WebInspector.Workspace} workspace - * @param {function(!WebInspector.PersistenceBinding)} onBindingCreated - * @param {function(!WebInspector.PersistenceBinding)} onBindingRemoved + * @param {!Workspace.Workspace} workspace + * @param {function(!Persistence.PersistenceBinding)} onBindingCreated + * @param {function(!Persistence.PersistenceBinding)} onBindingRemoved */ constructor(workspace, onBindingCreated, onBindingRemoved) { this._workspace = workspace; this._onBindingCreated = onBindingCreated; this._onBindingRemoved = onBindingRemoved; - /** @type {!Set<!WebInspector.PersistenceBinding>} */ + /** @type {!Set<!Persistence.PersistenceBinding>} */ this._bindings = new Set(); - /** @type {!Map<string, !WebInspector.UISourceCode>} */ + /** @type {!Map<string, !Workspace.UISourceCode>} */ this._fileSystemUISourceCodes = new Map(); - this._sweepThrottler = new WebInspector.Throttler(100); + this._sweepThrottler = new Common.Throttler(100); - var pathEncoder = new WebInspector.Automapping.PathEncoder(); - this._filesIndex = new WebInspector.Automapping.FilePathIndex(pathEncoder); - this._projectFoldersIndex = new WebInspector.Automapping.FolderIndex(pathEncoder); - this._activeFoldersIndex = new WebInspector.Automapping.FolderIndex(pathEncoder); + var pathEncoder = new Persistence.Automapping.PathEncoder(); + this._filesIndex = new Persistence.Automapping.FilePathIndex(pathEncoder); + this._projectFoldersIndex = new Persistence.Automapping.FolderIndex(pathEncoder); + this._activeFoldersIndex = new Persistence.Automapping.FolderIndex(pathEncoder); this._eventListeners = [ this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeAdded, - event => this._onUISourceCodeAdded(/** @type {!WebInspector.UISourceCode} */ (event.data))), + Workspace.Workspace.Events.UISourceCodeAdded, + event => this._onUISourceCodeAdded(/** @type {!Workspace.UISourceCode} */ (event.data))), this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeRemoved, - event => this._onUISourceCodeRemoved(/** @type {!WebInspector.UISourceCode} */ (event.data))), + Workspace.Workspace.Events.UISourceCodeRemoved, + event => this._onUISourceCodeRemoved(/** @type {!Workspace.UISourceCode} */ (event.data))), this._workspace.addEventListener( - WebInspector.Workspace.Events.ProjectAdded, - event => this._onProjectAdded(/** @type {!WebInspector.Project} */ (event.data)), this), + Workspace.Workspace.Events.ProjectAdded, + event => this._onProjectAdded(/** @type {!Workspace.Project} */ (event.data)), this), this._workspace.addEventListener( - WebInspector.Workspace.Events.ProjectRemoved, - event => this._onProjectRemoved(/** @type {!WebInspector.Project} */ (event.data)), this), + Workspace.Workspace.Events.ProjectRemoved, + event => this._onProjectRemoved(/** @type {!Workspace.Project} */ (event.data)), this), ]; for (var fileSystem of workspace.projects()) @@ -58,11 +58,11 @@ this._sweepThrottler.schedule(sweepUnmapped.bind(this)); /** - * @this {WebInspector.Automapping} + * @this {Persistence.Automapping} * @return {!Promise} */ function sweepUnmapped() { - var networkProjects = this._workspace.projectsForType(WebInspector.projectTypes.Network); + var networkProjects = this._workspace.projectsForType(Workspace.projectTypes.Network); for (var networkProject of networkProjects) { for (var uiSourceCode of networkProject.uiSourceCodes()) this._bindNetwork(uiSourceCode); @@ -76,14 +76,14 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project */ _onProjectRemoved(project) { for (var uiSourceCode of project.uiSourceCodes()) this._onUISourceCodeRemoved(uiSourceCode); - if (project.type() !== WebInspector.projectTypes.FileSystem) + if (project.type() !== Workspace.projectTypes.FileSystem) return; - var fileSystem = /** @type {!WebInspector.FileSystemWorkspaceBinding.FileSystem} */ (project); + var fileSystem = /** @type {!Bindings.FileSystemWorkspaceBinding.FileSystem} */ (project); for (var gitFolder of fileSystem.gitFolders()) this._projectFoldersIndex.removeFolder(gitFolder); this._projectFoldersIndex.removeFolder(fileSystem.fileSystemPath()); @@ -91,12 +91,12 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project */ _onProjectAdded(project) { - if (project.type() !== WebInspector.projectTypes.FileSystem) + if (project.type() !== Workspace.projectTypes.FileSystem) return; - var fileSystem = /** @type {!WebInspector.FileSystemWorkspaceBinding.FileSystem} */ (project); + var fileSystem = /** @type {!Bindings.FileSystemWorkspaceBinding.FileSystem} */ (project); for (var gitFolder of fileSystem.gitFolders()) this._projectFoldersIndex.addFolder(gitFolder); this._projectFoldersIndex.addFolder(fileSystem.fileSystemPath()); @@ -104,59 +104,59 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _onUISourceCodeAdded(uiSourceCode) { - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) { + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) { this._filesIndex.addPath(uiSourceCode.url()); this._fileSystemUISourceCodes.set(uiSourceCode.url(), uiSourceCode); this._scheduleSweep(); - } else if (uiSourceCode.project().type() === WebInspector.projectTypes.Network) { + } else if (uiSourceCode.project().type() === Workspace.projectTypes.Network) { this._bindNetwork(uiSourceCode); } } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _onUISourceCodeRemoved(uiSourceCode) { - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) { + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) { this._filesIndex.removePath(uiSourceCode.url()); this._fileSystemUISourceCodes.delete(uiSourceCode.url()); - var binding = uiSourceCode[WebInspector.Automapping._binding]; + var binding = uiSourceCode[Persistence.Automapping._binding]; if (binding) this._unbindNetwork(binding.network); - } else if (uiSourceCode.project().type() === WebInspector.projectTypes.Network) { + } else if (uiSourceCode.project().type() === Workspace.projectTypes.Network) { this._unbindNetwork(uiSourceCode); } } /** - * @param {!WebInspector.UISourceCode} networkSourceCode + * @param {!Workspace.UISourceCode} networkSourceCode */ _bindNetwork(networkSourceCode) { - if (networkSourceCode[WebInspector.Automapping._processingPromise] || - networkSourceCode[WebInspector.Automapping._binding]) + if (networkSourceCode[Persistence.Automapping._processingPromise] || + networkSourceCode[Persistence.Automapping._binding]) return; var createBindingPromise = this._createBinding(networkSourceCode).then(onBinding.bind(this)); - networkSourceCode[WebInspector.Automapping._processingPromise] = createBindingPromise; + networkSourceCode[Persistence.Automapping._processingPromise] = createBindingPromise; /** - * @param {?WebInspector.PersistenceBinding} binding - * @this {WebInspector.Automapping} + * @param {?Persistence.PersistenceBinding} binding + * @this {Persistence.Automapping} */ function onBinding(binding) { - if (networkSourceCode[WebInspector.Automapping._processingPromise] !== createBindingPromise) + if (networkSourceCode[Persistence.Automapping._processingPromise] !== createBindingPromise) return; - networkSourceCode[WebInspector.Automapping._processingPromise] = null; + networkSourceCode[Persistence.Automapping._processingPromise] = null; if (!binding) { this._onBindingFailedForTest(); return; } this._bindings.add(binding); - binding.network[WebInspector.Automapping._binding] = binding; - binding.fileSystem[WebInspector.Automapping._binding] = binding; + binding.network[Persistence.Automapping._binding] = binding; + binding.fileSystem[Persistence.Automapping._binding] = binding; if (binding.exactMatch) { var projectFolder = this._projectFoldersIndex.closestParentFolder(binding.fileSystem.url()); var newFolderAdded = projectFolder ? this._activeFoldersIndex.addFolder(projectFolder) : false; @@ -171,20 +171,20 @@ } /** - * @param {!WebInspector.UISourceCode} networkSourceCode + * @param {!Workspace.UISourceCode} networkSourceCode */ _unbindNetwork(networkSourceCode) { - if (networkSourceCode[WebInspector.Automapping._processingPromise]) { - networkSourceCode[WebInspector.Automapping._processingPromise] = null; + if (networkSourceCode[Persistence.Automapping._processingPromise]) { + networkSourceCode[Persistence.Automapping._processingPromise] = null; return; } - var binding = networkSourceCode[WebInspector.Automapping._binding]; + var binding = networkSourceCode[Persistence.Automapping._binding]; if (!binding) return; this._bindings.delete(binding); - binding.network[WebInspector.Automapping._binding] = null; - binding.fileSystem[WebInspector.Automapping._binding] = null; + binding.network[Persistence.Automapping._binding] = null; + binding.fileSystem[Persistence.Automapping._binding] = null; if (binding.exactMatch) { var projectFolder = this._projectFoldersIndex.closestParentFolder(binding.fileSystem.url()); if (projectFolder) @@ -194,39 +194,39 @@ } /** - * @param {!WebInspector.UISourceCode} networkSourceCode - * @return {!Promise<?WebInspector.PersistenceBinding>} + * @param {!Workspace.UISourceCode} networkSourceCode + * @return {!Promise<?Persistence.PersistenceBinding>} */ _createBinding(networkSourceCode) { if (networkSourceCode.url().startsWith('file://')) { var fileSourceCode = this._fileSystemUISourceCodes.get(networkSourceCode.url()); - var binding = fileSourceCode ? new WebInspector.PersistenceBinding(networkSourceCode, fileSourceCode, false) : null; + var binding = fileSourceCode ? new Persistence.PersistenceBinding(networkSourceCode, fileSourceCode, false) : null; return Promise.resolve(binding); } - var networkPath = WebInspector.ParsedURL.extractPath(networkSourceCode.url()); + var networkPath = Common.ParsedURL.extractPath(networkSourceCode.url()); if (networkPath === null) - return Promise.resolve(/** @type {?WebInspector.PersistenceBinding} */ (null)); + return Promise.resolve(/** @type {?Persistence.PersistenceBinding} */ (null)); if (networkPath.endsWith('/')) networkPath += 'index.html'; var similarFiles = this._filesIndex.similarFiles(networkPath).map(path => this._fileSystemUISourceCodes.get(path)); if (!similarFiles.length) - return Promise.resolve(/** @type {?WebInspector.PersistenceBinding} */ (null)); + return Promise.resolve(/** @type {?Persistence.PersistenceBinding} */ (null)); return this._pullMetadatas(similarFiles.concat(networkSourceCode)).then(onMetadatas.bind(this)); /** - * @this {WebInspector.Automapping} + * @this {Persistence.Automapping} */ function onMetadatas() { var activeFiles = similarFiles.filter(file => !!this._activeFoldersIndex.closestParentFolder(file.url())); - var networkMetadata = networkSourceCode[WebInspector.Automapping._metadata]; + var networkMetadata = networkSourceCode[Persistence.Automapping._metadata]; if (!networkMetadata || (!networkMetadata.modificationTime && typeof networkMetadata.contentSize !== 'number')) { // If networkSourceCode does not have metadata, try to match against active folders. if (activeFiles.length !== 1) return null; - return new WebInspector.PersistenceBinding(networkSourceCode, activeFiles[0], false); + return new Persistence.PersistenceBinding(networkSourceCode, activeFiles[0], false); } // Try to find exact matches, prioritizing active folders. @@ -235,12 +235,12 @@ exactMatches = this._filterWithMetadata(similarFiles, networkMetadata); if (exactMatches.length !== 1) return null; - return new WebInspector.PersistenceBinding(networkSourceCode, exactMatches[0], true); + return new Persistence.PersistenceBinding(networkSourceCode, exactMatches[0], true); } } /** - * @param {!Array<!WebInspector.UISourceCode>} uiSourceCodes + * @param {!Array<!Workspace.UISourceCode>} uiSourceCodes * @return {!Promise} */ _pullMetadatas(uiSourceCodes) { @@ -248,22 +248,22 @@ return Promise.all(promises); /** - * @param {!WebInspector.UISourceCode} file + * @param {!Workspace.UISourceCode} file * @return {!Promise} */ function fetchMetadata(file) { - return file.requestMetadata().then(metadata => file[WebInspector.Automapping._metadata] = metadata); + return file.requestMetadata().then(metadata => file[Persistence.Automapping._metadata] = metadata); } } /** - * @param {!Array<!WebInspector.UISourceCode>} files - * @param {!WebInspector.UISourceCodeMetadata} networkMetadata - * @return {!Array<!WebInspector.UISourceCode>} + * @param {!Array<!Workspace.UISourceCode>} files + * @param {!Workspace.UISourceCodeMetadata} networkMetadata + * @return {!Array<!Workspace.UISourceCode>} */ _filterWithMetadata(files, networkMetadata) { return files.filter(file => { - var fileMetadata = file[WebInspector.Automapping._metadata]; + var fileMetadata = file[Persistence.Automapping._metadata]; if (!fileMetadata) return false; // Allow a second of difference due to network timestamps lack of precision. @@ -275,17 +275,17 @@ } }; -WebInspector.Automapping._binding = Symbol('Automapping.Binding'); -WebInspector.Automapping._processingPromise = Symbol('Automapping.ProcessingPromise'); -WebInspector.Automapping._metadata = Symbol('Automapping.Metadata'); +Persistence.Automapping._binding = Symbol('Automapping.Binding'); +Persistence.Automapping._processingPromise = Symbol('Automapping.ProcessingPromise'); +Persistence.Automapping._metadata = Symbol('Automapping.Metadata'); /** * @unrestricted */ -WebInspector.Automapping.PathEncoder = class { +Persistence.Automapping.PathEncoder = class { constructor() { - /** @type {!WebInspector.CharacterIdMap<string>} */ - this._encoder = new WebInspector.CharacterIdMap(); + /** @type {!Common.CharacterIdMap<string>} */ + this._encoder = new Common.CharacterIdMap(); } /** @@ -308,13 +308,13 @@ /** * @unrestricted */ -WebInspector.Automapping.FilePathIndex = class { +Persistence.Automapping.FilePathIndex = class { /** - * @param {!WebInspector.Automapping.PathEncoder} encoder + * @param {!Persistence.Automapping.PathEncoder} encoder */ constructor(encoder) { this._encoder = encoder; - this._reversedIndex = new WebInspector.Trie(); + this._reversedIndex = new Common.Trie(); } /** @@ -350,13 +350,13 @@ /** * @unrestricted */ -WebInspector.Automapping.FolderIndex = class { +Persistence.Automapping.FolderIndex = class { /** - * @param {!WebInspector.Automapping.PathEncoder} encoder + * @param {!Persistence.Automapping.PathEncoder} encoder */ constructor(encoder) { this._encoder = encoder; - this._index = new WebInspector.Trie(); + this._index = new Common.Trie(); /** @type {!Map<string, number>} */ this._folderCount = new Map(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js b/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js index 186fcca..c7acf11 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js
@@ -4,29 +4,29 @@ /** * @unrestricted */ -WebInspector.DefaultMapping = class { +Persistence.DefaultMapping = class { /** - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.FileSystemMapping} fileSystemMapping - * @param {function(!WebInspector.PersistenceBinding)} onBindingCreated - * @param {function(!WebInspector.PersistenceBinding)} onBindingRemoved + * @param {!Workspace.Workspace} workspace + * @param {!Workspace.FileSystemMapping} fileSystemMapping + * @param {function(!Persistence.PersistenceBinding)} onBindingCreated + * @param {function(!Persistence.PersistenceBinding)} onBindingRemoved */ constructor(workspace, fileSystemMapping, onBindingCreated, onBindingRemoved) { this._workspace = workspace; this._fileSystemMapping = fileSystemMapping; - /** @type {!Set<!WebInspector.PersistenceBinding>} */ + /** @type {!Set<!Persistence.PersistenceBinding>} */ this._bindings = new Set(); this._onBindingCreated = onBindingCreated; this._onBindingRemoved = onBindingRemoved; this._eventListeners = [ - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._onUISourceCodeAdded, this), - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, this._onUISourceCodeRemoved, this), - workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._onProjectRemoved, this), + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._onUISourceCodeAdded, this), + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._onUISourceCodeRemoved, this), + workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._onProjectRemoved, this), this._fileSystemMapping.addEventListener( - WebInspector.FileSystemMapping.Events.FileMappingAdded, this._remap, this), + Workspace.FileSystemMapping.Events.FileMappingAdded, this._remap, this), this._fileSystemMapping.addEventListener( - WebInspector.FileSystemMapping.Events.FileMappingRemoved, this._remap, this) + Workspace.FileSystemMapping.Events.FileMappingRemoved, this._remap, this) ]; this._remap(); } @@ -34,7 +34,7 @@ _remap() { for (var binding of this._bindings.valuesArray()) this._unbind(binding.network); - var networkProjects = this._workspace.projectsForType(WebInspector.projectTypes.Network); + var networkProjects = this._workspace.projectsForType(Workspace.projectTypes.Network); for (var networkProject of networkProjects) { for (var uiSourceCode of networkProject.uiSourceCodes()) this._bind(uiSourceCode); @@ -42,98 +42,98 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onUISourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._bind(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onUISourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._unbind(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onProjectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); for (var uiSourceCode of project.uiSourceCodes()) this._unbind(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.PersistenceBinding} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?Persistence.PersistenceBinding} */ _createBinding(uiSourceCode) { - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) { - var fileSystemPath = WebInspector.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id()); + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) { + var fileSystemPath = Bindings.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id()); var networkURL = this._fileSystemMapping.networkURLForFileSystemURL(fileSystemPath, uiSourceCode.url()); var networkSourceCode = networkURL ? this._workspace.uiSourceCodeForURL(networkURL) : null; - return networkSourceCode ? new WebInspector.PersistenceBinding(networkSourceCode, uiSourceCode, false) : null; + return networkSourceCode ? new Persistence.PersistenceBinding(networkSourceCode, uiSourceCode, false) : null; } - if (uiSourceCode.project().type() === WebInspector.projectTypes.Network) { + if (uiSourceCode.project().type() === Workspace.projectTypes.Network) { var file = this._fileSystemMapping.fileForURL(uiSourceCode.url()); - var projectId = file ? WebInspector.FileSystemWorkspaceBinding.projectId(file.fileSystemPath) : null; + var projectId = file ? Bindings.FileSystemWorkspaceBinding.projectId(file.fileSystemPath) : null; var fileSourceCode = file && projectId ? this._workspace.uiSourceCode(projectId, file.fileURL) : null; - return fileSourceCode ? new WebInspector.PersistenceBinding(uiSourceCode, fileSourceCode, false) : null; + return fileSourceCode ? new Persistence.PersistenceBinding(uiSourceCode, fileSourceCode, false) : null; } return null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _bind(uiSourceCode) { - console.assert(!uiSourceCode[WebInspector.DefaultMapping._binding], 'Cannot bind already bound UISourceCode!'); + console.assert(!uiSourceCode[Persistence.DefaultMapping._binding], 'Cannot bind already bound UISourceCode!'); var binding = this._createBinding(uiSourceCode); if (!binding) return; this._bindings.add(binding); - binding.network[WebInspector.DefaultMapping._binding] = binding; - binding.fileSystem[WebInspector.DefaultMapping._binding] = binding; + binding.network[Persistence.DefaultMapping._binding] = binding; + binding.fileSystem[Persistence.DefaultMapping._binding] = binding; binding.fileSystem.addEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._onFileSystemUISourceCodeRenamed, this); + Workspace.UISourceCode.Events.TitleChanged, this._onFileSystemUISourceCodeRenamed, this); this._onBindingCreated.call(null, binding); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _unbind(uiSourceCode) { - var binding = uiSourceCode[WebInspector.DefaultMapping._binding]; + var binding = uiSourceCode[Persistence.DefaultMapping._binding]; if (!binding) return; this._bindings.delete(binding); - binding.network[WebInspector.DefaultMapping._binding] = null; - binding.fileSystem[WebInspector.DefaultMapping._binding] = null; + binding.network[Persistence.DefaultMapping._binding] = null; + binding.fileSystem[Persistence.DefaultMapping._binding] = null; binding.fileSystem.removeEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._onFileSystemUISourceCodeRenamed, this); + Workspace.UISourceCode.Events.TitleChanged, this._onFileSystemUISourceCodeRenamed, this); this._onBindingRemoved.call(null, binding); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemUISourceCodeRenamed(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); - var binding = uiSourceCode[WebInspector.DefaultMapping._binding]; + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); + var binding = uiSourceCode[Persistence.DefaultMapping._binding]; this._unbind(binding.network); this._bind(binding.network); } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } }; -WebInspector.DefaultMapping._binding = Symbol('DefaultMapping.Binding'); +Persistence.DefaultMapping._binding = Symbol('DefaultMapping.Binding');
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js index 681681e..f6f8cc9 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.Persistence = class extends WebInspector.Object { +Persistence.Persistence = class extends Common.Object { /** - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.BreakpointManager} breakpointManager - * @param {!WebInspector.FileSystemMapping} fileSystemMapping + * @param {!Workspace.Workspace} workspace + * @param {!Bindings.BreakpointManager} breakpointManager + * @param {!Workspace.FileSystemMapping} fileSystemMapping */ constructor(workspace, breakpointManager, fileSystemMapping) { super(); @@ -18,112 +18,112 @@ this._filePathPrefixesToBindingCount = new Map(); if (Runtime.experiments.isEnabled('persistence2')) { - var linkDecorator = new WebInspector.PersistenceUtils.LinkDecorator(this); - WebInspector.Linkifier.setLinkDecorator(linkDecorator); + var linkDecorator = new Persistence.PersistenceUtils.LinkDecorator(this); + Components.Linkifier.setLinkDecorator(linkDecorator); this._mapping = - new WebInspector.Automapping(workspace, this._onBindingCreated.bind(this), this._onBindingRemoved.bind(this)); + new Persistence.Automapping(workspace, this._onBindingCreated.bind(this), this._onBindingRemoved.bind(this)); } else { - this._mapping = new WebInspector.DefaultMapping( + this._mapping = new Persistence.DefaultMapping( workspace, fileSystemMapping, this._onBindingCreated.bind(this), this._onBindingRemoved.bind(this)); } } /** - * @param {!WebInspector.PersistenceBinding} binding + * @param {!Persistence.PersistenceBinding} binding */ _onBindingCreated(binding) { if (binding.network.isDirty()) { - WebInspector.console.log(WebInspector.UIString( + Common.console.log(Common.UIString( '%s can not be persisted to file system due to unsaved changes.', binding.network.name())); return; } if (binding.fileSystem.isDirty()) binding.network.setWorkingCopy(binding.fileSystem.workingCopy()); - binding.network[WebInspector.Persistence._binding] = binding; - binding.fileSystem[WebInspector.Persistence._binding] = binding; + binding.network[Persistence.Persistence._binding] = binding; + binding.fileSystem[Persistence.Persistence._binding] = binding; binding.fileSystem.forceLoadOnCheckContent(); binding.network.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); binding.fileSystem.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); this._addFilePathBindingPrefixes(binding.fileSystem.url()); this._moveBreakpoints(binding.fileSystem, binding.network); - this.dispatchEventToListeners(WebInspector.Persistence.Events.BindingCreated, binding); + this.dispatchEventToListeners(Persistence.Persistence.Events.BindingCreated, binding); } /** - * @param {!WebInspector.PersistenceBinding} binding + * @param {!Persistence.PersistenceBinding} binding */ _onBindingRemoved(binding) { if (binding.network.isDirty()) binding.fileSystem.setWorkingCopy(binding.network.workingCopy()); - binding.network[WebInspector.Persistence._binding] = null; - binding.fileSystem[WebInspector.Persistence._binding] = null; + binding.network[Persistence.Persistence._binding] = null; + binding.fileSystem[Persistence.Persistence._binding] = null; binding.network.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); binding.fileSystem.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); this._removeFilePathBindingPrefixes(binding.fileSystem.url()); this._copyBreakpoints(binding.network, binding.fileSystem); - this.dispatchEventToListeners(WebInspector.Persistence.Events.BindingRemoved, binding); + this.dispatchEventToListeners(Persistence.Persistence.Events.BindingRemoved, binding); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWorkingCopyCommitted(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); - var binding = uiSourceCode[WebInspector.Persistence._binding]; - if (!binding || binding[WebInspector.Persistence._muteCommit]) + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); + var binding = uiSourceCode[Persistence.Persistence._binding]; + if (!binding || binding[Persistence.Persistence._muteCommit]) return; var newContent = /** @type {string} */ (event.data.content); var other = binding.network === uiSourceCode ? binding.fileSystem : binding.network; - var target = WebInspector.NetworkProject.targetForUISourceCode(binding.network); + var target = Bindings.NetworkProject.targetForUISourceCode(binding.network); if (target.isNodeJS()) { other.requestContent().then( currentContent => this._syncNodeJSContent(binding, other, currentContent, newContent)); return; } - binding[WebInspector.Persistence._muteCommit] = true; + binding[Persistence.Persistence._muteCommit] = true; other.addRevision(newContent); - binding[WebInspector.Persistence._muteCommit] = false; + binding[Persistence.Persistence._muteCommit] = false; this._contentSyncedForTest(); } /** - * @param {!WebInspector.PersistenceBinding} binding - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Persistence.PersistenceBinding} binding + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} currentContent * @param {string} newContent */ _syncNodeJSContent(binding, uiSourceCode, currentContent, newContent) { if (uiSourceCode === binding.fileSystem) { - if (newContent.startsWith(WebInspector.Persistence._NodePrefix) && - newContent.endsWith(WebInspector.Persistence._NodeSuffix)) + if (newContent.startsWith(Persistence.Persistence._NodePrefix) && + newContent.endsWith(Persistence.Persistence._NodeSuffix)) newContent = newContent.substring( - WebInspector.Persistence._NodePrefix.length, - newContent.length - WebInspector.Persistence._NodeSuffix.length); - if (currentContent.startsWith(WebInspector.Persistence._NodeShebang)) - newContent = WebInspector.Persistence._NodeShebang + newContent; + Persistence.Persistence._NodePrefix.length, + newContent.length - Persistence.Persistence._NodeSuffix.length); + if (currentContent.startsWith(Persistence.Persistence._NodeShebang)) + newContent = Persistence.Persistence._NodeShebang + newContent; } else { - if (newContent.startsWith(WebInspector.Persistence._NodeShebang)) - newContent = newContent.substring(WebInspector.Persistence._NodeShebang.length); - if (currentContent.startsWith(WebInspector.Persistence._NodePrefix) && - currentContent.endsWith(WebInspector.Persistence._NodeSuffix)) - newContent = WebInspector.Persistence._NodePrefix + newContent + WebInspector.Persistence._NodeSuffix; + if (newContent.startsWith(Persistence.Persistence._NodeShebang)) + newContent = newContent.substring(Persistence.Persistence._NodeShebang.length); + if (currentContent.startsWith(Persistence.Persistence._NodePrefix) && + currentContent.endsWith(Persistence.Persistence._NodeSuffix)) + newContent = Persistence.Persistence._NodePrefix + newContent + Persistence.Persistence._NodeSuffix; } - binding[WebInspector.Persistence._muteCommit] = true; + binding[Persistence.Persistence._muteCommit] = true; uiSourceCode.addRevision(newContent); - binding[WebInspector.Persistence._muteCommit] = false; + binding[Persistence.Persistence._muteCommit] = false; this._contentSyncedForTest(); } @@ -131,8 +131,8 @@ } /** - * @param {!WebInspector.UISourceCode} from - * @param {!WebInspector.UISourceCode} to + * @param {!Workspace.UISourceCode} from + * @param {!Workspace.UISourceCode} to */ _moveBreakpoints(from, to) { var breakpoints = this._breakpointManager.breakpointsForUISourceCode(from); @@ -144,8 +144,8 @@ } /** - * @param {!WebInspector.UISourceCode} from - * @param {!WebInspector.UISourceCode} to + * @param {!Workspace.UISourceCode} from + * @param {!Workspace.UISourceCode} to */ _copyBreakpoints(from, to) { var breakpoints = this._breakpointManager.breakpointsForUISourceCode(from); @@ -155,32 +155,32 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ hasUnsavedCommittedChanges(uiSourceCode) { if (this._workspace.hasResourceContentTrackingExtensions()) return false; - if (uiSourceCode.url() && WebInspector.fileManager.isURLSaved(uiSourceCode.url())) + if (uiSourceCode.url() && Workspace.fileManager.isURLSaved(uiSourceCode.url())) return false; if (uiSourceCode.project().canSetFileContent()) return false; - if (uiSourceCode[WebInspector.Persistence._binding]) + if (uiSourceCode[Persistence.Persistence._binding]) return false; return !!uiSourceCode.history.length; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.PersistenceBinding} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?Persistence.PersistenceBinding} */ binding(uiSourceCode) { - return uiSourceCode[WebInspector.Persistence._binding] || null; + return uiSourceCode[Persistence.Persistence._binding] || null; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.UISourceCode} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?Workspace.UISourceCode} */ fileSystem(uiSourceCode) { var binding = this.binding(uiSourceCode); @@ -229,14 +229,14 @@ } }; -WebInspector.Persistence._binding = Symbol('Persistence.Binding'); -WebInspector.Persistence._muteCommit = Symbol('Persistence.MuteCommit'); +Persistence.Persistence._binding = Symbol('Persistence.Binding'); +Persistence.Persistence._muteCommit = Symbol('Persistence.MuteCommit'); -WebInspector.Persistence._NodePrefix = '(function (exports, require, module, __filename, __dirname) { '; -WebInspector.Persistence._NodeSuffix = '\n});'; -WebInspector.Persistence._NodeShebang = '#!/usr/bin/env node\n'; +Persistence.Persistence._NodePrefix = '(function (exports, require, module, __filename, __dirname) { '; +Persistence.Persistence._NodeSuffix = '\n});'; +Persistence.Persistence._NodeShebang = '#!/usr/bin/env node\n'; -WebInspector.Persistence.Events = { +Persistence.Persistence.Events = { BindingCreated: Symbol('BindingCreated'), BindingRemoved: Symbol('BindingRemoved') }; @@ -244,10 +244,10 @@ /** * @unrestricted */ -WebInspector.PersistenceBinding = class { +Persistence.PersistenceBinding = class { /** - * @param {!WebInspector.UISourceCode} network - * @param {!WebInspector.UISourceCode} fileSystem + * @param {!Workspace.UISourceCode} network + * @param {!Workspace.UISourceCode} fileSystem * @param {boolean} exactMatch */ constructor(network, fileSystem, exactMatch) { @@ -257,5 +257,5 @@ } }; -/** @type {!WebInspector.Persistence} */ -WebInspector.persistence; +/** @type {!Persistence.Persistence} */ +Persistence.persistence;
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js index 5c33fab..c69504b 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
@@ -2,56 +2,56 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -WebInspector.PersistenceUtils = class { +Persistence.PersistenceUtils = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ static tooltipForUISourceCode(uiSourceCode) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (!binding) return ''; if (uiSourceCode === binding.network) - return WebInspector.UIString('Persisted to file system: %s', binding.fileSystem.url().trimMiddle(150)); + return Common.UIString('Persisted to file system: %s', binding.fileSystem.url().trimMiddle(150)); if (binding.network.contentType().isFromSourceMap()) - return WebInspector.UIString('Linked to source map: %s', binding.network.url().trimMiddle(150)); - return WebInspector.UIString('Linked to %s', binding.network.url().trimMiddle(150)); + return Common.UIString('Linked to source map: %s', binding.network.url().trimMiddle(150)); + return Common.UIString('Linked to %s', binding.network.url().trimMiddle(150)); } }; /** - * @extends {WebInspector.Object} - * @implements {WebInspector.LinkDecorator} + * @extends {Common.Object} + * @implements {Components.LinkDecorator} */ -WebInspector.PersistenceUtils.LinkDecorator = class extends WebInspector.Object { +Persistence.PersistenceUtils.LinkDecorator = class extends Common.Object { /** - * @param {!WebInspector.Persistence} persistence + * @param {!Persistence.Persistence} persistence */ constructor(persistence) { super(); - persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._bindingChanged, this); - persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._bindingChanged, this); + persistence.addEventListener(Persistence.Persistence.Events.BindingCreated, this._bindingChanged, this); + persistence.addEventListener(Persistence.Persistence.Events.BindingRemoved, this._bindingChanged, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _bindingChanged(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data); - this.dispatchEventToListeners(WebInspector.LinkDecorator.Events.LinkIconChanged, binding.network); + var binding = /** @type {!Persistence.PersistenceBinding} */(event.data); + this.dispatchEventToListeners(Components.LinkDecorator.Events.LinkIconChanged, binding.network); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.Icon} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?UI.Icon} */ linkIcon(uiSourceCode) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (!binding) return null; - var icon = WebInspector.Icon.create('smallicon-green-checkmark'); - icon.title = WebInspector.PersistenceUtils.tooltipForUISourceCode(uiSourceCode); + var icon = UI.Icon.create('smallicon-green-checkmark'); + icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(uiSourceCode); return icon; } }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/BottomUpProfileDataGrid.js b/third_party/WebKit/Source/devtools/front_end/profiler/BottomUpProfileDataGrid.js index 80a11c3..9bf39dd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/BottomUpProfileDataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/BottomUpProfileDataGrid.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.BottomUpProfileDataGridNode = class extends WebInspector.ProfileDataGridNode { +Profiler.BottomUpProfileDataGridNode = class extends Profiler.ProfileDataGridNode { /** - * @param {!WebInspector.ProfileNode} profileNode - * @param {!WebInspector.TopDownProfileDataGridTree} owningTree + * @param {!SDK.ProfileNode} profileNode + * @param {!Profiler.TopDownProfileDataGridTree} owningTree */ constructor(profileNode, owningTree) { super(profileNode, owningTree, !!profileNode.parent && !!profileNode.parent.parent); @@ -42,7 +42,7 @@ } /** - * @param {!WebInspector.BottomUpProfileDataGridNode|!WebInspector.BottomUpProfileDataGridTree} container + * @param {!Profiler.BottomUpProfileDataGridNode|!Profiler.BottomUpProfileDataGridTree} container */ static _sharedPopulate(container) { var remainingNodeInfos = container._remainingNodeInfos; @@ -65,8 +65,8 @@ } else { // If not, add it as a true ancestor. // In heavy mode, we take our visual identity from ancestor node... - child = new WebInspector.BottomUpProfileDataGridNode( - ancestor, /** @type {!WebInspector.TopDownProfileDataGridTree} */ (container.tree)); + child = new Profiler.BottomUpProfileDataGridNode( + ancestor, /** @type {!Profiler.TopDownProfileDataGridTree} */ (container.tree)); if (ancestor !== focusNode) { // But the actual statistics from the "root" node (bottom of the callstack). @@ -88,7 +88,7 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode */ _takePropertiesFromProfileDataGridNode(profileDataGridNode) { this.save(); @@ -98,7 +98,7 @@ /** * When focusing, we keep just the members of the callstack. - * @param {!WebInspector.ProfileDataGridNode} child + * @param {!Profiler.ProfileDataGridNode} child */ _keepOnlyChild(child) { this.save(); @@ -140,7 +140,7 @@ /** * @override - * @param {!WebInspector.ProfileDataGridNode} child + * @param {!Profiler.ProfileDataGridNode} child * @param {boolean} shouldAbsorb */ merge(child, shouldAbsorb) { @@ -152,7 +152,7 @@ * @override */ populateChildren() { - WebInspector.BottomUpProfileDataGridNode._sharedPopulate(this); + Profiler.BottomUpProfileDataGridNode._sharedPopulate(this); } _willHaveChildren(profileNode) { @@ -166,11 +166,11 @@ /** * @unrestricted */ -WebInspector.BottomUpProfileDataGridTree = class extends WebInspector.ProfileDataGridTree { +Profiler.BottomUpProfileDataGridTree = class extends Profiler.ProfileDataGridTree { /** - * @param {!WebInspector.ProfileDataGridNode.Formatter} formatter - * @param {!WebInspector.SearchableView} searchableView - * @param {!WebInspector.ProfileNode} rootProfileNode + * @param {!Profiler.ProfileDataGridNode.Formatter} formatter + * @param {!UI.SearchableView} searchableView + * @param {!SDK.ProfileNode} rootProfileNode * @param {number} total */ constructor(formatter, searchableView, rootProfileNode, total) { @@ -230,14 +230,14 @@ } // Populate the top level nodes. - WebInspector.ProfileDataGridNode.populate(this); + Profiler.ProfileDataGridNode.populate(this); return this; } /** * When focusing, we keep the entire callstack up to this ancestor. - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode */ focus(profileDataGridNode) { if (!profileDataGridNode) @@ -248,13 +248,13 @@ var currentNode = profileDataGridNode; var focusNode = profileDataGridNode; - while (currentNode.parent && (currentNode instanceof WebInspector.ProfileDataGridNode)) { + while (currentNode.parent && (currentNode instanceof Profiler.ProfileDataGridNode)) { currentNode._takePropertiesFromProfileDataGridNode(profileDataGridNode); focusNode = currentNode; currentNode = currentNode.parent; - if (currentNode instanceof WebInspector.ProfileDataGridNode) + if (currentNode instanceof Profiler.ProfileDataGridNode) currentNode._keepOnlyChild(focusNode); } @@ -263,7 +263,7 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode */ exclude(profileDataGridNode) { if (!profileDataGridNode) @@ -291,7 +291,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -315,6 +315,6 @@ * @override */ populateChildren() { - WebInspector.BottomUpProfileDataGridNode._sharedPopulate(this); + Profiler.BottomUpProfileDataGridNode._sharedPopulate(this); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js index c5930e3..4481a4d3 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileFlameChart.js
@@ -29,33 +29,33 @@ */ /** - * @implements {WebInspector.FlameChartDataProvider} + * @implements {UI.FlameChartDataProvider} * @unrestricted */ -WebInspector.ProfileFlameChartDataProvider = class { +Profiler.ProfileFlameChartDataProvider = class { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ constructor(target) { - WebInspector.FlameChartDataProvider.call(this); + UI.FlameChartDataProvider.call(this); this._target = target; - this._colorGenerator = WebInspector.ProfileFlameChartDataProvider.colorGenerator(); + this._colorGenerator = Profiler.ProfileFlameChartDataProvider.colorGenerator(); } /** - * @return {!WebInspector.FlameChart.ColorGenerator} + * @return {!UI.FlameChart.ColorGenerator} */ static colorGenerator() { - if (!WebInspector.ProfileFlameChartDataProvider._colorGenerator) { - var colorGenerator = new WebInspector.FlameChart.ColorGenerator( + if (!Profiler.ProfileFlameChartDataProvider._colorGenerator) { + var colorGenerator = new UI.FlameChart.ColorGenerator( {min: 30, max: 330}, {min: 50, max: 80, count: 5}, {min: 80, max: 90, count: 3}); colorGenerator.setColorForID('(idle)', 'hsl(0, 0%, 94%)'); colorGenerator.setColorForID('(program)', 'hsl(0, 0%, 80%)'); colorGenerator.setColorForID('(garbage collector)', 'hsl(0, 0%, 80%)'); - WebInspector.ProfileFlameChartDataProvider._colorGenerator = colorGenerator; + Profiler.ProfileFlameChartDataProvider._colorGenerator = colorGenerator; } - return WebInspector.ProfileFlameChartDataProvider._colorGenerator; + return Profiler.ProfileFlameChartDataProvider._colorGenerator; } /** @@ -118,14 +118,14 @@ /** * @override - * @return {?WebInspector.FlameChart.TimelineData} + * @return {?UI.FlameChart.TimelineData} */ timelineData() { return this._timelineData || this._calculateTimelineData(); } /** - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ _calculateTimelineData() { throw 'Not implemented.'; @@ -156,7 +156,7 @@ */ entryTitle(entryIndex) { var node = this._entryNodes[entryIndex]; - return WebInspector.beautifyFunctionName(node.functionName); + return UI.beautifyFunctionName(node.functionName); } /** @@ -166,7 +166,7 @@ */ entryFont(entryIndex) { if (!this._font) { - this._font = (this.barHeight() - 4) + 'px ' + WebInspector.fontFamily(); + this._font = (this.barHeight() - 4) + 'px ' + Host.fontFamily(); this._boldFont = 'bold ' + this._font; } var node = this._entryNodes[entryIndex]; @@ -229,26 +229,26 @@ /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.CPUProfileFlameChart = class extends WebInspector.VBox { +Profiler.CPUProfileFlameChart = class extends UI.VBox { /** - * @param {!WebInspector.SearchableView} searchableView - * @param {!WebInspector.FlameChartDataProvider} dataProvider + * @param {!UI.SearchableView} searchableView + * @param {!UI.FlameChartDataProvider} dataProvider */ constructor(searchableView, dataProvider) { super(); this.element.id = 'cpu-flame-chart'; this._searchableView = searchableView; - this._overviewPane = new WebInspector.CPUProfileFlameChart.OverviewPane(dataProvider); + this._overviewPane = new Profiler.CPUProfileFlameChart.OverviewPane(dataProvider); this._overviewPane.show(this.element); - this._mainPane = new WebInspector.FlameChart(dataProvider, this._overviewPane); + this._mainPane = new UI.FlameChart(dataProvider, this._overviewPane); this._mainPane.show(this.element); - this._mainPane.addEventListener(WebInspector.FlameChart.Events.EntrySelected, this._onEntrySelected, this); - this._overviewPane.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); + this._mainPane.addEventListener(UI.FlameChart.Events.EntrySelected, this._onEntrySelected, this); + this._overviewPane.addEventListener(UI.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); this._dataProvider = dataProvider; this._searchResults = []; } @@ -261,7 +261,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWindowChanged(event) { var windowLeft = event.data.windowTimeLeft; @@ -278,10 +278,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onEntrySelected(event) { - this.dispatchEventToListeners(WebInspector.FlameChart.Events.EntrySelected, event.data); + this.dispatchEventToListeners(UI.FlameChart.Events.EntrySelected, event.data); } update() { @@ -291,7 +291,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -363,10 +363,10 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.CPUProfileFlameChart.OverviewCalculator = class { +Profiler.CPUProfileFlameChart.OverviewCalculator = class { constructor(dataProvider) { this._dataProvider = dataProvider; } @@ -380,7 +380,7 @@ } /** - * @param {!WebInspector.CPUProfileFlameChart.OverviewPane} overviewPane + * @param {!Profiler.CPUProfileFlameChart.OverviewPane} overviewPane */ _updateBoundaries(overviewPane) { this._minimumBoundaries = overviewPane._dataProvider.minimumBoundary(); @@ -442,24 +442,24 @@ }; /** - * @implements {WebInspector.FlameChartDelegate} + * @implements {UI.FlameChartDelegate} * @unrestricted */ -WebInspector.CPUProfileFlameChart.OverviewPane = class extends WebInspector.VBox { +Profiler.CPUProfileFlameChart.OverviewPane = class extends UI.VBox { /** - * @param {!WebInspector.FlameChartDataProvider} dataProvider + * @param {!UI.FlameChartDataProvider} dataProvider */ constructor(dataProvider) { super(); this.element.classList.add('cpu-profile-flame-chart-overview-pane'); this._overviewContainer = this.element.createChild('div', 'cpu-profile-flame-chart-overview-container'); - this._overviewGrid = new WebInspector.OverviewGrid('cpu-profile-flame-chart'); + this._overviewGrid = new UI.OverviewGrid('cpu-profile-flame-chart'); this._overviewGrid.element.classList.add('fill'); this._overviewCanvas = this._overviewContainer.createChild('canvas', 'cpu-profile-flame-chart-overview-canvas'); this._overviewContainer.appendChild(this._overviewGrid.element); - this._overviewCalculator = new WebInspector.CPUProfileFlameChart.OverviewCalculator(dataProvider); + this._overviewCalculator = new Profiler.CPUProfileFlameChart.OverviewCalculator(dataProvider); this._dataProvider = dataProvider; - this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); + this._overviewGrid.addEventListener(UI.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); } /** @@ -490,7 +490,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWindowChanged(event) { var startTime = this._dataProvider.minimumBoundary(); @@ -499,11 +499,11 @@ windowTimeLeft: startTime + this._overviewGrid.windowLeft() * totalTime, windowTimeRight: startTime + this._overviewGrid.windowRight() * totalTime }; - this.dispatchEventToListeners(WebInspector.OverviewGrid.Events.WindowChanged, data); + this.dispatchEventToListeners(UI.OverviewGrid.Events.WindowChanged, data); } /** - * @return {?WebInspector.FlameChart.TimelineData} + * @return {?UI.FlameChart.TimelineData} */ _timelineData() { return this._dataProvider.timelineData(); @@ -529,7 +529,7 @@ return; this._resetCanvas( this._overviewContainer.clientWidth, - this._overviewContainer.clientHeight - WebInspector.FlameChart.DividersBarHeight); + this._overviewContainer.clientHeight - UI.FlameChart.DividersBarHeight); this._overviewCalculator._updateBoundaries(this); this._overviewGrid.updateDividers(this._overviewCalculator); this._drawOverviewCanvas();
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js index 30919c2bd..3627ff82 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
@@ -23,20 +23,20 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.CPUProfileView = class extends WebInspector.ProfileView { +Profiler.CPUProfileView = class extends Profiler.ProfileView { /** - * @param {!WebInspector.CPUProfileHeader} profileHeader + * @param {!Profiler.CPUProfileHeader} profileHeader */ constructor(profileHeader) { super(); this._profileHeader = profileHeader; - this.profile = new WebInspector.CPUProfileDataModel(profileHeader._profile || profileHeader.protocolProfile()); + this.profile = new SDK.CPUProfileDataModel(profileHeader._profile || profileHeader.protocolProfile()); this.adjustedTotal = this.profile.profileHead.total; this.adjustedTotal -= this.profile.idleNode ? this.profile.idleNode.total : 0; - this.initialize(new WebInspector.CPUProfileView.NodeFormatter(this)); + this.initialize(new Profiler.CPUProfileView.NodeFormatter(this)); } /** @@ -44,7 +44,7 @@ */ wasShown() { super.wasShown(); - var lineLevelProfile = WebInspector.LineLevelProfile.instance(); + var lineLevelProfile = Components.LineLevelProfile.instance(); lineLevelProfile.reset(); lineLevelProfile.appendCPUProfile(this.profile); } @@ -57,39 +57,39 @@ columnHeader(columnId) { switch (columnId) { case 'self': - return WebInspector.UIString('Self Time'); + return Common.UIString('Self Time'); case 'total': - return WebInspector.UIString('Total Time'); + return Common.UIString('Total Time'); } return ''; } /** * @override - * @return {!WebInspector.FlameChartDataProvider} + * @return {!UI.FlameChartDataProvider} */ createFlameChartDataProvider() { - return new WebInspector.CPUFlameChartDataProvider(this.profile, this._profileHeader.target()); + return new Profiler.CPUFlameChartDataProvider(this.profile, this._profileHeader.target()); } }; /** * @unrestricted */ -WebInspector.CPUProfileType = class extends WebInspector.ProfileType { +Profiler.CPUProfileType = class extends Profiler.ProfileType { constructor() { - super(WebInspector.CPUProfileType.TypeId, WebInspector.UIString('Record JavaScript CPU Profile')); + super(Profiler.CPUProfileType.TypeId, Common.UIString('Record JavaScript CPU Profile')); this._recording = false; this._nextAnonymousConsoleProfileNumber = 1; this._anonymousConsoleProfileIdToTitle = {}; - WebInspector.CPUProfileType.instance = this; - WebInspector.targetManager.addModelListener( - WebInspector.CPUProfilerModel, WebInspector.CPUProfilerModel.Events.ConsoleProfileStarted, + Profiler.CPUProfileType.instance = this; + SDK.targetManager.addModelListener( + SDK.CPUProfilerModel, SDK.CPUProfilerModel.Events.ConsoleProfileStarted, this._consoleProfileStarted, this); - WebInspector.targetManager.addModelListener( - WebInspector.CPUProfilerModel, WebInspector.CPUProfilerModel.Events.ConsoleProfileFinished, + SDK.targetManager.addModelListener( + SDK.CPUProfilerModel, SDK.CPUProfilerModel.Events.ConsoleProfileFinished, this._consoleProfileFinished, this); } @@ -110,7 +110,7 @@ } get buttonTooltip() { - return this._recording ? WebInspector.UIString('Stop CPU profiling') : WebInspector.UIString('Start CPU profiling'); + return this._recording ? Common.UIString('Stop CPU profiling') : Common.UIString('Start CPU profiling'); } /** @@ -128,58 +128,58 @@ } get treeItemTitle() { - return WebInspector.UIString('CPU PROFILES'); + return Common.UIString('CPU PROFILES'); } get description() { - return WebInspector.UIString( + return Common.UIString( 'CPU profiles show where the execution time is spent in your page\'s JavaScript functions.'); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _consoleProfileStarted(event) { - var data = /** @type {!WebInspector.CPUProfilerModel.EventData} */ (event.data); + var data = /** @type {!SDK.CPUProfilerModel.EventData} */ (event.data); var resolvedTitle = data.title; if (!resolvedTitle) { - resolvedTitle = WebInspector.UIString('Profile %s', this._nextAnonymousConsoleProfileNumber++); + resolvedTitle = Common.UIString('Profile %s', this._nextAnonymousConsoleProfileNumber++); this._anonymousConsoleProfileIdToTitle[data.id] = resolvedTitle; } this._addMessageToConsole( - WebInspector.ConsoleMessage.MessageType.Profile, data.scriptLocation, - WebInspector.UIString('Profile \'%s\' started.', resolvedTitle)); + SDK.ConsoleMessage.MessageType.Profile, data.scriptLocation, + Common.UIString('Profile \'%s\' started.', resolvedTitle)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _consoleProfileFinished(event) { - var data = /** @type {!WebInspector.CPUProfilerModel.EventData} */ (event.data); + var data = /** @type {!SDK.CPUProfilerModel.EventData} */ (event.data); var cpuProfile = /** @type {!Protocol.Profiler.Profile} */ (data.cpuProfile); var resolvedTitle = data.title; if (typeof resolvedTitle === 'undefined') { resolvedTitle = this._anonymousConsoleProfileIdToTitle[data.id]; delete this._anonymousConsoleProfileIdToTitle[data.id]; } - var profile = new WebInspector.CPUProfileHeader(data.scriptLocation.target(), this, resolvedTitle); + var profile = new Profiler.CPUProfileHeader(data.scriptLocation.target(), this, resolvedTitle); profile.setProtocolProfile(cpuProfile); this.addProfile(profile); this._addMessageToConsole( - WebInspector.ConsoleMessage.MessageType.ProfileEnd, data.scriptLocation, - WebInspector.UIString('Profile \'%s\' finished.', resolvedTitle)); + SDK.ConsoleMessage.MessageType.ProfileEnd, data.scriptLocation, + Common.UIString('Profile \'%s\' finished.', resolvedTitle)); } /** * @param {string} type - * @param {!WebInspector.DebuggerModel.Location} scriptLocation + * @param {!SDK.DebuggerModel.Location} scriptLocation * @param {string} messageText */ _addMessageToConsole(type, scriptLocation, messageText) { var script = scriptLocation.script(); var target = scriptLocation.target(); - var message = new WebInspector.ConsoleMessage( - target, WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, WebInspector.ConsoleMessage.MessageLevel.Debug, + var message = new SDK.ConsoleMessage( + target, SDK.ConsoleMessage.MessageSource.ConsoleAPI, SDK.ConsoleMessage.MessageLevel.Debug, messageText, type, undefined, undefined, undefined, undefined, [{ functionName: '', scriptId: scriptLocation.scriptId, @@ -192,14 +192,14 @@ } startRecordingProfile() { - var target = WebInspector.context.flavor(WebInspector.Target); + var target = UI.context.flavor(SDK.Target); if (this._profileBeingRecorded || !target) return; - var profile = new WebInspector.CPUProfileHeader(target, this); + var profile = new Profiler.CPUProfileHeader(target, this); this.setProfileBeingRecorded(profile); - WebInspector.targetManager.suspendAllTargets(); + SDK.targetManager.suspendAllTargets(); this.addProfile(profile); - profile.updateStatus(WebInspector.UIString('Recording\u2026')); + profile.updateStatus(Common.UIString('Recording\u2026')); this._recording = true; target.cpuProfilerModel.startRecording(); } @@ -213,7 +213,7 @@ /** * @param {?Protocol.Profiler.Profile} profile - * @this {WebInspector.CPUProfileType} + * @this {Profiler.CPUProfileType} */ function didStopProfiling(profile) { if (!this._profileBeingRecorded) @@ -226,26 +226,26 @@ } /** - * @this {WebInspector.CPUProfileType} + * @this {Profiler.CPUProfileType} */ function fireEvent() { - this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, recordedProfile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete, recordedProfile); } this._profileBeingRecorded.target() .cpuProfilerModel.stopRecording() .then(didStopProfiling.bind(this)) - .then(WebInspector.targetManager.resumeAllTargets.bind(WebInspector.targetManager)) + .then(SDK.targetManager.resumeAllTargets.bind(SDK.targetManager)) .then(fireEvent.bind(this)); } /** * @override * @param {string} title - * @return {!WebInspector.ProfileHeader} + * @return {!Profiler.ProfileHeader} */ createProfileLoadedFromFile(title) { - return new WebInspector.CPUProfileHeader(null, this, title); + return new Profiler.CPUProfileHeader(null, this, title); } /** @@ -256,15 +256,15 @@ } }; -WebInspector.CPUProfileType.TypeId = 'CPU'; +Profiler.CPUProfileType.TypeId = 'CPU'; /** * @unrestricted */ -WebInspector.CPUProfileHeader = class extends WebInspector.WritableProfileHeader { +Profiler.CPUProfileHeader = class extends Profiler.WritableProfileHeader { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.CPUProfileType} type + * @param {?SDK.Target} target + * @param {!Profiler.CPUProfileType} type * @param {string=} title */ constructor(target, type, title) { @@ -273,10 +273,10 @@ /** * @override - * @return {!WebInspector.ProfileView} + * @return {!Profiler.ProfileView} */ createView() { - return new WebInspector.CPUProfileView(this); + return new Profiler.CPUProfileView(this); } /** @@ -288,10 +288,10 @@ }; /** - * @implements {WebInspector.ProfileDataGridNode.Formatter} + * @implements {Profiler.ProfileDataGridNode.Formatter} * @unrestricted */ -WebInspector.CPUProfileView.NodeFormatter = class { +Profiler.CPUProfileView.NodeFormatter = class { constructor(profileView) { this._profileView = profileView; } @@ -302,22 +302,22 @@ * @return {string} */ formatValue(value) { - return WebInspector.UIString('%.1f\u2009ms', value); + return Common.UIString('%.1f\u2009ms', value); } /** * @override * @param {number} value - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {string} */ formatPercent(value, node) { - return node.profileNode === this._profileView.profile.idleNode ? '' : WebInspector.UIString('%.2f\u2009%%', value); + return node.profileNode === this._profileView.profile.idleNode ? '' : Common.UIString('%.2f\u2009%%', value); } /** * @override - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {?Element} */ linkifyNode(node) { @@ -329,10 +329,10 @@ /** * @unrestricted */ -WebInspector.CPUFlameChartDataProvider = class extends WebInspector.ProfileFlameChartDataProvider { +Profiler.CPUFlameChartDataProvider = class extends Profiler.ProfileFlameChartDataProvider { /** - * @param {!WebInspector.CPUProfileDataModel} cpuProfile - * @param {?WebInspector.Target} target + * @param {!SDK.CPUProfileDataModel} cpuProfile + * @param {?SDK.Target} target */ constructor(cpuProfile, target) { super(target); @@ -341,10 +341,10 @@ /** * @override - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ _calculateTimelineData() { - /** @type {!Array.<?WebInspector.CPUFlameChartDataProvider.ChartEntry>} */ + /** @type {!Array.<?Profiler.CPUFlameChartDataProvider.ChartEntry>} */ var entries = []; /** @type {!Array.<number>} */ var stack = []; @@ -358,7 +358,7 @@ } /** * @param {number} depth - * @param {!WebInspector.CPUProfileNode} node + * @param {!SDK.CPUProfileNode} node * @param {number} startTime * @param {number} totalTime * @param {number} selfTime @@ -366,12 +366,12 @@ function onCloseFrame(depth, node, startTime, totalTime, selfTime) { var index = stack.pop(); entries[index] = - new WebInspector.CPUFlameChartDataProvider.ChartEntry(depth, totalTime, startTime, selfTime, node); + new Profiler.CPUFlameChartDataProvider.ChartEntry(depth, totalTime, startTime, selfTime, node); maxDepth = Math.max(maxDepth, depth); } this._cpuProfile.forEachFrame(onOpenFrame, onCloseFrame); - /** @type {!Array<!WebInspector.CPUProfileNode>} */ + /** @type {!Array<!SDK.CPUProfileNode>} */ var entryNodes = new Array(entries.length); var entryLevels = new Uint16Array(entries.length); var entryTotalTimes = new Float32Array(entries.length); @@ -390,9 +390,9 @@ this._maxStackDepth = maxDepth; - this._timelineData = new WebInspector.FlameChart.TimelineData(entryLevels, entryTotalTimes, entryStartTimes, null); + this._timelineData = new UI.FlameChart.TimelineData(entryLevels, entryTotalTimes, entryStartTimes, null); - /** @type {!Array<!WebInspector.CPUProfileNode>} */ + /** @type {!Array<!SDK.CPUProfileNode>} */ this._entryNodes = entryNodes; this._entrySelfTimes = entrySelfTimes; @@ -426,39 +426,39 @@ if (ms === 0) return '0'; if (ms < 1000) - return WebInspector.UIString('%.1f\u2009ms', ms); + return Common.UIString('%.1f\u2009ms', ms); return Number.secondsToString(ms / 1000, true); } - var name = WebInspector.beautifyFunctionName(node.functionName); - pushEntryInfoRow(WebInspector.UIString('Name'), name); + var name = UI.beautifyFunctionName(node.functionName); + pushEntryInfoRow(Common.UIString('Name'), name); var selfTime = millisecondsToString(this._entrySelfTimes[entryIndex]); var totalTime = millisecondsToString(timelineData.entryTotalTimes[entryIndex]); - pushEntryInfoRow(WebInspector.UIString('Self time'), selfTime); - pushEntryInfoRow(WebInspector.UIString('Total time'), totalTime); - var linkifier = new WebInspector.Linkifier(); + pushEntryInfoRow(Common.UIString('Self time'), selfTime); + pushEntryInfoRow(Common.UIString('Total time'), totalTime); + var linkifier = new Components.Linkifier(); var link = linkifier.maybeLinkifyConsoleCallFrame(this._target, node.callFrame); if (link) - pushEntryInfoRow(WebInspector.UIString('URL'), link.textContent); + pushEntryInfoRow(Common.UIString('URL'), link.textContent); linkifier.dispose(); - pushEntryInfoRow(WebInspector.UIString('Aggregated self time'), Number.secondsToString(node.self / 1000, true)); - pushEntryInfoRow(WebInspector.UIString('Aggregated total time'), Number.secondsToString(node.total / 1000, true)); + pushEntryInfoRow(Common.UIString('Aggregated self time'), Number.secondsToString(node.self / 1000, true)); + pushEntryInfoRow(Common.UIString('Aggregated total time'), Number.secondsToString(node.total / 1000, true)); if (node.deoptReason) - pushEntryInfoRow(WebInspector.UIString('Not optimized'), node.deoptReason); + pushEntryInfoRow(Common.UIString('Not optimized'), node.deoptReason); - return WebInspector.ProfileView.buildPopoverTable(entryInfo); + return Profiler.ProfileView.buildPopoverTable(entryInfo); } }; /** * @unrestricted */ -WebInspector.CPUFlameChartDataProvider.ChartEntry = class { +Profiler.CPUFlameChartDataProvider.ChartEntry = class { /** * @param {number} depth * @param {number} duration * @param {number} startTime * @param {number} selfTime - * @param {!WebInspector.CPUProfileNode} node + * @param {!SDK.CPUProfileNode} node */ constructor(depth, duration, startTime, selfTime, node) { this.depth = depth;
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js index a5f6eaf..10b5034d 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
@@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.HeapProfileView = class extends WebInspector.ProfileView { +Profiler.HeapProfileView = class extends Profiler.ProfileView { /** - * @param {!WebInspector.SamplingHeapProfileHeader} profileHeader + * @param {!Profiler.SamplingHeapProfileHeader} profileHeader */ constructor(profileHeader) { super(); this._profileHeader = profileHeader; - this.profile = new WebInspector.SamplingHeapProfileModel(profileHeader._profile || profileHeader.protocolProfile()); + this.profile = new Profiler.SamplingHeapProfileModel(profileHeader._profile || profileHeader.protocolProfile()); this.adjustedTotal = this.profile.total; var views = [ - WebInspector.ProfileView.ViewTypes.Flame, WebInspector.ProfileView.ViewTypes.Heavy, - WebInspector.ProfileView.ViewTypes.Tree + Profiler.ProfileView.ViewTypes.Flame, Profiler.ProfileView.ViewTypes.Heavy, + Profiler.ProfileView.ViewTypes.Tree ]; - this.initialize(new WebInspector.HeapProfileView.NodeFormatter(this), views); + this.initialize(new Profiler.HeapProfileView.NodeFormatter(this), views); } /** @@ -29,30 +29,30 @@ columnHeader(columnId) { switch (columnId) { case 'self': - return WebInspector.UIString('Self Size (bytes)'); + return Common.UIString('Self Size (bytes)'); case 'total': - return WebInspector.UIString('Total Size (bytes)'); + return Common.UIString('Total Size (bytes)'); } return ''; } /** * @override - * @return {!WebInspector.FlameChartDataProvider} + * @return {!UI.FlameChartDataProvider} */ createFlameChartDataProvider() { - return new WebInspector.HeapFlameChartDataProvider(this.profile, this._profileHeader.target()); + return new Profiler.HeapFlameChartDataProvider(this.profile, this._profileHeader.target()); } }; /** * @unrestricted */ -WebInspector.SamplingHeapProfileType = class extends WebInspector.ProfileType { +Profiler.SamplingHeapProfileType = class extends Profiler.ProfileType { constructor() { - super(WebInspector.SamplingHeapProfileType.TypeId, WebInspector.UIString('Record Allocation Profile')); + super(Profiler.SamplingHeapProfileType.TypeId, Common.UIString('Record Allocation Profile')); this._recording = false; - WebInspector.SamplingHeapProfileType.instance = this; + Profiler.SamplingHeapProfileType.instance = this; } /** @@ -72,8 +72,8 @@ } get buttonTooltip() { - return this._recording ? WebInspector.UIString('Stop heap profiling') : - WebInspector.UIString('Start heap profiling'); + return this._recording ? Common.UIString('Stop heap profiling') : + Common.UIString('Start heap profiling'); } /** @@ -90,22 +90,22 @@ } get treeItemTitle() { - return WebInspector.UIString('ALLOCATION PROFILES'); + return Common.UIString('ALLOCATION PROFILES'); } get description() { - return WebInspector.UIString('Allocation profiles show memory allocations from your JavaScript functions.'); + return Common.UIString('Allocation profiles show memory allocations from your JavaScript functions.'); } startRecordingProfile() { - var target = WebInspector.context.flavor(WebInspector.Target); + var target = UI.context.flavor(SDK.Target); if (this._profileBeingRecorded || !target) return; - var profile = new WebInspector.SamplingHeapProfileHeader(target, this); + var profile = new Profiler.SamplingHeapProfileHeader(target, this); this.setProfileBeingRecorded(profile); - WebInspector.targetManager.suspendAllTargets(); + SDK.targetManager.suspendAllTargets(); this.addProfile(profile); - profile.updateStatus(WebInspector.UIString('Recording\u2026')); + profile.updateStatus(Common.UIString('Recording\u2026')); this._recording = true; target.heapProfilerModel.startSampling(); } @@ -119,7 +119,7 @@ /** * @param {?Protocol.HeapProfiler.SamplingHeapProfile} profile - * @this {WebInspector.SamplingHeapProfileType} + * @this {Profiler.SamplingHeapProfileType} */ function didStopProfiling(profile) { if (!this._profileBeingRecorded) @@ -132,26 +132,26 @@ } /** - * @this {WebInspector.SamplingHeapProfileType} + * @this {Profiler.SamplingHeapProfileType} */ function fireEvent() { - this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, recordedProfile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete, recordedProfile); } this._profileBeingRecorded.target() .heapProfilerModel.stopSampling() .then(didStopProfiling.bind(this)) - .then(WebInspector.targetManager.resumeAllTargets.bind(WebInspector.targetManager)) + .then(SDK.targetManager.resumeAllTargets.bind(SDK.targetManager)) .then(fireEvent.bind(this)); } /** * @override * @param {string} title - * @return {!WebInspector.ProfileHeader} + * @return {!Profiler.ProfileHeader} */ createProfileLoadedFromFile(title) { - return new WebInspector.SamplingHeapProfileHeader(null, this, title); + return new Profiler.SamplingHeapProfileHeader(null, this, title); } /** @@ -162,27 +162,27 @@ } }; -WebInspector.SamplingHeapProfileType.TypeId = 'SamplingHeap'; +Profiler.SamplingHeapProfileType.TypeId = 'SamplingHeap'; /** * @unrestricted */ -WebInspector.SamplingHeapProfileHeader = class extends WebInspector.WritableProfileHeader { +Profiler.SamplingHeapProfileHeader = class extends Profiler.WritableProfileHeader { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.SamplingHeapProfileType} type + * @param {?SDK.Target} target + * @param {!Profiler.SamplingHeapProfileType} type * @param {string=} title */ constructor(target, type, title) { - super(target, type, title || WebInspector.UIString('Profile %d', type.nextProfileUid())); + super(target, type, title || Common.UIString('Profile %d', type.nextProfileUid())); } /** * @override - * @return {!WebInspector.ProfileView} + * @return {!Profiler.ProfileView} */ createView() { - return new WebInspector.HeapProfileView(this); + return new Profiler.HeapProfileView(this); } /** @@ -196,7 +196,7 @@ /** * @unrestricted */ -WebInspector.SamplingHeapProfileNode = class extends WebInspector.ProfileNode { +Profiler.SamplingHeapProfileNode = class extends SDK.ProfileNode { /** * @param {!Protocol.HeapProfiler.SamplingHeapProfileNode} node */ @@ -217,7 +217,7 @@ /** * @unrestricted */ -WebInspector.SamplingHeapProfileModel = class extends WebInspector.ProfileTreeModel { +Profiler.SamplingHeapProfileModel = class extends SDK.ProfileTreeModel { /** * @param {!Protocol.HeapProfiler.SamplingHeapProfile} profile */ @@ -227,16 +227,16 @@ /** * @param {!Protocol.HeapProfiler.SamplingHeapProfileNode} root - * @return {!WebInspector.SamplingHeapProfileNode} + * @return {!Profiler.SamplingHeapProfileNode} */ function translateProfileTree(root) { - var resultRoot = new WebInspector.SamplingHeapProfileNode(root); + var resultRoot = new Profiler.SamplingHeapProfileNode(root); var targetNodeStack = [resultRoot]; var sourceNodeStack = [root]; while (sourceNodeStack.length) { var sourceNode = sourceNodeStack.pop(); var parentNode = targetNodeStack.pop(); - parentNode.children = sourceNode.children.map(child => new WebInspector.SamplingHeapProfileNode(child)); + parentNode.children = sourceNode.children.map(child => new Profiler.SamplingHeapProfileNode(child)); sourceNodeStack.push.apply(sourceNodeStack, sourceNode.children); targetNodeStack.push.apply(targetNodeStack, parentNode.children); } @@ -246,12 +246,12 @@ }; /** - * @implements {WebInspector.ProfileDataGridNode.Formatter} + * @implements {Profiler.ProfileDataGridNode.Formatter} * @unrestricted */ -WebInspector.HeapProfileView.NodeFormatter = class { +Profiler.HeapProfileView.NodeFormatter = class { /** - * @param {!WebInspector.ProfileView} profileView + * @param {!Profiler.ProfileView} profileView */ constructor(profileView) { this._profileView = profileView; @@ -269,16 +269,16 @@ /** * @override * @param {number} value - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {string} */ formatPercent(value, node) { - return WebInspector.UIString('%.2f\u2009%%', value); + return Common.UIString('%.2f\u2009%%', value); } /** * @override - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {?Element} */ linkifyNode(node) { @@ -290,10 +290,10 @@ /** * @unrestricted */ -WebInspector.HeapFlameChartDataProvider = class extends WebInspector.ProfileFlameChartDataProvider { +Profiler.HeapFlameChartDataProvider = class extends Profiler.ProfileFlameChartDataProvider { /** - * @param {!WebInspector.ProfileTreeModel} profile - * @param {?WebInspector.Target} target + * @param {!SDK.ProfileTreeModel} profile + * @param {?SDK.Target} target */ constructor(profile, target) { super(target); @@ -323,23 +323,23 @@ * @return {string} */ formatValue(value, precision) { - return WebInspector.UIString('%s\u2009KB', Number.withThousandsSeparator(value / 1e3)); + return Common.UIString('%s\u2009KB', Number.withThousandsSeparator(value / 1e3)); } /** * @override - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ _calculateTimelineData() { /** - * @param {!WebInspector.ProfileNode} node + * @param {!SDK.ProfileNode} node * @return {number} */ function nodesCount(node) { return node.children.reduce((count, node) => count + nodesCount(node), 1); } var count = nodesCount(this._profile.root); - /** @type {!Array<!WebInspector.ProfileNode>} */ + /** @type {!Array<!SDK.ProfileNode>} */ var entryNodes = new Array(count); var entryLevels = new Uint16Array(count); var entryTotalTimes = new Float32Array(count); @@ -350,7 +350,7 @@ var index = 0; /** - * @param {!WebInspector.ProfileNode} node + * @param {!SDK.ProfileNode} node */ function addNode(node) { var start = position; @@ -369,7 +369,7 @@ this._maxStackDepth = maxDepth + 1; this._entryNodes = entryNodes; - this._timelineData = new WebInspector.FlameChart.TimelineData(entryLevels, entryTotalTimes, entryStartTimes, null); + this._timelineData = new UI.FlameChart.TimelineData(entryLevels, entryTotalTimes, entryStartTimes, null); return this._timelineData; } @@ -391,14 +391,14 @@ function pushEntryInfoRow(title, value) { entryInfo.push({title: title, value: value}); } - pushEntryInfoRow(WebInspector.UIString('Name'), WebInspector.beautifyFunctionName(node.functionName)); - pushEntryInfoRow(WebInspector.UIString('Self size'), Number.bytesToString(node.self)); - pushEntryInfoRow(WebInspector.UIString('Total size'), Number.bytesToString(node.total)); - var linkifier = new WebInspector.Linkifier(); + pushEntryInfoRow(Common.UIString('Name'), UI.beautifyFunctionName(node.functionName)); + pushEntryInfoRow(Common.UIString('Self size'), Number.bytesToString(node.self)); + pushEntryInfoRow(Common.UIString('Total size'), Number.bytesToString(node.total)); + var linkifier = new Components.Linkifier(); var link = linkifier.maybeLinkifyConsoleCallFrame(this._target, node.callFrame); if (link) - pushEntryInfoRow(WebInspector.UIString('URL'), link.textContent); + pushEntryInfoRow(Common.UIString('URL'), link.textContent); linkifier.dispose(); - return WebInspector.ProfileView.buildPopoverTable(entryInfo); + return Profiler.ProfileView.buildPopoverTable(entryInfo); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotCommon.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotCommon.js index 9701ae6b..23c6131 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotCommon.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotCommon.js
@@ -27,27 +27,30 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.HeapSnapshotProgressEvent = { + +self['Profiler'] = self['Profiler'] || {}; + +Profiler.HeapSnapshotProgressEvent = { Update: 'ProgressUpdate', BrokenSnapshot: 'BrokenSnapshot' }; -WebInspector.HeapSnapshotCommon = {}; +Profiler.HeapSnapshotCommon = {}; -WebInspector.HeapSnapshotCommon.baseSystemDistance = 100000000; +Profiler.HeapSnapshotCommon.baseSystemDistance = 100000000; /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.AllocationNodeCallers = class { +Profiler.HeapSnapshotCommon.AllocationNodeCallers = class { /** - * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} nodesWithSingleCaller - * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} branchingCallers + * @param {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} nodesWithSingleCaller + * @param {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} branchingCallers */ constructor(nodesWithSingleCaller, branchingCallers) { - /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */ + /** @type {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} */ this.nodesWithSingleCaller = nodesWithSingleCaller; - /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */ + /** @type {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} */ this.branchingCallers = branchingCallers; } }; @@ -55,7 +58,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.SerializedAllocationNode = class { +Profiler.HeapSnapshotCommon.SerializedAllocationNode = class { /** * @param {number} nodeId * @param {string} functionName @@ -98,7 +101,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.AllocationStackFrame = class { +Profiler.HeapSnapshotCommon.AllocationStackFrame = class { /** * @param {string} functionName * @param {string} scriptName @@ -123,7 +126,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Node = class { +Profiler.HeapSnapshotCommon.Node = class { /** * @param {number} id * @param {string} name @@ -150,10 +153,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Edge = class { +Profiler.HeapSnapshotCommon.Edge = class { /** * @param {string} name - * @param {!WebInspector.HeapSnapshotCommon.Node} node + * @param {!Profiler.HeapSnapshotCommon.Node} node * @param {string} type * @param {number} edgeIndex */ @@ -168,7 +171,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Aggregate = class { +Profiler.HeapSnapshotCommon.Aggregate = class { constructor() { /** @type {number} */ this.count; @@ -190,7 +193,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.AggregateForDiff = class { +Profiler.HeapSnapshotCommon.AggregateForDiff = class { constructor() { /** @type {!Array.<number>} */ this.indexes = []; @@ -204,7 +207,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Diff = class { +Profiler.HeapSnapshotCommon.Diff = class { constructor() { /** @type {number} */ this.addedCount = 0; @@ -224,7 +227,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.DiffForClass = class { +Profiler.HeapSnapshotCommon.DiffForClass = class { constructor() { /** @type {number} */ this.addedCount; @@ -249,7 +252,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.ComparatorConfig = class { +Profiler.HeapSnapshotCommon.ComparatorConfig = class { constructor() { /** @type {string} */ this.fieldName1; @@ -265,7 +268,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.WorkerCommand = class { +Profiler.HeapSnapshotCommon.WorkerCommand = class { constructor() { /** @type {number} */ this.callId; @@ -287,7 +290,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.ItemsRange = class { +Profiler.HeapSnapshotCommon.ItemsRange = class { /** * @param {number} startPosition * @param {number} endPosition @@ -309,7 +312,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.StaticData = class { +Profiler.HeapSnapshotCommon.StaticData = class { /** * @param {number} nodeCount * @param {number} rootNodeIndex @@ -331,7 +334,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Statistics = class { +Profiler.HeapSnapshotCommon.Statistics = class { constructor() { /** @type {number} */ this.total; @@ -353,7 +356,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.NodeFilter = class { +Profiler.HeapSnapshotCommon.NodeFilter = class { /** * @param {number=} minNodeId * @param {number=} maxNodeId @@ -368,7 +371,7 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} o + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} o * @return {boolean} */ equals(o) { @@ -380,7 +383,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.SearchConfig = class { +Profiler.HeapSnapshotCommon.SearchConfig = class { /** * @param {string} query * @param {boolean} caseSensitive @@ -400,7 +403,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotCommon.Samples = class { +Profiler.HeapSnapshotCommon.Samples = class { /** * @param {!Array.<number>} timestamps * @param {!Array.<number>} lastAssignedIds
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js index cb4d810..410c78f 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotSortableDataGrid = class extends WebInspector.DataGrid { +Profiler.HeapSnapshotSortableDataGrid = class extends UI.DataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columns + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Array.<!UI.DataGrid.ColumnDescriptor>} columns */ constructor(dataDisplayDelegate, columns) { super(columns); @@ -45,7 +45,7 @@ */ this._recursiveSortingDepth = 0; /** - * @type {?WebInspector.HeapSnapshotGridNode} + * @type {?Profiler.HeapSnapshotGridNode} */ this._highlightedNode = null; /** @@ -53,24 +53,24 @@ */ this._populatedAndSorted = false; /** - * @type {?WebInspector.ToolbarInput} + * @type {?UI.ToolbarInput} */ this._nameFilter = null; - this._nodeFilter = new WebInspector.HeapSnapshotCommon.NodeFilter(); + this._nodeFilter = new Profiler.HeapSnapshotCommon.NodeFilter(); this.addEventListener( - WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, this._sortingComplete, this); - this.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this.sortingChanged, this); + Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, this._sortingComplete, this); + this.addEventListener(UI.DataGrid.Events.SortingChanged, this.sortingChanged, this); } /** - * @return {!WebInspector.HeapSnapshotCommon.NodeFilter} + * @return {!Profiler.HeapSnapshotCommon.NodeFilter} */ nodeFilter() { return this._nodeFilter; } /** - * @param {!WebInspector.ToolbarInput} nameFilter + * @param {!UI.ToolbarInput} nameFilter */ setNameFilter(nameFilter) { this._nameFilter = nameFilter; @@ -94,18 +94,18 @@ */ wasShown() { if (this._nameFilter) { - this._nameFilter.addEventListener(WebInspector.ToolbarInput.Event.TextChanged, this._onNameFilterChanged, this); + this._nameFilter.addEventListener(UI.ToolbarInput.Event.TextChanged, this._onNameFilterChanged, this); this.updateVisibleNodes(true); } if (this._populatedAndSorted) - this.dispatchEventToListeners(WebInspector.HeapSnapshotSortableDataGrid.Events.ContentShown, this); + this.dispatchEventToListeners(Profiler.HeapSnapshotSortableDataGrid.Events.ContentShown, this); } _sortingComplete() { this.removeEventListener( - WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete, this._sortingComplete, this); + Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete, this._sortingComplete, this); this._populatedAndSorted = true; - this.dispatchEventToListeners(WebInspector.HeapSnapshotSortableDataGrid.Events.ContentShown, this); + this.dispatchEventToListeners(Profiler.HeapSnapshotSortableDataGrid.Events.ContentShown, this); } /** @@ -114,12 +114,12 @@ willHide() { if (this._nameFilter) this._nameFilter.removeEventListener( - WebInspector.ToolbarInput.Event.TextChanged, this._onNameFilterChanged, this); + UI.ToolbarInput.Event.TextChanged, this._onNameFilterChanged, this); this._clearCurrentHighlight(); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Event} event */ populateContextMenu(contextMenu, event) { @@ -129,15 +129,15 @@ var node = td.heapSnapshotNode; /** - * @this {WebInspector.HeapSnapshotSortableDataGrid} + * @this {Profiler.HeapSnapshotSortableDataGrid} */ function revealInSummaryView() { this._dataDisplayDelegate.showObject(node.snapshotNodeId, 'Summary'); } - if (node instanceof WebInspector.HeapSnapshotRetainingObjectNode) + if (node instanceof Profiler.HeapSnapshotRetainingObjectNode) contextMenu.appendItem( - WebInspector.UIString.capitalize('Reveal in Summary ^view'), revealInSummaryView.bind(this)); + Common.UIString.capitalize('Reveal in Summary ^view'), revealInSummaryView.bind(this)); } resetSortingCache() { @@ -146,7 +146,7 @@ } /** - * @return {!Array.<!WebInspector.HeapSnapshotGridNode>} + * @return {!Array.<!Profiler.HeapSnapshotGridNode>} */ topLevelNodes() { return this.rootNode().children; @@ -154,19 +154,19 @@ /** * @param {!Protocol.HeapProfiler.HeapSnapshotObjectId} heapSnapshotObjectId - * @return {!Promise<?WebInspector.HeapSnapshotGridNode>} + * @return {!Promise<?Profiler.HeapSnapshotGridNode>} */ revealObjectByHeapSnapshotId(heapSnapshotObjectId) { - return Promise.resolve(/** @type {?WebInspector.HeapSnapshotGridNode} */ (null)); + return Promise.resolve(/** @type {?Profiler.HeapSnapshotGridNode} */ (null)); } /** - * @param {!WebInspector.HeapSnapshotGridNode} node + * @param {!Profiler.HeapSnapshotGridNode} node */ highlightNode(node) { this._clearCurrentHighlight(); this._highlightedNode = node; - WebInspector.runCSSAnimationOnce(this._highlightedNode.element(), 'highlighted-row'); + UI.runCSSAnimationOnce(this._highlightedNode.element(), 'highlighted-row'); } nodeWasDetached(node) { @@ -246,7 +246,7 @@ if (--this._recursiveSortingDepth) return; this.updateVisibleNodes(true); - this.dispatchEventToListeners(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete); + this.dispatchEventToListeners(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete); } /** @@ -256,16 +256,16 @@ } /** - * @param {!WebInspector.DataGridNode} parent - * @return {!Array.<!WebInspector.HeapSnapshotGridNode>} + * @param {!UI.DataGridNode} parent + * @return {!Array.<!Profiler.HeapSnapshotGridNode>} */ allChildren(parent) { return parent.children; } /** - * @param {!WebInspector.DataGridNode} parent - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} parent + * @param {!UI.DataGridNode} node * @param {number} index */ insertChild(parent, node, index) { @@ -273,7 +273,7 @@ } /** - * @param {!WebInspector.HeapSnapshotGridNode} parent + * @param {!Profiler.HeapSnapshotGridNode} parent * @param {number} index */ removeChildByIndex(parent, index) { @@ -281,7 +281,7 @@ } /** - * @param {!WebInspector.HeapSnapshotGridNode} parent + * @param {!Profiler.HeapSnapshotGridNode} parent */ removeAllChildren(parent) { parent.removeChildren(); @@ -289,7 +289,7 @@ }; /** @enum {symbol} */ -WebInspector.HeapSnapshotSortableDataGrid.Events = { +Profiler.HeapSnapshotSortableDataGrid.Events = { ContentShown: Symbol('ContentShown'), SortingComplete: Symbol('SortingComplete') }; @@ -297,10 +297,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotViewportDataGrid = class extends WebInspector.HeapSnapshotSortableDataGrid { +Profiler.HeapSnapshotViewportDataGrid = class extends Profiler.HeapSnapshotSortableDataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columns + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Array.<!UI.DataGrid.ColumnDescriptor>} columns */ constructor(dataDisplayDelegate, columns) { super(dataDisplayDelegate, columns); @@ -311,7 +311,7 @@ /** * @override - * @return {!Array.<!WebInspector.HeapSnapshotGridNode>} + * @return {!Array.<!Profiler.HeapSnapshotGridNode>} */ topLevelNodes() { return this.allChildren(this.rootNode()); @@ -364,7 +364,7 @@ } /** - * @param {!WebInspector.DataGridNode} parentNode + * @param {!UI.DataGridNode} parentNode * @param {number} topBound * @param {number} bottomBound * @return {number} @@ -418,7 +418,7 @@ } /** - * @param {!WebInspector.HeapSnapshotGridNode} node + * @param {!Profiler.HeapSnapshotGridNode} node * @return {number} */ _nodeHeight(node) { @@ -434,12 +434,12 @@ } /** - * @param {!Array.<!WebInspector.HeapSnapshotGridNode>} pathToReveal - * @return {!Promise.<!WebInspector.HeapSnapshotGridNode>} + * @param {!Array.<!Profiler.HeapSnapshotGridNode>} pathToReveal + * @return {!Promise.<!Profiler.HeapSnapshotGridNode>} */ revealTreeNode(pathToReveal) { var height = this._calculateOffset(pathToReveal); - var node = /** @type {!WebInspector.HeapSnapshotGridNode} */ (pathToReveal.peekLast()); + var node = /** @type {!Profiler.HeapSnapshotGridNode} */ (pathToReveal.peekLast()); var scrollTop = this.scrollContainer.scrollTop; var scrollBottom = scrollTop + this.scrollContainer.offsetHeight; if (height >= scrollTop && height < scrollBottom) @@ -451,8 +451,8 @@ } /** - * @param {!WebInspector.HeapSnapshotGridNode} node - * @param {function(!WebInspector.HeapSnapshotGridNode)} fulfill + * @param {!Profiler.HeapSnapshotGridNode} node + * @param {function(!Profiler.HeapSnapshotGridNode)} fulfill */ _scrollTo(node, fulfill) { console.assert(!this._scrollToResolveCallback); @@ -460,7 +460,7 @@ } /** - * @param {!Array.<!WebInspector.HeapSnapshotGridNode>} pathToReveal + * @param {!Array.<!Profiler.HeapSnapshotGridNode>} pathToReveal * @return {number} */ _calculateOffset(pathToReveal) { @@ -484,16 +484,16 @@ /** * @override - * @param {!WebInspector.DataGridNode} parent - * @return {!Array.<!WebInspector.HeapSnapshotGridNode>} + * @param {!UI.DataGridNode} parent + * @return {!Array.<!Profiler.HeapSnapshotGridNode>} */ allChildren(parent) { return parent._allChildren || (parent._allChildren = []); } /** - * @param {!WebInspector.DataGridNode} parent - * @param {!WebInspector.HeapSnapshotGridNode} node + * @param {!UI.DataGridNode} parent + * @param {!Profiler.HeapSnapshotGridNode} node */ appendNode(parent, node) { this.allChildren(parent).push(node); @@ -501,12 +501,12 @@ /** * @override - * @param {!WebInspector.DataGridNode} parent - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} parent + * @param {!UI.DataGridNode} node * @param {number} index */ insertChild(parent, node, index) { - this.allChildren(parent).splice(index, 0, /** @type {!WebInspector.HeapSnapshotGridNode} */ (node)); + this.allChildren(parent).splice(index, 0, /** @type {!Profiler.HeapSnapshotGridNode} */ (node)); } /** @@ -562,36 +562,36 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotContainmentDataGrid = class extends WebInspector.HeapSnapshotSortableDataGrid { +Profiler.HeapSnapshotContainmentDataGrid = class extends Profiler.HeapSnapshotSortableDataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>=} columns + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Array.<!UI.DataGrid.ColumnDescriptor>=} columns */ constructor(dataDisplayDelegate, columns) { columns = - columns || (/** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'object', title: WebInspector.UIString('Object'), disclosure: true, sortable: true}, - {id: 'distance', title: WebInspector.UIString('Distance'), width: '65px', sortable: true, fixedWidth: true}, { + columns || (/** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'object', title: Common.UIString('Object'), disclosure: true, sortable: true}, + {id: 'distance', title: Common.UIString('Distance'), width: '65px', sortable: true, fixedWidth: true}, { id: 'shallowSize', - title: WebInspector.UIString('Shallow Size'), + title: Common.UIString('Shallow Size'), width: '105px', sortable: true, fixedWidth: true }, { id: 'retainedSize', - title: WebInspector.UIString('Retained Size'), + title: Common.UIString('Retained Size'), width: '105px', sortable: true, fixedWidth: true, - sort: WebInspector.DataGrid.Order.Descending + sort: UI.DataGrid.Order.Descending } ])); super(dataDisplayDelegate, columns); } /** - * @param {!WebInspector.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotProxy} snapshot * @param {number} nodeIndex */ setDataSource(snapshot, nodeIndex) { @@ -603,7 +603,7 @@ } _createRootNode(snapshot, fakeEdge) { - return new WebInspector.HeapSnapshotObjectNode(this, snapshot, fakeEdge, null); + return new Profiler.HeapSnapshotObjectNode(this, snapshot, fakeEdge, null); } /** @@ -619,30 +619,30 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotRetainmentDataGrid = class extends WebInspector.HeapSnapshotContainmentDataGrid { +Profiler.HeapSnapshotRetainmentDataGrid = class extends Profiler.HeapSnapshotContainmentDataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate */ constructor(dataDisplayDelegate) { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'object', title: WebInspector.UIString('Object'), disclosure: true, sortable: true}, { + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'object', title: Common.UIString('Object'), disclosure: true, sortable: true}, { id: 'distance', - title: WebInspector.UIString('Distance'), + title: Common.UIString('Distance'), width: '65px', sortable: true, fixedWidth: true, - sort: WebInspector.DataGrid.Order.Ascending + sort: UI.DataGrid.Order.Ascending }, { id: 'shallowSize', - title: WebInspector.UIString('Shallow Size'), + title: Common.UIString('Shallow Size'), width: '105px', sortable: true, fixedWidth: true }, { id: 'retainedSize', - title: WebInspector.UIString('Retained Size'), + title: Common.UIString('Retained Size'), width: '105px', sortable: true, fixedWidth: true @@ -655,7 +655,7 @@ * @override */ _createRootNode(snapshot, fakeEdge) { - return new WebInspector.HeapSnapshotRetainingObjectNode(this, snapshot, fakeEdge, null); + return new Profiler.HeapSnapshotRetainingObjectNode(this, snapshot, fakeEdge, null); } _sortFields(sortColumn, sortAscending) { @@ -675,7 +675,7 @@ /** * @override - * @param {!WebInspector.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotProxy} snapshot * @param {number} nodeIndex */ setDataSource(snapshot, nodeIndex) { @@ -685,33 +685,33 @@ }; /** @enum {symbol} */ -WebInspector.HeapSnapshotRetainmentDataGrid.Events = { +Profiler.HeapSnapshotRetainmentDataGrid.Events = { ExpandRetainersComplete: Symbol('ExpandRetainersComplete') }; /** * @unrestricted */ -WebInspector.HeapSnapshotConstructorsDataGrid = class extends WebInspector.HeapSnapshotViewportDataGrid { +Profiler.HeapSnapshotConstructorsDataGrid = class extends Profiler.HeapSnapshotViewportDataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate */ constructor(dataDisplayDelegate) { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'object', title: WebInspector.UIString('Constructor'), disclosure: true, sortable: true}, - {id: 'distance', title: WebInspector.UIString('Distance'), width: '65px', sortable: true, fixedWidth: true}, - {id: 'count', title: WebInspector.UIString('Objects Count'), width: '90px', sortable: true, fixedWidth: true}, { + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'object', title: Common.UIString('Constructor'), disclosure: true, sortable: true}, + {id: 'distance', title: Common.UIString('Distance'), width: '65px', sortable: true, fixedWidth: true}, + {id: 'count', title: Common.UIString('Objects Count'), width: '90px', sortable: true, fixedWidth: true}, { id: 'shallowSize', - title: WebInspector.UIString('Shallow Size'), + title: Common.UIString('Shallow Size'), width: '105px', sortable: true, fixedWidth: true }, { id: 'retainedSize', - title: WebInspector.UIString('Retained Size'), + title: Common.UIString('Retained Size'), width: '105px', - sort: WebInspector.DataGrid.Order.Descending, + sort: UI.DataGrid.Order.Descending, sortable: true, fixedWidth: true } @@ -735,18 +735,18 @@ /** * @override * @param {!Protocol.HeapProfiler.HeapSnapshotObjectId} id - * @return {!Promise<?WebInspector.HeapSnapshotGridNode>} + * @return {!Promise<?Profiler.HeapSnapshotGridNode>} */ revealObjectByHeapSnapshotId(id) { if (!this.snapshot) { this._objectIdToSelect = id; - return Promise.resolve(/** @type {?WebInspector.HeapSnapshotGridNode} */ (null)); + return Promise.resolve(/** @type {?Profiler.HeapSnapshotGridNode} */ (null)); } /** - * @param {!Array<!WebInspector.HeapSnapshotGridNode>} nodes - * @return {?Promise<!WebInspector.HeapSnapshotGridNode>} - * @this {WebInspector.HeapSnapshotConstructorsDataGrid} + * @param {!Array<!Profiler.HeapSnapshotGridNode>} nodes + * @return {?Promise<!Profiler.HeapSnapshotGridNode>} + * @this {Profiler.HeapSnapshotConstructorsDataGrid} */ function didPopulateNode(nodes) { return nodes.length ? this.revealTreeNode(nodes) : null; @@ -754,8 +754,8 @@ /** * @param {?string} className - * @return {?Promise<?WebInspector.HeapSnapshotGridNode>} - * @this {WebInspector.HeapSnapshotConstructorsDataGrid} + * @return {?Promise<?Profiler.HeapSnapshotGridNode>} + * @this {Profiler.HeapSnapshotConstructorsDataGrid} */ function didGetClassName(className) { if (!className) @@ -779,7 +779,7 @@ } /** - * @param {!WebInspector.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotProxy} snapshot */ setDataSource(snapshot) { this.snapshot = snapshot; @@ -797,7 +797,7 @@ * @param {number} maxNodeId */ setSelectionRange(minNodeId, maxNodeId) { - this._nodeFilter = new WebInspector.HeapSnapshotCommon.NodeFilter(minNodeId, maxNodeId); + this._nodeFilter = new Profiler.HeapSnapshotCommon.NodeFilter(minNodeId, maxNodeId); this._populateChildren(this._nodeFilter); } @@ -805,14 +805,14 @@ * @param {number} allocationNodeId */ setAllocationNodeId(allocationNodeId) { - this._nodeFilter = new WebInspector.HeapSnapshotCommon.NodeFilter(); + this._nodeFilter = new Profiler.HeapSnapshotCommon.NodeFilter(); this._nodeFilter.allocationNodeId = allocationNodeId; this._populateChildren(this._nodeFilter); } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter - * @param {!Object.<string, !WebInspector.HeapSnapshotCommon.Aggregate>} aggregates + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter + * @param {!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>} aggregates */ _aggregatesReceived(nodeFilter, aggregates) { this._filterInProgress = null; @@ -827,16 +827,16 @@ for (var constructor in aggregates) this.appendNode( this.rootNode(), - new WebInspector.HeapSnapshotConstructorNode(this, constructor, aggregates[constructor], nodeFilter)); + new Profiler.HeapSnapshotConstructorNode(this, constructor, aggregates[constructor], nodeFilter)); this.sortingChanged(); this._lastFilter = nodeFilter; } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter=} nodeFilter + * @param {!Profiler.HeapSnapshotCommon.NodeFilter=} nodeFilter */ _populateChildren(nodeFilter) { - nodeFilter = nodeFilter || new WebInspector.HeapSnapshotCommon.NodeFilter(); + nodeFilter = nodeFilter || new Profiler.HeapSnapshotCommon.NodeFilter(); if (this._filterInProgress) { this._nextRequestedFilter = this._filterInProgress.equals(nodeFilter) ? null : nodeFilter; @@ -854,7 +854,7 @@ if (profileIndex !== -1) { var minNodeId = profileIndex > 0 ? profiles[profileIndex - 1].maxJSObjectId : 0; var maxNodeId = profiles[profileIndex].maxJSObjectId; - this._nodeFilter = new WebInspector.HeapSnapshotCommon.NodeFilter(minNodeId, maxNodeId); + this._nodeFilter = new Profiler.HeapSnapshotCommon.NodeFilter(minNodeId, maxNodeId); } this._populateChildren(this._nodeFilter); @@ -864,25 +864,25 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotDiffDataGrid = class extends WebInspector.HeapSnapshotViewportDataGrid { +Profiler.HeapSnapshotDiffDataGrid = class extends Profiler.HeapSnapshotViewportDataGrid { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate */ constructor(dataDisplayDelegate) { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'object', title: WebInspector.UIString('Constructor'), disclosure: true, sortable: true}, - {id: 'addedCount', title: WebInspector.UIString('# New'), width: '72px', sortable: true, fixedWidth: true}, - {id: 'removedCount', title: WebInspector.UIString('# Deleted'), width: '72px', sortable: true, fixedWidth: true}, - {id: 'countDelta', title: WebInspector.UIString('# Delta'), width: '64px', sortable: true, fixedWidth: true}, { + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'object', title: Common.UIString('Constructor'), disclosure: true, sortable: true}, + {id: 'addedCount', title: Common.UIString('# New'), width: '72px', sortable: true, fixedWidth: true}, + {id: 'removedCount', title: Common.UIString('# Deleted'), width: '72px', sortable: true, fixedWidth: true}, + {id: 'countDelta', title: Common.UIString('# Delta'), width: '64px', sortable: true, fixedWidth: true}, { id: 'addedSize', - title: WebInspector.UIString('Alloc. Size'), + title: Common.UIString('Alloc. Size'), width: '72px', sortable: true, fixedWidth: true, - sort: WebInspector.DataGrid.Order.Descending + sort: UI.DataGrid.Order.Descending }, - {id: 'removedSize', title: WebInspector.UIString('Freed Size'), width: '72px', sortable: true, fixedWidth: true}, - {id: 'sizeDelta', title: WebInspector.UIString('Size Delta'), width: '72px', sortable: true, fixedWidth: true} + {id: 'removedSize', title: Common.UIString('Freed Size'), width: '72px', sortable: true, fixedWidth: true}, + {id: 'sizeDelta', title: Common.UIString('Size Delta'), width: '72px', sortable: true, fixedWidth: true} ]); super(dataDisplayDelegate, columns); } @@ -912,14 +912,14 @@ } /** - * @param {!WebInspector.HeapSnapshotProxy} baseSnapshot + * @param {!Profiler.HeapSnapshotProxy} baseSnapshot */ setBaseDataSource(baseSnapshot) { this.baseSnapshot = baseSnapshot; this.removeTopLevelNodes(); this.resetSortingCache(); if (this.baseSnapshot === this.snapshot) { - this.dispatchEventToListeners(WebInspector.HeapSnapshotSortableDataGrid.Events.SortingComplete); + this.dispatchEventToListeners(Profiler.HeapSnapshotSortableDataGrid.Events.SortingComplete); return; } this._populateChildren(); @@ -927,19 +927,19 @@ _populateChildren() { /** - * @this {WebInspector.HeapSnapshotDiffDataGrid} + * @this {Profiler.HeapSnapshotDiffDataGrid} */ function aggregatesForDiffReceived(aggregatesForDiff) { this.snapshot.calculateSnapshotDiff( this.baseSnapshot.uid, aggregatesForDiff, didCalculateSnapshotDiff.bind(this)); /** - * @this {WebInspector.HeapSnapshotDiffDataGrid} + * @this {Profiler.HeapSnapshotDiffDataGrid} */ function didCalculateSnapshotDiff(diffByClassName) { for (var className in diffByClassName) { var diff = diffByClassName[className]; - this.appendNode(this.rootNode(), new WebInspector.HeapSnapshotDiffNode(this, className, diff)); + this.appendNode(this.rootNode(), new Profiler.HeapSnapshotDiffNode(this, className, diff)); } this.sortingChanged(); } @@ -954,33 +954,33 @@ /** * @unrestricted */ -WebInspector.AllocationDataGrid = class extends WebInspector.HeapSnapshotViewportDataGrid { +Profiler.AllocationDataGrid = class extends Profiler.HeapSnapshotViewportDataGrid { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {?SDK.Target} target + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate */ constructor(target, dataDisplayDelegate) { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'liveCount', title: WebInspector.UIString('Live Count'), width: '72px', sortable: true, fixedWidth: true}, - {id: 'count', title: WebInspector.UIString('Count'), width: '60px', sortable: true, fixedWidth: true}, - {id: 'liveSize', title: WebInspector.UIString('Live Size'), width: '72px', sortable: true, fixedWidth: true}, + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'liveCount', title: Common.UIString('Live Count'), width: '72px', sortable: true, fixedWidth: true}, + {id: 'count', title: Common.UIString('Count'), width: '60px', sortable: true, fixedWidth: true}, + {id: 'liveSize', title: Common.UIString('Live Size'), width: '72px', sortable: true, fixedWidth: true}, { id: 'size', - title: WebInspector.UIString('Size'), + title: Common.UIString('Size'), width: '72px', sortable: true, fixedWidth: true, - sort: WebInspector.DataGrid.Order.Descending + sort: UI.DataGrid.Order.Descending }, - {id: 'name', title: WebInspector.UIString('Function'), disclosure: true, sortable: true}, + {id: 'name', title: Common.UIString('Function'), disclosure: true, sortable: true}, ]); super(dataDisplayDelegate, columns); this._target = target; - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._target; @@ -995,8 +995,8 @@ this.snapshot.allocationTracesTops(didReceiveAllocationTracesTops.bind(this)); /** - * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} tops - * @this {WebInspector.AllocationDataGrid} + * @param {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} tops + * @this {Profiler.AllocationDataGrid} */ function didReceiveAllocationTracesTops(tops) { this._topNodes = tops; @@ -1009,7 +1009,7 @@ var root = this.rootNode(); var tops = this._topNodes; for (var i = 0; i < tops.length; i++) - this.appendNode(root, new WebInspector.AllocationGridNode(this, tops[i])); + this.appendNode(root, new Profiler.AllocationGridNode(this, tops[i])); this.updateVisibleNodes(true); } @@ -1027,7 +1027,7 @@ */ _createComparator() { var fieldName = this.sortColumnId(); - var compareResult = (this.sortOrder() === WebInspector.DataGrid.Order.Ascending) ? +1 : -1; + var compareResult = (this.sortOrder() === UI.DataGrid.Order.Ascending) ? +1 : -1; /** * @param {!Object} a * @param {!Object} b
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js index e77adcd..604d9d3b 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotGridNode = class extends WebInspector.DataGridNode { +Profiler.HeapSnapshotGridNode = class extends UI.DataGridNode { /** - * @param {!WebInspector.HeapSnapshotSortableDataGrid} tree + * @param {!Profiler.HeapSnapshotSortableDataGrid} tree * @param {boolean} hasChildren */ constructor(tree, hasChildren) { @@ -49,7 +49,7 @@ this._retrievedChildrenRanges = []; /** - * @type {?WebInspector.HeapSnapshotGridNode.ChildrenProvider} + * @type {?Profiler.HeapSnapshotGridNode.ChildrenProvider} */ this._providerObject = null; this._reachableFromWindow = false; @@ -57,36 +57,36 @@ /** * @param {!Array.<string>} fieldNames - * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} + * @return {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ static createComparator(fieldNames) { - return /** @type {!WebInspector.HeapSnapshotCommon.ComparatorConfig} */ ( + return /** @type {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ ( {fieldName1: fieldNames[0], ascending1: fieldNames[1], fieldName2: fieldNames[2], ascending2: fieldNames[3]}); } /** - * @return {!WebInspector.HeapSnapshotSortableDataGrid} + * @return {!Profiler.HeapSnapshotSortableDataGrid} */ heapSnapshotDataGrid() { return this._dataGrid; } /** - * @return {!WebInspector.HeapSnapshotGridNode.ChildrenProvider} + * @return {!Profiler.HeapSnapshotGridNode.ChildrenProvider} */ createProvider() { throw new Error('Not implemented.'); } /** - * @return {?{snapshot:!WebInspector.HeapSnapshotProxy, snapshotNodeIndex:number}} + * @return {?{snapshot:!Profiler.HeapSnapshotProxy, snapshotNodeIndex:number}} */ retainersDataSource() { return null; } /** - * @return {!WebInspector.HeapSnapshotGridNode.ChildrenProvider} + * @return {!Profiler.HeapSnapshotGridNode.ChildrenProvider} */ _provider() { if (!this._providerObject) @@ -131,8 +131,8 @@ } /** - * @param {!WebInspector.Target} target - * @param {function(!WebInspector.RemoteObject)} callback + * @param {!SDK.Target} target + * @param {function(!SDK.RemoteObject)} callback * @param {string} objectGroupName */ queryObjectContent(target, callback, objectGroupName) { @@ -158,13 +158,13 @@ * @return {string} */ _toUIDistance(distance) { - var baseSystemDistance = WebInspector.HeapSnapshotCommon.baseSystemDistance; - return distance >= 0 && distance < baseSystemDistance ? WebInspector.UIString('%d', distance) : - WebInspector.UIString('\u2212'); + var baseSystemDistance = Profiler.HeapSnapshotCommon.baseSystemDistance; + return distance >= 0 && distance < baseSystemDistance ? Common.UIString('%d', distance) : + Common.UIString('\u2212'); } /** - * @return {!Array.<!WebInspector.DataGridNode>} + * @return {!Array.<!UI.DataGridNode>} */ allChildren() { return this._dataGrid.allChildren(this); @@ -179,7 +179,7 @@ /** * @param {number} nodePosition - * @return {?WebInspector.DataGridNode} + * @return {?UI.DataGridNode} */ childForPosition(nodePosition) { var indexOfFirstChildInRange = 0; @@ -250,7 +250,7 @@ var firstNotSerializedPosition = fromPosition; /** - * @this {WebInspector.HeapSnapshotGridNode} + * @this {Profiler.HeapSnapshotGridNode} */ function serializeNextChunk() { if (firstNotSerializedPosition >= toPosition) @@ -261,7 +261,7 @@ } /** - * @this {WebInspector.HeapSnapshotGridNode} + * @this {Profiler.HeapSnapshotGridNode} */ function insertRetrievedChild(item, insertionIndex) { if (this._savedChildren) { @@ -275,17 +275,17 @@ } /** - * @this {WebInspector.HeapSnapshotGridNode} + * @this {Profiler.HeapSnapshotGridNode} */ function insertShowMoreButton(from, to, insertionIndex) { - var button = new WebInspector.ShowMoreDataGridNode( + var button = new UI.ShowMoreDataGridNode( this._populateChildren.bind(this), from, to, this._dataGrid.defaultPopulateCount()); this._dataGrid.insertChild(this, button, insertionIndex); } /** - * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} itemsRange - * @this {WebInspector.HeapSnapshotGridNode} + * @param {!Profiler.HeapSnapshotCommon.ItemsRange} itemsRange + * @this {Profiler.HeapSnapshotGridNode} */ function childrenRetrieved(itemsRange) { var itemIndex = 0; @@ -381,7 +381,7 @@ this._dataGrid.updateVisibleNodes(true); if (afterPopulate) afterPopulate(); - this.dispatchEventToListeners(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete); + this.dispatchEventToListeners(Profiler.HeapSnapshotGridNode.Events.PopulateComplete); } serializeNextChunk.call(this); } @@ -403,7 +403,7 @@ this._dataGrid.recursiveSortingEnter(); /** - * @this {WebInspector.HeapSnapshotGridNode} + * @this {Profiler.HeapSnapshotGridNode} */ function afterSort() { this._saveChildren(); @@ -411,7 +411,7 @@ this._retrievedChildrenRanges = []; /** - * @this {WebInspector.HeapSnapshotGridNode} + * @this {Profiler.HeapSnapshotGridNode} */ function afterPopulate() { var children = this.allChildren(); @@ -432,7 +432,7 @@ }; /** @enum {symbol} */ -WebInspector.HeapSnapshotGridNode.Events = { +Profiler.HeapSnapshotGridNode.Events = { PopulateComplete: Symbol('PopulateComplete') }; @@ -440,9 +440,9 @@ /** * @interface */ -WebInspector.HeapSnapshotGridNode.ChildrenProvider = function() {}; +Profiler.HeapSnapshotGridNode.ChildrenProvider = function() {}; -WebInspector.HeapSnapshotGridNode.ChildrenProvider.prototype = { +Profiler.HeapSnapshotGridNode.ChildrenProvider.prototype = { dispose: function() {}, /** @@ -459,12 +459,12 @@ /** * @param {number} startPosition * @param {number} endPosition - * @param {function(!WebInspector.HeapSnapshotCommon.ItemsRange)} callback + * @param {function(!Profiler.HeapSnapshotCommon.ItemsRange)} callback */ serializeItemsRange: function(startPosition, endPosition, callback) {}, /** - * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator + * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator * @return {!Promise<?>} */ sortAndRewind: function(comparator) {} @@ -473,10 +473,10 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotGenericObjectNode = class extends WebInspector.HeapSnapshotGridNode { +Profiler.HeapSnapshotGenericObjectNode = class extends Profiler.HeapSnapshotGridNode { /** - * @param {!WebInspector.HeapSnapshotSortableDataGrid} dataGrid - * @param {!WebInspector.HeapSnapshotCommon.Node} node + * @param {!Profiler.HeapSnapshotSortableDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotCommon.Node} node */ constructor(dataGrid, node) { super(dataGrid, false); @@ -514,7 +514,7 @@ /** * @override - * @return {?{snapshot:!WebInspector.HeapSnapshotProxy, snapshotNodeIndex:number}} + * @return {?{snapshot:!Profiler.HeapSnapshotProxy, snapshotNodeIndex:number}} */ retainersDataSource() { return {snapshot: this._dataGrid.snapshot, snapshotNodeIndex: this.snapshotNodeIndex}; @@ -603,8 +603,8 @@ /** * @override - * @param {!WebInspector.Target} target - * @param {function(!WebInspector.RemoteObject)} callback + * @param {!SDK.Target} target + * @param {function(!SDK.RemoteObject)} callback * @param {string} objectGroupName */ queryObjectContent(target, callback, objectGroupName) { @@ -617,7 +617,7 @@ callback(target.runtimeModel.createRemoteObject(object)); else callback(target.runtimeModel.createRemoteObjectFromPrimitiveValue( - WebInspector.UIString('Preview is not available'))); + Common.UIString('Preview is not available'))); } if (this._type === 'string') @@ -628,7 +628,7 @@ updateHasChildren() { /** - * @this {WebInspector.HeapSnapshotGenericObjectNode} + * @this {Profiler.HeapSnapshotGenericObjectNode} */ function isEmptyCallback(isEmpty) { this.hasChildren = !isEmpty; @@ -658,12 +658,12 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotObjectNode = class extends WebInspector.HeapSnapshotGenericObjectNode { +Profiler.HeapSnapshotObjectNode = class extends Profiler.HeapSnapshotGenericObjectNode { /** - * @param {!WebInspector.HeapSnapshotSortableDataGrid} dataGrid - * @param {!WebInspector.HeapSnapshotProxy} snapshot - * @param {!WebInspector.HeapSnapshotCommon.Edge} edge - * @param {?WebInspector.HeapSnapshotObjectNode} parentObjectNode + * @param {!Profiler.HeapSnapshotSortableDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotCommon.Edge} edge + * @param {?Profiler.HeapSnapshotObjectNode} parentObjectNode */ constructor(dataGrid, snapshot, edge, parentObjectNode) { super(dataGrid, edge.node); @@ -689,7 +689,7 @@ /** * @override - * @return {?{snapshot:!WebInspector.HeapSnapshotProxy, snapshotNodeIndex:number}} + * @return {?{snapshot:!Profiler.HeapSnapshotProxy, snapshotNodeIndex:number}} */ retainersDataSource() { return {snapshot: this._snapshot, snapshotNodeIndex: this.snapshotNodeIndex}; @@ -697,7 +697,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createProvider() { return this._snapshot.createEdgesProvider(this.snapshotNodeIndex); @@ -714,15 +714,15 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.Edge} item - * @return {!WebInspector.HeapSnapshotObjectNode} + * @param {!Profiler.HeapSnapshotCommon.Edge} item + * @return {!Profiler.HeapSnapshotObjectNode} */ _createChildNode(item) { - return new WebInspector.HeapSnapshotObjectNode(this._dataGrid, this._snapshot, item, this); + return new Profiler.HeapSnapshotObjectNode(this._dataGrid, this._snapshot, item, this); } /** - * @param {!WebInspector.HeapSnapshotCommon.Edge} edge + * @param {!Profiler.HeapSnapshotCommon.Edge} edge * @return {number} */ _childHashForEntity(edge) { @@ -730,7 +730,7 @@ } /** - * @param {!WebInspector.HeapSnapshotObjectNode} childNode + * @param {!Profiler.HeapSnapshotObjectNode} childNode * @return {number} */ _childHashForNode(childNode) { @@ -738,7 +738,7 @@ } /** - * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} + * @return {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ comparator() { var sortAscending = this._dataGrid.isSortOrderAscending(); @@ -751,7 +751,7 @@ distance: ['distance', sortAscending, '_name', true] }[sortColumnId] || ['!edgeName', true, 'retainedSize', false]; - return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); + return Profiler.HeapSnapshotGridNode.createComparator(sortFields); } /** @@ -799,12 +799,12 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotRetainingObjectNode = class extends WebInspector.HeapSnapshotObjectNode { +Profiler.HeapSnapshotRetainingObjectNode = class extends Profiler.HeapSnapshotObjectNode { /** - * @param {!WebInspector.HeapSnapshotSortableDataGrid} dataGrid - * @param {!WebInspector.HeapSnapshotProxy} snapshot - * @param {!WebInspector.HeapSnapshotCommon.Edge} edge - * @param {?WebInspector.HeapSnapshotRetainingObjectNode} parentRetainingObjectNode + * @param {!Profiler.HeapSnapshotSortableDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotCommon.Edge} edge + * @param {?Profiler.HeapSnapshotRetainingObjectNode} parentRetainingObjectNode */ constructor(dataGrid, snapshot, edge, parentRetainingObjectNode) { super(dataGrid, snapshot, edge, parentRetainingObjectNode); @@ -812,7 +812,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createProvider() { return this._snapshot.createRetainingEdgesProvider(this.snapshotNodeIndex); @@ -820,11 +820,11 @@ /** * @override - * @param {!WebInspector.HeapSnapshotCommon.Edge} item - * @return {!WebInspector.HeapSnapshotRetainingObjectNode} + * @param {!Profiler.HeapSnapshotCommon.Edge} item + * @return {!Profiler.HeapSnapshotRetainingObjectNode} */ _createChildNode(item) { - return new WebInspector.HeapSnapshotRetainingObjectNode(this._dataGrid, this._snapshot, item, this); + return new Profiler.HeapSnapshotRetainingObjectNode(this._dataGrid, this._snapshot, item, this); } /** @@ -847,15 +847,15 @@ */ _expandRetainersChain(maxExpandLevels) { /** - * @this {!WebInspector.HeapSnapshotRetainingObjectNode} + * @this {!Profiler.HeapSnapshotRetainingObjectNode} */ function populateComplete() { - this.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + this.removeEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); this._expandRetainersChain(maxExpandLevels); } if (!this._populated) { - this.addEventListener(WebInspector.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); + this.addEventListener(Profiler.HeapSnapshotGridNode.Events.PopulateComplete, populateComplete, this); this.populate(); return; } @@ -867,18 +867,18 @@ return; } } - this._dataGrid.dispatchEventToListeners(WebInspector.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete); + this._dataGrid.dispatchEventToListeners(Profiler.HeapSnapshotRetainmentDataGrid.Events.ExpandRetainersComplete); } }; /** * @unrestricted */ -WebInspector.HeapSnapshotInstanceNode = class extends WebInspector.HeapSnapshotGenericObjectNode { +Profiler.HeapSnapshotInstanceNode = class extends Profiler.HeapSnapshotGenericObjectNode { /** - * @param {!WebInspector.HeapSnapshotSortableDataGrid} dataGrid - * @param {!WebInspector.HeapSnapshotProxy} snapshot - * @param {!WebInspector.HeapSnapshotCommon.Node} node + * @param {!Profiler.HeapSnapshotSortableDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotCommon.Node} node * @param {boolean} isDeletedNode */ constructor(dataGrid, snapshot, node, isDeletedNode) { @@ -906,7 +906,7 @@ /** * @override - * @return {?{snapshot:!WebInspector.HeapSnapshotProxy, snapshotNodeIndex:number}} + * @return {?{snapshot:!Profiler.HeapSnapshotProxy, snapshotNodeIndex:number}} */ retainersDataSource() { return {snapshot: this._baseSnapshotOrSnapshot, snapshotNodeIndex: this.snapshotNodeIndex}; @@ -914,22 +914,22 @@ /** * @override - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createProvider() { return this._baseSnapshotOrSnapshot.createEdgesProvider(this.snapshotNodeIndex); } /** - * @param {!WebInspector.HeapSnapshotCommon.Edge} item - * @return {!WebInspector.HeapSnapshotObjectNode} + * @param {!Profiler.HeapSnapshotCommon.Edge} item + * @return {!Profiler.HeapSnapshotObjectNode} */ _createChildNode(item) { - return new WebInspector.HeapSnapshotObjectNode(this._dataGrid, this._baseSnapshotOrSnapshot, item, null); + return new Profiler.HeapSnapshotObjectNode(this._dataGrid, this._baseSnapshotOrSnapshot, item, null); } /** - * @param {!WebInspector.HeapSnapshotCommon.Edge} edge + * @param {!Profiler.HeapSnapshotCommon.Edge} edge * @return {number} */ _childHashForEntity(edge) { @@ -937,7 +937,7 @@ } /** - * @param {!WebInspector.HeapSnapshotObjectNode} childNode + * @param {!Profiler.HeapSnapshotObjectNode} childNode * @return {number} */ _childHashForNode(childNode) { @@ -945,7 +945,7 @@ } /** - * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} + * @return {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ comparator() { var sortAscending = this._dataGrid.isSortOrderAscending(); @@ -960,19 +960,19 @@ retainedSize: ['retainedSize', sortAscending, '!edgeName', true] }[sortColumnId] || ['!edgeName', true, 'retainedSize', false]; - return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); + return Profiler.HeapSnapshotGridNode.createComparator(sortFields); } }; /** * @unrestricted */ -WebInspector.HeapSnapshotConstructorNode = class extends WebInspector.HeapSnapshotGridNode { +Profiler.HeapSnapshotConstructorNode = class extends Profiler.HeapSnapshotGridNode { /** - * @param {!WebInspector.HeapSnapshotConstructorsDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotConstructorsDataGrid} dataGrid * @param {string} className - * @param {!WebInspector.HeapSnapshotCommon.Aggregate} aggregate - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter + * @param {!Profiler.HeapSnapshotCommon.Aggregate} aggregate + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter */ constructor(dataGrid, className, aggregate, nodeFilter) { super(dataGrid, aggregate.count > 0); @@ -1002,7 +1002,7 @@ /** * @override - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createProvider() { return this._dataGrid.snapshot.createNodesProviderForClass(this._name, this._nodeFilter); @@ -1010,20 +1010,20 @@ /** * @param {number} snapshotObjectId - * @return {!Promise<!Array<!WebInspector.HeapSnapshotGridNode>>} + * @return {!Promise<!Array<!Profiler.HeapSnapshotGridNode>>} */ populateNodeBySnapshotObjectId(snapshotObjectId) { /** - * @this {WebInspector.HeapSnapshotConstructorNode} + * @this {Profiler.HeapSnapshotConstructorNode} */ function didExpand() { return this._provider().nodePosition(snapshotObjectId).then(didGetNodePosition.bind(this)); } /** - * @this {WebInspector.HeapSnapshotConstructorNode} + * @this {Profiler.HeapSnapshotConstructorNode} * @param {number} nodePosition - * @return {!Promise<!Array<!WebInspector.HeapSnapshotGridNode>>} + * @return {!Promise<!Array<!Profiler.HeapSnapshotGridNode>>} */ function didGetNodePosition(nodePosition) { if (nodePosition === -1) { @@ -1031,8 +1031,8 @@ return Promise.resolve([]); } else { /** - * @param {function(!Array<!WebInspector.HeapSnapshotGridNode>)} fulfill - * @this {WebInspector.HeapSnapshotConstructorNode} + * @param {function(!Array<!Profiler.HeapSnapshotGridNode>)} fulfill + * @this {Profiler.HeapSnapshotConstructorNode} */ function action(fulfill) { this._populateChildren(nodePosition, null, didPopulateChildren.bind(this, nodePosition, fulfill)); @@ -1042,12 +1042,12 @@ } /** - * @this {WebInspector.HeapSnapshotConstructorNode} + * @this {Profiler.HeapSnapshotConstructorNode} * @param {number} nodePosition - * @param {function(!Array<!WebInspector.HeapSnapshotGridNode>)} callback + * @param {function(!Array<!Profiler.HeapSnapshotGridNode>)} callback */ function didPopulateChildren(nodePosition, callback) { - var node = /** @type {?WebInspector.HeapSnapshotGridNode} */ (this.childForPosition(nodePosition)); + var node = /** @type {?Profiler.HeapSnapshotGridNode} */ (this.childForPosition(nodePosition)); callback(node ? [this, node] : []); } @@ -1076,15 +1076,15 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.Node} item - * @return {!WebInspector.HeapSnapshotInstanceNode} + * @param {!Profiler.HeapSnapshotCommon.Node} item + * @return {!Profiler.HeapSnapshotInstanceNode} */ _createChildNode(item) { - return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.snapshot, item, false); + return new Profiler.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.snapshot, item, false); } /** - * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} + * @return {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ comparator() { var sortAscending = this._dataGrid.isSortOrderAscending(); @@ -1096,11 +1096,11 @@ shallowSize: ['selfSize', sortAscending, 'id', true], retainedSize: ['retainedSize', sortAscending, 'id', true] }[sortColumnId]; - return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); + return Profiler.HeapSnapshotGridNode.createComparator(sortFields); } /** - * @param {!WebInspector.HeapSnapshotCommon.Node} node + * @param {!Profiler.HeapSnapshotCommon.Node} node * @return {number} */ _childHashForEntity(node) { @@ -1108,7 +1108,7 @@ } /** - * @param {!WebInspector.HeapSnapshotInstanceNode} childNode + * @param {!Profiler.HeapSnapshotInstanceNode} childNode * @return {number} */ _childHashForNode(childNode) { @@ -1117,13 +1117,13 @@ }; /** - * @implements {WebInspector.HeapSnapshotGridNode.ChildrenProvider} + * @implements {Profiler.HeapSnapshotGridNode.ChildrenProvider} * @unrestricted */ -WebInspector.HeapSnapshotDiffNodesProvider = class { +Profiler.HeapSnapshotDiffNodesProvider = class { /** - * @param {!WebInspector.HeapSnapshotProviderProxy} addedNodesProvider - * @param {!WebInspector.HeapSnapshotProviderProxy} deletedNodesProvider + * @param {!Profiler.HeapSnapshotProviderProxy} addedNodesProvider + * @param {!Profiler.HeapSnapshotProviderProxy} deletedNodesProvider * @param {number} addedCount * @param {number} removedCount */ @@ -1163,12 +1163,12 @@ * @override * @param {number} beginPosition * @param {number} endPosition - * @param {function(!WebInspector.HeapSnapshotCommon.ItemsRange)} callback + * @param {function(!Profiler.HeapSnapshotCommon.ItemsRange)} callback */ serializeItemsRange(beginPosition, endPosition, callback) { /** - * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} items - * @this {WebInspector.HeapSnapshotDiffNodesProvider} + * @param {!Profiler.HeapSnapshotCommon.ItemsRange} items + * @this {Profiler.HeapSnapshotDiffNodesProvider} */ function didReceiveAllItems(items) { items.totalLength = this._addedCount + this._removedCount; @@ -1176,9 +1176,9 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} addedItems - * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} itemsRange - * @this {WebInspector.HeapSnapshotDiffNodesProvider} + * @param {!Profiler.HeapSnapshotCommon.ItemsRange} addedItems + * @param {!Profiler.HeapSnapshotCommon.ItemsRange} itemsRange + * @this {Profiler.HeapSnapshotDiffNodesProvider} */ function didReceiveDeletedItems(addedItems, itemsRange) { var items = itemsRange.items; @@ -1193,8 +1193,8 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.ItemsRange} itemsRange - * @this {WebInspector.HeapSnapshotDiffNodesProvider} + * @param {!Profiler.HeapSnapshotCommon.ItemsRange} itemsRange + * @this {Profiler.HeapSnapshotDiffNodesProvider} */ function didReceiveAddedItems(itemsRange) { var items = itemsRange.items; @@ -1211,7 +1211,7 @@ if (beginPosition < this._addedCount) { this._addedNodesProvider.serializeItemsRange(beginPosition, endPosition, didReceiveAddedItems.bind(this)); } else { - var emptyRange = new WebInspector.HeapSnapshotCommon.ItemsRange(0, 0, 0, []); + var emptyRange = new Profiler.HeapSnapshotCommon.ItemsRange(0, 0, 0, []); this._deletedNodesProvider.serializeItemsRange( beginPosition - this._addedCount, endPosition - this._addedCount, didReceiveDeletedItems.bind(this, emptyRange)); @@ -1220,12 +1220,12 @@ /** * @override - * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator + * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator * @return {!Promise<?>} */ sortAndRewind(comparator) { /** - * @this {WebInspector.HeapSnapshotDiffNodesProvider} + * @this {Profiler.HeapSnapshotDiffNodesProvider} * @return {!Promise<?>} */ function afterSort() { @@ -1238,11 +1238,11 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotDiffNode = class extends WebInspector.HeapSnapshotGridNode { +Profiler.HeapSnapshotDiffNode = class extends Profiler.HeapSnapshotGridNode { /** - * @param {!WebInspector.HeapSnapshotDiffDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotDiffDataGrid} dataGrid * @param {string} className - * @param {!WebInspector.HeapSnapshotCommon.DiffForClass} diffForClass + * @param {!Profiler.HeapSnapshotCommon.DiffForClass} diffForClass */ constructor(dataGrid, className, diffForClass) { super(dataGrid, true); @@ -1267,11 +1267,11 @@ /** * @override - * @return {!WebInspector.HeapSnapshotDiffNodesProvider} + * @return {!Profiler.HeapSnapshotDiffNodesProvider} */ createProvider() { var tree = this._dataGrid; - return new WebInspector.HeapSnapshotDiffNodesProvider( + return new Profiler.HeapSnapshotDiffNodesProvider( tree.snapshot.createAddedNodesProvider(tree.baseSnapshot.uid, this._name), tree.baseSnapshot.createDeletedNodesProvider(this._deletedIndexes), this._addedCount, this._removedCount); } @@ -1289,18 +1289,18 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.Node} item - * @return {!WebInspector.HeapSnapshotInstanceNode} + * @param {!Profiler.HeapSnapshotCommon.Node} item + * @return {!Profiler.HeapSnapshotInstanceNode} */ _createChildNode(item) { if (item.isAddedNotRemoved) - return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.snapshot, item, false); + return new Profiler.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.snapshot, item, false); else - return new WebInspector.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.baseSnapshot, item, true); + return new Profiler.HeapSnapshotInstanceNode(this._dataGrid, this._dataGrid.baseSnapshot, item, true); } /** - * @param {!WebInspector.HeapSnapshotCommon.Node} node + * @param {!Profiler.HeapSnapshotCommon.Node} node * @return {number} */ _childHashForEntity(node) { @@ -1308,7 +1308,7 @@ } /** - * @param {!WebInspector.HeapSnapshotInstanceNode} childNode + * @param {!Profiler.HeapSnapshotInstanceNode} childNode * @return {number} */ _childHashForNode(childNode) { @@ -1316,7 +1316,7 @@ } /** - * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} + * @return {!Profiler.HeapSnapshotCommon.ComparatorConfig} */ comparator() { var sortAscending = this._dataGrid.isSortOrderAscending(); @@ -1330,7 +1330,7 @@ removedSize: ['selfSize', sortAscending, 'id', true], sizeDelta: ['selfSize', sortAscending, 'id', true] }[sortColumnId]; - return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); + return Profiler.HeapSnapshotGridNode.createComparator(sortFields); } /** @@ -1354,10 +1354,10 @@ /** * @unrestricted */ -WebInspector.AllocationGridNode = class extends WebInspector.HeapSnapshotGridNode { +Profiler.AllocationGridNode = class extends Profiler.HeapSnapshotGridNode { /** - * @param {!WebInspector.AllocationDataGrid} dataGrid - * @param {!WebInspector.HeapSnapshotCommon.SerializedAllocationNode} data + * @param {!Profiler.AllocationDataGrid} dataGrid + * @param {!Profiler.HeapSnapshotCommon.SerializedAllocationNode} data */ constructor(dataGrid, data) { super(dataGrid, data.hasChildren); @@ -1382,15 +1382,15 @@ this._dataGrid.snapshot.allocationNodeCallers(this._allocationNode.id, didReceiveCallers.bind(this)); /** - * @param {!WebInspector.HeapSnapshotCommon.AllocationNodeCallers} callers - * @this {WebInspector.AllocationGridNode} + * @param {!Profiler.HeapSnapshotCommon.AllocationNodeCallers} callers + * @this {Profiler.AllocationGridNode} */ function didReceiveCallers(callers) { var callersChain = callers.nodesWithSingleCaller; var parentNode = this; - var dataGrid = /** @type {!WebInspector.AllocationDataGrid} */ (this._dataGrid); + var dataGrid = /** @type {!Profiler.AllocationDataGrid} */ (this._dataGrid); for (var i = 0; i < callersChain.length; i++) { - var child = new WebInspector.AllocationGridNode(dataGrid, callersChain[i]); + var child = new Profiler.AllocationGridNode(dataGrid, callersChain[i]); dataGrid.appendNode(parentNode, child); parentNode = child; parentNode._populated = true; @@ -1401,7 +1401,7 @@ var callersBranch = callers.branchingCallers; callersBranch.sort(this._dataGrid._createComparator()); for (var i = 0; i < callersBranch.length; i++) - dataGrid.appendNode(parentNode, new WebInspector.AllocationGridNode(dataGrid, callersBranch[i])); + dataGrid.appendNode(parentNode, new Profiler.AllocationGridNode(dataGrid, callersBranch[i])); dataGrid.updateVisibleNodes(true); } }
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotProxy.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotProxy.js index 297bb54..aff3058 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotProxy.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotProxy.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotWorkerProxy = class extends WebInspector.Object { +Profiler.HeapSnapshotWorkerProxy = class extends Common.Object { /** * @param {function(string, *)} eventHandler */ @@ -44,23 +44,23 @@ this._callbacks = new Map(); /** @type {!Set<number>} */ this._previousCallbacks = new Set(); - this._worker = new WebInspector.Worker('heap_snapshot_worker'); + this._worker = new Common.Worker('heap_snapshot_worker'); this._worker.onmessage = this._messageReceived.bind(this); } /** * @param {number} profileUid - * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback - * @return {!WebInspector.HeapSnapshotLoaderProxy} + * @param {function(!Profiler.HeapSnapshotProxy)} snapshotReceivedCallback + * @return {!Profiler.HeapSnapshotLoaderProxy} */ createLoader(profileUid, snapshotReceivedCallback) { var objectId = this._nextObjectId++; - var proxy = new WebInspector.HeapSnapshotLoaderProxy(this, objectId, profileUid, snapshotReceivedCallback); + var proxy = new Profiler.HeapSnapshotLoaderProxy(this, objectId, profileUid, snapshotReceivedCallback); this._postMessage({ callId: this._nextCallId++, disposition: 'create', objectId: objectId, - methodName: 'WebInspector.HeapSnapshotLoader' + methodName: 'HeapSnapshotWorker.HeapSnapshotLoader' }); return proxy; } @@ -95,7 +95,7 @@ var newObjectId = this._nextObjectId++; /** - * @this {WebInspector.HeapSnapshotWorkerProxy} + * @this {Profiler.HeapSnapshotWorkerProxy} */ function wrapCallback(remoteResult) { callback(remoteResult ? new proxyConstructor(this, newObjectId) : null); @@ -173,9 +173,9 @@ } if (data.error) { if (data.errorMethodName) - WebInspector.console.error(WebInspector.UIString( + Common.console.error(Common.UIString( 'An error occurred when a call to method \'%s\' was requested', data.errorMethodName)); - WebInspector.console.error(data['errorCallStack']); + Common.console.error(data['errorCallStack']); this._callbacks.delete(data.callId); return; } @@ -194,9 +194,9 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotProxyObject = class { +Profiler.HeapSnapshotProxyObject = class { /** - * @param {!WebInspector.HeapSnapshotWorkerProxy} worker + * @param {!Profiler.HeapSnapshotWorkerProxy} worker * @param {number} objectId */ constructor(worker, objectId) { @@ -254,7 +254,7 @@ /** * @param {!Array.<*>} args * @param {function(?T)} fulfill - * @this {WebInspector.HeapSnapshotProxyObject} + * @this {Profiler.HeapSnapshotProxyObject} * @template T */ function action(args, fulfill) { @@ -265,15 +265,15 @@ }; /** - * @implements {WebInspector.OutputStream} + * @implements {Common.OutputStream} * @unrestricted */ -WebInspector.HeapSnapshotLoaderProxy = class extends WebInspector.HeapSnapshotProxyObject { +Profiler.HeapSnapshotLoaderProxy = class extends Profiler.HeapSnapshotProxyObject { /** - * @param {!WebInspector.HeapSnapshotWorkerProxy} worker + * @param {!Profiler.HeapSnapshotWorkerProxy} worker * @param {number} objectId * @param {number} profileUid - * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback + * @param {function(!Profiler.HeapSnapshotProxy)} snapshotReceivedCallback */ constructor(worker, objectId, profileUid, snapshotReceivedCallback) { super(worker, objectId); @@ -284,7 +284,7 @@ /** * @override * @param {string} chunk - * @param {function(!WebInspector.OutputStream)=} callback + * @param {function(!Common.OutputStream)=} callback */ write(chunk, callback) { this.callMethod(callback, 'write', chunk); @@ -296,17 +296,17 @@ */ close(callback) { /** - * @this {WebInspector.HeapSnapshotLoaderProxy} + * @this {Profiler.HeapSnapshotLoaderProxy} */ function buildSnapshot() { if (callback) callback(); - this.callFactoryMethod(updateStaticData.bind(this), 'buildSnapshot', WebInspector.HeapSnapshotProxy); + this.callFactoryMethod(updateStaticData.bind(this), 'buildSnapshot', Profiler.HeapSnapshotProxy); } /** - * @param {!WebInspector.HeapSnapshotProxy} snapshotProxy - * @this {WebInspector.HeapSnapshotLoaderProxy} + * @param {!Profiler.HeapSnapshotProxy} snapshotProxy + * @this {Profiler.HeapSnapshotLoaderProxy} */ function updateStaticData(snapshotProxy) { this.dispose(); @@ -321,20 +321,20 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotProxy = class extends WebInspector.HeapSnapshotProxyObject { +Profiler.HeapSnapshotProxy = class extends Profiler.HeapSnapshotProxyObject { /** - * @param {!WebInspector.HeapSnapshotWorkerProxy} worker + * @param {!Profiler.HeapSnapshotWorkerProxy} worker * @param {number} objectId */ constructor(worker, objectId) { super(worker, objectId); - /** @type {?WebInspector.HeapSnapshotCommon.StaticData} */ + /** @type {?Profiler.HeapSnapshotCommon.StaticData} */ this._staticData = null; } /** - * @param {!WebInspector.HeapSnapshotCommon.SearchConfig} searchConfig - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} filter + * @param {!Profiler.HeapSnapshotCommon.SearchConfig} searchConfig + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter * @return {!Promise<!Array<number>>} */ search(searchConfig, filter) { @@ -342,8 +342,8 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} filter - * @param {function(!Object.<string, !WebInspector.HeapSnapshotCommon.Aggregate>)} callback + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter + * @param {function(!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>)} callback */ aggregatesWithFilter(filter, callback) { this.callMethod(callback, 'aggregatesWithFilter', filter); @@ -367,56 +367,56 @@ /** * @param {number} nodeIndex - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createEdgesProvider(nodeIndex) { - return this.callFactoryMethod(null, 'createEdgesProvider', WebInspector.HeapSnapshotProviderProxy, nodeIndex); + return this.callFactoryMethod(null, 'createEdgesProvider', Profiler.HeapSnapshotProviderProxy, nodeIndex); } /** * @param {number} nodeIndex - * @return {!WebInspector.HeapSnapshotProviderProxy} + * @return {!Profiler.HeapSnapshotProviderProxy} */ createRetainingEdgesProvider(nodeIndex) { return this.callFactoryMethod( - null, 'createRetainingEdgesProvider', WebInspector.HeapSnapshotProviderProxy, nodeIndex); + null, 'createRetainingEdgesProvider', Profiler.HeapSnapshotProviderProxy, nodeIndex); } /** * @param {string} baseSnapshotId * @param {string} className - * @return {?WebInspector.HeapSnapshotProviderProxy} + * @return {?Profiler.HeapSnapshotProviderProxy} */ createAddedNodesProvider(baseSnapshotId, className) { return this.callFactoryMethod( - null, 'createAddedNodesProvider', WebInspector.HeapSnapshotProviderProxy, baseSnapshotId, className); + null, 'createAddedNodesProvider', Profiler.HeapSnapshotProviderProxy, baseSnapshotId, className); } /** * @param {!Array.<number>} nodeIndexes - * @return {?WebInspector.HeapSnapshotProviderProxy} + * @return {?Profiler.HeapSnapshotProviderProxy} */ createDeletedNodesProvider(nodeIndexes) { return this.callFactoryMethod( - null, 'createDeletedNodesProvider', WebInspector.HeapSnapshotProviderProxy, nodeIndexes); + null, 'createDeletedNodesProvider', Profiler.HeapSnapshotProviderProxy, nodeIndexes); } /** * @param {function(*):boolean} filter - * @return {?WebInspector.HeapSnapshotProviderProxy} + * @return {?Profiler.HeapSnapshotProviderProxy} */ createNodesProvider(filter) { - return this.callFactoryMethod(null, 'createNodesProvider', WebInspector.HeapSnapshotProviderProxy, filter); + return this.callFactoryMethod(null, 'createNodesProvider', Profiler.HeapSnapshotProviderProxy, filter); } /** * @param {string} className - * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter - * @return {?WebInspector.HeapSnapshotProviderProxy} + * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter + * @return {?Profiler.HeapSnapshotProviderProxy} */ createNodesProviderForClass(className, nodeFilter) { return this.callFactoryMethod( - null, 'createNodesProviderForClass', WebInspector.HeapSnapshotProviderProxy, className, nodeFilter); + null, 'createNodesProviderForClass', Profiler.HeapSnapshotProviderProxy, className, nodeFilter); } allocationTracesTops(callback) { @@ -425,7 +425,7 @@ /** * @param {number} nodeId - * @param {function(!WebInspector.HeapSnapshotCommon.AllocationNodeCallers)} callback + * @param {function(!Profiler.HeapSnapshotCommon.AllocationNodeCallers)} callback */ allocationNodeCallers(nodeId, callback) { this.callMethod(callback, 'allocationNodeCallers', nodeId); @@ -433,7 +433,7 @@ /** * @param {number} nodeIndex - * @param {function(?Array.<!WebInspector.HeapSnapshotCommon.AllocationStackFrame>)} callback + * @param {function(?Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame>)} callback */ allocationStack(nodeIndex, callback) { this.callMethod(callback, 'allocationStack', nodeIndex); @@ -456,8 +456,8 @@ updateStaticData(callback) { /** - * @param {!WebInspector.HeapSnapshotCommon.StaticData} staticData - * @this {WebInspector.HeapSnapshotProxy} + * @param {!Profiler.HeapSnapshotCommon.StaticData} staticData + * @this {Profiler.HeapSnapshotProxy} */ function dataReceived(staticData) { this._staticData = staticData; @@ -467,14 +467,14 @@ } /** - * @return {!Promise.<!WebInspector.HeapSnapshotCommon.Statistics>} + * @return {!Promise.<!Profiler.HeapSnapshotCommon.Statistics>} */ getStatistics() { return this._callMethodPromise('getStatistics'); } /** - * @return {!Promise.<?WebInspector.HeapSnapshotCommon.Samples>} + * @return {!Promise.<?Profiler.HeapSnapshotCommon.Samples>} */ getSamples() { return this._callMethodPromise('getSamples'); @@ -501,12 +501,12 @@ }; /** - * @implements {WebInspector.HeapSnapshotGridNode.ChildrenProvider} + * @implements {Profiler.HeapSnapshotGridNode.ChildrenProvider} * @unrestricted */ -WebInspector.HeapSnapshotProviderProxy = class extends WebInspector.HeapSnapshotProxyObject { +Profiler.HeapSnapshotProviderProxy = class extends Profiler.HeapSnapshotProxyObject { /** - * @param {!WebInspector.HeapSnapshotWorkerProxy} worker + * @param {!Profiler.HeapSnapshotWorkerProxy} worker * @param {number} objectId */ constructor(worker, objectId) { @@ -534,7 +534,7 @@ * @override * @param {number} startPosition * @param {number} endPosition - * @param {function(!WebInspector.HeapSnapshotCommon.ItemsRange)} callback + * @param {function(!Profiler.HeapSnapshotCommon.ItemsRange)} callback */ serializeItemsRange(startPosition, endPosition, callback) { this.callMethod(callback, 'serializeItemsRange', startPosition, endPosition); @@ -542,7 +542,7 @@ /** * @override - * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator + * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator * @return {!Promise<?>} */ sortAndRewind(comparator) {
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotView.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotView.js index d4540ee..3c391b09 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotView.js
@@ -28,83 +28,83 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ProfileType.DataDisplayDelegate} - * @implements {WebInspector.Searchable} + * @implements {Profiler.ProfileType.DataDisplayDelegate} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.HeapSnapshotView = class extends WebInspector.SimpleView { +Profiler.HeapSnapshotView = class extends UI.SimpleView { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!WebInspector.HeapProfileHeader} profile + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.HeapProfileHeader} profile */ constructor(dataDisplayDelegate, profile) { - super(WebInspector.UIString('Heap Snapshot')); + super(Common.UIString('Heap Snapshot')); this.element.classList.add('heap-snapshot-view'); profile.profileType().addEventListener( - WebInspector.HeapSnapshotProfileType.SnapshotReceived, this._onReceiveSnapshot, this); + Profiler.HeapSnapshotProfileType.SnapshotReceived, this._onReceiveSnapshot, this); profile.profileType().addEventListener( - WebInspector.ProfileType.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); + Profiler.ProfileType.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); - var isHeapTimeline = profile.profileType().id === WebInspector.TrackingHeapSnapshotProfileType.TypeId; + var isHeapTimeline = profile.profileType().id === Profiler.TrackingHeapSnapshotProfileType.TypeId; if (isHeapTimeline) { - this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(profile); + this._trackingOverviewGrid = new Profiler.HeapTrackingOverviewGrid(profile); this._trackingOverviewGrid.addEventListener( - WebInspector.HeapTrackingOverviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); + Profiler.HeapTrackingOverviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); } this._parentDataDisplayDelegate = dataDisplayDelegate; - this._searchableView = new WebInspector.SearchableView(this); + this._searchableView = new UI.SearchableView(this); this._searchableView.show(this.element); - this._splitWidget = new WebInspector.SplitWidget(false, true, 'heapSnapshotSplitViewState', 200, 200); + this._splitWidget = new UI.SplitWidget(false, true, 'heapSnapshotSplitViewState', 200, 200); this._splitWidget.show(this._searchableView.element); - this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid(this); - this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this); + this._containmentDataGrid = new Profiler.HeapSnapshotContainmentDataGrid(this); + this._containmentDataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._selectionChanged, this); this._containmentWidget = this._containmentDataGrid.asWidget(); this._containmentWidget.setMinimumSize(50, 25); - this._statisticsView = new WebInspector.HeapSnapshotStatisticsView(); + this._statisticsView = new Profiler.HeapSnapshotStatisticsView(); - this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid(this); + this._constructorsDataGrid = new Profiler.HeapSnapshotConstructorsDataGrid(this); this._constructorsDataGrid.addEventListener( - WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this); + UI.DataGrid.Events.SelectedNode, this._selectionChanged, this); this._constructorsWidget = this._constructorsDataGrid.asWidget(); this._constructorsWidget.setMinimumSize(50, 25); - this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(this); - this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this); + this._diffDataGrid = new Profiler.HeapSnapshotDiffDataGrid(this); + this._diffDataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._selectionChanged, this); this._diffWidget = this._diffDataGrid.asWidget(); this._diffWidget.setMinimumSize(50, 25); - if (isHeapTimeline && WebInspector.moduleSetting('recordAllocationStacks').get()) { - this._allocationDataGrid = new WebInspector.AllocationDataGrid(profile.target(), this); + if (isHeapTimeline && Common.moduleSetting('recordAllocationStacks').get()) { + this._allocationDataGrid = new Profiler.AllocationDataGrid(profile.target(), this); this._allocationDataGrid.addEventListener( - WebInspector.DataGrid.Events.SelectedNode, this._onSelectAllocationNode, this); + UI.DataGrid.Events.SelectedNode, this._onSelectAllocationNode, this); this._allocationWidget = this._allocationDataGrid.asWidget(); this._allocationWidget.setMinimumSize(50, 25); - this._allocationStackView = new WebInspector.HeapAllocationStackView(profile.target()); + this._allocationStackView = new Profiler.HeapAllocationStackView(profile.target()); this._allocationStackView.setMinimumSize(50, 25); - this._tabbedPane = new WebInspector.TabbedPane(); + this._tabbedPane = new UI.TabbedPane(); } - this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid(this); + this._retainmentDataGrid = new Profiler.HeapSnapshotRetainmentDataGrid(this); this._retainmentWidget = this._retainmentDataGrid.asWidget(); this._retainmentWidget.setMinimumSize(50, 21); this._retainmentWidget.element.classList.add('retaining-paths-view'); var splitWidgetResizer; if (this._allocationStackView) { - this._tabbedPane = new WebInspector.TabbedPane(); + this._tabbedPane = new UI.TabbedPane(); - this._tabbedPane.appendTab('retainers', WebInspector.UIString('Retainers'), this._retainmentWidget); + this._tabbedPane.appendTab('retainers', Common.UIString('Retainers'), this._retainmentWidget); this._tabbedPane.appendTab( - 'allocation-stack', WebInspector.UIString('Allocation stack'), this._allocationStackView); + 'allocation-stack', Common.UIString('Allocation stack'), this._allocationStackView); splitWidgetResizer = this._tabbedPane.headerElement(); this._objectDetailsView = this._tabbedPane; @@ -112,10 +112,10 @@ var retainmentViewHeader = createElementWithClass('div', 'heap-snapshot-view-resizer'); var retainingPathsTitleDiv = retainmentViewHeader.createChild('div', 'title'); var retainingPathsTitle = retainingPathsTitleDiv.createChild('span'); - retainingPathsTitle.textContent = WebInspector.UIString('Retainers'); + retainingPathsTitle.textContent = Common.UIString('Retainers'); splitWidgetResizer = retainmentViewHeader; - this._objectDetailsView = new WebInspector.VBox(); + this._objectDetailsView = new UI.VBox(); this._objectDetailsView.element.appendChild(retainmentViewHeader); this._retainmentWidget.show(this._objectDetailsView.element); } @@ -123,40 +123,40 @@ this._splitWidget.installResizer(splitWidgetResizer); this._retainmentDataGrid.addEventListener( - WebInspector.DataGrid.Events.SelectedNode, this._inspectedObjectChanged, this); + UI.DataGrid.Events.SelectedNode, this._inspectedObjectChanged, this); this._retainmentDataGrid.reset(); this._perspectives = []; - this._perspectives.push(new WebInspector.HeapSnapshotView.SummaryPerspective()); - if (profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trackingHeapSnapshotProfileType) - this._perspectives.push(new WebInspector.HeapSnapshotView.ComparisonPerspective()); - this._perspectives.push(new WebInspector.HeapSnapshotView.ContainmentPerspective()); + this._perspectives.push(new Profiler.HeapSnapshotView.SummaryPerspective()); + if (profile.profileType() !== Profiler.ProfileTypeRegistry.instance.trackingHeapSnapshotProfileType) + this._perspectives.push(new Profiler.HeapSnapshotView.ComparisonPerspective()); + this._perspectives.push(new Profiler.HeapSnapshotView.ContainmentPerspective()); if (this._allocationWidget) - this._perspectives.push(new WebInspector.HeapSnapshotView.AllocationPerspective()); - this._perspectives.push(new WebInspector.HeapSnapshotView.StatisticsPerspective()); + this._perspectives.push(new Profiler.HeapSnapshotView.AllocationPerspective()); + this._perspectives.push(new Profiler.HeapSnapshotView.StatisticsPerspective()); - this._perspectiveSelect = new WebInspector.ToolbarComboBox(this._onSelectedPerspectiveChanged.bind(this)); + this._perspectiveSelect = new UI.ToolbarComboBox(this._onSelectedPerspectiveChanged.bind(this)); for (var i = 0; i < this._perspectives.length; ++i) this._perspectiveSelect.createOption(this._perspectives[i].title()); this._profile = profile; - this._baseSelect = new WebInspector.ToolbarComboBox(this._changeBase.bind(this)); + this._baseSelect = new UI.ToolbarComboBox(this._changeBase.bind(this)); this._baseSelect.setVisible(false); this._updateBaseOptions(); - this._filterSelect = new WebInspector.ToolbarComboBox(this._changeFilter.bind(this)); + this._filterSelect = new UI.ToolbarComboBox(this._changeFilter.bind(this)); this._filterSelect.setVisible(false); this._updateFilterOptions(); - this._classNameFilter = new WebInspector.ToolbarInput('Class filter'); + this._classNameFilter = new UI.ToolbarInput('Class filter'); this._classNameFilter.setVisible(false); this._constructorsDataGrid.setNameFilter(this._classNameFilter); this._diffDataGrid.setNameFilter(this._classNameFilter); - this._selectedSizeText = new WebInspector.ToolbarText(); + this._selectedSizeText = new UI.ToolbarText(); - this._popoverHelper = new WebInspector.ObjectPopoverHelper( + this._popoverHelper = new Components.ObjectPopoverHelper( this.element, this._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefined, true); this._currentPerspectiveIndex = 0; @@ -165,11 +165,11 @@ this._dataGrid = this._currentPerspective.masterGrid(this); this._populate(); - this._searchThrottler = new WebInspector.Throttler(0); + this._searchThrottler = new Common.Throttler(0); } /** - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -177,8 +177,8 @@ /** * @override - * @param {?WebInspector.ProfileHeader} profile - * @return {?WebInspector.Widget} + * @param {?Profiler.ProfileHeader} profile + * @return {?UI.Widget} */ showProfile(profile) { return this._parentDataDisplayDelegate.showProfile(profile); @@ -201,7 +201,7 @@ .then(heapSnapshotProxy => { heapSnapshotProxy.getStatistics().then(this._gotStatistics.bind(this)); this._dataGrid.setDataSource(heapSnapshotProxy); - if (this._profile.profileType().id === WebInspector.TrackingHeapSnapshotProfileType.TypeId && + if (this._profile.profileType().id === Profiler.TrackingHeapSnapshotProfileType.TypeId && this._profile.fromFile()) return heapSnapshotProxy.getSamples().then(samples => this._trackingOverviewGrid._setSamples(samples)); }) @@ -215,36 +215,36 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.Statistics} statistics + * @param {!Profiler.HeapSnapshotCommon.Statistics} statistics */ _gotStatistics(statistics) { this._statisticsView.setTotal(statistics.total); - this._statisticsView.addRecord(statistics.code, WebInspector.UIString('Code'), '#f77'); - this._statisticsView.addRecord(statistics.strings, WebInspector.UIString('Strings'), '#5e5'); - this._statisticsView.addRecord(statistics.jsArrays, WebInspector.UIString('JS Arrays'), '#7af'); - this._statisticsView.addRecord(statistics.native, WebInspector.UIString('Typed Arrays'), '#fc5'); - this._statisticsView.addRecord(statistics.system, WebInspector.UIString('System Objects'), '#98f'); - this._statisticsView.addRecord(statistics.total, WebInspector.UIString('Total')); + this._statisticsView.addRecord(statistics.code, Common.UIString('Code'), '#f77'); + this._statisticsView.addRecord(statistics.strings, Common.UIString('Strings'), '#5e5'); + this._statisticsView.addRecord(statistics.jsArrays, Common.UIString('JS Arrays'), '#7af'); + this._statisticsView.addRecord(statistics.native, Common.UIString('Typed Arrays'), '#fc5'); + this._statisticsView.addRecord(statistics.system, Common.UIString('System Objects'), '#98f'); + this._statisticsView.addRecord(statistics.total, Common.UIString('Total')); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onIdsRangeChanged(event) { var minId = event.data.minId; var maxId = event.data.maxId; - this._selectedSizeText.setText(WebInspector.UIString('Selected size: %s', Number.bytesToString(event.data.size))); + this._selectedSizeText.setText(Common.UIString('Selected size: %s', Number.bytesToString(event.data.size))); if (this._constructorsDataGrid.snapshot) this._constructorsDataGrid.setSelectionRange(minId, maxId); } /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { var result = [this._perspectiveSelect, this._classNameFilter]; - if (this._profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trackingHeapSnapshotProfileType) + if (this._profile.profileType() !== Profiler.ProfileTypeRegistry.instance.trackingHeapSnapshotProfileType) result.push(this._baseSelect, this._filterSelect); result.push(this._selectedSizeText); return result; @@ -292,7 +292,7 @@ } /** - * @param {?WebInspector.HeapSnapshotGridNode} node + * @param {?Profiler.HeapSnapshotGridNode} node */ _selectRevealedNode(node) { if (node) @@ -301,12 +301,12 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ performSearch(searchConfig, shouldJump, jumpBackwards) { - var nextQuery = new WebInspector.HeapSnapshotCommon.SearchConfig( + var nextQuery = new Profiler.HeapSnapshotCommon.SearchConfig( searchConfig.query.trim(), searchConfig.caseSensitive, searchConfig.isRegex, shouldJump, jumpBackwards || false); @@ -314,7 +314,7 @@ } /** - * @param {!WebInspector.HeapSnapshotCommon.SearchConfig} nextQuery + * @param {!Profiler.HeapSnapshotCommon.SearchConfig} nextQuery * @return {!Promise<?>} */ _performSearch(nextQuery) { @@ -341,7 +341,7 @@ /** * @param {!Array<number>} entryIds * @return {!Promise<?>} - * @this {WebInspector.HeapSnapshotView} + * @this {Profiler.HeapSnapshotView} */ function didSearch(entryIds) { this._searchResults = entryIds; @@ -401,7 +401,7 @@ return; this._baseProfile = this._profiles()[this._baseSelect.selectedIndex()]; - var dataGrid = /** @type {!WebInspector.HeapSnapshotDiffDataGrid} */ (this._dataGrid); + var dataGrid = /** @type {!Profiler.HeapSnapshotDiffDataGrid} */ (this._dataGrid); // Change set base data source only if main data source is already set. if (dataGrid.snapshot) this._baseProfile._loadPromise.then(dataGrid.setBaseDataSource.bind(dataGrid)); @@ -429,14 +429,14 @@ } /** - * @return {!Array.<!WebInspector.ProfileHeader>} + * @return {!Array.<!Profiler.ProfileHeader>} */ _profiles() { return this._profile.profileType().getProfiles(); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Event} event */ populateContextMenu(contextMenu, event) { @@ -459,12 +459,12 @@ _inspectedObjectChanged(event) { var selectedNode = event.target.selectedNode; var target = this._profile.target(); - if (target && selectedNode instanceof WebInspector.HeapSnapshotGenericObjectNode) + if (target && selectedNode instanceof Profiler.HeapSnapshotGenericObjectNode) target.heapProfilerAgent().addInspectedHeapObject(String(selectedNode.snapshotNodeId)); } /** - * @param {?WebInspector.HeapSnapshotGridNode} nodeItem + * @param {?Profiler.HeapSnapshotGridNode} nodeItem */ _setSelectedNodeForDetailsView(nodeItem) { var dataSource = nodeItem && nodeItem.retainersDataSource(); @@ -497,17 +497,17 @@ } /** - * @this {WebInspector.HeapSnapshotView} + * @this {Profiler.HeapSnapshotView} */ function dataGridContentShown(event) { var dataGrid = event.data; dataGrid.removeEventListener( - WebInspector.HeapSnapshotSortableDataGrid.Events.ContentShown, dataGridContentShown, this); + Profiler.HeapSnapshotSortableDataGrid.Events.ContentShown, dataGridContentShown, this); if (dataGrid === this._dataGrid) callback(); } this._perspectives[perspectiveIndex].masterGrid(this).addEventListener( - WebInspector.HeapSnapshotSortableDataGrid.Events.ContentShown, dataGridContentShown, this); + Profiler.HeapSnapshotSortableDataGrid.Events.ContentShown, dataGridContentShown, this); this._perspectiveSelect.setSelectedIndex(perspectiveIndex); this._changePerspective(perspectiveIndex); @@ -521,7 +521,7 @@ this._profile._loadPromise.then(didLoadSnapshot.bind(this)); /** - * @this {WebInspector.HeapSnapshotView} + * @this {Profiler.HeapSnapshotView} */ function didLoadSnapshot(snapshotProxy) { if (this._dataGrid !== dataGrid) @@ -536,7 +536,7 @@ } /** - * @this {WebInspector.HeapSnapshotView} + * @this {Profiler.HeapSnapshotView} */ function didLoadBaseSnapshot(baseSnapshotProxy) { if (this._diffDataGrid.baseSnapshot !== baseSnapshotProxy) @@ -586,20 +586,20 @@ this._changePerspectiveAndWait(perspectiveName, didChangePerspective.bind(this)); /** - * @this {WebInspector.HeapSnapshotView} + * @this {Profiler.HeapSnapshotView} */ function didChangePerspective() { this._dataGrid.revealObjectByHeapSnapshotId(snapshotObjectId, didRevealObject); } /** - * @param {?WebInspector.HeapSnapshotGridNode} node + * @param {?Profiler.HeapSnapshotGridNode} node */ function didRevealObject(node) { if (node) node.select(); else - WebInspector.console.error('Cannot find corresponding heap snapshot node'); + Common.console.error('Cannot find corresponding heap snapshot node'); } } @@ -641,14 +641,14 @@ return; if (!this._filterSelect.size()) - this._filterSelect.createOption(WebInspector.UIString('All objects')); + this._filterSelect.createOption(Common.UIString('All objects')); for (var i = this._filterSelect.size() - 1, n = list.length; i < n; ++i) { var title = list[i].title; if (!i) - title = WebInspector.UIString('Objects allocated before %s', title); + title = Common.UIString('Objects allocated before %s', title); else - title = WebInspector.UIString('Objects allocated between %s and %s', list[i - 1].title, title); + title = Common.UIString('Objects allocated between %s and %s', list[i - 1].title, title); this._filterSelect.createOption(title); } } @@ -659,23 +659,23 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onReceiveSnapshot(event) { this._updateControls(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onProfileHeaderRemoved(event) { var profile = event.data; if (this._profile === profile) { this.detach(); this._profile.profileType().removeEventListener( - WebInspector.HeapSnapshotProfileType.SnapshotReceived, this._onReceiveSnapshot, this); + Profiler.HeapSnapshotProfileType.SnapshotReceived, this._onReceiveSnapshot, this); this._profile.profileType().removeEventListener( - WebInspector.ProfileType.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); + Profiler.ProfileType.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); this.dispose(); } else { this._updateControls(); @@ -695,7 +695,7 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.Perspective = class { +Profiler.HeapSnapshotView.Perspective = class { /** * @param {string} title */ @@ -704,13 +704,13 @@ } /** - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { } /** - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ deactivate(heapSnapshotView) { heapSnapshotView._baseSelect.setVisible(false); @@ -728,8 +728,8 @@ } /** - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return null; @@ -753,14 +753,14 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.SummaryPerspective = class extends WebInspector.HeapSnapshotView.Perspective { +Profiler.HeapSnapshotView.SummaryPerspective = class extends Profiler.HeapSnapshotView.Perspective { constructor() { - super(WebInspector.UIString('Summary')); + super(Common.UIString('Summary')); } /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructorsWidget); @@ -778,8 +778,8 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return heapSnapshotView._constructorsDataGrid; @@ -797,14 +797,14 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.ComparisonPerspective = class extends WebInspector.HeapSnapshotView.Perspective { +Profiler.HeapSnapshotView.ComparisonPerspective = class extends Profiler.HeapSnapshotView.Perspective { constructor() { - super(WebInspector.UIString('Comparison')); + super(Common.UIString('Comparison')); } /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._diffWidget); @@ -816,8 +816,8 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return heapSnapshotView._diffDataGrid; @@ -835,14 +835,14 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.ContainmentPerspective = class extends WebInspector.HeapSnapshotView.Perspective { +Profiler.HeapSnapshotView.ContainmentPerspective = class extends Profiler.HeapSnapshotView.Perspective { constructor() { - super(WebInspector.UIString('Containment')); + super(Common.UIString('Containment')); } /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._containmentWidget); @@ -852,8 +852,8 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return heapSnapshotView._containmentDataGrid; @@ -863,27 +863,27 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.AllocationPerspective = class extends WebInspector.HeapSnapshotView.Perspective { +Profiler.HeapSnapshotView.AllocationPerspective = class extends Profiler.HeapSnapshotView.Perspective { constructor() { - super(WebInspector.UIString('Allocation')); + super(Common.UIString('Allocation')); this._allocationSplitWidget = - new WebInspector.SplitWidget(false, true, 'heapSnapshotAllocationSplitViewState', 200, 200); - this._allocationSplitWidget.setSidebarWidget(new WebInspector.VBox()); + new UI.SplitWidget(false, true, 'heapSnapshotAllocationSplitViewState', 200, 200); + this._allocationSplitWidget.setSidebarWidget(new UI.VBox()); } /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { this._allocationSplitWidget.setMainWidget(heapSnapshotView._allocationWidget); heapSnapshotView._splitWidget.setMainWidget(heapSnapshotView._constructorsWidget); heapSnapshotView._splitWidget.setSidebarWidget(heapSnapshotView._objectDetailsView); - var allocatedObjectsView = new WebInspector.VBox(); + var allocatedObjectsView = new UI.VBox(); var resizer = createElementWithClass('div', 'heap-snapshot-view-resizer'); var title = resizer.createChild('div', 'title').createChild('span'); - title.textContent = WebInspector.UIString('Live objects'); + title.textContent = Common.UIString('Live objects'); this._allocationSplitWidget.hideDefaultResizer(); this._allocationSplitWidget.installResizer(resizer); allocatedObjectsView.element.appendChild(resizer); @@ -900,7 +900,7 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ deactivate(heapSnapshotView) { this._allocationSplitWidget.detach(); @@ -909,8 +909,8 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return heapSnapshotView._allocationDataGrid; @@ -920,14 +920,14 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotView.StatisticsPerspective = class extends WebInspector.HeapSnapshotView.Perspective { +Profiler.HeapSnapshotView.StatisticsPerspective = class extends Profiler.HeapSnapshotView.Perspective { constructor() { - super(WebInspector.UIString('Statistics')); + super(Common.UIString('Statistics')); } /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView + * @param {!Profiler.HeapSnapshotView} heapSnapshotView */ activate(heapSnapshotView) { heapSnapshotView._statisticsView.show(heapSnapshotView._searchableView.element); @@ -935,8 +935,8 @@ /** * @override - * @param {!WebInspector.HeapSnapshotView} heapSnapshotView - * @return {?WebInspector.DataGrid} + * @param {!Profiler.HeapSnapshotView} heapSnapshotView + * @return {?UI.DataGrid} */ masterGrid(heapSnapshotView) { return null; @@ -944,30 +944,30 @@ }; /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.HeapSnapshotProfileType = class extends WebInspector.ProfileType { +Profiler.HeapSnapshotProfileType = class extends Profiler.ProfileType { /** * @param {string=} id * @param {string=} title */ constructor(id, title) { - super(id || WebInspector.HeapSnapshotProfileType.TypeId, title || WebInspector.UIString('Take Heap Snapshot')); - WebInspector.targetManager.observeTargets(this); - WebInspector.targetManager.addModelListener( - WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this); - WebInspector.targetManager.addModelListener( - WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, + super(id || Profiler.HeapSnapshotProfileType.TypeId, title || Common.UIString('Take Heap Snapshot')); + SDK.targetManager.observeTargets(this); + SDK.targetManager.addModelListener( + SDK.HeapProfilerModel, SDK.HeapProfilerModel.Events.ResetProfiles, this._resetProfiles, this); + SDK.targetManager.addModelListener( + SDK.HeapProfilerModel, SDK.HeapProfilerModel.Events.AddHeapSnapshotChunk, this._addHeapSnapshotChunk, this); - WebInspector.targetManager.addModelListener( - WebInspector.HeapProfilerModel, WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, + SDK.targetManager.addModelListener( + SDK.HeapProfilerModel, SDK.HeapProfilerModel.Events.ReportHeapSnapshotProgress, this._reportHeapSnapshotProgress, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { target.heapProfilerModel.enable(); @@ -975,7 +975,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } @@ -989,7 +989,7 @@ } get buttonTooltip() { - return WebInspector.UIString('Take heap snapshot'); + return Common.UIString('Take heap snapshot'); } /** @@ -1006,54 +1006,54 @@ */ buttonClicked() { this._takeHeapSnapshot(function() {}); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ProfilesHeapProfileTaken); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ProfilesHeapProfileTaken); return false; } get treeItemTitle() { - return WebInspector.UIString('HEAP SNAPSHOTS'); + return Common.UIString('HEAP SNAPSHOTS'); } get description() { - return WebInspector.UIString( + return Common.UIString( 'Heap snapshot profiles show memory distribution among your page\'s JavaScript objects and related DOM nodes.'); } /** * @override * @param {string} title - * @return {!WebInspector.ProfileHeader} + * @return {!Profiler.ProfileHeader} */ createProfileLoadedFromFile(title) { - return new WebInspector.HeapProfileHeader(null, this, title); + return new Profiler.HeapProfileHeader(null, this, title); } _takeHeapSnapshot(callback) { if (this.profileBeingRecorded()) return; - var target = /** @type {!WebInspector.Target} */ (WebInspector.context.flavor(WebInspector.Target)); - var profile = new WebInspector.HeapProfileHeader(target, this); + var target = /** @type {!SDK.Target} */ (UI.context.flavor(SDK.Target)); + var profile = new Profiler.HeapProfileHeader(target, this); this.setProfileBeingRecorded(profile); this.addProfile(profile); - profile.updateStatus(WebInspector.UIString('Snapshotting\u2026')); + profile.updateStatus(Common.UIString('Snapshotting\u2026')); /** * @param {?string} error - * @this {WebInspector.HeapSnapshotProfileType} + * @this {Profiler.HeapSnapshotProfileType} */ function didTakeHeapSnapshot(error) { var profile = this._profileBeingRecorded; - profile.title = WebInspector.UIString('Snapshot %d', profile.uid); + profile.title = Common.UIString('Snapshot %d', profile.uid); profile._finishLoad(); this.setProfileBeingRecorded(null); - this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, profile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete, profile); callback(); } target.heapProfilerAgent().takeHeapSnapshot(true, didTakeHeapSnapshot.bind(this)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _addHeapSnapshotChunk(event) { if (!this.profileBeingRecorded()) @@ -1063,14 +1063,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _reportHeapSnapshotProgress(event) { var profile = this.profileBeingRecorded(); if (!profile) return; var data = /** @type {{done: number, total: number, finished: boolean}} */ (event.data); - profile.updateStatus(WebInspector.UIString('%.0f%%', (data.done / data.total) * 100), true); + profile.updateStatus(Common.UIString('%.0f%%', (data.done / data.total) * 100), true); if (data.finished) profile._prepareToLoad(); } @@ -1082,47 +1082,47 @@ _snapshotReceived(profile) { if (this._profileBeingRecorded === profile) this.setProfileBeingRecorded(null); - this.dispatchEventToListeners(WebInspector.HeapSnapshotProfileType.SnapshotReceived, profile); + this.dispatchEventToListeners(Profiler.HeapSnapshotProfileType.SnapshotReceived, profile); } }; -WebInspector.HeapSnapshotProfileType.TypeId = 'HEAP'; -WebInspector.HeapSnapshotProfileType.SnapshotReceived = 'SnapshotReceived'; +Profiler.HeapSnapshotProfileType.TypeId = 'HEAP'; +Profiler.HeapSnapshotProfileType.SnapshotReceived = 'SnapshotReceived'; /** * @unrestricted */ -WebInspector.TrackingHeapSnapshotProfileType = class extends WebInspector.HeapSnapshotProfileType { +Profiler.TrackingHeapSnapshotProfileType = class extends Profiler.HeapSnapshotProfileType { constructor() { - super(WebInspector.TrackingHeapSnapshotProfileType.TypeId, WebInspector.UIString('Record Allocation Timeline')); + super(Profiler.TrackingHeapSnapshotProfileType.TypeId, Common.UIString('Record Allocation Timeline')); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { super.targetAdded(target); target.heapProfilerModel.addEventListener( - WebInspector.HeapProfilerModel.Events.HeapStatsUpdate, this._heapStatsUpdate, this); + SDK.HeapProfilerModel.Events.HeapStatsUpdate, this._heapStatsUpdate, this); target.heapProfilerModel.addEventListener( - WebInspector.HeapProfilerModel.Events.LastSeenObjectId, this._lastSeenObjectId, this); + SDK.HeapProfilerModel.Events.LastSeenObjectId, this._lastSeenObjectId, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { super.targetRemoved(target); target.heapProfilerModel.removeEventListener( - WebInspector.HeapProfilerModel.Events.HeapStatsUpdate, this._heapStatsUpdate, this); + SDK.HeapProfilerModel.Events.HeapStatsUpdate, this._heapStatsUpdate, this); target.heapProfilerModel.removeEventListener( - WebInspector.HeapProfilerModel.Events.LastSeenObjectId, this._lastSeenObjectId, this); + SDK.HeapProfilerModel.Events.LastSeenObjectId, this._lastSeenObjectId, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _heapStatsUpdate(event) { if (!this._profileSamples) @@ -1139,7 +1139,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _lastSeenObjectId(event) { var profileSamples = this._profileSamples; @@ -1155,7 +1155,7 @@ profileSamples.timestamps[currentIndex] = data.timestamp; if (profileSamples.totalTime < data.timestamp - profileSamples.timestamps[0]) profileSamples.totalTime *= 2; - this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._profileSamples); + this.dispatchEventToListeners(Profiler.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._profileSamples); this._profileBeingRecorded.updateStatus(null, true); } @@ -1168,8 +1168,8 @@ } get buttonTooltip() { - return this._recording ? WebInspector.UIString('Stop recording heap profile') : - WebInspector.UIString('Start recording heap profile'); + return this._recording ? Common.UIString('Stop recording heap profile') : + Common.UIString('Start recording heap profile'); } /** @@ -1192,26 +1192,26 @@ if (this.profileBeingRecorded()) return; this._addNewProfile(); - var recordAllocationStacks = WebInspector.moduleSetting('recordAllocationStacks').get(); + var recordAllocationStacks = Common.moduleSetting('recordAllocationStacks').get(); this.profileBeingRecorded().target().heapProfilerAgent().startTrackingHeapObjects(recordAllocationStacks); } _addNewProfile() { - var target = WebInspector.context.flavor(WebInspector.Target); - this.setProfileBeingRecorded(new WebInspector.HeapProfileHeader(target, this, undefined)); - this._profileSamples = new WebInspector.TrackingHeapSnapshotProfileType.Samples(); + var target = UI.context.flavor(SDK.Target); + this.setProfileBeingRecorded(new Profiler.HeapProfileHeader(target, this, undefined)); + this._profileSamples = new Profiler.TrackingHeapSnapshotProfileType.Samples(); this._profileBeingRecorded._profileSamples = this._profileSamples; this._recording = true; this.addProfile(this._profileBeingRecorded); - this._profileBeingRecorded.updateStatus(WebInspector.UIString('Recording\u2026')); - this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted); + this._profileBeingRecorded.updateStatus(Common.UIString('Recording\u2026')); + this.dispatchEventToListeners(Profiler.TrackingHeapSnapshotProfileType.TrackingStarted); } _stopRecordingProfile() { - this._profileBeingRecorded.updateStatus(WebInspector.UIString('Snapshotting\u2026')); + this._profileBeingRecorded.updateStatus(Common.UIString('Snapshotting\u2026')); /** * @param {?string} error - * @this {WebInspector.HeapSnapshotProfileType} + * @this {Profiler.HeapSnapshotProfileType} */ function didTakeHeapSnapshot(error) { var profile = this.profileBeingRecorded(); @@ -1220,13 +1220,13 @@ profile._finishLoad(); this._profileSamples = null; this.setProfileBeingRecorded(null); - this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProfileComplete, profile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete, profile); } this._profileBeingRecorded.target().heapProfilerAgent().stopTrackingHeapObjects( true, didTakeHeapSnapshot.bind(this)); this._recording = false; - this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped); + this.dispatchEventToListeners(Profiler.TrackingHeapSnapshotProfileType.TrackingStopped); } _toggleRecording() { @@ -1246,11 +1246,11 @@ } get treeItemTitle() { - return WebInspector.UIString('ALLOCATION TIMELINES'); + return Common.UIString('ALLOCATION TIMELINES'); } get description() { - return WebInspector.UIString( + return Common.UIString( 'Allocation timelines show memory allocations from your heap over time. Use this profile type to isolate memory leaks.'); } @@ -1276,16 +1276,16 @@ } }; -WebInspector.TrackingHeapSnapshotProfileType.TypeId = 'HEAP-RECORD'; +Profiler.TrackingHeapSnapshotProfileType.TypeId = 'HEAP-RECORD'; -WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate = 'HeapStatsUpdate'; -WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted = 'TrackingStarted'; -WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped = 'TrackingStopped'; +Profiler.TrackingHeapSnapshotProfileType.HeapStatsUpdate = 'HeapStatsUpdate'; +Profiler.TrackingHeapSnapshotProfileType.TrackingStarted = 'TrackingStarted'; +Profiler.TrackingHeapSnapshotProfileType.TrackingStopped = 'TrackingStopped'; /** * @unrestricted */ -WebInspector.TrackingHeapSnapshotProfileType.Samples = class { +Profiler.TrackingHeapSnapshotProfileType.Samples = class { constructor() { /** @type {!Array.<number>} */ this.sizes = []; @@ -1303,37 +1303,37 @@ /** * @unrestricted */ -WebInspector.HeapProfileHeader = class extends WebInspector.ProfileHeader { +Profiler.HeapProfileHeader = class extends Profiler.ProfileHeader { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.HeapSnapshotProfileType} type + * @param {?SDK.Target} target + * @param {!Profiler.HeapSnapshotProfileType} type * @param {string=} title */ constructor(target, type, title) { - super(target, type, title || WebInspector.UIString('Snapshot %d', type.nextProfileUid())); + super(target, type, title || Common.UIString('Snapshot %d', type.nextProfileUid())); this.maxJSObjectId = -1; /** - * @type {?WebInspector.HeapSnapshotWorkerProxy} + * @type {?Profiler.HeapSnapshotWorkerProxy} */ this._workerProxy = null; /** - * @type {?WebInspector.OutputStream} + * @type {?Common.OutputStream} */ this._receiver = null; /** - * @type {?WebInspector.HeapSnapshotProxy} + * @type {?Profiler.HeapSnapshotProxy} */ this._snapshotProxy = null; /** - * @type {!Promise.<!WebInspector.HeapSnapshotProxy>} + * @type {!Promise.<!Profiler.HeapSnapshotProxy>} */ this._loadPromise = new Promise(loadResolver.bind(this)); this._totalNumberOfChunks = 0; this._bufferedWriter = null; /** - * @param {function(!WebInspector.HeapSnapshotProxy)} fulfill - * @this {WebInspector.HeapProfileHeader} + * @param {function(!Profiler.HeapSnapshotProxy)} fulfill + * @this {Profiler.HeapProfileHeader} */ function loadResolver(fulfill) { this._fulfillLoad = fulfill; @@ -1342,26 +1342,26 @@ /** * @override - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @return {!WebInspector.ProfileSidebarTreeElement} + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @return {!Profiler.ProfileSidebarTreeElement} */ createSidebarTreeElement(dataDisplayDelegate) { - return new WebInspector.ProfileSidebarTreeElement(dataDisplayDelegate, this, 'heap-snapshot-sidebar-tree-item'); + return new Profiler.ProfileSidebarTreeElement(dataDisplayDelegate, this, 'heap-snapshot-sidebar-tree-item'); } /** * @override - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @return {!WebInspector.HeapSnapshotView} + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @return {!Profiler.HeapSnapshotView} */ createView(dataDisplayDelegate) { - return new WebInspector.HeapSnapshotView(dataDisplayDelegate, this); + return new Profiler.HeapSnapshotView(dataDisplayDelegate, this); } _prepareToLoad() { console.assert(!this._receiver, 'Already loading'); this._setupWorker(); - this.updateStatus(WebInspector.UIString('Loading\u2026'), true); + this.updateStatus(Common.UIString('Loading\u2026'), true); } _finishLoad() { @@ -1390,13 +1390,13 @@ _setupWorker() { /** - * @this {WebInspector.HeapProfileHeader} + * @this {Profiler.HeapProfileHeader} */ function setProfileWait(event) { this.updateStatus(null, event.data); } console.assert(!this._workerProxy, 'HeapSnapshotWorkerProxy already exists'); - this._workerProxy = new WebInspector.HeapSnapshotWorkerProxy(this._handleWorkerEvent.bind(this)); + this._workerProxy = new Profiler.HeapSnapshotWorkerProxy(this._handleWorkerEvent.bind(this)); this._workerProxy.addEventListener('wait', setProfileWait, this); this._receiver = this._workerProxy.createLoader(this.uid, this._snapshotReceived.bind(this)); } @@ -1406,13 +1406,13 @@ * @param {*} data */ _handleWorkerEvent(eventName, data) { - if (WebInspector.HeapSnapshotProgressEvent.BrokenSnapshot === eventName) { + if (Profiler.HeapSnapshotProgressEvent.BrokenSnapshot === eventName) { var error = /** @type {string} */ (data); - WebInspector.console.error(error); + Common.console.error(error); return; } - if (WebInspector.HeapSnapshotProgressEvent.Update !== eventName) + if (Profiler.HeapSnapshotProgressEvent.Update !== eventName) return; var subtitle = /** @type {string} */ (data); this.updateStatus(subtitle); @@ -1439,7 +1439,7 @@ */ transferChunk(chunk) { if (!this._bufferedWriter) - this._bufferedWriter = new WebInspector.DeferredTempFile('heap-profiler', String(this.uid)); + this._bufferedWriter = new Bindings.DeferredTempFile('heap-profiler', String(this.uid)); this._bufferedWriter.write([chunk]); ++this._totalNumberOfChunks; @@ -1461,7 +1461,7 @@ this._fulfillLoad(this._snapshotProxy); this._profileType._snapshotReceived(this); if (this.canSaveToFile()) - this.dispatchEventToListeners(WebInspector.ProfileHeader.Events.ProfileReceived); + this.dispatchEventToListeners(Profiler.ProfileHeader.Events.ProfileReceived); } // Hook point for tests. @@ -1480,20 +1480,20 @@ * @override */ saveToFile() { - var fileOutputStream = new WebInspector.FileOutputStream(); + var fileOutputStream = new Bindings.FileOutputStream(); /** * @param {boolean} accepted - * @this {WebInspector.HeapProfileHeader} + * @this {Profiler.HeapProfileHeader} */ function onOpen(accepted) { if (!accepted) return; if (this._failedToCreateTempFile) { - WebInspector.console.error('Failed to open temp file with heap snapshot'); + Common.console.error('Failed to open temp file with heap snapshot'); fileOutputStream.close(); } else if (this._tempFile) { - var delegate = new WebInspector.SaveSnapshotOutputStreamDelegate(this); + var delegate = new Profiler.SaveSnapshotOutputStreamDelegate(this); this._tempFile.copyToOutputStream(fileOutputStream, delegate); } else { this._onTempFileReady = onOpen.bind(this, accepted); @@ -1506,7 +1506,7 @@ _updateSaveProgress(value, total) { var percentValue = ((total ? (value / total) : 0) * 100).toFixed(0); - this.updateStatus(WebInspector.UIString('Saving\u2026 %d%%', percentValue)); + this.updateStatus(Common.UIString('Saving\u2026 %d%%', percentValue)); } /** @@ -1514,23 +1514,23 @@ * @param {!File} file */ loadFromFile(file) { - this.updateStatus(WebInspector.UIString('Loading\u2026'), true); + this.updateStatus(Common.UIString('Loading\u2026'), true); this._setupWorker(); - var delegate = new WebInspector.HeapSnapshotLoadFromFileDelegate(this); + var delegate = new Profiler.HeapSnapshotLoadFromFileDelegate(this); var fileReader = this._createFileReader(file, delegate); fileReader.start(this._receiver); } _createFileReader(file, delegate) { - return new WebInspector.ChunkedFileReader(file, 10000000, delegate); + return new Bindings.ChunkedFileReader(file, 10000000, delegate); } }; /** - * @implements {WebInspector.OutputStreamDelegate} + * @implements {Bindings.OutputStreamDelegate} * @unrestricted */ -WebInspector.HeapSnapshotLoadFromFileDelegate = class { +Profiler.HeapSnapshotLoadFromFileDelegate = class { constructor(snapshotHeader) { this._snapshotHeader = snapshotHeader; } @@ -1543,7 +1543,7 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred(reader) { } @@ -1556,34 +1556,34 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} e */ onError(reader, e) { var subtitle; switch (e.target.error.code) { case e.target.error.NOT_FOUND_ERR: - subtitle = WebInspector.UIString('\'%s\' not found.', reader.fileName()); + subtitle = Common.UIString('\'%s\' not found.', reader.fileName()); break; case e.target.error.NOT_READABLE_ERR: - subtitle = WebInspector.UIString('\'%s\' is not readable', reader.fileName()); + subtitle = Common.UIString('\'%s\' is not readable', reader.fileName()); break; case e.target.error.ABORT_ERR: return; default: - subtitle = WebInspector.UIString('\'%s\' error %d', reader.fileName(), e.target.error.code); + subtitle = Common.UIString('\'%s\' error %d', reader.fileName(), e.target.error.code); } this._snapshotHeader.updateStatus(subtitle); } }; /** - * @implements {WebInspector.OutputStreamDelegate} + * @implements {Bindings.OutputStreamDelegate} * @unrestricted */ -WebInspector.SaveSnapshotOutputStreamDelegate = class { +Profiler.SaveSnapshotOutputStreamDelegate = class { /** - * @param {!WebInspector.HeapProfileHeader} profileHeader + * @param {!Profiler.HeapProfileHeader} profileHeader */ constructor(profileHeader) { this._profileHeader = profileHeader; @@ -1605,7 +1605,7 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred(reader) { this._profileHeader._updateSaveProgress(reader.loadedSize(), reader.fileSize()); @@ -1613,11 +1613,11 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} event */ onError(reader, event) { - WebInspector.console.error( + Common.console.error( 'Failed to read heap snapshot from temp file: ' + /** @type {!ErrorEvent} */ (event).message); this.onTransferFinished(); } @@ -1626,9 +1626,9 @@ /** * @unrestricted */ -WebInspector.HeapTrackingOverviewGrid = class extends WebInspector.VBox { +Profiler.HeapTrackingOverviewGrid = class extends UI.VBox { /** - * @param {!WebInspector.HeapProfileHeader} heapProfileHeader + * @param {!Profiler.HeapProfileHeader} heapProfileHeader */ constructor(heapProfileHeader) { super(); @@ -1636,28 +1636,28 @@ this.element.classList.add('heap-tracking-overview'); this._overviewContainer = this.element.createChild('div', 'heap-overview-container'); - this._overviewGrid = new WebInspector.OverviewGrid('heap-recording'); + this._overviewGrid = new UI.OverviewGrid('heap-recording'); this._overviewGrid.element.classList.add('fill'); this._overviewCanvas = this._overviewContainer.createChild('canvas', 'heap-recording-overview-canvas'); this._overviewContainer.appendChild(this._overviewGrid.element); - this._overviewCalculator = new WebInspector.HeapTrackingOverviewGrid.OverviewCalculator(); - this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); + this._overviewCalculator = new Profiler.HeapTrackingOverviewGrid.OverviewCalculator(); + this._overviewGrid.addEventListener(UI.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); - this._profileSamples = heapProfileHeader.fromFile() ? new WebInspector.TrackingHeapSnapshotProfileType.Samples() : + this._profileSamples = heapProfileHeader.fromFile() ? new Profiler.TrackingHeapSnapshotProfileType.Samples() : heapProfileHeader._profileSamples; this._profileType = heapProfileHeader.profileType(); if (!heapProfileHeader.fromFile() && heapProfileHeader.profileType().profileBeingRecorded() === heapProfileHeader) { this._profileType.addEventListener( - WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); + Profiler.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); this._profileType.addEventListener( - WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped, this._onStopTracking, this); + Profiler.TrackingHeapSnapshotProfileType.TrackingStopped, this._onStopTracking, this); } this._windowLeft = 0.0; this._windowRight = 1.0; this._overviewGrid.setWindow(this._windowLeft, this._windowRight); - this._yScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); - this._xScale = new WebInspector.HeapTrackingOverviewGrid.SmoothScale(); + this._yScale = new Profiler.HeapTrackingOverviewGrid.SmoothScale(); + this._xScale = new Profiler.HeapTrackingOverviewGrid.SmoothScale(); } dispose() { @@ -1666,9 +1666,9 @@ _onStopTracking() { this._profileType.removeEventListener( - WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); + Profiler.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._onHeapStatsUpdate, this); this._profileType.removeEventListener( - WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped, this._onStopTracking, this); + Profiler.TrackingHeapSnapshotProfileType.TrackingStopped, this._onStopTracking, this); } _onHeapStatsUpdate(event) { @@ -1677,14 +1677,14 @@ } /** - * @param {?WebInspector.HeapSnapshotCommon.Samples} samples + * @param {?Profiler.HeapSnapshotCommon.Samples} samples */ _setSamples(samples) { if (!samples) return; console.assert(!this._profileSamples.timestamps.length, 'Should only call this method when loading from file.'); console.assert(samples.timestamps.length); - this._profileSamples = new WebInspector.TrackingHeapSnapshotProfileType.Samples(); + this._profileSamples = new Profiler.TrackingHeapSnapshotProfileType.Samples(); this._profileSamples.sizes = samples.sizes; this._profileSamples.ids = samples.lastAssignedIds; this._profileSamples.timestamps = samples.timestamps; @@ -1883,16 +1883,16 @@ } this.dispatchEventToListeners( - WebInspector.HeapTrackingOverviewGrid.IdsRangeChanged, {minId: minId, maxId: maxId, size: size}); + Profiler.HeapTrackingOverviewGrid.IdsRangeChanged, {minId: minId, maxId: maxId, size: size}); } }; -WebInspector.HeapTrackingOverviewGrid.IdsRangeChanged = 'IdsRangeChanged'; +Profiler.HeapTrackingOverviewGrid.IdsRangeChanged = 'IdsRangeChanged'; /** * @unrestricted */ -WebInspector.HeapTrackingOverviewGrid.SmoothScale = class { +Profiler.HeapTrackingOverviewGrid.SmoothScale = class { constructor() { this._lastUpdate = 0; this._currentScale = 0.0; @@ -1920,10 +1920,10 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.HeapTrackingOverviewGrid.OverviewCalculator = class { +Profiler.HeapTrackingOverviewGrid.OverviewCalculator = class { /** * @override * @return {number} @@ -1933,7 +1933,7 @@ } /** - * @param {!WebInspector.HeapTrackingOverviewGrid} chart + * @param {!Profiler.HeapTrackingOverviewGrid} chart */ _updateBoundaries(chart) { this._minimumBoundaries = 0; @@ -1996,11 +1996,11 @@ /** * @unrestricted */ -WebInspector.HeapSnapshotStatisticsView = class extends WebInspector.VBox { +Profiler.HeapSnapshotStatisticsView = class extends UI.VBox { constructor() { super(); this.setMinimumSize(50, 25); - this._pieChart = new WebInspector.PieChart(150, WebInspector.HeapSnapshotStatisticsView._valueFormatter, true); + this._pieChart = new UI.PieChart(150, Profiler.HeapSnapshotStatisticsView._valueFormatter, true); this._pieChart.element.classList.add('heap-snapshot-stats-pie-chart'); this.element.appendChild(this._pieChart.element); this._labels = this.element.createChild('div', 'heap-snapshot-stats-legend'); @@ -2011,7 +2011,7 @@ * @return {string} */ static _valueFormatter(value) { - return WebInspector.UIString('%s KB', Number.withThousandsSeparator(Math.round(value / 1024))); + return Common.UIString('%s KB', Number.withThousandsSeparator(Math.round(value / 1024))); } /** @@ -2039,7 +2039,7 @@ else swatchDiv.classList.add('heap-snapshot-stats-empty-swatch'); nameDiv.textContent = name; - sizeDiv.textContent = WebInspector.HeapSnapshotStatisticsView._valueFormatter(value); + sizeDiv.textContent = Profiler.HeapSnapshotStatisticsView._valueFormatter(value); } }; @@ -2047,18 +2047,18 @@ /** * @unrestricted */ -WebInspector.HeapAllocationStackView = class extends WebInspector.Widget { +Profiler.HeapAllocationStackView = class extends UI.Widget { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ constructor(target) { super(); this._target = target; - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); } /** - * @param {!WebInspector.HeapSnapshotProxy} snapshot + * @param {!Profiler.HeapSnapshotProxy} snapshot * @param {number} snapshotNodeIndex */ setAllocatedObject(snapshot, snapshotNodeIndex) { @@ -2072,12 +2072,12 @@ } /** - * @param {?Array.<!WebInspector.HeapSnapshotCommon.AllocationStackFrame>} frames + * @param {?Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame>} frames */ _didReceiveAllocationStack(frames) { if (!frames) { var stackDiv = this.element.createChild('div', 'no-heap-allocation-stack'); - stackDiv.createTextChild(WebInspector.UIString( + stackDiv.createTextChild(Common.UIString( 'Stack was not recorded for this object because it had been allocated before this profile recording started.')); return; } @@ -2087,7 +2087,7 @@ var frame = frames[i]; var frameDiv = stackDiv.createChild('div', 'stack-frame'); var name = frameDiv.createChild('div'); - name.textContent = WebInspector.beautifyFunctionName(frame.functionName); + name.textContent = UI.beautifyFunctionName(frame.functionName); if (frame.scriptId) { var urlElement = this._linkifier.linkifyScriptLocation( this._target, String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1);
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js index b6f1f917..f44de68 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileDataGrid.js
@@ -26,10 +26,10 @@ /** * @unrestricted */ -WebInspector.ProfileDataGridNode = class extends WebInspector.DataGridNode { +Profiler.ProfileDataGridNode = class extends UI.DataGridNode { /** - * @param {!WebInspector.ProfileNode} profileNode - * @param {!WebInspector.ProfileDataGridTree} owningTree + * @param {!SDK.ProfileNode} profileNode + * @param {!Profiler.ProfileDataGridTree} owningTree * @param {boolean} hasChildren */ constructor(profileNode, owningTree, hasChildren) { @@ -37,20 +37,20 @@ this.profileNode = profileNode; this.tree = owningTree; - /** @type {!Map<string, !WebInspector.ProfileDataGridNode>} */ + /** @type {!Map<string, !Profiler.ProfileDataGridNode>} */ this.childrenByCallUID = new Map(); this.lastComparator = null; this.callUID = profileNode.callUID; this.self = profileNode.self; this.total = profileNode.total; - this.functionName = WebInspector.beautifyFunctionName(profileNode.functionName); + this.functionName = UI.beautifyFunctionName(profileNode.functionName); this._deoptReason = profileNode.deoptReason || ''; this.url = profileNode.url; } /** - * @param {!Array<!Array<!WebInspector.ProfileDataGridNode>>} gridNodeGroups + * @param {!Array<!Array<!Profiler.ProfileDataGridNode>>} gridNodeGroups * @param {function(!T, !T)} comparator * @param {boolean} force * @template T @@ -89,8 +89,8 @@ } /** - * @param {!WebInspector.ProfileDataGridNode|!WebInspector.ProfileDataGridTree} container - * @param {!WebInspector.ProfileDataGridNode} child + * @param {!Profiler.ProfileDataGridNode|!Profiler.ProfileDataGridTree} container + * @param {!Profiler.ProfileDataGridNode} child * @param {boolean} shouldAbsorb */ static merge(container, child, shouldAbsorb) { @@ -118,14 +118,14 @@ var existingChild = container.childrenByCallUID.get(orphanedChild.callUID); if (existingChild) - existingChild.merge(/** @type{!WebInspector.ProfileDataGridNode} */ (orphanedChild), false); + existingChild.merge(/** @type{!Profiler.ProfileDataGridNode} */ (orphanedChild), false); else container.appendChild(orphanedChild); } } /** - * @param {!WebInspector.ProfileDataGridNode|!WebInspector.ProfileDataGridTree} container + * @param {!Profiler.ProfileDataGridNode|!Profiler.ProfileDataGridTree} container */ static populate(container) { if (container._populated) @@ -163,8 +163,8 @@ cell.classList.toggle('highlight', this._searchMatchedFunctionColumn); if (this._deoptReason) { cell.classList.add('not-optimized'); - var warningIcon = WebInspector.Icon.create('smallicon-warning', 'profile-warn-marker'); - warningIcon.title = WebInspector.UIString('Not optimized: %s', this._deoptReason); + var warningIcon = UI.Icon.create('smallicon-warning', 'profile-warn-marker'); + warningIcon.title = Common.UIString('Not optimized: %s', this._deoptReason); cell.appendChild(warningIcon); } cell.createTextChild(this.functionName); @@ -203,29 +203,29 @@ * @template T */ sort(comparator, force) { - return WebInspector.ProfileDataGridNode.sort([[this]], comparator, force); + return Profiler.ProfileDataGridNode.sort([[this]], comparator, force); } /** * @override - * @param {!WebInspector.DataGridNode} profileDataGridNode + * @param {!UI.DataGridNode} profileDataGridNode * @param {number} index */ insertChild(profileDataGridNode, index) { super.insertChild(profileDataGridNode, index); this.childrenByCallUID.set( - profileDataGridNode.callUID, /** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode)); + profileDataGridNode.callUID, /** @type {!Profiler.ProfileDataGridNode} */ (profileDataGridNode)); } /** * @override - * @param {!WebInspector.DataGridNode} profileDataGridNode + * @param {!UI.DataGridNode} profileDataGridNode */ removeChild(profileDataGridNode) { super.removeChild(profileDataGridNode); - this.childrenByCallUID.delete((/** @type {!WebInspector.ProfileDataGridNode} */ (profileDataGridNode)).callUID); + this.childrenByCallUID.delete((/** @type {!Profiler.ProfileDataGridNode} */ (profileDataGridNode)).callUID); } /** @@ -238,8 +238,8 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} node - * @return {?WebInspector.ProfileDataGridNode} + * @param {!Profiler.ProfileDataGridNode} node + * @return {?Profiler.ProfileDataGridNode} */ findChild(node) { if (!node) @@ -259,7 +259,7 @@ * @override */ populate() { - WebInspector.ProfileDataGridNode.populate(this); + Profiler.ProfileDataGridNode.populate(this); } /** @@ -305,23 +305,23 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} child + * @param {!Profiler.ProfileDataGridNode} child * @param {boolean} shouldAbsorb */ merge(child, shouldAbsorb) { - WebInspector.ProfileDataGridNode.merge(this, child, shouldAbsorb); + Profiler.ProfileDataGridNode.merge(this, child, shouldAbsorb); } }; /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.ProfileDataGridTree = class { +Profiler.ProfileDataGridTree = class { /** - * @param {!WebInspector.ProfileDataGridNode.Formatter} formatter - * @param {!WebInspector.SearchableView} searchableView + * @param {!Profiler.ProfileDataGridNode.Formatter} formatter + * @param {!UI.SearchableView} searchableView * @param {number} total */ constructor(formatter, searchableView, total) { @@ -340,7 +340,7 @@ * @return {function(!Object.<string, *>, !Object.<string, *>)} */ static propertyComparator(property, isAscending) { - var comparator = WebInspector.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property]; + var comparator = Profiler.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property]; if (!comparator) { if (isAscending) { @@ -365,7 +365,7 @@ }; } - WebInspector.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property] = comparator; + Profiler.ProfileDataGridTree.propertyComparators[(isAscending ? 1 : 0)][property] = comparator; } return comparator; @@ -393,8 +393,8 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} node - * @return {?WebInspector.ProfileDataGridNode} + * @param {!Profiler.ProfileDataGridNode} node + * @return {?Profiler.ProfileDataGridNode} */ findChild(node) { if (!node) @@ -408,7 +408,7 @@ * @template T */ sort(comparator, force) { - return WebInspector.ProfileDataGridNode.sort([[this]], comparator, force); + return Profiler.ProfileDataGridNode.sort([[this]], comparator, force); } /** @@ -439,8 +439,8 @@ } /** - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig - * @return {?function(!WebInspector.ProfileDataGridNode):boolean} + * @param {!UI.SearchableView.SearchConfig} searchConfig + * @return {?function(!Profiler.ProfileDataGridNode):boolean} */ _matchFunction(searchConfig) { var query = searchConfig.query.trim(); @@ -471,7 +471,7 @@ var matcher = createPlainTextSearchRegex(query, 'i'); /** - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode * @return {boolean} */ function matchesQuery(profileDataGridNode) { @@ -536,7 +536,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -623,31 +623,31 @@ } }; -WebInspector.ProfileDataGridTree.propertyComparators = [{}, {}]; +Profiler.ProfileDataGridTree.propertyComparators = [{}, {}]; /** * @interface */ -WebInspector.ProfileDataGridNode.Formatter = function() {}; +Profiler.ProfileDataGridNode.Formatter = function() {}; -WebInspector.ProfileDataGridNode.Formatter.prototype = { +Profiler.ProfileDataGridNode.Formatter.prototype = { /** * @param {number} value - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {string} */ formatValue: function(value, node) {}, /** * @param {number} value - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {string} */ formatPercent: function(value, node) {}, /** - * @param {!WebInspector.ProfileDataGridNode} node + * @param {!Profiler.ProfileDataGridNode} node * @return {?Element} */ linkifyNode: function(node) {}
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileLauncherView.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileLauncherView.js index 8ab49419..4d6a882 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileLauncherView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileLauncherView.js
@@ -28,12 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ProfileLauncherView = class extends WebInspector.VBox { +Profiler.ProfileLauncherView = class extends UI.VBox { /** - * @param {!WebInspector.ProfilesPanel} profilesPanel + * @param {!Profiler.ProfilesPanel} profilesPanel */ constructor(profilesPanel) { super(); @@ -47,20 +47,20 @@ this._innerContentElement = this._contentElement.createChild('div'); var targetSpan = this._contentElement.createChild('span'); var selectTargetText = targetSpan.createChild('span'); - selectTargetText.textContent = WebInspector.UIString('Target:'); + selectTargetText.textContent = Common.UIString('Target:'); var targetsSelect = targetSpan.createChild('select', 'chrome-select'); - new WebInspector.TargetsComboBoxController(targetsSelect, targetSpan); + new Profiler.TargetsComboBoxController(targetsSelect, targetSpan); this._controlButton = createTextButton('', this._controlButtonClicked.bind(this), 'control-profiling'); this._contentElement.appendChild(this._controlButton); this._recordButtonEnabled = true; this._loadButton = - createTextButton(WebInspector.UIString('Load'), this._loadButtonClicked.bind(this), 'load-profile'); + createTextButton(Common.UIString('Load'), this._loadButtonClicked.bind(this), 'load-profile'); this._contentElement.appendChild(this._loadButton); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ searchableView() { return null; @@ -68,7 +68,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._updateLoadButtonLayout(); @@ -76,7 +76,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._updateLoadButtonLayout(); @@ -84,11 +84,11 @@ _updateLoadButtonLayout() { this._loadButton.classList.toggle( - 'multi-target', WebInspector.targetManager.targets(WebInspector.Target.Capability.JS).length > 1); + 'multi-target', SDK.targetManager.targets(SDK.Target.Capability.JS).length > 1); } /** - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType */ addProfileType(profileType) { var descriptionElement = this._innerContentElement.createChild('h1'); @@ -113,16 +113,16 @@ this._controlButton.removeAttribute('disabled'); else this._controlButton.setAttribute('disabled', ''); - this._controlButton.title = this._recordButtonEnabled ? '' : WebInspector.anotherProfilerActiveLabel(); + this._controlButton.title = this._recordButtonEnabled ? '' : UI.anotherProfilerActiveLabel(); if (this._isInstantProfile) { this._controlButton.classList.remove('running'); - this._controlButton.textContent = WebInspector.UIString('Take Snapshot'); + this._controlButton.textContent = Common.UIString('Take Snapshot'); } else if (this._isProfiling) { this._controlButton.classList.add('running'); - this._controlButton.textContent = WebInspector.UIString('Stop'); + this._controlButton.textContent = Common.UIString('Stop'); } else { this._controlButton.classList.remove('running'); - this._controlButton.textContent = WebInspector.UIString('Start'); + this._controlButton.textContent = Common.UIString('Start'); } } @@ -137,7 +137,7 @@ } /** - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType * @param {boolean} recordButtonEnabled */ updateProfileType(profileType, recordButtonEnabled) { @@ -151,17 +151,17 @@ /** * @unrestricted */ -WebInspector.MultiProfileLauncherView = class extends WebInspector.ProfileLauncherView { +Profiler.MultiProfileLauncherView = class extends Profiler.ProfileLauncherView { /** - * @param {!WebInspector.ProfilesPanel} profilesPanel + * @param {!Profiler.ProfilesPanel} profilesPanel */ constructor(profilesPanel) { super(profilesPanel); - this._selectedProfileTypeSetting = WebInspector.settings.createSetting('selectedProfileType', 'CPU'); + this._selectedProfileTypeSetting = Common.settings.createSetting('selectedProfileType', 'CPU'); var header = this._innerContentElement.createChild('h1'); - header.textContent = WebInspector.UIString('Select profiling type'); + header.textContent = Common.UIString('Select profiling type'); this._profileTypeSelectorForm = this._innerContentElement.createChild('form'); @@ -172,7 +172,7 @@ /** * @override - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType */ addProfileType(profileType) { var labelElement = createRadioLabel('profile-type', profileType.name); @@ -195,7 +195,7 @@ typeId = Object.keys(this._typeIdToOptionElement)[0]; this._typeIdToOptionElement[typeId].checked = true; var type = this._typeIdToOptionElement[typeId]._profileType; - this.dispatchEventToListeners(WebInspector.MultiProfileLauncherView.Events.ProfileTypeSelected, type); + this.dispatchEventToListeners(Profiler.MultiProfileLauncherView.Events.ProfileTypeSelected, type); } /** @@ -218,10 +218,10 @@ } /** - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType */ _profileTypeChanged(profileType) { - this.dispatchEventToListeners(WebInspector.MultiProfileLauncherView.Events.ProfileTypeSelected, profileType); + this.dispatchEventToListeners(Profiler.MultiProfileLauncherView.Events.ProfileTypeSelected, profileType); this._isInstantProfile = profileType.isInstantProfile(); this._isEnabled = profileType.isEnabled(); this._updateControls(); @@ -246,6 +246,6 @@ }; /** @enum {symbol} */ -WebInspector.MultiProfileLauncherView.Events = { +Profiler.MultiProfileLauncherView.Events = { ProfileTypeSelected: Symbol('ProfileTypeSelected') };
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileTypeRegistry.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileTypeRegistry.js index 8383b46..736ad72 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileTypeRegistry.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileTypeRegistry.js
@@ -4,33 +4,33 @@ /** * @unrestricted */ -WebInspector.ProfileTypeRegistry = class { +Profiler.ProfileTypeRegistry = class { constructor() { this._profileTypes = []; - this.cpuProfileType = new WebInspector.CPUProfileType(); + this.cpuProfileType = new Profiler.CPUProfileType(); this._addProfileType(this.cpuProfileType); - this.heapSnapshotProfileType = new WebInspector.HeapSnapshotProfileType(); + this.heapSnapshotProfileType = new Profiler.HeapSnapshotProfileType(); this._addProfileType(this.heapSnapshotProfileType); - this.trackingHeapSnapshotProfileType = new WebInspector.TrackingHeapSnapshotProfileType(); + this.trackingHeapSnapshotProfileType = new Profiler.TrackingHeapSnapshotProfileType(); this._addProfileType(this.trackingHeapSnapshotProfileType); - this.samplingHeapProfileType = new WebInspector.SamplingHeapProfileType(); + this.samplingHeapProfileType = new Profiler.SamplingHeapProfileType(); this._addProfileType(this.samplingHeapProfileType); } /** - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType */ _addProfileType(profileType) { this._profileTypes.push(profileType); } /** - * @return {!Array.<!WebInspector.ProfileType>} + * @return {!Array.<!Profiler.ProfileType>} */ profileTypes() { return this._profileTypes; } }; -WebInspector.ProfileTypeRegistry.instance = new WebInspector.ProfileTypeRegistry(); +Profiler.ProfileTypeRegistry.instance = new Profiler.ProfileTypeRegistry();
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileView.js index aeba70ac..c642e48 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileView.js
@@ -2,52 +2,52 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.Searchable} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.ProfileView = class extends WebInspector.SimpleView { +Profiler.ProfileView = class extends UI.SimpleView { constructor() { - super(WebInspector.UIString('Profile')); + super(Common.UIString('Profile')); - this._searchableView = new WebInspector.SearchableView(this); - this._searchableView.setPlaceholder(WebInspector.UIString('Find by cost (>50ms), name or file')); + this._searchableView = new UI.SearchableView(this); + this._searchableView.setPlaceholder(Common.UIString('Find by cost (>50ms), name or file')); this._searchableView.show(this.element); - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([]); + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([]); columns.push({ id: 'self', title: this.columnHeader('self'), width: '120px', fixedWidth: true, sortable: true, - sort: WebInspector.DataGrid.Order.Descending + sort: UI.DataGrid.Order.Descending }); columns.push({id: 'total', title: this.columnHeader('total'), width: '120px', fixedWidth: true, sortable: true}); - columns.push({id: 'function', title: WebInspector.UIString('Function'), disclosure: true, sortable: true}); + columns.push({id: 'function', title: Common.UIString('Function'), disclosure: true, sortable: true}); - this.dataGrid = new WebInspector.DataGrid(columns); - this.dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortProfile, this); - this.dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._nodeSelected.bind(this, true)); - this.dataGrid.addEventListener(WebInspector.DataGrid.Events.DeselectedNode, this._nodeSelected.bind(this, false)); + this.dataGrid = new UI.DataGrid(columns); + this.dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortProfile, this); + this.dataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._nodeSelected.bind(this, true)); + this.dataGrid.addEventListener(UI.DataGrid.Events.DeselectedNode, this._nodeSelected.bind(this, false)); - this.viewSelectComboBox = new WebInspector.ToolbarComboBox(this._changeView.bind(this)); + this.viewSelectComboBox = new UI.ToolbarComboBox(this._changeView.bind(this)); this.focusButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Focus selected function'), 'largeicon-visibility'); + new UI.ToolbarButton(Common.UIString('Focus selected function'), 'largeicon-visibility'); this.focusButton.setEnabled(false); this.focusButton.addEventListener('click', this._focusClicked, this); this.excludeButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Exclude selected function'), 'largeicon-delete'); + new UI.ToolbarButton(Common.UIString('Exclude selected function'), 'largeicon-delete'); this.excludeButton.setEnabled(false); this.excludeButton.addEventListener('click', this._excludeClicked, this); this.resetButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Restore all functions'), 'largeicon-refresh'); + new UI.ToolbarButton(Common.UIString('Restore all functions'), 'largeicon-refresh'); this.resetButton.setEnabled(false); this.resetButton.addEventListener('click', this._resetClicked, this); - this._linkifier = new WebInspector.Linkifier(WebInspector.ProfileView._maxLinkLength); + this._linkifier = new Components.Linkifier(Profiler.ProfileView._maxLinkLength); } /** @@ -65,23 +65,23 @@ } /** - * @param {!WebInspector.ProfileDataGridNode.Formatter} nodeFormatter + * @param {!Profiler.ProfileDataGridNode.Formatter} nodeFormatter * @param {!Array<string>=} viewTypes * @protected */ initialize(nodeFormatter, viewTypes) { this._nodeFormatter = nodeFormatter; - this._viewType = WebInspector.settings.createSetting('profileView', WebInspector.ProfileView.ViewTypes.Heavy); + this._viewType = Common.settings.createSetting('profileView', Profiler.ProfileView.ViewTypes.Heavy); viewTypes = viewTypes || [ - WebInspector.ProfileView.ViewTypes.Flame, WebInspector.ProfileView.ViewTypes.Heavy, - WebInspector.ProfileView.ViewTypes.Tree + Profiler.ProfileView.ViewTypes.Flame, Profiler.ProfileView.ViewTypes.Heavy, + Profiler.ProfileView.ViewTypes.Tree ]; var optionNames = new Map([ - [WebInspector.ProfileView.ViewTypes.Flame, WebInspector.UIString('Chart')], - [WebInspector.ProfileView.ViewTypes.Heavy, WebInspector.UIString('Heavy (Bottom Up)')], - [WebInspector.ProfileView.ViewTypes.Tree, WebInspector.UIString('Tree (Top Down)')], + [Profiler.ProfileView.ViewTypes.Flame, Common.UIString('Chart')], + [Profiler.ProfileView.ViewTypes.Heavy, Common.UIString('Heavy (Bottom Up)')], + [Profiler.ProfileView.ViewTypes.Tree, Common.UIString('Tree (Top Down)')], ]); var options = @@ -114,7 +114,7 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._profileHeader.target(); @@ -132,28 +132,28 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this.viewSelectComboBox, this.focusButton, this.excludeButton, this.resetButton]; } /** - * @return {!WebInspector.ProfileDataGridTree} + * @return {!Profiler.ProfileDataGridTree} */ _getBottomUpProfileDataGridTree() { if (!this._bottomUpProfileDataGridTree) - this._bottomUpProfileDataGridTree = new WebInspector.BottomUpProfileDataGridTree( + this._bottomUpProfileDataGridTree = new Profiler.BottomUpProfileDataGridTree( this._nodeFormatter, this._searchableView, this.profile.root, this.adjustedTotal); return this._bottomUpProfileDataGridTree; } /** - * @return {!WebInspector.ProfileDataGridTree} + * @return {!Profiler.ProfileDataGridTree} */ _getTopDownProfileDataGridTree() { if (!this._topDownProfileDataGridTree) - this._topDownProfileDataGridTree = new WebInspector.TopDownProfileDataGridTree( + this._topDownProfileDataGridTree = new Profiler.TopDownProfileDataGridTree( this._nodeFormatter, this._searchableView, this.profile.root, this.adjustedTotal); return this._topDownProfileDataGridTree; } @@ -189,7 +189,7 @@ } /** - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; @@ -220,7 +220,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -243,14 +243,14 @@ } /** - * @return {!WebInspector.Linkifier} + * @return {!Components.Linkifier} */ linkifier() { return this._linkifier; } /** - * @return {!WebInspector.FlameChartDataProvider} + * @return {!UI.FlameChartDataProvider} */ createFlameChartDataProvider() { throw 'Not implemented'; @@ -260,12 +260,12 @@ if (this._flameChart) return; this._dataProvider = this.createFlameChartDataProvider(); - this._flameChart = new WebInspector.CPUProfileFlameChart(this._searchableView, this._dataProvider); - this._flameChart.addEventListener(WebInspector.FlameChart.Events.EntrySelected, this._onEntrySelected.bind(this)); + this._flameChart = new Profiler.CPUProfileFlameChart(this._searchableView, this._dataProvider); + this._flameChart.addEventListener(UI.FlameChart.Events.EntrySelected, this._onEntrySelected.bind(this)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onEntrySelected(event) { var entryIndex = event.data; @@ -276,9 +276,9 @@ var script = debuggerModel.scriptForId(node.scriptId); if (!script) return; - var location = /** @type {!WebInspector.DebuggerModel.Location} */ ( + var location = /** @type {!SDK.DebuggerModel.Location} */ ( debuggerModel.createRawLocation(script, node.lineNumber, node.columnNumber)); - WebInspector.Revealer.reveal(WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location)); + Common.Revealer.reveal(Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location)); } _changeView() { @@ -292,18 +292,18 @@ this._viewType.set(this.viewSelectComboBox.selectedOption().value); switch (this._viewType.get()) { - case WebInspector.ProfileView.ViewTypes.Flame: + case Profiler.ProfileView.ViewTypes.Flame: this._ensureFlameChartCreated(); this._visibleView = this._flameChart; this._searchableElement = this._flameChart; break; - case WebInspector.ProfileView.ViewTypes.Tree: + case Profiler.ProfileView.ViewTypes.Tree: this.profileDataGridTree = this._getTopDownProfileDataGridTree(); this._sortProfile(); this._visibleView = this.dataGrid.asWidget(); this._searchableElement = this.profileDataGridTree; break; - case WebInspector.ProfileView.ViewTypes.Heavy: + case Profiler.ProfileView.ViewTypes.Heavy: this.profileDataGridTree = this._getBottomUpProfileDataGridTree(); this._sortProfile(); this._visibleView = this.dataGrid.asWidget(); @@ -311,7 +311,7 @@ break; } - var isFlame = this._viewType.get() === WebInspector.ProfileView.ViewTypes.Flame; + var isFlame = this._viewType.get() === Profiler.ProfileView.ViewTypes.Flame; this.focusButton.setVisible(!isFlame); this.excludeButton.setVisible(!isFlame); this.resetButton.setVisible(!isFlame); @@ -363,16 +363,16 @@ var sortAscending = this.dataGrid.isSortOrderAscending(); var sortColumnId = this.dataGrid.sortColumnId(); var sortProperty = sortColumnId === 'function' ? 'functionName' : sortColumnId || ''; - this.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyComparator(sortProperty, sortAscending)); + this.profileDataGridTree.sort(Profiler.ProfileDataGridTree.propertyComparator(sortProperty, sortAscending)); this.refresh(); } }; -WebInspector.ProfileView._maxLinkLength = 30; +Profiler.ProfileView._maxLinkLength = 30; /** @enum {string} */ -WebInspector.ProfileView.ViewTypes = { +Profiler.ProfileView.ViewTypes = { Flame: 'Flame', Tree: 'Tree', Heavy: 'Heavy' @@ -380,19 +380,19 @@ /** - * @implements {WebInspector.OutputStream} - * @implements {WebInspector.OutputStreamDelegate} + * @implements {Common.OutputStream} + * @implements {Bindings.OutputStreamDelegate} * @unrestricted */ -WebInspector.WritableProfileHeader = class extends WebInspector.ProfileHeader { +Profiler.WritableProfileHeader = class extends Profiler.ProfileHeader { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.ProfileType} type + * @param {?SDK.Target} target + * @param {!Profiler.ProfileType} type * @param {string=} title */ constructor(target, type, title) { - super(target, type, title || WebInspector.UIString('Profile %d', type.nextProfileUid())); - this._debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + super(target, type, title || Common.UIString('Profile %d', type.nextProfileUid())); + this._debuggerModel = SDK.DebuggerModel.fromTarget(target); this._tempFile = null; } @@ -402,25 +402,25 @@ onTransferStarted() { this._jsonifiedProfile = ''; this.updateStatus( - WebInspector.UIString('Loading\u2026 %s', Number.bytesToString(this._jsonifiedProfile.length)), true); + Common.UIString('Loading\u2026 %s', Number.bytesToString(this._jsonifiedProfile.length)), true); } /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred(reader) { - this.updateStatus(WebInspector.UIString('Loading\u2026 %d%%', Number.bytesToString(this._jsonifiedProfile.length))); + this.updateStatus(Common.UIString('Loading\u2026 %d%%', Number.bytesToString(this._jsonifiedProfile.length))); } /** * @override */ onTransferFinished() { - this.updateStatus(WebInspector.UIString('Parsing\u2026'), true); + this.updateStatus(Common.UIString('Parsing\u2026'), true); this._profile = JSON.parse(this._jsonifiedProfile); this._jsonifiedProfile = null; - this.updateStatus(WebInspector.UIString('Loaded'), false); + this.updateStatus(Common.UIString('Loaded'), false); if (this._profileType.profileBeingRecorded() === this) this._profileType.setProfileBeingRecorded(null); @@ -428,22 +428,22 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} e */ onError(reader, e) { var subtitle; switch (e.target.error.code) { case e.target.error.NOT_FOUND_ERR: - subtitle = WebInspector.UIString('\'%s\' not found.', reader.fileName()); + subtitle = Common.UIString('\'%s\' not found.', reader.fileName()); break; case e.target.error.NOT_READABLE_ERR: - subtitle = WebInspector.UIString('\'%s\' is not readable', reader.fileName()); + subtitle = Common.UIString('\'%s\' is not readable', reader.fileName()); break; case e.target.error.ABORT_ERR: return; default: - subtitle = WebInspector.UIString('\'%s\' error %d', reader.fileName(), e.target.error.code); + subtitle = Common.UIString('\'%s\' error %d', reader.fileName(), e.target.error.code); } this.updateStatus(subtitle); } @@ -471,11 +471,11 @@ /** * @override - * @param {!WebInspector.ProfileType.DataDisplayDelegate} panel - * @return {!WebInspector.ProfileSidebarTreeElement} + * @param {!Profiler.ProfileType.DataDisplayDelegate} panel + * @return {!Profiler.ProfileSidebarTreeElement} */ createSidebarTreeElement(panel) { - return new WebInspector.ProfileSidebarTreeElement(panel, this, 'profile-sidebar-tree-item'); + return new Profiler.ProfileSidebarTreeElement(panel, this, 'profile-sidebar-tree-item'); } /** @@ -490,11 +490,11 @@ * @override */ saveToFile() { - var fileOutputStream = new WebInspector.FileOutputStream(); + var fileOutputStream = new Bindings.FileOutputStream(); /** * @param {boolean} accepted - * @this {WebInspector.WritableProfileHeader} + * @this {Profiler.WritableProfileHeader} */ function onOpenForSave(accepted) { if (!accepted) @@ -506,7 +506,7 @@ fileOutputStream.close(); } if (this._failedToCreateTempFile) { - WebInspector.console.error('Failed to open temp file with heap snapshot'); + Common.console.error('Failed to open temp file with heap snapshot'); fileOutputStream.close(); } else if (this._tempFile) { this._tempFile.read(didRead); @@ -524,8 +524,8 @@ * @param {!File} file */ loadFromFile(file) { - this.updateStatus(WebInspector.UIString('Loading\u2026'), true); - var fileReader = new WebInspector.ChunkedFileReader(file, 10000000, this); + this.updateStatus(Common.UIString('Loading\u2026'), true); + var fileReader = new Bindings.ChunkedFileReader(file, 10000000, this); fileReader.start(this); } @@ -536,7 +536,7 @@ this._protocolProfile = profile; this._saveProfileDataToTempFile(profile); if (this.canSaveToFile()) - this.dispatchEventToListeners(WebInspector.ProfileHeader.Events.ProfileReceived); + this.dispatchEventToListeners(Profiler.ProfileHeader.Events.ProfileReceived); } /** @@ -546,16 +546,16 @@ var serializedData = JSON.stringify(data); /** - * @this {WebInspector.WritableProfileHeader} + * @this {Profiler.WritableProfileHeader} */ function didCreateTempFile(tempFile) { this._writeToTempFile(tempFile, serializedData); } - WebInspector.TempFile.create('cpu-profiler', String(this.uid)).then(didCreateTempFile.bind(this)); + Bindings.TempFile.create('cpu-profiler', String(this.uid)).then(didCreateTempFile.bind(this)); } /** - * @param {?WebInspector.TempFile} tempFile + * @param {?Bindings.TempFile} tempFile * @param {string} serializedData */ _writeToTempFile(tempFile, serializedData) { @@ -567,7 +567,7 @@ } /** * @param {number} fileSize - * @this {WebInspector.WritableProfileHeader} + * @this {Profiler.WritableProfileHeader} */ function didWriteToTempFile(fileSize) { if (!fileSize)
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js index 6706c2c..4e5931c 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js
@@ -26,7 +26,7 @@ /** * @unrestricted */ -WebInspector.ProfileType = class extends WebInspector.Object { +Profiler.ProfileType = class extends Common.Object { /** * @param {string} id * @param {string} name @@ -36,9 +36,9 @@ super(); this._id = id; this._name = name; - /** @type {!Array.<!WebInspector.ProfileHeader>} */ + /** @type {!Array.<!Profiler.ProfileHeader>} */ this._profiles = []; - /** @type {?WebInspector.ProfileHeader} */ + /** @type {?Profiler.ProfileHeader} */ this._profileBeingRecorded = null; this._nextProfileUid = 1; @@ -75,7 +75,7 @@ } /** - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ toolbarItems() { return []; @@ -123,13 +123,13 @@ } /** - * @return {!Array.<!WebInspector.ProfileHeader>} + * @return {!Array.<!Profiler.ProfileHeader>} */ getProfiles() { /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile * @return {boolean} - * @this {WebInspector.ProfileType} + * @this {Profiler.ProfileType} */ function isFinished(profile) { return this._profileBeingRecorded !== profile; @@ -146,7 +146,7 @@ /** * @param {number} uid - * @return {?WebInspector.ProfileHeader} + * @return {?Profiler.ProfileHeader} */ getProfile(uid) { for (var i = 0; i < this._profiles.length; ++i) { @@ -173,22 +173,22 @@ /** * @param {string} title - * @return {!WebInspector.ProfileHeader} + * @return {!Profiler.ProfileHeader} */ createProfileLoadedFromFile(title) { throw new Error('Needs implemented.'); } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ addProfile(profile) { this._profiles.push(profile); - this.dispatchEventToListeners(WebInspector.ProfileType.Events.AddProfileHeader, profile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.AddProfileHeader, profile); } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ removeProfile(profile) { var index = this._profiles.indexOf(profile); @@ -204,14 +204,14 @@ } /** - * @return {?WebInspector.ProfileHeader} + * @return {?Profiler.ProfileHeader} */ profileBeingRecorded() { return this._profileBeingRecorded; } /** - * @param {?WebInspector.ProfileHeader} profile + * @param {?Profiler.ProfileHeader} profile */ setProfileBeingRecorded(profile) { this._profileBeingRecorded = profile; @@ -230,10 +230,10 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ _disposeProfile(profile) { - this.dispatchEventToListeners(WebInspector.ProfileType.Events.RemoveProfileHeader, profile); + this.dispatchEventToListeners(Profiler.ProfileType.Events.RemoveProfileHeader, profile); profile.dispose(); if (this._profileBeingRecorded === profile) { this.profileBeingRecordedRemoved(); @@ -243,7 +243,7 @@ }; /** @enum {symbol} */ -WebInspector.ProfileType.Events = { +Profiler.ProfileType.Events = { AddProfileHeader: Symbol('add-profile-header'), ProfileComplete: Symbol('profile-complete'), RemoveProfileHeader: Symbol('remove-profile-header'), @@ -253,12 +253,12 @@ /** * @interface */ -WebInspector.ProfileType.DataDisplayDelegate = function() {}; +Profiler.ProfileType.DataDisplayDelegate = function() {}; -WebInspector.ProfileType.DataDisplayDelegate.prototype = { +Profiler.ProfileType.DataDisplayDelegate.prototype = { /** - * @param {?WebInspector.ProfileHeader} profile - * @return {?WebInspector.Widget} + * @param {?Profiler.ProfileHeader} profile + * @return {?UI.Widget} */ showProfile: function(profile) {}, @@ -272,10 +272,10 @@ /** * @unrestricted */ -WebInspector.ProfileHeader = class extends WebInspector.Object { +Profiler.ProfileHeader = class extends Common.Object { /** - * @param {?WebInspector.Target} target - * @param {!WebInspector.ProfileType} profileType + * @param {?SDK.Target} target + * @param {!Profiler.ProfileType} profileType * @param {string} title */ constructor(target, profileType, title) { @@ -288,14 +288,14 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._target; } /** - * @return {!WebInspector.ProfileType} + * @return {!Profiler.ProfileType} */ profileType() { return this._profileType; @@ -307,21 +307,21 @@ */ updateStatus(subtitle, wait) { this.dispatchEventToListeners( - WebInspector.ProfileHeader.Events.UpdateStatus, new WebInspector.ProfileHeader.StatusUpdate(subtitle, wait)); + Profiler.ProfileHeader.Events.UpdateStatus, new Profiler.ProfileHeader.StatusUpdate(subtitle, wait)); } /** * Must be implemented by subclasses. - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @return {!WebInspector.ProfileSidebarTreeElement} + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @return {!Profiler.ProfileSidebarTreeElement} */ createSidebarTreeElement(dataDisplayDelegate) { throw new Error('Needs implemented.'); } /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @return {!WebInspector.Widget} + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @return {!UI.Widget} */ createView(dataDisplayDelegate) { throw new Error('Not implemented.'); @@ -368,7 +368,7 @@ /** * @unrestricted */ -WebInspector.ProfileHeader.StatusUpdate = class { +Profiler.ProfileHeader.StatusUpdate = class { /** * @param {?string} subtitle * @param {boolean|undefined} wait @@ -382,16 +382,16 @@ }; /** @enum {symbol} */ -WebInspector.ProfileHeader.Events = { +Profiler.ProfileHeader.Events = { UpdateStatus: Symbol('UpdateStatus'), ProfileReceived: Symbol('ProfileReceived') }; /** - * @implements {WebInspector.ProfileType.DataDisplayDelegate} + * @implements {Profiler.ProfileType.DataDisplayDelegate} * @unrestricted */ -WebInspector.ProfilesPanel = class extends WebInspector.PanelWithSidebar { +Profiler.ProfilesPanel = class extends UI.PanelWithSidebar { constructor() { super('profiles'); this.registerRequiredCSS('ui/panelEnablerView.css'); @@ -399,10 +399,10 @@ this.registerRequiredCSS('profiler/profilesPanel.css'); this.registerRequiredCSS('components/objectValue.css'); - var mainContainer = new WebInspector.VBox(); + var mainContainer = new UI.VBox(); this.splitWidget().setMainWidget(mainContainer); - this.profilesItemTreeElement = new WebInspector.ProfilesSidebarTreeElement(this); + this.profilesItemTreeElement = new Profiler.ProfilesSidebarTreeElement(this); this._sidebarTree = new TreeOutlineInShadow(); this._sidebarTree.registerRequiredCSS('profiler/profilesSidebarTree.css'); @@ -421,29 +421,29 @@ this.panelSidebarElement().classList.add('profiles-sidebar-tree-box'); var toolbarContainerLeft = createElementWithClass('div', 'profiles-toolbar'); this.panelSidebarElement().insertBefore(toolbarContainerLeft, this.panelSidebarElement().firstChild); - var toolbar = new WebInspector.Toolbar('', toolbarContainerLeft); + var toolbar = new UI.Toolbar('', toolbarContainerLeft); this._toggleRecordAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('profiler.toggle-recording')); - this._toggleRecordButton = WebInspector.Toolbar.createActionButton(this._toggleRecordAction); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('profiler.toggle-recording')); + this._toggleRecordButton = UI.Toolbar.createActionButton(this._toggleRecordAction); toolbar.appendToolbarItem(this._toggleRecordButton); this.clearResultsButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Clear all profiles'), 'largeicon-clear'); + new UI.ToolbarButton(Common.UIString('Clear all profiles'), 'largeicon-clear'); this.clearResultsButton.addEventListener('click', this._reset, this); toolbar.appendToolbarItem(this.clearResultsButton); - this._profileTypeToolbar = new WebInspector.Toolbar('', this._toolbarElement); - this._profileViewToolbar = new WebInspector.Toolbar('', this._toolbarElement); + this._profileTypeToolbar = new UI.Toolbar('', this._toolbarElement); + this._profileViewToolbar = new UI.Toolbar('', this._toolbarElement); this._profileGroups = {}; - this._launcherView = new WebInspector.MultiProfileLauncherView(this); + this._launcherView = new Profiler.MultiProfileLauncherView(this); this._launcherView.addEventListener( - WebInspector.MultiProfileLauncherView.Events.ProfileTypeSelected, this._onProfileTypeSelected, this); + Profiler.MultiProfileLauncherView.Events.ProfileTypeSelected, this._onProfileTypeSelected, this); this._profileToView = []; this._typeIdToSidebarSection = {}; - var types = WebInspector.ProfileTypeRegistry.instance.profileTypes(); + var types = Profiler.ProfileTypeRegistry.instance.profileTypes(); for (var i = 0; i < types.length; i++) this._registerProfileType(types[i]); this._launcherView.restoreSelectedProfileType(); @@ -455,15 +455,15 @@ this.contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); } /** - * @return {!WebInspector.ProfilesPanel} + * @return {!Profiler.ProfilesPanel} */ static _instance() { - return /** @type {!WebInspector.ProfilesPanel} */ (self.runtime.sharedInstance(WebInspector.ProfilesPanel)); + return /** @type {!Profiler.ProfilesPanel} */ (self.runtime.sharedInstance(Profiler.ProfilesPanel)); } /** @@ -481,7 +481,7 @@ /** * @override - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ searchableView() { return this.visibleView && this.visibleView.searchableView ? this.visibleView.searchableView() : null; @@ -490,13 +490,13 @@ _createFileSelectorElement() { if (this._fileSelectorElement) this.element.removeChild(this._fileSelectorElement); - this._fileSelectorElement = WebInspector.createFileSelectorElement(this._loadFromFile.bind(this)); - WebInspector.ProfilesPanel._fileSelectorElement = this._fileSelectorElement; + this._fileSelectorElement = Bindings.createFileSelectorElement(this._loadFromFile.bind(this)); + Profiler.ProfilesPanel._fileSelectorElement = this._fileSelectorElement; this.element.appendChild(this._fileSelectorElement); } _findProfileTypeByExtension(fileName) { - var types = WebInspector.ProfileTypeRegistry.instance.profileTypes(); + var types = Profiler.ProfileTypeRegistry.instance.profileTypes(); for (var i = 0; i < types.length; i++) { var type = types[i]; var extension = type.fileExtension(); @@ -517,20 +517,20 @@ var profileType = this._findProfileTypeByExtension(file.name); if (!profileType) { var extensions = []; - var types = WebInspector.ProfileTypeRegistry.instance.profileTypes(); + var types = Profiler.ProfileTypeRegistry.instance.profileTypes(); for (var i = 0; i < types.length; i++) { var extension = types[i].fileExtension(); if (!extension || extensions.indexOf(extension) !== -1) continue; extensions.push(extension); } - WebInspector.console.error(WebInspector.UIString( + Common.console.error(Common.UIString( 'Can\'t load file. Only files with extensions \'%s\' can be loaded.', extensions.join('\', \''))); return; } if (!!profileType.profileBeingRecorded()) { - WebInspector.console.error(WebInspector.UIString('Can\'t load profile while another profile is recording.')); + Common.console.error(Common.UIString('Can\'t load profile while another profile is recording.')); return; } @@ -564,13 +564,13 @@ * @param {boolean} toggled */ _updateToggleRecordAction(toggled) { - var enable = toggled || !WebInspector.targetManager.allTargetsSuspended(); + var enable = toggled || !SDK.targetManager.allTargetsSuspended(); this._toggleRecordAction.setEnabled(enable); this._toggleRecordAction.setToggled(toggled); if (enable) this._toggleRecordButton.setTitle(this._selectedProfileType ? this._selectedProfileType.buttonTooltip : ''); else - this._toggleRecordButton.setTitle(WebInspector.anotherProfilerActiveLabel()); + this._toggleRecordButton.setTitle(UI.anotherProfilerActiveLabel()); if (this._selectedProfileType) this._launcherView.updateProfileType(this._selectedProfileType, enable); } @@ -581,10 +581,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onProfileTypeSelected(event) { - this._selectedProfileType = /** @type {!WebInspector.ProfileType} */ (event.data); + this._selectedProfileType = /** @type {!Profiler.ProfileType} */ (event.data); this._updateProfileTypeSpecificUI(); } @@ -597,7 +597,7 @@ } _reset() { - var types = WebInspector.ProfileTypeRegistry.instance.profileTypes(); + var types = Profiler.ProfileTypeRegistry.instance.profileTypes(); for (var i = 0; i < types.length; i++) types[i]._reset(); @@ -629,44 +629,44 @@ } /** - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType} profileType */ _registerProfileType(profileType) { this._launcherView.addProfileType(profileType); - var profileTypeSection = new WebInspector.ProfileTypeSidebarSection(this, profileType); + var profileTypeSection = new Profiler.ProfileTypeSidebarSection(this, profileType); this._typeIdToSidebarSection[profileType.id] = profileTypeSection; this._sidebarTree.appendChild(profileTypeSection); profileTypeSection.childrenListElement.addEventListener( 'contextmenu', this._handleContextMenuEvent.bind(this), false); /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ProfilesPanel} + * @param {!Common.Event} event + * @this {Profiler.ProfilesPanel} */ function onAddProfileHeader(event) { - this._addProfileHeader(/** @type {!WebInspector.ProfileHeader} */ (event.data)); + this._addProfileHeader(/** @type {!Profiler.ProfileHeader} */ (event.data)); } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ProfilesPanel} + * @param {!Common.Event} event + * @this {Profiler.ProfilesPanel} */ function onRemoveProfileHeader(event) { - this._removeProfileHeader(/** @type {!WebInspector.ProfileHeader} */ (event.data)); + this._removeProfileHeader(/** @type {!Profiler.ProfileHeader} */ (event.data)); } /** - * @param {!WebInspector.Event} event - * @this {WebInspector.ProfilesPanel} + * @param {!Common.Event} event + * @this {Profiler.ProfilesPanel} */ function profileComplete(event) { - this.showProfile(/** @type {!WebInspector.ProfileHeader} */ (event.data)); + this.showProfile(/** @type {!Profiler.ProfileHeader} */ (event.data)); } - profileType.addEventListener(WebInspector.ProfileType.Events.ViewUpdated, this._updateProfileTypeSpecificUI, this); - profileType.addEventListener(WebInspector.ProfileType.Events.AddProfileHeader, onAddProfileHeader, this); - profileType.addEventListener(WebInspector.ProfileType.Events.RemoveProfileHeader, onRemoveProfileHeader, this); - profileType.addEventListener(WebInspector.ProfileType.Events.ProfileComplete, profileComplete, this); + profileType.addEventListener(Profiler.ProfileType.Events.ViewUpdated, this._updateProfileTypeSpecificUI, this); + profileType.addEventListener(Profiler.ProfileType.Events.AddProfileHeader, onAddProfileHeader, this); + profileType.addEventListener(Profiler.ProfileType.Events.RemoveProfileHeader, onRemoveProfileHeader, this); + profileType.addEventListener(Profiler.ProfileType.Events.ProfileComplete, profileComplete, this); var profiles = profileType.getProfiles(); for (var i = 0; i < profiles.length; i++) @@ -677,13 +677,13 @@ * @param {!Event} event */ _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - if (this.visibleView instanceof WebInspector.HeapSnapshotView) { + var contextMenu = new UI.ContextMenu(event); + if (this.visibleView instanceof Profiler.HeapSnapshotView) { this.visibleView.populateContextMenu(contextMenu, event); } if (this.panelSidebarElement().isSelfOrAncestor(event.srcElement)) contextMenu.appendItem( - WebInspector.UIString('Load\u2026'), this._fileSelectorElement.click.bind(this._fileSelectorElement)); + Common.UIString('Load\u2026'), this._fileSelectorElement.click.bind(this._fileSelectorElement)); contextMenu.show(); } @@ -692,7 +692,7 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ _addProfileHeader(profile) { var profileType = profile.profileType(); @@ -703,7 +703,7 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ _removeProfileHeader(profile) { if (profile.profileType()._profileBeingRecorded === profile) @@ -727,8 +727,8 @@ /** * @override - * @param {?WebInspector.ProfileHeader} profile - * @return {?WebInspector.Widget} + * @param {?Profiler.ProfileHeader} profile + * @return {?UI.Widget} */ showProfile(profile) { if (!profile || @@ -765,7 +765,7 @@ * @param {string} perspectiveName */ showObject(snapshotObjectId, perspectiveName) { - var heapProfiles = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType.getProfiles(); + var heapProfiles = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType.getProfiles(); for (var i = 0; i < heapProfiles.length; i++) { var profile = heapProfiles[i]; // FIXME: allow to choose snapshot if there are several options. @@ -779,8 +779,8 @@ } /** - * @param {!WebInspector.ProfileHeader} profile - * @return {!WebInspector.Widget} + * @param {!Profiler.ProfileHeader} profile + * @return {!UI.Widget} */ _viewForProfile(profile) { var index = this._indexOfViewForProfile(profile); @@ -793,7 +793,7 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile * @return {number} */ _indexOfViewForProfile(profile) { @@ -812,34 +812,34 @@ /** * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { - if (!(target instanceof WebInspector.RemoteObject)) + if (!(target instanceof SDK.RemoteObject)) return; if (!this.isShowing()) return; - var object = /** @type {!WebInspector.RemoteObject} */ (target); + var object = /** @type {!SDK.RemoteObject} */ (target); var objectId = object.objectId; if (!objectId) return; - var heapProfiles = WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType.getProfiles(); + var heapProfiles = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType.getProfiles(); if (!heapProfiles.length) return; /** - * @this {WebInspector.ProfilesPanel} + * @this {Profiler.ProfilesPanel} */ function revealInView(viewName) { object.target().heapProfilerAgent().getHeapObjectId(objectId, didReceiveHeapObjectId.bind(this, viewName)); } /** - * @this {WebInspector.ProfilesPanel} + * @this {Profiler.ProfilesPanel} */ function didReceiveHeapObjectId(viewName, error, result) { if (!this.isShowing()) @@ -849,14 +849,14 @@ } contextMenu.appendItem( - WebInspector.UIString.capitalize('Reveal in Summary ^view'), revealInView.bind(this, 'Summary')); + Common.UIString.capitalize('Reveal in Summary ^view'), revealInView.bind(this, 'Summary')); } /** * @override */ wasShown() { - WebInspector.context.setFlavor(WebInspector.ProfilesPanel, this); + UI.context.setFlavor(Profiler.ProfilesPanel, this); } /** @@ -870,32 +870,32 @@ * @override */ willHide() { - WebInspector.context.setFlavor(WebInspector.ProfilesPanel, null); + UI.context.setFlavor(Profiler.ProfilesPanel, null); } }; /** * @unrestricted */ -WebInspector.ProfileTypeSidebarSection = class extends TreeElement { +Profiler.ProfileTypeSidebarSection = class extends TreeElement { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!WebInspector.ProfileType} profileType + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileType} profileType */ constructor(dataDisplayDelegate, profileType) { super(profileType.treeItemTitle.escapeHTML(), true); this.selectable = false; this._dataDisplayDelegate = dataDisplayDelegate; - /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ + /** @type {!Array<!Profiler.ProfileSidebarTreeElement>} */ this._profileTreeElements = []; - /** @type {!Object<string, !WebInspector.ProfileTypeSidebarSection.ProfileGroup>} */ + /** @type {!Object<string, !Profiler.ProfileTypeSidebarSection.ProfileGroup>} */ this._profileGroups = {}; this.expand(); this.hidden = true; } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile */ addProfileHeader(profile) { this.hidden = false; @@ -908,7 +908,7 @@ var profileTitle = profile.title; var group = this._profileGroups[profileTitle]; if (!group) { - group = new WebInspector.ProfileTypeSidebarSection.ProfileGroup(); + group = new Profiler.ProfileTypeSidebarSection.ProfileGroup(); this._profileGroups[profileTitle] = group; } group.profileSidebarTreeElements.push(profileTreeElement); @@ -917,7 +917,7 @@ if (groupSize === 2) { // Make a group TreeElement now that there are 2 profiles. group.sidebarTreeElement = - new WebInspector.ProfileGroupSidebarTreeElement(this._dataDisplayDelegate, profile.title); + new Profiler.ProfileGroupSidebarTreeElement(this._dataDisplayDelegate, profile.title); var firstProfileTreeElement = group.profileSidebarTreeElements[0]; // Insert at the same index for the first profile of the group. @@ -932,7 +932,7 @@ firstProfileTreeElement.revealAndSelect(); firstProfileTreeElement.setSmall(true); - firstProfileTreeElement.setMainTitle(WebInspector.UIString('Run %d', 1)); + firstProfileTreeElement.setMainTitle(Common.UIString('Run %d', 1)); this.treeOutline.element.classList.add('some-expandable'); } @@ -940,7 +940,7 @@ if (groupSize >= 2) { sidebarParent = group.sidebarTreeElement; profileTreeElement.setSmall(true); - profileTreeElement.setMainTitle(WebInspector.UIString('Run %d', groupSize)); + profileTreeElement.setMainTitle(Common.UIString('Run %d', groupSize)); } } @@ -948,7 +948,7 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile * @return {boolean} */ removeProfileHeader(profile) { @@ -966,7 +966,7 @@ if (groupElements.length === 1) { // Move the last profile out of its group and remove the group. var pos = sidebarParent.children().indexOf( - /** @type {!WebInspector.ProfileGroupSidebarTreeElement} */ (group.sidebarTreeElement)); + /** @type {!Profiler.ProfileGroupSidebarTreeElement} */ (group.sidebarTreeElement)); group.sidebarTreeElement.removeChild(groupElements[0]); this.insertChild(groupElements[0], pos); groupElements[0].setSmall(false); @@ -986,8 +986,8 @@ } /** - * @param {!WebInspector.ProfileHeader} profile - * @return {?WebInspector.ProfileSidebarTreeElement} + * @param {!Profiler.ProfileHeader} profile + * @return {?Profiler.ProfileSidebarTreeElement} */ sidebarElementForProfile(profile) { var index = this._sidebarElementIndex(profile); @@ -995,7 +995,7 @@ } /** - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileHeader} profile * @return {number} */ _sidebarElementIndex(profile) { @@ -1018,38 +1018,38 @@ /** * @unrestricted */ -WebInspector.ProfileTypeSidebarSection.ProfileGroup = class { +Profiler.ProfileTypeSidebarSection.ProfileGroup = class { constructor() { - /** @type {!Array<!WebInspector.ProfileSidebarTreeElement>} */ + /** @type {!Array<!Profiler.ProfileSidebarTreeElement>} */ this.profileSidebarTreeElements = []; - /** @type {?WebInspector.ProfileGroupSidebarTreeElement} */ + /** @type {?Profiler.ProfileGroupSidebarTreeElement} */ this.sidebarTreeElement = null; } }; /** - * @implements {WebInspector.ContextMenu.Provider} + * @implements {UI.ContextMenu.Provider} * @unrestricted */ -WebInspector.ProfilesPanel.ContextMenuProvider = class { +Profiler.ProfilesPanel.ContextMenuProvider = class { /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { - WebInspector.ProfilesPanel._instance().appendApplicableItems(event, contextMenu, target); + Profiler.ProfilesPanel._instance().appendApplicableItems(event, contextMenu, target); } }; /** * @unrestricted */ -WebInspector.ProfileSidebarTreeElement = class extends TreeElement { +Profiler.ProfileSidebarTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate - * @param {!WebInspector.ProfileHeader} profile + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileHeader} profile * @param {string} className */ constructor(dataDisplayDelegate, profile, className) { @@ -1065,16 +1065,16 @@ this._small = false; this._dataDisplayDelegate = dataDisplayDelegate; this.profile = profile; - profile.addEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, this._updateStatus, this); + profile.addEventListener(Profiler.ProfileHeader.Events.UpdateStatus, this._updateStatus, this); if (profile.canSaveToFile()) this._createSaveLink(); else - profile.addEventListener(WebInspector.ProfileHeader.Events.ProfileReceived, this._onProfileReceived, this); + profile.addEventListener(Profiler.ProfileHeader.Events.ProfileReceived, this._onProfileReceived, this); } _createSaveLink() { this._saveLinkElement = this._titleContainer.createChild('span', 'save-link'); - this._saveLinkElement.textContent = WebInspector.UIString('Save'); + this._saveLinkElement.textContent = Common.UIString('Save'); this._saveLinkElement.addEventListener('click', this._saveProfile.bind(this), false); } @@ -1083,7 +1083,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _updateStatus(event) { var statusUpdate = event.data; @@ -1096,8 +1096,8 @@ } dispose() { - this.profile.removeEventListener(WebInspector.ProfileHeader.Events.UpdateStatus, this._updateStatus, this); - this.profile.removeEventListener(WebInspector.ProfileHeader.Events.ProfileReceived, this._onProfileReceived, this); + this.profile.removeEventListener(Profiler.ProfileHeader.Events.UpdateStatus, this._updateStatus, this); + this.profile.removeEventListener(Profiler.ProfileHeader.Events.ProfileReceived, this._onProfileReceived, this); } /** @@ -1135,14 +1135,14 @@ */ _handleContextMenuEvent(event) { var profile = this.profile; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); // FIXME: use context menu provider contextMenu.appendItem( - WebInspector.UIString('Load\u2026'), - WebInspector.ProfilesPanel._fileSelectorElement.click.bind(WebInspector.ProfilesPanel._fileSelectorElement)); + Common.UIString('Load\u2026'), + Profiler.ProfilesPanel._fileSelectorElement.click.bind(Profiler.ProfilesPanel._fileSelectorElement)); if (profile.canSaveToFile()) - contextMenu.appendItem(WebInspector.UIString('Save\u2026'), profile.saveToFile.bind(profile)); - contextMenu.appendItem(WebInspector.UIString('Delete'), this.ondelete.bind(this)); + contextMenu.appendItem(Common.UIString('Save\u2026'), profile.saveToFile.bind(profile)); + contextMenu.appendItem(Common.UIString('Delete'), this.ondelete.bind(this)); contextMenu.show(); } @@ -1170,9 +1170,9 @@ /** * @unrestricted */ -WebInspector.ProfileGroupSidebarTreeElement = class extends TreeElement { +Profiler.ProfileGroupSidebarTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegate + * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate * @param {string} title */ constructor(dataDisplayDelegate, title) { @@ -1211,9 +1211,9 @@ /** * @unrestricted */ -WebInspector.ProfilesSidebarTreeElement = class extends TreeElement { +Profiler.ProfilesSidebarTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ProfilesPanel} panel + * @param {!Profiler.ProfilesPanel} panel */ constructor(panel) { super('', false); @@ -1239,25 +1239,25 @@ this.listItemElement.createChild('div', 'titles no-subtitle') .createChild('span', 'title-container') .createChild('span', 'title') - .textContent = WebInspector.UIString('Profiles'); + .textContent = Common.UIString('Profiles'); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.ProfilesPanel.RecordActionDelegate = class { +Profiler.ProfilesPanel.RecordActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); - console.assert(panel && panel instanceof WebInspector.ProfilesPanel); + var panel = UI.context.flavor(Profiler.ProfilesPanel); + console.assert(panel && panel instanceof Profiler.ProfilesPanel); panel.toggleRecord(); return true; }
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/TargetsComboBoxController.js b/third_party/WebKit/Source/devtools/front_end/profiler/TargetsComboBoxController.js index 86604d4c..c8a5cfab 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/TargetsComboBoxController.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/TargetsComboBoxController.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.TargetsComboBoxController = class { +Profiler.TargetsComboBoxController = class { /** * @param {!Element} selectElement * @param {!Element} elementToHide @@ -15,25 +15,25 @@ selectElement.addEventListener('change', this._onComboBoxSelectionChange.bind(this), false); this._selectElement = selectElement; this._elementToHide = elementToHide; - /** @type {!Map.<!WebInspector.Target, !Element>} */ + /** @type {!Map.<!SDK.Target, !Element>} */ this._targetToOption = new Map(); - WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targetChangedExternally, this); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.NameChanged, this._targetNameChanged, this); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.JS); + UI.context.addFlavorChangeListener(SDK.Target, this._targetChangedExternally, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.NameChanged, this._targetNameChanged, this); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.JS); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { var option = this._selectElement.createChild('option'); option.text = target.name(); option.__target = target; this._targetToOption.set(target, option); - if (WebInspector.context.flavor(WebInspector.Target) === target) + if (UI.context.flavor(SDK.Target) === target) this._selectElement.selectedIndex = Array.prototype.indexOf.call(/** @type {?} */ (this._selectElement), option); this._updateVisibility(); @@ -41,7 +41,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { var option = this._targetToOption.remove(target); @@ -50,10 +50,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetNameChanged(event) { - var target = /** @type {!WebInspector.Target} */ (event.data); + var target = /** @type {!SDK.Target} */ (event.data); var option = this._targetToOption.get(target); option.text = target.name(); } @@ -63,7 +63,7 @@ if (!selectedOption) return; - WebInspector.context.setFlavor(WebInspector.Target, selectedOption.__target); + UI.context.setFlavor(SDK.Target, selectedOption.__target); } _updateVisibility() { @@ -72,10 +72,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetChangedExternally(event) { - var target = /** @type {?WebInspector.Target} */ (event.data); + var target = /** @type {?SDK.Target} */ (event.data); if (target) { var option = /** @type {!Element} */ (this._targetToOption.get(target)); this._select(option);
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js b/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js index 406f7ec..f276f32 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/TopDownProfileDataGrid.js
@@ -26,10 +26,10 @@ /** * @unrestricted */ -WebInspector.TopDownProfileDataGridNode = class extends WebInspector.ProfileDataGridNode { +Profiler.TopDownProfileDataGridNode = class extends Profiler.ProfileDataGridNode { /** - * @param {!WebInspector.ProfileNode} profileNode - * @param {!WebInspector.TopDownProfileDataGridTree} owningTree + * @param {!SDK.ProfileNode} profileNode + * @param {!Profiler.TopDownProfileDataGridTree} owningTree */ constructor(profileNode, owningTree) { var hasChildren = !!(profileNode.children && profileNode.children.length); @@ -40,21 +40,21 @@ } /** - * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container + * @param {!Profiler.TopDownProfileDataGridNode|!Profiler.TopDownProfileDataGridTree} container */ static _sharedPopulate(container) { var children = container._remainingChildren; var childrenLength = children.length; for (var i = 0; i < childrenLength; ++i) - container.appendChild(new WebInspector.TopDownProfileDataGridNode( - children[i], /** @type {!WebInspector.TopDownProfileDataGridTree} */ (container.tree))); + container.appendChild(new Profiler.TopDownProfileDataGridNode( + children[i], /** @type {!Profiler.TopDownProfileDataGridTree} */ (container.tree))); container._remainingChildren = null; } /** - * @param {!WebInspector.TopDownProfileDataGridNode|!WebInspector.TopDownProfileDataGridTree} container + * @param {!Profiler.TopDownProfileDataGridNode|!Profiler.TopDownProfileDataGridTree} container * @param {string} aCallUID */ static _excludeRecursively(container, aCallUID) { @@ -67,19 +67,19 @@ var index = container.children.length; while (index--) - WebInspector.TopDownProfileDataGridNode._excludeRecursively(children[index], aCallUID); + Profiler.TopDownProfileDataGridNode._excludeRecursively(children[index], aCallUID); var child = container.childrenByCallUID.get(aCallUID); if (child) - WebInspector.ProfileDataGridNode.merge(container, child, true); + Profiler.ProfileDataGridNode.merge(container, child, true); } /** * @override */ populateChildren() { - WebInspector.TopDownProfileDataGridNode._sharedPopulate(this); + Profiler.TopDownProfileDataGridNode._sharedPopulate(this); } }; @@ -87,21 +87,21 @@ /** * @unrestricted */ -WebInspector.TopDownProfileDataGridTree = class extends WebInspector.ProfileDataGridTree { +Profiler.TopDownProfileDataGridTree = class extends Profiler.ProfileDataGridTree { /** - * @param {!WebInspector.ProfileDataGridNode.Formatter} formatter - * @param {!WebInspector.SearchableView} searchableView - * @param {!WebInspector.ProfileNode} rootProfileNode + * @param {!Profiler.ProfileDataGridNode.Formatter} formatter + * @param {!UI.SearchableView} searchableView + * @param {!SDK.ProfileNode} rootProfileNode * @param {number} total */ constructor(formatter, searchableView, rootProfileNode, total) { super(formatter, searchableView, total); this._remainingChildren = rootProfileNode.children; - WebInspector.ProfileDataGridNode.populate(this); + Profiler.ProfileDataGridNode.populate(this); } /** - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode */ focus(profileDataGridNode) { if (!profileDataGridNode) @@ -115,7 +115,7 @@ } /** - * @param {!WebInspector.ProfileDataGridNode} profileDataGridNode + * @param {!Profiler.ProfileDataGridNode} profileDataGridNode */ exclude(profileDataGridNode) { if (!profileDataGridNode) @@ -123,7 +123,7 @@ this.save(); - WebInspector.TopDownProfileDataGridNode._excludeRecursively(this, profileDataGridNode.callUID); + Profiler.TopDownProfileDataGridNode._excludeRecursively(this, profileDataGridNode.callUID); if (this.lastComparator) this.sort(this.lastComparator, true); @@ -145,6 +145,6 @@ * @override */ populateChildren() { - WebInspector.TopDownProfileDataGridNode._sharedPopulate(this); + Profiler.TopDownProfileDataGridNode._sharedPopulate(this); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/module.json b/third_party/WebKit/Source/devtools/front_end/profiler/module.json index 3d4232f..cc70003 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/module.json +++ b/third_party/WebKit/Source/devtools/front_end/profiler/module.json
@@ -6,12 +6,12 @@ "id": "profiles", "title": "Profiles", "order": 60, - "className": "WebInspector.ProfilesPanel" + "className": "Profiler.ProfilesPanel" }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.RemoteObject"], - "className": "WebInspector.ProfilesPanel.ContextMenuProvider" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["SDK.RemoteObject"], + "className": "Profiler.ProfilesPanel.ContextMenuProvider" }, { "type": "setting", @@ -38,13 +38,13 @@ "defaultValue": false }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "profiler.toggle-recording", "iconClass": "largeicon-start-recording", "toggledIconClass": "largeicon-stop-recording", "toggleWithRedColor": true, - "contextTypes": ["WebInspector.ProfilesPanel"], - "className": "WebInspector.ProfilesPanel.RecordActionDelegate", + "contextTypes": ["Profiler.ProfilesPanel"], + "className": "Profiler.ProfilesPanel.RecordActionDelegate", "bindings": [ { "platform": "windows,linux",
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js index 55f38a9..5383828 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
@@ -2,74 +2,74 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.AppManifestView = class extends WebInspector.VBox { +Resources.AppManifestView = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('resources/appManifestView.css'); - this._reportView = new WebInspector.ReportView(WebInspector.UIString('App Manifest')); + this._reportView = new UI.ReportView(Common.UIString('App Manifest')); this._reportView.show(this.contentElement); - this._errorsSection = this._reportView.appendSection(WebInspector.UIString('Errors and warnings')); - this._identitySection = this._reportView.appendSection(WebInspector.UIString('Identity')); + this._errorsSection = this._reportView.appendSection(Common.UIString('Errors and warnings')); + this._identitySection = this._reportView.appendSection(Common.UIString('Identity')); var toolbar = this._identitySection.createToolbar(); toolbar.renderAsLinks(); - var addToHomeScreen = new WebInspector.ToolbarButton( - WebInspector.UIString('Add to homescreen'), undefined, WebInspector.UIString('Add to homescreen')); + var addToHomeScreen = new UI.ToolbarButton( + Common.UIString('Add to homescreen'), undefined, Common.UIString('Add to homescreen')); addToHomeScreen.addEventListener('click', this._addToHomescreen.bind(this)); toolbar.appendToolbarItem(addToHomeScreen); - this._presentationSection = this._reportView.appendSection(WebInspector.UIString('Presentation')); - this._iconsSection = this._reportView.appendSection(WebInspector.UIString('Icons')); + this._presentationSection = this._reportView.appendSection(Common.UIString('Presentation')); + this._iconsSection = this._reportView.appendSection(Common.UIString('Icons')); - this._nameField = this._identitySection.appendField(WebInspector.UIString('Name')); - this._shortNameField = this._identitySection.appendField(WebInspector.UIString('Short name')); + this._nameField = this._identitySection.appendField(Common.UIString('Name')); + this._shortNameField = this._identitySection.appendField(Common.UIString('Short name')); - this._startURLField = this._presentationSection.appendField(WebInspector.UIString('Start URL')); + this._startURLField = this._presentationSection.appendField(Common.UIString('Start URL')); - var themeColorField = this._presentationSection.appendField(WebInspector.UIString('Theme color')); - this._themeColorSwatch = WebInspector.ColorSwatch.create(); + var themeColorField = this._presentationSection.appendField(Common.UIString('Theme color')); + this._themeColorSwatch = UI.ColorSwatch.create(); themeColorField.appendChild(this._themeColorSwatch); - var backgroundColorField = this._presentationSection.appendField(WebInspector.UIString('Background color')); - this._backgroundColorSwatch = WebInspector.ColorSwatch.create(); + var backgroundColorField = this._presentationSection.appendField(Common.UIString('Background color')); + this._backgroundColorSwatch = UI.ColorSwatch.create(); backgroundColorField.appendChild(this._backgroundColorSwatch); - this._orientationField = this._presentationSection.appendField(WebInspector.UIString('Orientation')); - this._displayField = this._presentationSection.appendField(WebInspector.UIString('Display')); + this._orientationField = this._presentationSection.appendField(Common.UIString('Orientation')); + this._displayField = this._presentationSection.appendField(Common.UIString('Display')); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.DOM); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.DOM); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._resourceTreeModel) return; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (!resourceTreeModel) return; this._resourceTreeModel = resourceTreeModel; this._updateManifest(); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (!this._resourceTreeModel || this._resourceTreeModel !== resourceTreeModel) return; resourceTreeModel.removeEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this); delete this._resourceTreeModel; } @@ -99,18 +99,18 @@ this._startURLField.removeChildren(); var startURL = stringProperty('start_url'); if (startURL) - this._startURLField.appendChild(WebInspector.linkifyResourceAsNode( - /** @type {string} */ (WebInspector.ParsedURL.completeURL(url, startURL)), undefined, undefined, undefined, + this._startURLField.appendChild(Components.linkifyResourceAsNode( + /** @type {string} */ (Common.ParsedURL.completeURL(url, startURL)), undefined, undefined, undefined, undefined, startURL)); this._themeColorSwatch.classList.toggle('hidden', !stringProperty('theme_color')); var themeColor = - WebInspector.Color.parse(stringProperty('theme_color') || 'white') || WebInspector.Color.parse('white'); - this._themeColorSwatch.setColor(/** @type {!WebInspector.Color} */ (themeColor)); + Common.Color.parse(stringProperty('theme_color') || 'white') || Common.Color.parse('white'); + this._themeColorSwatch.setColor(/** @type {!Common.Color} */ (themeColor)); this._backgroundColorSwatch.classList.toggle('hidden', !stringProperty('background_color')); var backgroundColor = - WebInspector.Color.parse(stringProperty('background_color') || 'white') || WebInspector.Color.parse('white'); - this._backgroundColorSwatch.setColor(/** @type {!WebInspector.Color} */ (backgroundColor)); + Common.Color.parse(stringProperty('background_color') || 'white') || Common.Color.parse('white'); + this._backgroundColorSwatch.setColor(/** @type {!Common.Color} */ (backgroundColor)); this._orientationField.textContent = stringProperty('orientation'); this._displayField.textContent = stringProperty('display'); @@ -123,7 +123,7 @@ var imageElement = field.createChild('img'); imageElement.style.maxWidth = '200px'; imageElement.style.maxHeight = '200px'; - imageElement.src = WebInspector.ParsedURL.completeURL(url, icon['src']); + imageElement.src = Common.ParsedURL.completeURL(url, icon['src']); } /** @@ -139,10 +139,10 @@ } _addToHomescreen() { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); if (target && target.hasBrowserCapability()) { target.pageAgent().requestAppBanner(); - WebInspector.console.show(); + Common.console.show(); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationCacheItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationCacheItemsView.js index b71a3b4..0e2db5e 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationCacheItemsView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationCacheItemsView.js
@@ -26,15 +26,15 @@ /** * @unrestricted */ -WebInspector.ApplicationCacheItemsView = class extends WebInspector.SimpleView { +Resources.ApplicationCacheItemsView = class extends UI.SimpleView { constructor(model, frameId) { - super(WebInspector.UIString('AppCache')); + super(Common.UIString('AppCache')); this._model = model; this.element.classList.add('storage-view', 'table'); - this._deleteButton = new WebInspector.ToolbarButton(WebInspector.UIString('Delete'), 'largeicon-delete'); + this._deleteButton = new UI.ToolbarButton(Common.UIString('Delete'), 'largeicon-delete'); this._deleteButton.setVisible(false); this._deleteButton.addEventListener('click', this._deleteButtonClicked, this); @@ -46,7 +46,7 @@ this._frameId = frameId; this._emptyWidget = - new WebInspector.EmptyWidget(WebInspector.UIString('No Application Cache information available.')); + new UI.EmptyWidget(Common.UIString('No Application Cache information available.')); this._emptyWidget.show(this.element); this._markDirty(); @@ -62,12 +62,12 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [ - this._deleteButton, new WebInspector.ToolbarItem(this._connectivityIcon), new WebInspector.ToolbarSeparator(), - new WebInspector.ToolbarItem(this._statusIcon) + this._deleteButton, new UI.ToolbarItem(this._connectivityIcon), new UI.ToolbarSeparator(), + new UI.ToolbarItem(this._statusIcon) ]; } @@ -130,10 +130,10 @@ updateNetworkState(isNowOnline) { if (isNowOnline) { this._connectivityIcon.type = 'smallicon-green-ball'; - this._connectivityIcon.textContent = WebInspector.UIString('Online'); + this._connectivityIcon.textContent = Common.UIString('Online'); } else { this._connectivityIcon.type = 'smallicon-red-ball'; - this._connectivityIcon.textContent = WebInspector.UIString('Offline'); + this._connectivityIcon.textContent = Common.UIString('Offline'); } } @@ -176,23 +176,23 @@ // FIXME: For Chrome, put creationTime and updateTime somewhere. // NOTE: localizedString has not yet been added. - // WebInspector.UIString("(%s) Created: %s Updated: %s", this._size, this._creationTime, this._updateTime); + // Common.UIString("(%s) Created: %s Updated: %s", this._size, this._creationTime, this._updateTime); } _createDataGrid() { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ { id: 'resource', - title: WebInspector.UIString('Resource'), - sort: WebInspector.DataGrid.Order.Ascending, + title: Common.UIString('Resource'), + sort: UI.DataGrid.Order.Ascending, sortable: true }, - {id: 'type', title: WebInspector.UIString('Type'), sortable: true}, - {id: 'size', title: WebInspector.UIString('Size'), align: WebInspector.DataGrid.Align.Right, sortable: true} + {id: 'type', title: Common.UIString('Type'), sortable: true}, + {id: 'size', title: Common.UIString('Size'), align: UI.DataGrid.Align.Right, sortable: true} ]); - this._dataGrid = new WebInspector.DataGrid(columns); + this._dataGrid = new UI.DataGrid(columns); this._dataGrid.asWidget().show(this.element); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._populateDataGrid, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._populateDataGrid, this); } _populateDataGrid() { @@ -231,7 +231,7 @@ data.resource = resource.url; data.type = resource.type; data.size = Number.bytesToString(resource.size); - var node = new WebInspector.DataGridNode(data); + var node = new UI.DataGridNode(data); node.resource = resource; node.selectable = true; this._dataGrid.rootNode().appendChild(node);
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js b/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js index 497fc4a..bc852dd 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ClearStorageView = class extends WebInspector.VBox { +Resources.ClearStorageView = class extends UI.VBox { /** - * @param {!WebInspector.ResourcesPanel} resourcesPanel + * @param {!Resources.ResourcesPanel} resourcesPanel */ constructor(resourcesPanel) { super(true); this._resourcesPanel = resourcesPanel; - this._reportView = new WebInspector.ReportView(WebInspector.UIString('Clear storage')); + this._reportView = new UI.ReportView(Common.UIString('Clear storage')); this._reportView.registerRequiredCSS('resources/clearStorageView.css'); this._reportView.element.classList.add('clear-storage-header'); this._reportView.show(this.contentElement); @@ -24,67 +24,67 @@ Protocol.Storage.StorageType.Cookies, Protocol.Storage.StorageType.Indexeddb, Protocol.Storage.StorageType.Local_storage, Protocol.Storage.StorageType.Service_workers, Protocol.Storage.StorageType.Websql]) { - this._settings.set(type, WebInspector.settings.createSetting('clear-storage-' + type, true)); + this._settings.set(type, Common.settings.createSetting('clear-storage-' + type, true)); } - var application = this._reportView.appendSection(WebInspector.UIString('Application')); - this._appendItem(application, WebInspector.UIString('Unregister service workers'), 'service_workers'); + var application = this._reportView.appendSection(Common.UIString('Application')); + this._appendItem(application, Common.UIString('Unregister service workers'), 'service_workers'); - var storage = this._reportView.appendSection(WebInspector.UIString('Storage')); - this._appendItem(storage, WebInspector.UIString('Local and session storage'), 'local_storage'); - this._appendItem(storage, WebInspector.UIString('Indexed DB'), 'indexeddb'); - this._appendItem(storage, WebInspector.UIString('Web SQL'), 'websql'); - this._appendItem(storage, WebInspector.UIString('Cookies'), 'cookies'); + var storage = this._reportView.appendSection(Common.UIString('Storage')); + this._appendItem(storage, Common.UIString('Local and session storage'), 'local_storage'); + this._appendItem(storage, Common.UIString('Indexed DB'), 'indexeddb'); + this._appendItem(storage, Common.UIString('Web SQL'), 'websql'); + this._appendItem(storage, Common.UIString('Cookies'), 'cookies'); - var caches = this._reportView.appendSection(WebInspector.UIString('Cache')); - this._appendItem(caches, WebInspector.UIString('Cache storage'), 'cache_storage'); - this._appendItem(caches, WebInspector.UIString('Application cache'), 'appcache'); + var caches = this._reportView.appendSection(Common.UIString('Cache')); + this._appendItem(caches, Common.UIString('Cache storage'), 'cache_storage'); + this._appendItem(caches, Common.UIString('Application cache'), 'appcache'); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); var footer = this._reportView.appendSection('', 'clear-storage-button').appendRow(); this._clearButton = createTextButton( - WebInspector.UIString('Clear site data'), this._clear.bind(this), WebInspector.UIString('Clear site data')); + Common.UIString('Clear site data'), this._clear.bind(this), Common.UIString('Clear site data')); footer.appendChild(this._clearButton); } /** - * @param {!WebInspector.ReportView.Section} section + * @param {!UI.ReportView.Section} section * @param {string} title * @param {string} settingName */ _appendItem(section, title, settingName) { var row = section.appendRow(); - row.appendChild(WebInspector.SettingsUI.createSettingCheckbox(title, this._settings.get(settingName), true)); + row.appendChild(UI.SettingsUI.createSettingCheckbox(title, this._settings.get(settingName), true)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._target) return; this._target = target; - var securityOriginManager = WebInspector.SecurityOriginManager.fromTarget(target); + var securityOriginManager = SDK.SecurityOriginManager.fromTarget(target); this._updateOrigin(securityOriginManager.mainSecurityOrigin()); securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.MainSecurityOriginChanged, this._originChanged, this); + SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this._originChanged, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (this._target !== target) return; - var securityOriginManager = WebInspector.SecurityOriginManager.fromTarget(target); + var securityOriginManager = SDK.SecurityOriginManager.fromTarget(target); securityOriginManager.removeEventListener( - WebInspector.SecurityOriginManager.Events.MainSecurityOriginChanged, this._originChanged, this); + SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this._originChanged, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _originChanged(event) { var origin = /** *@type {string} */ (event.data); @@ -95,7 +95,7 @@ * @param {string} url */ _updateOrigin(url) { - this._securityOrigin = new WebInspector.ParsedURL(url).securityOrigin(); + this._securityOrigin = new Common.ParsedURL(url).securityOrigin(); this._reportView.setSubtitle(this._securityOrigin); } @@ -114,21 +114,21 @@ this._resourcesPanel.clearCookies(this._securityOrigin); if (set.has(Protocol.Storage.StorageType.Indexeddb) || hasAll) { - for (var target of WebInspector.targetManager.targets()) { - var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(target); + for (var target of SDK.targetManager.targets()) { + var indexedDBModel = Resources.IndexedDBModel.fromTarget(target); if (indexedDBModel) indexedDBModel.clearForOrigin(this._securityOrigin); } } if (set.has(Protocol.Storage.StorageType.Local_storage) || hasAll) { - var storageModel = WebInspector.DOMStorageModel.fromTarget(this._target); + var storageModel = Resources.DOMStorageModel.fromTarget(this._target); if (storageModel) storageModel.clearForOrigin(this._securityOrigin); } if (set.has(Protocol.Storage.StorageType.Websql) || hasAll) { - var databaseModel = WebInspector.DatabaseModel.fromTarget(this._target); + var databaseModel = Resources.DatabaseModel.fromTarget(this._target); if (databaseModel) { databaseModel.disable(); databaseModel.enable(); @@ -136,23 +136,23 @@ } if (set.has(Protocol.Storage.StorageType.Cache_storage) || hasAll) { - var target = WebInspector.targetManager.mainTarget(); - var model = target && WebInspector.ServiceWorkerCacheModel.fromTarget(target); + var target = SDK.targetManager.mainTarget(); + var model = target && SDK.ServiceWorkerCacheModel.fromTarget(target); if (model) model.clearForOrigin(this._securityOrigin); } if (set.has(Protocol.Storage.StorageType.Appcache) || hasAll) { - var appcacheModel = WebInspector.ApplicationCacheModel.fromTarget(this._target); + var appcacheModel = SDK.ApplicationCacheModel.fromTarget(this._target); if (appcacheModel) appcacheModel.reset(); } this._clearButton.disabled = true; - this._clearButton.textContent = WebInspector.UIString('Clearing...'); + this._clearButton.textContent = Common.UIString('Clearing...'); setTimeout(() => { this._clearButton.disabled = false; - this._clearButton.textContent = WebInspector.UIString('Clear selected'); + this._clearButton.textContent = Common.UIString('Clear selected'); }, 500); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js index 5e2d29f..c1d1fec 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/CookieItemsView.js
@@ -30,30 +30,30 @@ /** * @unrestricted */ -WebInspector.CookieItemsView = class extends WebInspector.SimpleView { +Resources.CookieItemsView = class extends UI.SimpleView { constructor(treeElement, cookieDomain) { - super(WebInspector.UIString('Cookies')); + super(Common.UIString('Cookies')); this.element.classList.add('storage-view'); - this._deleteButton = new WebInspector.ToolbarButton(WebInspector.UIString('Delete'), 'largeicon-delete'); + this._deleteButton = new UI.ToolbarButton(Common.UIString('Delete'), 'largeicon-delete'); this._deleteButton.setVisible(false); this._deleteButton.addEventListener('click', this._deleteButtonClicked, this); - this._clearButton = new WebInspector.ToolbarButton(WebInspector.UIString('Clear'), 'largeicon-clear'); + this._clearButton = new UI.ToolbarButton(Common.UIString('Clear'), 'largeicon-clear'); this._clearButton.setVisible(false); this._clearButton.addEventListener('click', this._clearButtonClicked, this); - this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this._refreshButton.addEventListener('click', this._refreshButtonClicked, this); this._treeElement = treeElement; this._cookieDomain = cookieDomain; - this._emptyWidget = new WebInspector.EmptyWidget( + this._emptyWidget = new UI.EmptyWidget( cookieDomain ? - WebInspector.UIString('This site has no cookies.') : - WebInspector.UIString( + Common.UIString('This site has no cookies.') : + Common.UIString( 'By default cookies are disabled for local files.\nYou could override this by starting the browser with --enable-file-cookies command line flag.')); this._emptyWidget.show(this.element); @@ -62,7 +62,7 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this._refreshButton, this._clearButton, this._deleteButton]; @@ -83,11 +83,11 @@ } _update() { - WebInspector.Cookies.getCookiesAsync(this._updateWithCookies.bind(this)); + SDK.Cookies.getCookiesAsync(this._updateWithCookies.bind(this)); } /** - * @param {!Array.<!WebInspector.Cookie>} allCookies + * @param {!Array.<!SDK.Cookie>} allCookies */ _updateWithCookies(allCookies) { this._cookies = this._filterCookiesForDomain(allCookies); @@ -104,19 +104,19 @@ if (!this._cookiesTable) this._cookiesTable = - new WebInspector.CookiesTable(false, this._update.bind(this), this._showDeleteButton.bind(this)); + new Components.CookiesTable(false, this._update.bind(this), this._showDeleteButton.bind(this)); this._cookiesTable.setCookies(this._cookies); this._emptyWidget.detach(); this._cookiesTable.show(this.element); this._treeElement.subtitle = String.sprintf( - WebInspector.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize)); + Common.UIString('%d cookies (%s)'), this._cookies.length, Number.bytesToString(this._totalSize)); this._clearButton.setVisible(true); this._deleteButton.setVisible(!!this._cookiesTable.selectedCookie()); } /** - * @param {!Array.<!WebInspector.Cookie>} allCookies + * @param {!Array.<!SDK.Cookie>} allCookies */ _filterCookiesForDomain(allCookies) { var cookies = []; @@ -124,21 +124,21 @@ this._totalSize = 0; /** - * @this {WebInspector.CookieItemsView} + * @this {Resources.CookieItemsView} */ function populateResourcesForDocuments(resource) { var url = resource.documentURL.asParsedURL(); if (url && url.securityOrigin() === this._cookieDomain) resourceURLsForDocumentURL.push(resource.url); } - WebInspector.forAllResources(populateResourcesForDocuments.bind(this)); + Bindings.forAllResources(populateResourcesForDocuments.bind(this)); for (var i = 0; i < allCookies.length; ++i) { var pushed = false; var size = allCookies[i].size(); for (var j = 0; j < resourceURLsForDocumentURL.length; ++j) { var resourceURL = resourceURLsForDocumentURL[j]; - if (WebInspector.Cookies.cookieMatchesResourceURL(allCookies[i], resourceURL)) { + if (SDK.Cookies.cookieMatchesResourceURL(allCookies[i], resourceURL)) { this._totalSize += size; if (!pushed) { pushed = true; @@ -177,8 +177,8 @@ _contextMenu(event) { if (!this._cookies.length) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Refresh'), this._update.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Refresh'), this._update.bind(this)); contextMenu.show(); } }
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js index f0e008db..3e810dd0 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js
@@ -27,34 +27,34 @@ /** * @unrestricted */ -WebInspector.DOMStorageItemsView = class extends WebInspector.SimpleView { +Resources.DOMStorageItemsView = class extends UI.SimpleView { constructor(domStorage) { - super(WebInspector.UIString('DOM Storage')); + super(Common.UIString('DOM Storage')); this.domStorage = domStorage; this.element.classList.add('storage-view', 'table'); - this.deleteButton = new WebInspector.ToolbarButton(WebInspector.UIString('Delete'), 'largeicon-delete'); + this.deleteButton = new UI.ToolbarButton(Common.UIString('Delete'), 'largeicon-delete'); this.deleteButton.setVisible(false); this.deleteButton.addEventListener('click', this._deleteButtonClicked, this); - this.refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this.refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this.refreshButton.addEventListener('click', this._refreshButtonClicked, this); this.domStorage.addEventListener( - WebInspector.DOMStorage.Events.DOMStorageItemsCleared, this._domStorageItemsCleared, this); + Resources.DOMStorage.Events.DOMStorageItemsCleared, this._domStorageItemsCleared, this); this.domStorage.addEventListener( - WebInspector.DOMStorage.Events.DOMStorageItemRemoved, this._domStorageItemRemoved, this); + Resources.DOMStorage.Events.DOMStorageItemRemoved, this._domStorageItemRemoved, this); this.domStorage.addEventListener( - WebInspector.DOMStorage.Events.DOMStorageItemAdded, this._domStorageItemAdded, this); + Resources.DOMStorage.Events.DOMStorageItemAdded, this._domStorageItemAdded, this); this.domStorage.addEventListener( - WebInspector.DOMStorage.Events.DOMStorageItemUpdated, this._domStorageItemUpdated, this); + Resources.DOMStorage.Events.DOMStorageItemUpdated, this._domStorageItemUpdated, this); } /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this.refreshButton, this.deleteButton]; @@ -75,7 +75,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageItemsCleared(event) { if (!this.isShowing() || !this._dataGrid) @@ -88,7 +88,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageItemRemoved(event) { if (!this.isShowing() || !this._dataGrid) @@ -111,7 +111,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageItemAdded(event) { if (!this.isShowing() || !this._dataGrid) @@ -128,12 +128,12 @@ if (children[i].data.key === storageData.key) return; - var childNode = new WebInspector.DataGridNode({key: storageData.key, value: storageData.value}, false); + var childNode = new UI.DataGridNode({key: storageData.key, value: storageData.value}, false); rootNode.insertChild(childNode, children.length - 1); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageItemUpdated(event) { if (!this.isShowing() || !this._dataGrid) @@ -180,9 +180,9 @@ } _dataGridForDOMStorageItems(items) { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'key', title: WebInspector.UIString('Key'), sortable: false, editable: true, weight: 50}, - {id: 'value', title: WebInspector.UIString('Value'), sortable: false, editable: true, weight: 50} + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'key', title: Common.UIString('Key'), sortable: false, editable: true, weight: 50}, + {id: 'value', title: Common.UIString('Value'), sortable: false, editable: true, weight: 50} ]); var nodes = []; @@ -192,14 +192,14 @@ for (var i = 0; i < items.length; i++) { var key = items[i][0]; var value = items[i][1]; - var node = new WebInspector.DataGridNode({key: key, value: value}, false); + var node = new UI.DataGridNode({key: key, value: value}, false); node.selectable = true; nodes.push(node); keys.push(key); } var dataGrid = - new WebInspector.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this)); + new UI.DataGrid(columns, this._editingCallback.bind(this), this._deleteCallback.bind(this)); dataGrid.setName('DOMStorageItemsView'); length = nodes.length; for (var i = 0; i < length; ++i) @@ -233,7 +233,7 @@ } /** - * @param {!WebInspector.DataGridNode} masterNode + * @param {!UI.DataGridNode} masterNode */ _removeDupes(masterNode) { var rootNode = this._dataGrid.rootNode();
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageModel.js b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageModel.js index f4fffde..25d9f81 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageModel.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageModel.js
@@ -30,9 +30,9 @@ /** * @unrestricted */ -WebInspector.DOMStorage = class extends WebInspector.Object { +Resources.DOMStorage = class extends Common.Object { /** - * @param {!WebInspector.DOMStorageModel} model + * @param {!Resources.DOMStorageModel} model * @param {string} securityOrigin * @param {boolean} isLocalStorage */ @@ -54,7 +54,7 @@ /** @return {!Protocol.DOMStorage.StorageId} */ get id() { - return WebInspector.DOMStorage.storageId(this._securityOrigin, this._isLocalStorage); + return Resources.DOMStorage.storageId(this._securityOrigin, this._isLocalStorage); } /** @return {string} */ @@ -92,7 +92,7 @@ /** @enum {symbol} */ -WebInspector.DOMStorage.Events = { +Resources.DOMStorage.Events = { DOMStorageItemsCleared: Symbol('DOMStorageItemsCleared'), DOMStorageItemRemoved: Symbol('DOMStorageItemRemoved'), DOMStorageItemAdded: Symbol('DOMStorageItemAdded'), @@ -102,28 +102,28 @@ /** * @unrestricted */ -WebInspector.DOMStorageModel = class extends WebInspector.SDKModel { +Resources.DOMStorageModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.SecurityOriginManager} securityOriginManager + * @param {!SDK.Target} target + * @param {!SDK.SecurityOriginManager} securityOriginManager */ constructor(target, securityOriginManager) { - super(WebInspector.DOMStorageModel, target); + super(Resources.DOMStorageModel, target); this._securityOriginManager = securityOriginManager; - /** @type {!Object.<string, !WebInspector.DOMStorage>} */ + /** @type {!Object.<string, !Resources.DOMStorage>} */ this._storages = {}; this._agent = target.domstorageAgent(); } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.DOMStorageModel} + * @param {!SDK.Target} target + * @return {!Resources.DOMStorageModel} */ static fromTarget(target) { - var model = /** @type {?WebInspector.DOMStorageModel} */ (target.model(WebInspector.DOMStorageModel)); + var model = /** @type {?Resources.DOMStorageModel} */ (target.model(Resources.DOMStorageModel)); if (!model) { - model = new WebInspector.DOMStorageModel(target, WebInspector.SecurityOriginManager.fromTarget(target)); + model = new Resources.DOMStorageModel(target, SDK.SecurityOriginManager.fromTarget(target)); } return model; } @@ -132,11 +132,11 @@ if (this._enabled) return; - this.target().registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher(this)); + this.target().registerDOMStorageDispatcher(new Resources.DOMStorageDispatcher(this)); this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); + SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); + SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); for (var securityOrigin of this._securityOriginManager.securityOrigins()) this._addOrigin(securityOrigin); @@ -156,7 +156,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginAdded(event) { this._addOrigin(/** @type {string} */ (event.data)); @@ -168,19 +168,19 @@ _addOrigin(securityOrigin) { var localStorageKey = this._storageKey(securityOrigin, true); console.assert(!this._storages[localStorageKey]); - var localStorage = new WebInspector.DOMStorage(this, securityOrigin, true); + var localStorage = new Resources.DOMStorage(this, securityOrigin, true); this._storages[localStorageKey] = localStorage; - this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageAdded, localStorage); + this.dispatchEventToListeners(Resources.DOMStorageModel.Events.DOMStorageAdded, localStorage); var sessionStorageKey = this._storageKey(securityOrigin, false); console.assert(!this._storages[sessionStorageKey]); - var sessionStorage = new WebInspector.DOMStorage(this, securityOrigin, false); + var sessionStorage = new Resources.DOMStorage(this, securityOrigin, false); this._storages[sessionStorageKey] = sessionStorage; - this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageAdded, sessionStorage); + this.dispatchEventToListeners(Resources.DOMStorageModel.Events.DOMStorageAdded, sessionStorage); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginRemoved(event) { this._removeOrigin(/** @type {string} */ (event.data)); @@ -194,13 +194,13 @@ var localStorage = this._storages[localStorageKey]; console.assert(localStorage); delete this._storages[localStorageKey]; - this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageRemoved, localStorage); + this.dispatchEventToListeners(Resources.DOMStorageModel.Events.DOMStorageRemoved, localStorage); var sessionStorageKey = this._storageKey(securityOrigin, false); var sessionStorage = this._storages[sessionStorageKey]; console.assert(sessionStorage); delete this._storages[sessionStorageKey]; - this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageRemoved, sessionStorage); + this.dispatchEventToListeners(Resources.DOMStorageModel.Events.DOMStorageRemoved, sessionStorage); } /** @@ -209,7 +209,7 @@ * @return {string} */ _storageKey(securityOrigin, isLocalStorage) { - return JSON.stringify(WebInspector.DOMStorage.storageId(securityOrigin, isLocalStorage)); + return JSON.stringify(Resources.DOMStorage.storageId(securityOrigin, isLocalStorage)); } /** @@ -221,7 +221,7 @@ return; var eventData = {}; - domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemsCleared, eventData); + domStorage.dispatchEventToListeners(Resources.DOMStorage.Events.DOMStorageItemsCleared, eventData); } /** @@ -234,7 +234,7 @@ return; var eventData = {key: key}; - domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemRemoved, eventData); + domStorage.dispatchEventToListeners(Resources.DOMStorage.Events.DOMStorageItemRemoved, eventData); } /** @@ -248,7 +248,7 @@ return; var eventData = {key: key, value: value}; - domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemAdded, eventData); + domStorage.dispatchEventToListeners(Resources.DOMStorage.Events.DOMStorageItemAdded, eventData); } /** @@ -263,19 +263,19 @@ return; var eventData = {key: key, oldValue: oldValue, value: value}; - domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemUpdated, eventData); + domStorage.dispatchEventToListeners(Resources.DOMStorage.Events.DOMStorageItemUpdated, eventData); } /** * @param {!Protocol.DOMStorage.StorageId} storageId - * @return {!WebInspector.DOMStorage} + * @return {!Resources.DOMStorage} */ storageForId(storageId) { return this._storages[JSON.stringify(storageId)]; } /** - * @return {!Array.<!WebInspector.DOMStorage>} + * @return {!Array.<!Resources.DOMStorage>} */ storages() { var result = []; @@ -286,7 +286,7 @@ }; /** @enum {symbol} */ -WebInspector.DOMStorageModel.Events = { +Resources.DOMStorageModel.Events = { DOMStorageAdded: Symbol('DOMStorageAdded'), DOMStorageRemoved: Symbol('DOMStorageRemoved') }; @@ -295,9 +295,9 @@ * @implements {Protocol.DOMStorageDispatcher} * @unrestricted */ -WebInspector.DOMStorageDispatcher = class { +Resources.DOMStorageDispatcher = class { /** - * @param {!WebInspector.DOMStorageModel} model + * @param {!Resources.DOMStorageModel} model */ constructor(model) { this._model = model; @@ -342,4 +342,4 @@ } }; -WebInspector.DOMStorageModel._symbol = Symbol('DomStorage'); +Resources.DOMStorageModel._symbol = Symbol('DomStorage');
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js index 0bd905a..382e9da8 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.js
@@ -29,9 +29,9 @@ /** * @unrestricted */ -WebInspector.Database = class { +Resources.Database = class { /** - * @param {!WebInspector.DatabaseModel} model + * @param {!Resources.DatabaseModel} model * @param {string} id * @param {string} domain * @param {string} name @@ -113,9 +113,9 @@ if (errorObj.message) message = errorObj.message; else if (errorObj.code === 2) - message = WebInspector.UIString('Database no longer has expected version.'); + message = Common.UIString('Database no longer has expected version.'); else - message = WebInspector.UIString('An unexpected error %s occurred.', errorObj.code); + message = Common.UIString('An unexpected error %s occurred.', errorObj.code); onError(message); return; } @@ -128,27 +128,27 @@ /** * @unrestricted */ -WebInspector.DatabaseModel = class extends WebInspector.SDKModel { +Resources.DatabaseModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.DatabaseModel, target); + super(Resources.DatabaseModel, target); this._databases = []; this._agent = target.databaseAgent(); - this.target().registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher(this)); + this.target().registerDatabaseDispatcher(new Resources.DatabaseDispatcher(this)); } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.DatabaseModel} + * @param {!SDK.Target} target + * @return {!Resources.DatabaseModel} */ static fromTarget(target) { - if (!target[WebInspector.DatabaseModel._symbol]) - target[WebInspector.DatabaseModel._symbol] = new WebInspector.DatabaseModel(target); + if (!target[Resources.DatabaseModel._symbol]) + target[Resources.DatabaseModel._symbol] = new Resources.DatabaseModel(target); - return target[WebInspector.DatabaseModel._symbol]; + return target[Resources.DatabaseModel._symbol]; } enable() { @@ -164,11 +164,11 @@ this._enabled = false; this._databases = []; this._agent.disable(); - this.dispatchEventToListeners(WebInspector.DatabaseModel.Events.DatabasesRemoved); + this.dispatchEventToListeners(Resources.DatabaseModel.Events.DatabasesRemoved); } /** - * @return {!Array.<!WebInspector.Database>} + * @return {!Array.<!Resources.Database>} */ databases() { var result = []; @@ -178,16 +178,16 @@ } /** - * @param {!WebInspector.Database} database + * @param {!Resources.Database} database */ _addDatabase(database) { this._databases.push(database); - this.dispatchEventToListeners(WebInspector.DatabaseModel.Events.DatabaseAdded, database); + this.dispatchEventToListeners(Resources.DatabaseModel.Events.DatabaseAdded, database); } }; /** @enum {symbol} */ -WebInspector.DatabaseModel.Events = { +Resources.DatabaseModel.Events = { DatabaseAdded: Symbol('DatabaseAdded'), DatabasesRemoved: Symbol('DatabasesRemoved') }; @@ -196,9 +196,9 @@ * @implements {Protocol.DatabaseDispatcher} * @unrestricted */ -WebInspector.DatabaseDispatcher = class { +Resources.DatabaseDispatcher = class { /** - * @param {!WebInspector.DatabaseModel} model + * @param {!Resources.DatabaseModel} model */ constructor(model) { this._model = model; @@ -210,8 +210,8 @@ */ addDatabase(payload) { this._model._addDatabase( - new WebInspector.Database(this._model, payload.id, payload.domain, payload.name, payload.version)); + new Resources.Database(this._model, payload.id, payload.domain, payload.name, payload.version)); } }; -WebInspector.DatabaseModel._symbol = Symbol('DatabaseModel'); +Resources.DatabaseModel._symbol = Symbol('DatabaseModel');
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js index 6f97d82..ba0655b 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseQueryView.js
@@ -26,7 +26,7 @@ /** * @unrestricted */ -WebInspector.DatabaseQueryView = class extends WebInspector.VBox { +Resources.DatabaseQueryView = class extends UI.VBox { constructor(database) { super(); @@ -41,7 +41,7 @@ this._promptElement.addEventListener('keydown', this._promptKeyDown.bind(this), true); this.element.appendChild(this._promptElement); - this._prompt = new WebInspector.TextPrompt(); + this._prompt = new UI.TextPrompt(); this._prompt.initialize(this.completions.bind(this), ' '); this._proxyElement = this._prompt.attach(this._promptElement); @@ -97,7 +97,7 @@ this._prompt.clearAutocomplete(); /** - * @this {WebInspector.DatabaseQueryView} + * @this {Resources.DatabaseQueryView} */ function moveBackIfOutside() { delete this._selectionTimeout; @@ -131,7 +131,7 @@ } _queryFinished(query, columnNames, values) { - var dataGrid = WebInspector.SortableDataGrid.create(columnNames, values); + var dataGrid = UI.SortableDataGrid.create(columnNames, values); var trimmedQuery = query.trim(); if (dataGrid) { @@ -141,7 +141,7 @@ } if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i)) - this.dispatchEventToListeners(WebInspector.DatabaseQueryView.Events.SchemaUpdated, this.database); + this.dispatchEventToListeners(Resources.DatabaseQueryView.Events.SchemaUpdated, this.database); } _queryError(query, errorMessage) { @@ -150,7 +150,7 @@ /** * @param {string} query - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ _appendViewQueryResult(query, view) { var resultElement = this._appendQueryResult(query); @@ -188,6 +188,6 @@ }; /** @enum {symbol} */ -WebInspector.DatabaseQueryView.Events = { +Resources.DatabaseQueryView.Events = { SchemaUpdated: Symbol('SchemaUpdated') };
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseTableView.js b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseTableView.js index 40516b5..139483d 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/DatabaseTableView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/DatabaseTableView.js
@@ -26,22 +26,22 @@ /** * @unrestricted */ -WebInspector.DatabaseTableView = class extends WebInspector.SimpleView { +Resources.DatabaseTableView = class extends UI.SimpleView { constructor(database, tableName) { - super(WebInspector.UIString('Database')); + super(Common.UIString('Database')); this.database = database; this.tableName = tableName; this.element.classList.add('storage-view', 'table'); - this._visibleColumnsSetting = WebInspector.settings.createSetting('databaseTableViewVisibleColumns', {}); + this._visibleColumnsSetting = Common.settings.createSetting('databaseTableViewVisibleColumns', {}); - this.refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this.refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this.refreshButton.addEventListener('click', this._refreshButtonClicked, this); - this._visibleColumnsInput = new WebInspector.ToolbarInput(WebInspector.UIString('Visible columns'), 1); + this._visibleColumnsInput = new UI.ToolbarInput(Common.UIString('Visible columns'), 1); this._visibleColumnsInput.addEventListener( - WebInspector.ToolbarInput.Event.TextChanged, this._onVisibleColumnsChanged, this); + UI.ToolbarInput.Event.TextChanged, this._onVisibleColumnsChanged, this); } /** @@ -53,7 +53,7 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this.refreshButton, this._visibleColumnsInput]; @@ -77,11 +77,11 @@ this.detachChildWidgets(); this.element.removeChildren(); - this._dataGrid = WebInspector.SortableDataGrid.create(columnNames, values); + this._dataGrid = UI.SortableDataGrid.create(columnNames, values); this._visibleColumnsInput.setVisible(!!this._dataGrid); if (!this._dataGrid) { this._emptyWidget = - new WebInspector.EmptyWidget(WebInspector.UIString('The “%s”\ntable is empty.', this.tableName)); + new UI.EmptyWidget(Common.UIString('The “%s”\ntable is empty.', this.tableName)); this._emptyWidget.show(this.element); return; } @@ -133,7 +133,7 @@ var errorMsgElement = createElement('div'); errorMsgElement.className = 'storage-table-error'; errorMsgElement.textContent = - WebInspector.UIString('An error occurred trying to\nread the “%s” table.', this.tableName); + Common.UIString('An error occurred trying to\nread the “%s” table.', this.tableName); this.element.appendChild(errorMsgElement); }
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBModel.js b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBModel.js index 7c25870..a5de852f 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBModel.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBModel.js
@@ -31,17 +31,17 @@ /** * @unrestricted */ -WebInspector.IndexedDBModel = class extends WebInspector.SDKModel { +Resources.IndexedDBModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.SecurityOriginManager} securityOriginManager + * @param {!SDK.Target} target + * @param {!SDK.SecurityOriginManager} securityOriginManager */ constructor(target, securityOriginManager) { - super(WebInspector.IndexedDBModel, target); + super(Resources.IndexedDBModel, target); this._securityOriginManager = securityOriginManager; this._agent = target.indexedDBAgent(); - /** @type {!Map.<!WebInspector.IndexedDBModel.DatabaseId, !WebInspector.IndexedDBModel.Database>} */ + /** @type {!Map.<!Resources.IndexedDBModel.DatabaseId, !Resources.IndexedDBModel.Database>} */ this._databases = new Map(); /** @type {!Object.<string, !Array.<string>>} */ this._databaseNamesBySecurityOrigin = {}; @@ -66,21 +66,21 @@ switch (typeof(idbKey)) { case 'number': key.number = idbKey; - type = WebInspector.IndexedDBModel.KeyTypes.NumberType; + type = Resources.IndexedDBModel.KeyTypes.NumberType; break; case 'string': key.string = idbKey; - type = WebInspector.IndexedDBModel.KeyTypes.StringType; + type = Resources.IndexedDBModel.KeyTypes.StringType; break; case 'object': if (idbKey instanceof Date) { key.date = idbKey.getTime(); - type = WebInspector.IndexedDBModel.KeyTypes.DateType; + type = Resources.IndexedDBModel.KeyTypes.DateType; } else if (Array.isArray(idbKey)) { key.array = []; for (var i = 0; i < idbKey.length; ++i) - key.array.push(WebInspector.IndexedDBModel.keyFromIDBKey(idbKey[i])); - type = WebInspector.IndexedDBModel.KeyTypes.ArrayType; + key.array.push(Resources.IndexedDBModel.keyFromIDBKey(idbKey[i])); + type = Resources.IndexedDBModel.KeyTypes.ArrayType; } break; default: @@ -100,8 +100,8 @@ return null; var keyRange = {}; - keyRange.lower = WebInspector.IndexedDBModel.keyFromIDBKey(idbKeyRange.lower); - keyRange.upper = WebInspector.IndexedDBModel.keyFromIDBKey(idbKeyRange.upper); + keyRange.lower = Resources.IndexedDBModel.keyFromIDBKey(idbKeyRange.lower); + keyRange.upper = Resources.IndexedDBModel.keyFromIDBKey(idbKeyRange.upper); keyRange.lowerOpen = !!idbKeyRange.lowerOpen; keyRange.upperOpen = !!idbKeyRange.upperOpen; return keyRange; @@ -114,13 +114,13 @@ static idbKeyPathFromKeyPath(keyPath) { var idbKeyPath; switch (keyPath.type) { - case WebInspector.IndexedDBModel.KeyPathTypes.NullType: + case Resources.IndexedDBModel.KeyPathTypes.NullType: idbKeyPath = null; break; - case WebInspector.IndexedDBModel.KeyPathTypes.StringType: + case Resources.IndexedDBModel.KeyPathTypes.StringType: idbKeyPath = keyPath.string; break; - case WebInspector.IndexedDBModel.KeyPathTypes.ArrayType: + case Resources.IndexedDBModel.KeyPathTypes.ArrayType: idbKeyPath = keyPath.array; break; } @@ -140,13 +140,13 @@ } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.IndexedDBModel} + * @param {!SDK.Target} target + * @return {!Resources.IndexedDBModel} */ static fromTarget(target) { - var model = /** @type {?WebInspector.IndexedDBModel} */ (target.model(WebInspector.IndexedDBModel)); + var model = /** @type {?Resources.IndexedDBModel} */ (target.model(Resources.IndexedDBModel)); if (!model) - model = new WebInspector.IndexedDBModel(target, WebInspector.SecurityOriginManager.fromTarget(target)); + model = new Resources.IndexedDBModel(target, SDK.SecurityOriginManager.fromTarget(target)); return model; } @@ -156,9 +156,9 @@ this._agent.enable(); this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); + SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); + SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); for (var securityOrigin of this._securityOriginManager.securityOrigins()) this._addOrigin(securityOrigin); @@ -183,14 +183,14 @@ } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId */ refreshDatabase(databaseId) { this._loadDatabase(databaseId); } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @param {string} objectStoreName * @param {function()} callback */ @@ -199,7 +199,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginAdded(event) { var securityOrigin = /** @type {string} */ (event.data); @@ -207,7 +207,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginRemoved(event) { var securityOrigin = /** @type {string} */ (event.data); @@ -254,14 +254,14 @@ } /** - * @return {!Array.<!WebInspector.IndexedDBModel.DatabaseId>} + * @return {!Array.<!Resources.IndexedDBModel.DatabaseId>} */ databases() { var result = []; for (var securityOrigin in this._databaseNamesBySecurityOrigin) { var databaseNames = this._databaseNamesBySecurityOrigin[securityOrigin]; for (var i = 0; i < databaseNames.length; ++i) { - result.push(new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseNames[i])); + result.push(new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseNames[i])); } } return result; @@ -272,8 +272,8 @@ * @param {string} databaseName */ _databaseAdded(securityOrigin, databaseName) { - var databaseId = new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseName); - this.dispatchEventToListeners(WebInspector.IndexedDBModel.Events.DatabaseAdded, databaseId); + var databaseId = new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseName); + this.dispatchEventToListeners(Resources.IndexedDBModel.Events.DatabaseAdded, databaseId); } /** @@ -281,8 +281,8 @@ * @param {string} databaseName */ _databaseRemoved(securityOrigin, databaseName) { - var databaseId = new WebInspector.IndexedDBModel.DatabaseId(securityOrigin, databaseName); - this.dispatchEventToListeners(WebInspector.IndexedDBModel.Events.DatabaseRemoved, databaseId); + var databaseId = new Resources.IndexedDBModel.DatabaseId(securityOrigin, databaseName); + this.dispatchEventToListeners(Resources.IndexedDBModel.Events.DatabaseRemoved, databaseId); } /** @@ -292,7 +292,7 @@ /** * @param {?Protocol.Error} error * @param {!Array.<string>} databaseNames - * @this {WebInspector.IndexedDBModel} + * @this {Resources.IndexedDBModel} */ function callback(error, databaseNames) { if (error) { @@ -309,13 +309,13 @@ } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId */ _loadDatabase(databaseId) { /** * @param {?Protocol.Error} error * @param {!Protocol.IndexedDB.DatabaseWithObjectStores} databaseWithObjectStores - * @this {WebInspector.IndexedDBModel} + * @this {Resources.IndexedDBModel} */ function callback(error, databaseWithObjectStores) { if (error) { @@ -325,49 +325,49 @@ if (!this._databaseNamesBySecurityOrigin[databaseId.securityOrigin]) return; - var databaseModel = new WebInspector.IndexedDBModel.Database(databaseId, databaseWithObjectStores.version); + var databaseModel = new Resources.IndexedDBModel.Database(databaseId, databaseWithObjectStores.version); this._databases.set(databaseId, databaseModel); for (var i = 0; i < databaseWithObjectStores.objectStores.length; ++i) { var objectStore = databaseWithObjectStores.objectStores[i]; - var objectStoreIDBKeyPath = WebInspector.IndexedDBModel.idbKeyPathFromKeyPath(objectStore.keyPath); - var objectStoreModel = new WebInspector.IndexedDBModel.ObjectStore( + var objectStoreIDBKeyPath = Resources.IndexedDBModel.idbKeyPathFromKeyPath(objectStore.keyPath); + var objectStoreModel = new Resources.IndexedDBModel.ObjectStore( objectStore.name, objectStoreIDBKeyPath, objectStore.autoIncrement); for (var j = 0; j < objectStore.indexes.length; ++j) { var index = objectStore.indexes[j]; - var indexIDBKeyPath = WebInspector.IndexedDBModel.idbKeyPathFromKeyPath(index.keyPath); + var indexIDBKeyPath = Resources.IndexedDBModel.idbKeyPathFromKeyPath(index.keyPath); var indexModel = - new WebInspector.IndexedDBModel.Index(index.name, indexIDBKeyPath, index.unique, index.multiEntry); + new Resources.IndexedDBModel.Index(index.name, indexIDBKeyPath, index.unique, index.multiEntry); objectStoreModel.indexes[indexModel.name] = indexModel; } databaseModel.objectStores[objectStoreModel.name] = objectStoreModel; } - this.dispatchEventToListeners(WebInspector.IndexedDBModel.Events.DatabaseLoaded, databaseModel); + this.dispatchEventToListeners(Resources.IndexedDBModel.Events.DatabaseLoaded, databaseModel); } this._agent.requestDatabase(databaseId.securityOrigin, databaseId.name, callback.bind(this)); } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @param {string} objectStoreName * @param {?IDBKeyRange} idbKeyRange * @param {number} skipCount * @param {number} pageSize - * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback + * @param {function(!Array.<!Resources.IndexedDBModel.Entry>, boolean)} callback */ loadObjectStoreData(databaseId, objectStoreName, idbKeyRange, skipCount, pageSize, callback) { this._requestData(databaseId, databaseId.name, objectStoreName, '', idbKeyRange, skipCount, pageSize, callback); } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @param {string} objectStoreName * @param {string} indexName * @param {?IDBKeyRange} idbKeyRange * @param {number} skipCount * @param {number} pageSize - * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback + * @param {function(!Array.<!Resources.IndexedDBModel.Entry>, boolean)} callback */ loadIndexData(databaseId, objectStoreName, indexName, idbKeyRange, skipCount, pageSize, callback) { this._requestData( @@ -375,21 +375,21 @@ } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @param {string} databaseName * @param {string} objectStoreName * @param {string} indexName * @param {?IDBKeyRange} idbKeyRange * @param {number} skipCount * @param {number} pageSize - * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback + * @param {function(!Array.<!Resources.IndexedDBModel.Entry>, boolean)} callback */ _requestData(databaseId, databaseName, objectStoreName, indexName, idbKeyRange, skipCount, pageSize, callback) { /** * @param {?Protocol.Error} error * @param {!Array.<!Protocol.IndexedDB.DataEntry>} dataEntries * @param {boolean} hasMore - * @this {WebInspector.IndexedDBModel} + * @this {Resources.IndexedDBModel} */ function innerCallback(error, dataEntries, hasMore) { if (error) { @@ -404,26 +404,26 @@ var key = this.target().runtimeModel.createRemoteObject(dataEntries[i].key); var primaryKey = this.target().runtimeModel.createRemoteObject(dataEntries[i].primaryKey); var value = this.target().runtimeModel.createRemoteObject(dataEntries[i].value); - entries.push(new WebInspector.IndexedDBModel.Entry(key, primaryKey, value)); + entries.push(new Resources.IndexedDBModel.Entry(key, primaryKey, value)); } callback(entries, hasMore); } - var keyRange = WebInspector.IndexedDBModel.keyRangeFromIDBKeyRange(idbKeyRange); + var keyRange = Resources.IndexedDBModel.keyRangeFromIDBKeyRange(idbKeyRange); this._agent.requestData( databaseId.securityOrigin, databaseName, objectStoreName, indexName, skipCount, pageSize, keyRange ? keyRange : undefined, innerCallback.bind(this)); } }; -WebInspector.IndexedDBModel.KeyTypes = { +Resources.IndexedDBModel.KeyTypes = { NumberType: 'number', StringType: 'string', DateType: 'date', ArrayType: 'array' }; -WebInspector.IndexedDBModel.KeyPathTypes = { +Resources.IndexedDBModel.KeyPathTypes = { NullType: 'null', StringType: 'string', ArrayType: 'array' @@ -431,7 +431,7 @@ /** @enum {symbol} */ -WebInspector.IndexedDBModel.Events = { +Resources.IndexedDBModel.Events = { DatabaseAdded: Symbol('DatabaseAdded'), DatabaseRemoved: Symbol('DatabaseRemoved'), DatabaseLoaded: Symbol('DatabaseLoaded') @@ -440,11 +440,11 @@ /** * @unrestricted */ -WebInspector.IndexedDBModel.Entry = class { +Resources.IndexedDBModel.Entry = class { /** - * @param {!WebInspector.RemoteObject} key - * @param {!WebInspector.RemoteObject} primaryKey - * @param {!WebInspector.RemoteObject} value + * @param {!SDK.RemoteObject} key + * @param {!SDK.RemoteObject} primaryKey + * @param {!SDK.RemoteObject} value */ constructor(key, primaryKey, value) { this.key = key; @@ -456,7 +456,7 @@ /** * @unrestricted */ -WebInspector.IndexedDBModel.DatabaseId = class { +Resources.IndexedDBModel.DatabaseId = class { /** * @param {string} securityOrigin * @param {string} name @@ -467,7 +467,7 @@ } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @return {boolean} */ equals(databaseId) { @@ -478,9 +478,9 @@ /** * @unrestricted */ -WebInspector.IndexedDBModel.Database = class { +Resources.IndexedDBModel.Database = class { /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId * @param {number} version */ constructor(databaseId, version) { @@ -493,7 +493,7 @@ /** * @unrestricted */ -WebInspector.IndexedDBModel.ObjectStore = class { +Resources.IndexedDBModel.ObjectStore = class { /** * @param {string} name * @param {*} keyPath @@ -511,14 +511,14 @@ */ get keyPathString() { return /** @type {string}*/ ( - WebInspector.IndexedDBModel.keyPathStringFromIDBKeyPath(/** @type {string}*/ (this.keyPath))); + Resources.IndexedDBModel.keyPathStringFromIDBKeyPath(/** @type {string}*/ (this.keyPath))); } }; /** * @unrestricted */ -WebInspector.IndexedDBModel.Index = class { +Resources.IndexedDBModel.Index = class { /** * @param {string} name * @param {*} keyPath @@ -537,6 +537,6 @@ */ get keyPathString() { return /** @type {string}*/ ( - WebInspector.IndexedDBModel.keyPathStringFromIDBKeyPath(/** @type {string}*/ (this.keyPath))); + Resources.IndexedDBModel.keyPathStringFromIDBKeyPath(/** @type {string}*/ (this.keyPath))); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js index aa7eb1f7..e0d55ac9 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/IndexedDBViews.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.IDBDatabaseView = class extends WebInspector.VBox { +Resources.IDBDatabaseView = class extends UI.VBox { /** - * @param {!WebInspector.IndexedDBModel.Database} database + * @param {!Resources.IndexedDBModel.Database} database */ constructor(database) { super(); @@ -62,14 +62,14 @@ _refreshDatabase() { this._formatHeader( - this._securityOriginElement, WebInspector.UIString('Security origin'), + this._securityOriginElement, Common.UIString('Security origin'), this._database.databaseId.securityOrigin); - this._formatHeader(this._nameElement, WebInspector.UIString('Name'), this._database.databaseId.name); - this._formatHeader(this._versionElement, WebInspector.UIString('Version'), this._database.version); + this._formatHeader(this._nameElement, Common.UIString('Name'), this._database.databaseId.name); + this._formatHeader(this._versionElement, Common.UIString('Version'), this._database.version); } /** - * @param {!WebInspector.IndexedDBModel.Database} database + * @param {!Resources.IndexedDBModel.Database} database */ update(database) { this._database = database; @@ -80,15 +80,15 @@ /** * @unrestricted */ -WebInspector.IDBDataView = class extends WebInspector.SimpleView { +Resources.IDBDataView = class extends UI.SimpleView { /** - * @param {!WebInspector.IndexedDBModel} model - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId - * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore - * @param {?WebInspector.IndexedDBModel.Index} index + * @param {!Resources.IndexedDBModel} model + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.ObjectStore} objectStore + * @param {?Resources.IndexedDBModel.Index} index */ constructor(model, databaseId, objectStore, index) { - super(WebInspector.UIString('IDB')); + super(Common.UIString('IDB')); this.registerRequiredCSS('resources/indexedDBViews.css'); this._model = model; @@ -99,11 +99,11 @@ this._createEditorToolbar(); - this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this._refreshButton.addEventListener('click', this._refreshButtonClicked, this); this._clearButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Clear object store'), 'largeicon-clear'); + new UI.ToolbarButton(Common.UIString('Clear object store'), 'largeicon-clear'); this._clearButton.addEventListener('click', this._clearButtonClicked, this); this._pageSize = 50; @@ -114,28 +114,28 @@ } /** - * @return {!WebInspector.DataGrid} + * @return {!UI.DataGrid} */ _createDataGrid() { var keyPath = this._isIndex ? this._index.keyPath : this._objectStore.keyPath; - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([]); - columns.push({id: 'number', title: WebInspector.UIString('#'), sortable: false, width: '50px'}); + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([]); + columns.push({id: 'number', title: Common.UIString('#'), sortable: false, width: '50px'}); columns.push({ id: 'key', - titleDOMFragment: this._keyColumnHeaderFragment(WebInspector.UIString('Key'), keyPath), + titleDOMFragment: this._keyColumnHeaderFragment(Common.UIString('Key'), keyPath), sortable: false }); if (this._isIndex) columns.push({ id: 'primaryKey', titleDOMFragment: - this._keyColumnHeaderFragment(WebInspector.UIString('Primary key'), this._objectStore.keyPath), + this._keyColumnHeaderFragment(Common.UIString('Primary key'), this._objectStore.keyPath), sortable: false }); - columns.push({id: 'value', title: WebInspector.UIString('Value'), sortable: false}); + columns.push({id: 'value', title: Common.UIString('Value'), sortable: false}); - var dataGrid = new WebInspector.DataGrid(columns); + var dataGrid = new UI.DataGrid(columns); return dataGrid; } @@ -150,7 +150,7 @@ if (keyPath === null) return keyColumnHeaderFragment; - keyColumnHeaderFragment.createTextChild(' (' + WebInspector.UIString('Key path: ')); + keyColumnHeaderFragment.createTextChild(' (' + Common.UIString('Key path: ')); if (Array.isArray(keyPath)) { keyColumnHeaderFragment.createTextChild('['); for (var i = 0; i < keyPath.length; ++i) { @@ -181,21 +181,21 @@ } _createEditorToolbar() { - var editorToolbar = new WebInspector.Toolbar('data-view-toolbar', this.element); + var editorToolbar = new UI.Toolbar('data-view-toolbar', this.element); this._pageBackButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Show previous page'), 'largeicon-play-back'); + new UI.ToolbarButton(Common.UIString('Show previous page'), 'largeicon-play-back'); this._pageBackButton.addEventListener('click', this._pageBackButtonClicked, this); editorToolbar.appendToolbarItem(this._pageBackButton); this._pageForwardButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Show next page'), 'largeicon-play'); + new UI.ToolbarButton(Common.UIString('Show next page'), 'largeicon-play'); this._pageForwardButton.setEnabled(false); this._pageForwardButton.addEventListener('click', this._pageForwardButtonClicked, this); editorToolbar.appendToolbarItem(this._pageForwardButton); this._keyInputElement = editorToolbar.element.createChild('input', 'key-input'); - this._keyInputElement.placeholder = WebInspector.UIString('Start from key'); + this._keyInputElement.placeholder = Common.UIString('Start from key'); this._keyInputElement.addEventListener('paste', this._keyInputChanged.bind(this), false); this._keyInputElement.addEventListener('cut', this._keyInputChanged.bind(this), false); this._keyInputElement.addEventListener('keypress', this._keyInputChanged.bind(this), false); @@ -217,8 +217,8 @@ } /** - * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore - * @param {?WebInspector.IndexedDBModel.Index} index + * @param {!Resources.IndexedDBModel.ObjectStore} objectStore + * @param {?Resources.IndexedDBModel.Index} index */ update(objectStore, index) { this._objectStore = objectStore; @@ -268,9 +268,9 @@ this._lastSkipCount = skipCount; /** - * @param {!Array.<!WebInspector.IndexedDBModel.Entry>} entries + * @param {!Array.<!Resources.IndexedDBModel.Entry>} entries * @param {boolean} hasMore - * @this {WebInspector.IDBDataView} + * @this {Resources.IDBDataView} */ function callback(entries, hasMore) { this._refreshButton.setEnabled(true); @@ -283,7 +283,7 @@ data['primaryKey'] = entries[i].primaryKey; data['value'] = entries[i].value; - var node = new WebInspector.IDBDataGridNode(data); + var node = new Resources.IDBDataGridNode(data); this._dataGrid.rootNode().appendChild(node); } @@ -307,7 +307,7 @@ _clearButtonClicked(event) { /** - * @this {WebInspector.IDBDataView} + * @this {Resources.IDBDataView} */ function cleared() { this._clearButton.setEnabled(true); @@ -319,7 +319,7 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this._refreshButton, this._clearButton]; @@ -334,7 +334,7 @@ /** * @unrestricted */ -WebInspector.IDBDataGridNode = class extends WebInspector.DataGridNode { +Resources.IDBDataGridNode = class extends UI.DataGridNode { /** * @param {!Object.<string, *>} data */ @@ -349,14 +349,14 @@ */ createCell(columnIdentifier) { var cell = super.createCell(columnIdentifier); - var value = /** @type {!WebInspector.RemoteObject} */ (this.data[columnIdentifier]); + var value = /** @type {!SDK.RemoteObject} */ (this.data[columnIdentifier]); switch (columnIdentifier) { case 'value': case 'key': case 'primaryKey': cell.removeChildren(); - var objectElement = WebInspector.ObjectPropertiesSection.defaultObjectPresentation(value, undefined, true); + var objectElement = Components.ObjectPropertiesSection.defaultObjectPresentation(value, undefined, true); cell.appendChild(objectElement); break; default:
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js index 46ff648..e8088173 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
@@ -28,15 +28,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ResourcesPanel = class extends WebInspector.PanelWithSidebar { +Resources.ResourcesPanel = class extends UI.PanelWithSidebar { constructor() { super('resources'); this.registerRequiredCSS('resources/resourcesPanel.css'); - this._resourcesLastSelectedItemSetting = WebInspector.settings.createSetting('resourcesLastSelectedItem', {}); + this._resourcesLastSelectedItemSetting = Common.settings.createSetting('resourcesLastSelectedItem', {}); this._sidebarTree = new TreeOutlineInShadow(); this._sidebarTree.element.classList.add('resources-sidebar'); @@ -44,56 +44,56 @@ this._sidebarTree.element.classList.add('filter-all'); this.panelSidebarElement().appendChild(this._sidebarTree.element); - this._applicationTreeElement = this._addSidebarSection(WebInspector.UIString('Application')); - this._manifestTreeElement = new WebInspector.AppManifestTreeElement(this); + this._applicationTreeElement = this._addSidebarSection(Common.UIString('Application')); + this._manifestTreeElement = new Resources.AppManifestTreeElement(this); this._applicationTreeElement.appendChild(this._manifestTreeElement); - this.serviceWorkersTreeElement = new WebInspector.ServiceWorkersTreeElement(this); + this.serviceWorkersTreeElement = new Resources.ServiceWorkersTreeElement(this); this._applicationTreeElement.appendChild(this.serviceWorkersTreeElement); - var clearStorageTreeElement = new WebInspector.ClearStorageTreeElement(this); + var clearStorageTreeElement = new Resources.ClearStorageTreeElement(this); this._applicationTreeElement.appendChild(clearStorageTreeElement); - var storageTreeElement = this._addSidebarSection(WebInspector.UIString('Storage')); - this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement( - this, WebInspector.UIString('Local Storage'), 'LocalStorage', ['table-tree-item', 'resource-tree-item']); + var storageTreeElement = this._addSidebarSection(Common.UIString('Storage')); + this.localStorageListTreeElement = new Resources.StorageCategoryTreeElement( + this, Common.UIString('Local Storage'), 'LocalStorage', ['table-tree-item', 'resource-tree-item']); storageTreeElement.appendChild(this.localStorageListTreeElement); - this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement( - this, WebInspector.UIString('Session Storage'), 'SessionStorage', ['table-tree-item', 'resource-tree-item']); + this.sessionStorageListTreeElement = new Resources.StorageCategoryTreeElement( + this, Common.UIString('Session Storage'), 'SessionStorage', ['table-tree-item', 'resource-tree-item']); storageTreeElement.appendChild(this.sessionStorageListTreeElement); - this.indexedDBListTreeElement = new WebInspector.IndexedDBTreeElement(this); + this.indexedDBListTreeElement = new Resources.IndexedDBTreeElement(this); storageTreeElement.appendChild(this.indexedDBListTreeElement); - this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement( - this, WebInspector.UIString('Web SQL'), 'Databases', ['database-tree-item', 'resource-tree-item']); + this.databasesListTreeElement = new Resources.StorageCategoryTreeElement( + this, Common.UIString('Web SQL'), 'Databases', ['database-tree-item', 'resource-tree-item']); storageTreeElement.appendChild(this.databasesListTreeElement); - this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement( - this, WebInspector.UIString('Cookies'), 'Cookies', ['cookie-tree-item', 'resource-tree-item']); + this.cookieListTreeElement = new Resources.StorageCategoryTreeElement( + this, Common.UIString('Cookies'), 'Cookies', ['cookie-tree-item', 'resource-tree-item']); storageTreeElement.appendChild(this.cookieListTreeElement); - var cacheTreeElement = this._addSidebarSection(WebInspector.UIString('Cache')); - this.cacheStorageListTreeElement = new WebInspector.ServiceWorkerCacheTreeElement(this); + var cacheTreeElement = this._addSidebarSection(Common.UIString('Cache')); + this.cacheStorageListTreeElement = new Resources.ServiceWorkerCacheTreeElement(this); cacheTreeElement.appendChild(this.cacheStorageListTreeElement); - this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement( - this, WebInspector.UIString('Application Cache'), 'ApplicationCache', + this.applicationCacheListTreeElement = new Resources.StorageCategoryTreeElement( + this, Common.UIString('Application Cache'), 'ApplicationCache', ['appcache-tree-item', 'table-tree-item', 'resource-tree-item']); cacheTreeElement.appendChild(this.applicationCacheListTreeElement); - this.resourcesListTreeElement = this._addSidebarSection(WebInspector.UIString('Frames')); + this.resourcesListTreeElement = this._addSidebarSection(Common.UIString('Frames')); - var mainContainer = new WebInspector.VBox(); + var mainContainer = new UI.VBox(); this.storageViews = mainContainer.element.createChild('div', 'vbox flex-auto'); - this._storageViewToolbar = new WebInspector.Toolbar('resources-toolbar', mainContainer.element); + this._storageViewToolbar = new UI.Toolbar('resources-toolbar', mainContainer.element); this.splitWidget().setMainWidget(mainContainer); - /** @type {!Map.<!WebInspector.Database, !Object.<string, !WebInspector.DatabaseTableView>>} */ + /** @type {!Map.<!Resources.Database, !Object.<string, !Resources.DatabaseTableView>>} */ this._databaseTableViews = new Map(); - /** @type {!Map.<!WebInspector.Database, !WebInspector.DatabaseQueryView>} */ + /** @type {!Map.<!Resources.Database, !Resources.DatabaseQueryView>} */ this._databaseQueryViews = new Map(); - /** @type {!Map.<!WebInspector.Database, !WebInspector.DatabaseTreeElement>} */ + /** @type {!Map.<!Resources.Database, !Resources.DatabaseTreeElement>} */ this._databaseTreeElements = new Map(); - /** @type {!Map.<!WebInspector.DOMStorage, !WebInspector.DOMStorageItemsView>} */ + /** @type {!Map.<!Resources.DOMStorage, !Resources.DOMStorageItemsView>} */ this._domStorageViews = new Map(); - /** @type {!Map.<!WebInspector.DOMStorage, !WebInspector.DOMStorageTreeElement>} */ + /** @type {!Map.<!Resources.DOMStorage, !Resources.DOMStorageTreeElement>} */ this._domStorageTreeElements = new Map(); - /** @type {!Object.<string, !WebInspector.CookieItemsView>} */ + /** @type {!Object.<string, !Resources.CookieItemsView>} */ this._cookieViews = {}; /** @type {!Object.<string, boolean>} */ this._domains = {}; @@ -101,14 +101,14 @@ this.panelSidebarElement().addEventListener('mousemove', this._onmousemove.bind(this), false); this.panelSidebarElement().addEventListener('mouseleave', this._onmouseleave.bind(this), false); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** - * @return {!WebInspector.ResourcesPanel} + * @return {!Resources.ResourcesPanel} */ static _instance() { - return /** @type {!WebInspector.ResourcesPanel} */ (self.runtime.sharedInstance(WebInspector.ResourcesPanel)); + return /** @type {!Resources.ResourcesPanel} */ (self.runtime.sharedInstance(Resources.ResourcesPanel)); } /** @@ -126,18 +126,18 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._target) return; this._target = target; - this._databaseModel = WebInspector.DatabaseModel.fromTarget(target); + this._databaseModel = Resources.DatabaseModel.fromTarget(target); - this._databaseModel.addEventListener(WebInspector.DatabaseModel.Events.DatabaseAdded, this._databaseAdded, this); - this._databaseModel.addEventListener(WebInspector.DatabaseModel.Events.DatabasesRemoved, this._resetWebSQL, this); + this._databaseModel.addEventListener(Resources.DatabaseModel.Events.DatabaseAdded, this._databaseAdded, this); + this._databaseModel.addEventListener(Resources.DatabaseModel.Events.DatabasesRemoved, this._resetWebSQL, this); - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (!resourceTreeModel) return; @@ -145,30 +145,30 @@ this._initialize(); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded, this._initialize, this); + SDK.ResourceTreeModel.Events.CachedResourcesLoaded, this._initialize, this); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.WillLoadCachedResources, this._resetWithFrames, this); + SDK.ResourceTreeModel.Events.WillLoadCachedResources, this._resetWithFrames, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (target !== this._target) return; delete this._target; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) { resourceTreeModel.removeEventListener( - WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded, this._initialize, this); + SDK.ResourceTreeModel.Events.CachedResourcesLoaded, this._initialize, this); resourceTreeModel.removeEventListener( - WebInspector.ResourceTreeModel.Events.WillLoadCachedResources, this._resetWithFrames, this); + SDK.ResourceTreeModel.Events.WillLoadCachedResources, this._resetWithFrames, this); } - this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Events.DatabaseAdded, this._databaseAdded, this); + this._databaseModel.removeEventListener(Resources.DatabaseModel.Events.DatabaseAdded, this._databaseAdded, this); this._databaseModel.removeEventListener( - WebInspector.DatabaseModel.Events.DatabasesRemoved, this._resetWebSQL, this); + Resources.DatabaseModel.Events.DatabasesRemoved, this._resetWebSQL, this); this._resetWithFrames(); } @@ -183,19 +183,19 @@ _initialize() { this._databaseModel.enable(); - var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(this._target); + var indexedDBModel = Resources.IndexedDBModel.fromTarget(this._target); if (indexedDBModel) indexedDBModel.enable(); - var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(this._target); + var cacheStorageModel = SDK.ServiceWorkerCacheModel.fromTarget(this._target); if (cacheStorageModel) cacheStorageModel.enable(); - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this._target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(this._target); if (resourceTreeModel) { this._populateResourceTree(resourceTreeModel); this._populateApplicationCacheTree(resourceTreeModel); } - var domStorageModel = WebInspector.DOMStorageModel.fromTarget(this._target); + var domStorageModel = Resources.DOMStorageModel.fromTarget(this._target); if (domStorageModel) this._populateDOMStorageTree(domStorageModel); this.indexedDBListTreeElement._initialize(); @@ -225,8 +225,8 @@ } _resetWebSQL() { - if (this.visibleView instanceof WebInspector.DatabaseQueryView || - this.visibleView instanceof WebInspector.DatabaseTableView) { + if (this.visibleView instanceof Resources.DatabaseQueryView || + this.visibleView instanceof Resources.DatabaseTableView) { this.visibleView.detach(); delete this.visibleView; } @@ -234,7 +234,7 @@ var queryViews = this._databaseQueryViews.valuesArray(); for (var i = 0; i < queryViews.length; ++i) queryViews[i].removeEventListener( - WebInspector.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); + Resources.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); this._databaseTableViews.clear(); this._databaseQueryViews.clear(); this._databaseTreeElements.clear(); @@ -243,7 +243,7 @@ } _resetDOMStorage() { - if (this.visibleView instanceof WebInspector.DOMStorageItemsView) { + if (this.visibleView instanceof Resources.DOMStorageItemsView) { this.visibleView.detach(); delete this.visibleView; } @@ -255,7 +255,7 @@ } _resetCookies() { - if (this.visibleView instanceof WebInspector.CookieItemsView) { + if (this.visibleView instanceof Resources.CookieItemsView) { this.visibleView.detach(); delete this.visibleView; } @@ -264,7 +264,7 @@ } _resetCacheStorage() { - if (this.visibleView instanceof WebInspector.ServiceWorkerCacheView) { + if (this.visibleView instanceof Resources.ServiceWorkerCacheView) { this.visibleView.detach(); delete this.visibleView; } @@ -286,8 +286,8 @@ this._resetCacheStorage(); // No need to this._resetAppCache. - if ((this.visibleView instanceof WebInspector.ResourceSourceFrame) || - (this.visibleView instanceof WebInspector.ImageView) || (this.visibleView instanceof WebInspector.FontView)) { + if ((this.visibleView instanceof SourceFrame.ResourceSourceFrame) || + (this.visibleView instanceof SourceFrame.ImageView) || (this.visibleView instanceof SourceFrame.FontView)) { this.visibleView.detach(); delete this.visibleView; } @@ -299,19 +299,19 @@ } /** - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.ResourceTreeModel} resourceTreeModel */ _populateResourceTree(resourceTreeModel) { this._treeElementForFrameId = {}; - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.FrameAdded, this._frameAdded, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameAdded, this._frameAdded, this); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.ResourceAdded, this._resourceAdded, this); + SDK.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.ResourceAdded, this._resourceAdded, this); /** - * @param {!WebInspector.ResourceTreeFrame} frame - * @this {WebInspector.ResourcesPanel} + * @param {!SDK.ResourceTreeFrame} frame + * @this {Resources.ResourcesPanel} */ function populateFrame(frame) { this._frameAdded({data: frame}); @@ -335,7 +335,7 @@ return; } - var frameTreeElement = new WebInspector.FrameTreeElement(this, frame); + var frameTreeElement = new Resources.FrameTreeElement(this, frame); this._treeElementForFrameId[frame.id] = frameTreeElement; parentTreeElement.appendChild(frameTreeElement); } @@ -385,18 +385,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _databaseAdded(event) { - var database = /** @type {!WebInspector.Database} */ (event.data); + var database = /** @type {!Resources.Database} */ (event.data); this._addDatabase(database); } /** - * @param {!WebInspector.Database} database + * @param {!Resources.Database} database */ _addDatabase(database) { - var databaseTreeElement = new WebInspector.DatabaseTreeElement(this, database); + var databaseTreeElement = new Resources.DatabaseTreeElement(this, database); this._databaseTreeElements.set(database, databaseTreeElement); this.databasesListTreeElement.appendChild(databaseTreeElement); } @@ -409,26 +409,26 @@ var domain = parsedURL.securityOrigin(); if (!this._domains[domain]) { this._domains[domain] = true; - var cookieDomainTreeElement = new WebInspector.CookieTreeElement(this, domain); + var cookieDomainTreeElement = new Resources.CookieTreeElement(this, domain); this.cookieListTreeElement.appendChild(cookieDomainTreeElement); } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageAdded(event) { - var domStorage = /** @type {!WebInspector.DOMStorage} */ (event.data); + var domStorage = /** @type {!Resources.DOMStorage} */ (event.data); this._addDOMStorage(domStorage); } /** - * @param {!WebInspector.DOMStorage} domStorage + * @param {!Resources.DOMStorage} domStorage */ _addDOMStorage(domStorage) { console.assert(!this._domStorageTreeElements.get(domStorage)); - var domStorageTreeElement = new WebInspector.DOMStorageTreeElement(this, domStorage); + var domStorageTreeElement = new Resources.DOMStorageTreeElement(this, domStorage); this._domStorageTreeElements.set(domStorage, domStorageTreeElement); if (domStorage.isLocalStorage) this.localStorageListTreeElement.appendChild(domStorageTreeElement); @@ -437,15 +437,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _domStorageRemoved(event) { - var domStorage = /** @type {!WebInspector.DOMStorage} */ (event.data); + var domStorage = /** @type {!Resources.DOMStorage} */ (event.data); this._removeDOMStorage(domStorage); } /** - * @param {!WebInspector.DOMStorage} domStorage + * @param {!Resources.DOMStorage} domStorage */ _removeDOMStorage(domStorage) { var treeElement = this._domStorageTreeElements.get(domStorage); @@ -461,7 +461,7 @@ } /** - * @param {!WebInspector.Database} database + * @param {!Resources.Database} database */ selectDatabase(database) { if (database) { @@ -471,7 +471,7 @@ } /** - * @param {!WebInspector.DOMStorage} domStorage + * @param {!Resources.DOMStorage} domStorage */ selectDOMStorage(domStorage) { if (domStorage) { @@ -481,7 +481,7 @@ } /** - * @param {!WebInspector.Resource} resource + * @param {!SDK.Resource} resource * @param {number=} line * @param {number=} column * @return {boolean} @@ -509,8 +509,8 @@ } /** - * @param {!WebInspector.Resource} resource - * @return {?WebInspector.Widget} + * @param {!SDK.Resource} resource + * @return {?UI.Widget} */ _resourceViewForResource(resource) { if (resource.hasTextContent()) { @@ -521,28 +521,28 @@ } switch (resource.resourceType()) { - case WebInspector.resourceTypes.Image: - return new WebInspector.ImageView(resource.mimeType, resource); - case WebInspector.resourceTypes.Font: - return new WebInspector.FontView(resource.mimeType, resource); + case Common.resourceTypes.Image: + return new SourceFrame.ImageView(resource.mimeType, resource); + case Common.resourceTypes.Font: + return new SourceFrame.FontView(resource.mimeType, resource); default: - return new WebInspector.EmptyWidget(resource.url); + return new UI.EmptyWidget(resource.url); } } /** - * @param {!WebInspector.Resource} resource - * @return {?WebInspector.ResourceSourceFrame} + * @param {!SDK.Resource} resource + * @return {?SourceFrame.ResourceSourceFrame} */ _resourceSourceFrameViewForResource(resource) { var resourceView = this._resourceViewForResource(resource); - if (resourceView && resourceView instanceof WebInspector.ResourceSourceFrame) - return /** @type {!WebInspector.ResourceSourceFrame} */ (resourceView); + if (resourceView && resourceView instanceof SourceFrame.ResourceSourceFrame) + return /** @type {!SourceFrame.ResourceSourceFrame} */ (resourceView); return null; } /** - * @param {!WebInspector.Database} database + * @param {!Resources.Database} database * @param {string=} tableName */ _showDatabase(database, tableName) { @@ -553,20 +553,20 @@ if (tableName) { var tableViews = this._databaseTableViews.get(database); if (!tableViews) { - tableViews = /** @type {!Object.<string, !WebInspector.DatabaseTableView>} */ ({}); + tableViews = /** @type {!Object.<string, !Resources.DatabaseTableView>} */ ({}); this._databaseTableViews.set(database, tableViews); } view = tableViews[tableName]; if (!view) { - view = new WebInspector.DatabaseTableView(database, tableName); + view = new Resources.DatabaseTableView(database, tableName); tableViews[tableName] = view; } } else { view = this._databaseQueryViews.get(database); if (!view) { - view = new WebInspector.DatabaseQueryView(database); + view = new Resources.DatabaseQueryView(database); this._databaseQueryViews.set(database, view); - view.addEventListener(WebInspector.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); + view.addEventListener(Resources.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); } } @@ -574,7 +574,7 @@ } /** - * @param {!WebInspector.DOMStorage} domStorage + * @param {!Resources.DOMStorage} domStorage */ _showDOMStorage(domStorage) { if (!domStorage) @@ -583,7 +583,7 @@ var view; view = this._domStorageViews.get(domStorage); if (!view) { - view = new WebInspector.DOMStorageItemsView(domStorage); + view = new Resources.DOMStorageItemsView(domStorage); this._domStorageViews.set(domStorage, view); } @@ -591,13 +591,13 @@ } /** - * @param {!WebInspector.CookieTreeElement} treeElement + * @param {!Resources.CookieTreeElement} treeElement * @param {string} cookieDomain */ showCookies(treeElement, cookieDomain) { var view = this._cookieViews[cookieDomain]; if (!view) { - view = new WebInspector.CookieItemsView(treeElement, cookieDomain); + view = new Resources.CookieItemsView(treeElement, cookieDomain); this._cookieViews[cookieDomain] = view; } @@ -615,13 +615,13 @@ showApplicationCache(frameId) { if (!this._applicationCacheViews[frameId]) this._applicationCacheViews[frameId] = - new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, frameId); + new Resources.ApplicationCacheItemsView(this._applicationCacheModel, frameId); this._innerShowView(this._applicationCacheViews[frameId]); } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ showFileSystem(view) { this._innerShowView(view); @@ -629,7 +629,7 @@ showCategoryView(categoryName) { if (!this._categoryView) - this._categoryView = new WebInspector.StorageCategoryView(); + this._categoryView = new Resources.StorageCategoryView(); this._categoryView.setText(categoryName); this._innerShowView(this._categoryView); } @@ -645,7 +645,7 @@ this.visibleView = view; this._storageViewToolbar.removeToolbarItems(); - var toolbarItems = view instanceof WebInspector.SimpleView ? view.syncToolbarItems() : null; + var toolbarItems = view instanceof UI.SimpleView ? view.syncToolbarItems() : null; for (var i = 0; toolbarItems && i < toolbarItems.length; ++i) this._storageViewToolbar.appendToolbarItem(toolbarItems[i]); } @@ -692,39 +692,39 @@ } /** - * @param {!WebInspector.DOMStorageModel} domStorageModel + * @param {!Resources.DOMStorageModel} domStorageModel */ _populateDOMStorageTree(domStorageModel) { domStorageModel.enable(); domStorageModel.storages().forEach(this._addDOMStorage.bind(this)); - domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageAdded, this._domStorageAdded, this); + domStorageModel.addEventListener(Resources.DOMStorageModel.Events.DOMStorageAdded, this._domStorageAdded, this); domStorageModel.addEventListener( - WebInspector.DOMStorageModel.Events.DOMStorageRemoved, this._domStorageRemoved, this); + Resources.DOMStorageModel.Events.DOMStorageRemoved, this._domStorageRemoved, this); } /** - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.ResourceTreeModel} resourceTreeModel */ _populateApplicationCacheTree(resourceTreeModel) { - this._applicationCacheModel = new WebInspector.ApplicationCacheModel(this._target, resourceTreeModel); + this._applicationCacheModel = new SDK.ApplicationCacheModel(this._target, resourceTreeModel); this._applicationCacheViews = {}; this._applicationCacheFrameElements = {}; this._applicationCacheManifestElements = {}; this._applicationCacheModel.addEventListener( - WebInspector.ApplicationCacheModel.Events.FrameManifestAdded, this._applicationCacheFrameManifestAdded, this); + SDK.ApplicationCacheModel.Events.FrameManifestAdded, this._applicationCacheFrameManifestAdded, this); this._applicationCacheModel.addEventListener( - WebInspector.ApplicationCacheModel.Events.FrameManifestRemoved, this._applicationCacheFrameManifestRemoved, + SDK.ApplicationCacheModel.Events.FrameManifestRemoved, this._applicationCacheFrameManifestRemoved, this); this._applicationCacheModel.addEventListener( - WebInspector.ApplicationCacheModel.Events.FrameManifestsReset, this._resetAppCache, this); + SDK.ApplicationCacheModel.Events.FrameManifestsReset, this._resetAppCache, this); this._applicationCacheModel.addEventListener( - WebInspector.ApplicationCacheModel.Events.FrameManifestStatusUpdated, + SDK.ApplicationCacheModel.Events.FrameManifestStatusUpdated, this._applicationCacheFrameManifestStatusChanged, this); this._applicationCacheModel.addEventListener( - WebInspector.ApplicationCacheModel.Events.NetworkStateChanged, this._applicationCacheNetworkStateChanged, this); + SDK.ApplicationCacheModel.Events.NetworkStateChanged, this._applicationCacheNetworkStateChanged, this); } _applicationCacheFrameManifestAdded(event) { @@ -733,12 +733,12 @@ var manifestTreeElement = this._applicationCacheManifestElements[manifestURL]; if (!manifestTreeElement) { - manifestTreeElement = new WebInspector.ApplicationCacheManifestTreeElement(this, manifestURL); + manifestTreeElement = new Resources.ApplicationCacheManifestTreeElement(this, manifestURL); this.applicationCacheListTreeElement.appendChild(manifestTreeElement); this._applicationCacheManifestElements[manifestURL] = manifestTreeElement; } - var frameTreeElement = new WebInspector.ApplicationCacheFrameTreeElement(this, frameId, manifestURL); + var frameTreeElement = new Resources.ApplicationCacheFrameTreeElement(this, frameId, manifestURL); manifestTreeElement.appendChild(frameTreeElement); manifestTreeElement.expand(); this._applicationCacheFrameElements[frameId] = frameTreeElement; @@ -779,7 +779,7 @@ } _findTreeElementForResource(resource) { - return resource[WebInspector.FrameResourceTreeElement._symbol]; + return resource[Resources.FrameResourceTreeElement._symbol]; } showView(view) { @@ -805,7 +805,7 @@ delete this._previousHoveredElement; } - if (element instanceof WebInspector.FrameTreeElement) { + if (element instanceof Resources.FrameTreeElement) { this._previousHoveredElement = element; element.hovered = true; } @@ -820,29 +820,29 @@ }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.ResourcesPanel.ResourceRevealer = class { +Resources.ResourcesPanel.ResourceRevealer = class { /** * @override * @param {!Object} resource * @return {!Promise} */ reveal(resource) { - if (!(resource instanceof WebInspector.Resource)) + if (!(resource instanceof SDK.Resource)) return Promise.reject(new Error('Internal error: not a resource')); - var panel = WebInspector.ResourcesPanel._instance(); - return WebInspector.viewManager.showView('resources').then(panel.showResource.bind(panel, resource)); + var panel = Resources.ResourcesPanel._instance(); + return UI.viewManager.showView('resources').then(panel.showResource.bind(panel, resource)); } }; /** * @unrestricted */ -WebInspector.BaseStorageTreeElement = class extends TreeElement { +Resources.BaseStorageTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel * @param {string} title * @param {?Array.<string>=} iconClasses * @param {boolean=} expandable @@ -876,9 +876,9 @@ /** * @unrestricted */ -WebInspector.StorageCategoryTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.StorageCategoryTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel * @param {string} categoryName * @param {string} settingsKey * @param {?Array.<string>=} iconClasses @@ -887,12 +887,12 @@ constructor(storagePanel, categoryName, settingsKey, iconClasses, noIcon) { super(storagePanel, categoryName, iconClasses, false, noIcon); this._expandedSetting = - WebInspector.settings.createSetting('resources' + settingsKey + 'Expanded', settingsKey === 'Frames'); + Common.settings.createSetting('resources' + settingsKey + 'Expanded', settingsKey === 'Frames'); this._categoryName = categoryName; } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._storagePanel._target; @@ -939,10 +939,10 @@ /** * @unrestricted */ -WebInspector.FrameTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.FrameTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.ResourceTreeFrame} frame + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!SDK.ResourceTreeFrame} frame */ constructor(storagePanel, frame) { super(storagePanel, '', ['navigator-tree-item', 'navigator-frame-tree-item']); @@ -973,44 +973,44 @@ this._storagePanel.showCategoryView(this.titleAsText()); this.listItemElement.classList.remove('hovered'); - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); return false; } set hovered(hovered) { if (hovered) { this.listItemElement.classList.add('hovered'); - var domModel = WebInspector.DOMModel.fromTarget(this._frame.target()); + var domModel = SDK.DOMModel.fromTarget(this._frame.target()); if (domModel) domModel.highlightFrame(this._frameId); } else { this.listItemElement.classList.remove('hovered'); - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } } /** - * @param {!WebInspector.Resource} resource + * @param {!SDK.Resource} resource */ appendResource(resource) { var resourceType = resource.resourceType(); var categoryName = resourceType.name(); var categoryElement = - resourceType === WebInspector.resourceTypes.Document ? this : this._categoryElements[categoryName]; + resourceType === Common.resourceTypes.Document ? this : this._categoryElements[categoryName]; if (!categoryElement) { - categoryElement = new WebInspector.StorageCategoryTreeElement( + categoryElement = new Resources.StorageCategoryTreeElement( this._storagePanel, resource.resourceType().category().title, categoryName, null, true); this._categoryElements[resourceType.name()] = categoryElement; this._insertInPresentationOrder(this, categoryElement); } - var resourceTreeElement = new WebInspector.FrameResourceTreeElement(this._storagePanel, resource); + var resourceTreeElement = new Resources.FrameResourceTreeElement(this._storagePanel, resource); this._insertInPresentationOrder(categoryElement, resourceTreeElement); this._treeElementForResource[resource.url] = resourceTreeElement; } /** * @param {string} url - * @return {?WebInspector.Resource} + * @return {?SDK.Resource} */ resourceByURL(url) { var treeElement = this._treeElementForResource[url]; @@ -1027,9 +1027,9 @@ _insertInPresentationOrder(parentTreeElement, childTreeElement) { // Insert in the alphabetical order, first frames, then resources. Document resource goes last. function typeWeight(treeElement) { - if (treeElement instanceof WebInspector.StorageCategoryTreeElement) + if (treeElement instanceof Resources.StorageCategoryTreeElement) return 2; - if (treeElement instanceof WebInspector.FrameTreeElement) + if (treeElement instanceof Resources.FrameTreeElement) return 1; return 3; } @@ -1061,19 +1061,19 @@ /** * @unrestricted */ -WebInspector.FrameResourceTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.FrameResourceTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.Resource} resource + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!SDK.Resource} resource */ constructor(storagePanel, resource) { super(storagePanel, resource.displayName, [ 'navigator-tree-item', 'navigator-file-tree-item', 'navigator-' + resource.resourceType().name() + '-tree-item' ]); - /** @type {!WebInspector.Resource} */ + /** @type {!SDK.Resource} */ this._resource = resource; this.tooltip = resource.url; - this._resource[WebInspector.FrameResourceTreeElement._symbol] = this; + this._resource[Resources.FrameResourceTreeElement._symbol] = this; } get itemURL() { @@ -1120,17 +1120,17 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(this._resource); contextMenu.show(); } /** - * @return {!WebInspector.ResourceSourceFrame} + * @return {!SourceFrame.ResourceSourceFrame} */ sourceView() { if (!this._sourceView) { - var sourceFrame = new WebInspector.ResourceSourceFrame(this._resource); + var sourceFrame = new SourceFrame.ResourceSourceFrame(this._resource); sourceFrame.setHighlighterType(this._resource.canonicalMimeType()); this._sourceView = sourceFrame; } @@ -1138,15 +1138,15 @@ } }; -WebInspector.FrameResourceTreeElement._symbol = Symbol('treeElement'); +Resources.FrameResourceTreeElement._symbol = Symbol('treeElement'); /** * @unrestricted */ -WebInspector.DatabaseTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.DatabaseTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.Database} database + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!Resources.Database} database */ constructor(storagePanel, database) { super(storagePanel, database.name, ['database-tree-item', 'resource-tree-item'], true); @@ -1179,12 +1179,12 @@ /** * @param {!Array.<string>} tableNames - * @this {WebInspector.DatabaseTreeElement} + * @this {Resources.DatabaseTreeElement} */ function tableNamesCallback(tableNames) { var tableNamesLength = tableNames.length; for (var i = 0; i < tableNamesLength; ++i) - this.appendChild(new WebInspector.DatabaseTableTreeElement(this._storagePanel, this._database, tableNames[i])); + this.appendChild(new Resources.DatabaseTableTreeElement(this._storagePanel, this._database, tableNames[i])); } this._database.getTableNames(tableNamesCallback.bind(this)); } @@ -1193,7 +1193,7 @@ /** * @unrestricted */ -WebInspector.DatabaseTableTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.DatabaseTableTreeElement = class extends Resources.BaseStorageTreeElement { constructor(storagePanel, database, tableName) { super(storagePanel, tableName, ['table-tree-item', 'resource-tree-item']); this._database = database; @@ -1218,30 +1218,30 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerCacheTreeElement = class extends WebInspector.StorageCategoryTreeElement { +Resources.ServiceWorkerCacheTreeElement = class extends Resources.StorageCategoryTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel */ constructor(storagePanel) { super( - storagePanel, WebInspector.UIString('Cache Storage'), 'CacheStorage', + storagePanel, Common.UIString('Cache Storage'), 'CacheStorage', ['database-tree-item', 'resource-tree-item']); } _initialize() { - /** @type {!Array.<!WebInspector.SWCacheTreeElement>} */ + /** @type {!Array.<!Resources.SWCacheTreeElement>} */ this._swCacheTreeElements = []; var target = this._storagePanel._target; - var model = target && WebInspector.ServiceWorkerCacheModel.fromTarget(target); + var model = target && SDK.ServiceWorkerCacheModel.fromTarget(target); if (model) { for (var cache of model.caches()) this._addCache(model, cache); } - WebInspector.targetManager.addModelListener( - WebInspector.ServiceWorkerCacheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheAdded, this._cacheAdded, + SDK.targetManager.addModelListener( + SDK.ServiceWorkerCacheModel, SDK.ServiceWorkerCacheModel.Events.CacheAdded, this._cacheAdded, this); - WebInspector.targetManager.addModelListener( - WebInspector.ServiceWorkerCacheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheRemoved, + SDK.targetManager.addModelListener( + SDK.ServiceWorkerCacheModel, SDK.ServiceWorkerCacheModel.Events.CacheRemoved, this._cacheRemoved, this); } @@ -1254,15 +1254,15 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Refresh Caches'), this._refreshCaches.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Refresh Caches'), this._refreshCaches.bind(this)); contextMenu.show(); } _refreshCaches() { var target = this._storagePanel._target; if (target) { - var model = WebInspector.ServiceWorkerCacheModel.fromTarget(target); + var model = SDK.ServiceWorkerCacheModel.fromTarget(target); if (!model) return; model.refreshCacheNames(); @@ -1270,30 +1270,30 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _cacheAdded(event) { - var cache = /** @type {!WebInspector.ServiceWorkerCacheModel.Cache} */ (event.data); - var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.target); + var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data); + var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.target); this._addCache(model, cache); } /** - * @param {!WebInspector.ServiceWorkerCacheModel} model - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel} model + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ _addCache(model, cache) { - var swCacheTreeElement = new WebInspector.SWCacheTreeElement(this._storagePanel, model, cache); + var swCacheTreeElement = new Resources.SWCacheTreeElement(this._storagePanel, model, cache); this._swCacheTreeElements.push(swCacheTreeElement); this.appendChild(swCacheTreeElement); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _cacheRemoved(event) { - var cache = /** @type {!WebInspector.ServiceWorkerCacheModel.Cache} */ (event.data); - var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.target); + var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data); + var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.target); var swCacheTreeElement = this._cacheTreeElement(model, cache); if (!swCacheTreeElement) @@ -1305,9 +1305,9 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel} model - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache - * @return {?WebInspector.SWCacheTreeElement} + * @param {!SDK.ServiceWorkerCacheModel} model + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache + * @return {?Resources.SWCacheTreeElement} */ _cacheTreeElement(model, cache) { var index = -1; @@ -1326,11 +1326,11 @@ /** * @unrestricted */ -WebInspector.SWCacheTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.SWCacheTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.ServiceWorkerCacheModel} model - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!SDK.ServiceWorkerCacheModel} model + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ constructor(storagePanel, model, cache) { super(storagePanel, cache.cacheName + ' - ' + cache.securityOrigin, ['table-tree-item', 'resource-tree-item']); @@ -1352,8 +1352,8 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Delete'), this._clearCache.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Delete'), this._clearCache.bind(this)); contextMenu.show(); } @@ -1362,7 +1362,7 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ update(cache) { this._cache = cache; @@ -1377,7 +1377,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.ServiceWorkerCacheView(this._model, this._cache); + this._view = new Resources.ServiceWorkerCacheView(this._model, this._cache); this._storagePanel._innerShowView(this._view); return false; @@ -1392,13 +1392,13 @@ /** * @unrestricted */ -WebInspector.ServiceWorkersTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.ServiceWorkersTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel */ constructor(storagePanel) { super( - storagePanel, WebInspector.UIString('Service Workers'), ['service-worker-tree-item', 'resource-tree-item'], + storagePanel, Common.UIString('Service Workers'), ['service-worker-tree-item', 'resource-tree-item'], false); } @@ -1416,7 +1416,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.ServiceWorkersView(); + this._view = new Resources.ServiceWorkersView(); this._storagePanel._innerShowView(this._view); return false; } @@ -1425,12 +1425,12 @@ /** * @unrestricted */ -WebInspector.AppManifestTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.AppManifestTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel */ constructor(storagePanel) { - super(storagePanel, WebInspector.UIString('Manifest'), ['manifest-tree-item', 'resource-tree-item'], false, false); + super(storagePanel, Common.UIString('Manifest'), ['manifest-tree-item', 'resource-tree-item'], false, false); } /** @@ -1447,7 +1447,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.AppManifestView(); + this._view = new Resources.AppManifestView(); this._storagePanel._innerShowView(this._view); return false; } @@ -1456,13 +1456,13 @@ /** * @unrestricted */ -WebInspector.ClearStorageTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.ClearStorageTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel */ constructor(storagePanel) { super( - storagePanel, WebInspector.UIString('Clear storage'), ['clear-storage-tree-item', 'resource-tree-item'], false, + storagePanel, Common.UIString('Clear storage'), ['clear-storage-tree-item', 'resource-tree-item'], false, false); } @@ -1480,7 +1480,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.ClearStorageView(this._storagePanel); + this._view = new Resources.ClearStorageView(this._storagePanel); this._storagePanel._innerShowView(this._view); return false; } @@ -1489,27 +1489,27 @@ /** * @unrestricted */ -WebInspector.IndexedDBTreeElement = class extends WebInspector.StorageCategoryTreeElement { +Resources.IndexedDBTreeElement = class extends Resources.StorageCategoryTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel */ constructor(storagePanel) { - super(storagePanel, WebInspector.UIString('IndexedDB'), 'IndexedDB', ['database-tree-item', 'resource-tree-item']); + super(storagePanel, Common.UIString('IndexedDB'), 'IndexedDB', ['database-tree-item', 'resource-tree-item']); } _initialize() { - WebInspector.targetManager.addModelListener( - WebInspector.IndexedDBModel, WebInspector.IndexedDBModel.Events.DatabaseAdded, this._indexedDBAdded, this); - WebInspector.targetManager.addModelListener( - WebInspector.IndexedDBModel, WebInspector.IndexedDBModel.Events.DatabaseRemoved, this._indexedDBRemoved, this); - WebInspector.targetManager.addModelListener( - WebInspector.IndexedDBModel, WebInspector.IndexedDBModel.Events.DatabaseLoaded, this._indexedDBLoaded, this); - /** @type {!Array.<!WebInspector.IDBDatabaseTreeElement>} */ + SDK.targetManager.addModelListener( + Resources.IndexedDBModel, Resources.IndexedDBModel.Events.DatabaseAdded, this._indexedDBAdded, this); + SDK.targetManager.addModelListener( + Resources.IndexedDBModel, Resources.IndexedDBModel.Events.DatabaseRemoved, this._indexedDBRemoved, this); + SDK.targetManager.addModelListener( + Resources.IndexedDBModel, Resources.IndexedDBModel.Events.DatabaseLoaded, this._indexedDBLoaded, this); + /** @type {!Array.<!Resources.IDBDatabaseTreeElement>} */ this._idbDatabaseTreeElements = []; - var targets = WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser); + var targets = SDK.targetManager.targets(SDK.Target.Capability.Browser); for (var i = 0; i < targets.length; ++i) { - var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(targets[i]); + var indexedDBModel = Resources.IndexedDBModel.fromTarget(targets[i]); var databases = indexedDBModel.databases(); for (var j = 0; j < databases.length; ++j) this._addIndexedDB(indexedDBModel, databases[j]); @@ -1525,43 +1525,43 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Refresh IndexedDB'), this.refreshIndexedDB.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this.refreshIndexedDB.bind(this)); contextMenu.show(); } refreshIndexedDB() { - var targets = WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser); + var targets = SDK.targetManager.targets(SDK.Target.Capability.Browser); for (var i = 0; i < targets.length; ++i) - WebInspector.IndexedDBModel.fromTarget(targets[i]).refreshDatabaseNames(); + Resources.IndexedDBModel.fromTarget(targets[i]).refreshDatabaseNames(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _indexedDBAdded(event) { - var databaseId = /** @type {!WebInspector.IndexedDBModel.DatabaseId} */ (event.data); - var model = /** @type {!WebInspector.IndexedDBModel} */ (event.target); + var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.data); + var model = /** @type {!Resources.IndexedDBModel} */ (event.target); this._addIndexedDB(model, databaseId); } /** - * @param {!WebInspector.IndexedDBModel} model - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel} model + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId */ _addIndexedDB(model, databaseId) { - var idbDatabaseTreeElement = new WebInspector.IDBDatabaseTreeElement(this._storagePanel, model, databaseId); + var idbDatabaseTreeElement = new Resources.IDBDatabaseTreeElement(this._storagePanel, model, databaseId); this._idbDatabaseTreeElements.push(idbDatabaseTreeElement); this.appendChild(idbDatabaseTreeElement); model.refreshDatabase(databaseId); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _indexedDBRemoved(event) { - var databaseId = /** @type {!WebInspector.IndexedDBModel.DatabaseId} */ (event.data); - var model = /** @type {!WebInspector.IndexedDBModel} */ (event.target); + var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.data); + var model = /** @type {!Resources.IndexedDBModel} */ (event.target); var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId); if (!idbDatabaseTreeElement) @@ -1573,11 +1573,11 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _indexedDBLoaded(event) { - var database = /** @type {!WebInspector.IndexedDBModel.Database} */ (event.data); - var model = /** @type {!WebInspector.IndexedDBModel} */ (event.target); + var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data); + var model = /** @type {!Resources.IndexedDBModel} */ (event.target); var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.databaseId); if (!idbDatabaseTreeElement) @@ -1587,9 +1587,9 @@ } /** - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId - * @param {!WebInspector.IndexedDBModel} model - * @return {?WebInspector.IDBDatabaseTreeElement} + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel} model + * @return {?Resources.IDBDatabaseTreeElement} */ _idbDatabaseTreeElement(model, databaseId) { var index = -1; @@ -1609,11 +1609,11 @@ /** * @unrestricted */ -WebInspector.IDBDatabaseTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.IDBDatabaseTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.IndexedDBModel} model - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!Resources.IndexedDBModel} model + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId */ constructor(storagePanel, model, databaseId) { super( @@ -1637,8 +1637,8 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Refresh IndexedDB'), this._refreshIndexedDB.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIndexedDB.bind(this)); contextMenu.show(); } @@ -1647,7 +1647,7 @@ } /** - * @param {!WebInspector.IndexedDBModel.Database} database + * @param {!Resources.IndexedDBModel.Database} database */ update(database) { this._database = database; @@ -1657,7 +1657,7 @@ objectStoreNames[objectStore.name] = true; if (!this._idbObjectStoreTreeElements[objectStore.name]) { var idbObjectStoreTreeElement = - new WebInspector.IDBObjectStoreTreeElement(this._storagePanel, this._model, this._databaseId, objectStore); + new Resources.IDBObjectStoreTreeElement(this._storagePanel, this._model, this._databaseId, objectStore); this._idbObjectStoreTreeElements[objectStore.name] = idbObjectStoreTreeElement; this.appendChild(idbObjectStoreTreeElement); } @@ -1675,7 +1675,7 @@ } _updateTooltip() { - this.tooltip = WebInspector.UIString('Version') + ': ' + this._database.version; + this.tooltip = Common.UIString('Version') + ': ' + this._database.version; } /** @@ -1685,7 +1685,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.IDBDatabaseView(this._database); + this._view = new Resources.IDBDatabaseView(this._database); this._storagePanel._innerShowView(this._view); return false; @@ -1710,12 +1710,12 @@ /** * @unrestricted */ -WebInspector.IDBObjectStoreTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.IDBObjectStoreTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.IndexedDBModel} model - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId - * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!Resources.IndexedDBModel} model + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.ObjectStore} objectStore */ constructor(storagePanel, model, databaseId, objectStore) { super(storagePanel, objectStore.name, ['table-tree-item', 'resource-tree-item']); @@ -1738,14 +1738,14 @@ } _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Clear'), this._clearObjectStore.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Clear'), this._clearObjectStore.bind(this)); contextMenu.show(); } _clearObjectStore() { /** - * @this {WebInspector.IDBObjectStoreTreeElement} + * @this {Resources.IDBObjectStoreTreeElement} */ function callback() { this.update(this._objectStore); @@ -1754,7 +1754,7 @@ } /** - * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore + * @param {!Resources.IndexedDBModel.ObjectStore} objectStore */ update(objectStore) { this._objectStore = objectStore; @@ -1764,7 +1764,7 @@ var index = this._objectStore.indexes[indexName]; indexNames[index.name] = true; if (!this._idbIndexTreeElements[index.name]) { - var idbIndexTreeElement = new WebInspector.IDBIndexTreeElement( + var idbIndexTreeElement = new Resources.IDBIndexTreeElement( this._storagePanel, this._model, this._databaseId, this._objectStore, index); this._idbIndexTreeElements[index.name] = idbIndexTreeElement; this.appendChild(idbIndexTreeElement); @@ -1793,9 +1793,9 @@ _updateTooltip() { var keyPathString = this._objectStore.keyPathString; - var tooltipString = keyPathString !== null ? (WebInspector.UIString('Key path: ') + keyPathString) : ''; + var tooltipString = keyPathString !== null ? (Common.UIString('Key path: ') + keyPathString) : ''; if (this._objectStore.autoIncrement) - tooltipString += '\n' + WebInspector.UIString('autoIncrement'); + tooltipString += '\n' + Common.UIString('autoIncrement'); this.tooltip = tooltipString; } @@ -1806,7 +1806,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, null); + this._view = new Resources.IDBDataView(this._model, this._databaseId, this._objectStore, null); this._storagePanel._innerShowView(this._view); return false; @@ -1833,13 +1833,13 @@ /** * @unrestricted */ -WebInspector.IDBIndexTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.IDBIndexTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel - * @param {!WebInspector.IndexedDBModel} model - * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId - * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore - * @param {!WebInspector.IndexedDBModel.Index} index + * @param {!Resources.ResourcesPanel} storagePanel + * @param {!Resources.IndexedDBModel} model + * @param {!Resources.IndexedDBModel.DatabaseId} databaseId + * @param {!Resources.IndexedDBModel.ObjectStore} objectStore + * @param {!Resources.IndexedDBModel.Index} index */ constructor(storagePanel, model, databaseId, objectStore, index) { super(storagePanel, index.name, ['index-tree-item', 'resource-tree-item']); @@ -1855,7 +1855,7 @@ } /** - * @param {!WebInspector.IndexedDBModel.Index} index + * @param {!Resources.IndexedDBModel.Index} index */ update(index) { this._index = index; @@ -1869,11 +1869,11 @@ _updateTooltip() { var tooltipLines = []; var keyPathString = this._index.keyPathString; - tooltipLines.push(WebInspector.UIString('Key path: ') + keyPathString); + tooltipLines.push(Common.UIString('Key path: ') + keyPathString); if (this._index.unique) - tooltipLines.push(WebInspector.UIString('unique')); + tooltipLines.push(Common.UIString('unique')); if (this._index.multiEntry) - tooltipLines.push(WebInspector.UIString('multiEntry')); + tooltipLines.push(Common.UIString('multiEntry')); this.tooltip = tooltipLines.join('\n'); } @@ -1884,7 +1884,7 @@ onselect(selectedByUser) { super.onselect(selectedByUser); if (!this._view) - this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, this._index); + this._view = new Resources.IDBDataView(this._model, this._databaseId, this._objectStore, this._index); this._storagePanel._innerShowView(this._view); return false; @@ -1899,10 +1899,10 @@ /** * @unrestricted */ -WebInspector.DOMStorageTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.DOMStorageTreeElement = class extends Resources.BaseStorageTreeElement { constructor(storagePanel, domStorage) { super( - storagePanel, domStorage.securityOrigin ? domStorage.securityOrigin : WebInspector.UIString('Local Files'), + storagePanel, domStorage.securityOrigin ? domStorage.securityOrigin : Common.UIString('Local Files'), ['table-tree-item', 'resource-tree-item']); this._domStorage = domStorage; } @@ -1926,10 +1926,10 @@ /** * @unrestricted */ -WebInspector.CookieTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement { constructor(storagePanel, cookieDomain) { super( - storagePanel, cookieDomain ? cookieDomain : WebInspector.UIString('Local Files'), + storagePanel, cookieDomain ? cookieDomain : Common.UIString('Local Files'), ['cookie-tree-item', 'resource-tree-item']); this._cookieDomain = cookieDomain; } @@ -1950,8 +1950,8 @@ * @param {!Event} event */ _handleContextMenuEvent(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Clear'), this._clearCookies.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Clear'), this._clearCookies.bind(this)); contextMenu.show(); } @@ -1976,9 +1976,9 @@ /** * @unrestricted */ -WebInspector.ApplicationCacheManifestTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStorageTreeElement { constructor(storagePanel, manifestURL) { - var title = new WebInspector.ParsedURL(manifestURL).displayName; + var title = new Common.ParsedURL(manifestURL).displayName; super(storagePanel, title, ['application-cache-storage-tree-item']); this.tooltip = manifestURL; this._manifestURL = manifestURL; @@ -2006,9 +2006,9 @@ /** * @unrestricted */ -WebInspector.ApplicationCacheFrameTreeElement = class extends WebInspector.BaseStorageTreeElement { +Resources.ApplicationCacheFrameTreeElement = class extends Resources.BaseStorageTreeElement { /** - * @param {!WebInspector.ResourcesPanel} storagePanel + * @param {!Resources.ResourcesPanel} storagePanel * @param {!Protocol.Page.FrameId} frameId * @param {string} manifestURL */ @@ -2032,7 +2032,7 @@ } _refreshTitles() { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this._storagePanel._target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(this._storagePanel._target); var frame = resourceTreeModel.frameForId(this._frameId); this.title = frame.displayName(); } @@ -2055,12 +2055,12 @@ /** * @unrestricted */ -WebInspector.StorageCategoryView = class extends WebInspector.VBox { +Resources.StorageCategoryView = class extends UI.VBox { constructor() { super(); this.element.classList.add('storage-view'); - this._emptyWidget = new WebInspector.EmptyWidget(''); + this._emptyWidget = new UI.EmptyWidget(''); this._emptyWidget.show(this.element); }
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js index 19524f14..b5a88037f 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
@@ -4,13 +4,13 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerCacheView = class extends WebInspector.SimpleView { +Resources.ServiceWorkerCacheView = class extends UI.SimpleView { /** - * @param {!WebInspector.ServiceWorkerCacheModel} model - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel} model + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ constructor(model, cache) { - super(WebInspector.UIString('Cache')); + super(Common.UIString('Cache')); this.registerRequiredCSS('resources/serviceWorkerCacheViews.css'); this._model = model; @@ -20,7 +20,7 @@ this._createEditorToolbar(); - this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this._refreshButton.addEventListener('click', this._refreshButtonClicked, this); this._pageSize = 50; @@ -31,28 +31,28 @@ } /** - * @return {!WebInspector.DataGrid} + * @return {!UI.DataGrid} */ _createDataGrid() { - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'number', title: WebInspector.UIString('#'), width: '50px'}, - {id: 'request', title: WebInspector.UIString('Request')}, - {id: 'response', title: WebInspector.UIString('Response')} + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'number', title: Common.UIString('#'), width: '50px'}, + {id: 'request', title: Common.UIString('Request')}, + {id: 'response', title: Common.UIString('Response')} ]); - return new WebInspector.DataGrid( + return new UI.DataGrid( columns, undefined, this._deleteButtonClicked.bind(this), this._updateData.bind(this, true)); } _createEditorToolbar() { - var editorToolbar = new WebInspector.Toolbar('data-view-toolbar', this.element); + var editorToolbar = new UI.Toolbar('data-view-toolbar', this.element); this._pageBackButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Show previous page'), 'largeicon-play-back'); + new UI.ToolbarButton(Common.UIString('Show previous page'), 'largeicon-play-back'); this._pageBackButton.addEventListener('click', this._pageBackButtonClicked, this); editorToolbar.appendToolbarItem(this._pageBackButton); this._pageForwardButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Show next page'), 'largeicon-play'); + new UI.ToolbarButton(Common.UIString('Show next page'), 'largeicon-play'); this._pageForwardButton.setEnabled(false); this._pageForwardButton.addEventListener('click', this._pageForwardButtonClicked, this); editorToolbar.appendToolbarItem(this._pageForwardButton); @@ -69,14 +69,14 @@ } /** - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} node */ _deleteButtonClicked(node) { this._model.deleteCacheEntry(this._cache, /** @type {string} */ (node.data['request']), node.remove.bind(node)); } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ update(cache) { this._cache = cache; @@ -91,9 +91,9 @@ /** * @param {number} skipCount - * @param {!Array.<!WebInspector.ServiceWorkerCacheModel.Entry>} entries + * @param {!Array.<!SDK.ServiceWorkerCacheModel.Entry>} entries * @param {boolean} hasMore - * @this {WebInspector.ServiceWorkerCacheView} + * @this {Resources.ServiceWorkerCacheView} */ _updateDataCallback(skipCount, entries, hasMore) { this._refreshButton.setEnabled(true); @@ -104,7 +104,7 @@ data['number'] = i + skipCount; data['request'] = entries[i].request; data['response'] = entries[i].response; - var node = new WebInspector.DataGridNode(data); + var node = new UI.DataGridNode(data); node.selectable = true; this._dataGrid.rootNode().appendChild(node); } @@ -138,7 +138,7 @@ /** * @override - * @return {!Array.<!WebInspector.ToolbarItem>} + * @return {!Array.<!UI.ToolbarItem>} */ syncToolbarItems() { return [this._refreshButton];
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js index 8482db7..28865149 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js +++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -2,79 +2,79 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ServiceWorkersView = class extends WebInspector.VBox { +Resources.ServiceWorkersView = class extends UI.VBox { constructor() { super(true); - this._reportView = new WebInspector.ReportView(WebInspector.UIString('Service Workers')); + this._reportView = new UI.ReportView(Common.UIString('Service Workers')); this._reportView.show(this.contentElement); this._toolbar = this._reportView.createToolbar(); - /** @type {!Map<!WebInspector.ServiceWorkerRegistration, !WebInspector.ServiceWorkersView.Section>} */ + /** @type {!Map<!SDK.ServiceWorkerRegistration, !Resources.ServiceWorkersView.Section>} */ this._sections = new Map(); - this._toolbar.appendToolbarItem(WebInspector.NetworkConditionsSelector.createOfflineToolbarCheckbox()); - var forceUpdate = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Update on reload'), WebInspector.UIString('Force update Service Worker on page reload'), - WebInspector.settings.createSetting('serviceWorkerUpdateOnReload', false)); + this._toolbar.appendToolbarItem(Components.NetworkConditionsSelector.createOfflineToolbarCheckbox()); + var forceUpdate = new UI.ToolbarCheckbox( + Common.UIString('Update on reload'), Common.UIString('Force update Service Worker on page reload'), + Common.settings.createSetting('serviceWorkerUpdateOnReload', false)); this._toolbar.appendToolbarItem(forceUpdate); - var fallbackToNetwork = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Bypass for network'), - WebInspector.UIString('Bypass Service Worker and load resources from the network'), - WebInspector.settings.createSetting('bypassServiceWorker', false)); + var fallbackToNetwork = new UI.ToolbarCheckbox( + Common.UIString('Bypass for network'), + Common.UIString('Bypass Service Worker and load resources from the network'), + Common.settings.createSetting('bypassServiceWorker', false)); this._toolbar.appendToolbarItem(fallbackToNetwork); this._toolbar.appendSpacer(); - this._showAllCheckbox = new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Show all'), WebInspector.UIString('Show all Service Workers regardless of the origin')); + this._showAllCheckbox = new UI.ToolbarCheckbox( + Common.UIString('Show all'), Common.UIString('Show all Service Workers regardless of the origin')); this._showAllCheckbox.inputElement.addEventListener('change', this._updateSectionVisibility.bind(this), false); this._toolbar.appendToolbarItem(this._showAllCheckbox); - /** @type {!Map<!WebInspector.Target, !Array<!WebInspector.EventTarget.EventDescriptor>>}*/ + /** @type {!Map<!SDK.Target, !Array<!Common.EventTarget.EventDescriptor>>}*/ this._eventListeners = new Map(); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._manager || !target.serviceWorkerManager) return; this._manager = target.serviceWorkerManager; this._subTargetsManager = target.subTargetsManager; - this._securityOriginManager = WebInspector.SecurityOriginManager.fromTarget(target); + this._securityOriginManager = SDK.SecurityOriginManager.fromTarget(target); for (var registration of this._manager.registrations().values()) this._updateRegistration(registration); this._eventListeners.set(target, [ this._manager.addEventListener( - WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, this._registrationUpdated, this), + SDK.ServiceWorkerManager.Events.RegistrationUpdated, this._registrationUpdated, this), this._manager.addEventListener( - WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, this._registrationDeleted, this), + SDK.ServiceWorkerManager.Events.RegistrationDeleted, this._registrationDeleted, this), this._manager.addEventListener( - WebInspector.ServiceWorkerManager.Events.RegistrationErrorAdded, this._registrationErrorAdded, this), + SDK.ServiceWorkerManager.Events.RegistrationErrorAdded, this._registrationErrorAdded, this), this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, this._updateSectionVisibility, this), + SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._updateSectionVisibility, this), this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, this._updateSectionVisibility, this), + SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._updateSectionVisibility, this), ]); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (!this._manager || this._manager !== target.serviceWorkerManager) return; - WebInspector.EventTarget.removeEventListeners(this._eventListeners.get(target)); + Common.EventTarget.removeEventListeners(this._eventListeners.get(target)); this._eventListeners.delete(target); this._manager = null; this._subTargetsManager = null; @@ -90,18 +90,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _registrationUpdated(event) { - var registration = /** @type {!WebInspector.ServiceWorkerRegistration} */ (event.data); + var registration = /** @type {!SDK.ServiceWorkerRegistration} */ (event.data); this._updateRegistration(registration); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _registrationErrorAdded(event) { - var registration = /** @type {!WebInspector.ServiceWorkerRegistration} */ (event.data['registration']); + var registration = /** @type {!SDK.ServiceWorkerRegistration} */ (event.data['registration']); var error = /** @type {!Protocol.ServiceWorker.ServiceWorkerErrorMessage} */ (event.data['error']); var section = this._sections.get(registration); if (!section) @@ -110,12 +110,12 @@ } /** - * @param {!WebInspector.ServiceWorkerRegistration} registration + * @param {!SDK.ServiceWorkerRegistration} registration */ _updateRegistration(registration) { var section = this._sections.get(registration); if (!section) { - section = new WebInspector.ServiceWorkersView.Section( + section = new Resources.ServiceWorkersView.Section( this._manager, this._subTargetsManager, this._reportView.appendSection(''), registration); this._sections.set(registration, section); } @@ -124,10 +124,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _registrationDeleted(event) { - var registration = /** @type {!WebInspector.ServiceWorkerRegistration} */ (event.data); + var registration = /** @type {!SDK.ServiceWorkerRegistration} */ (event.data); var section = this._sections.get(registration); if (section) section._section.remove(); @@ -138,12 +138,12 @@ /** * @unrestricted */ -WebInspector.ServiceWorkersView.Section = class { +Resources.ServiceWorkersView.Section = class { /** - * @param {!WebInspector.ServiceWorkerManager} manager - * @param {!WebInspector.SubTargetsManager} subTargetsManager - * @param {!WebInspector.ReportView.Section} section - * @param {!WebInspector.ServiceWorkerRegistration} registration + * @param {!SDK.ServiceWorkerManager} manager + * @param {!SDK.SubTargetsManager} subTargetsManager + * @param {!UI.ReportView.Section} section + * @param {!SDK.ServiceWorkerRegistration} registration */ constructor(manager, subTargetsManager, section, registration) { this._manager = manager; @@ -154,40 +154,40 @@ this._toolbar = section.createToolbar(); this._toolbar.renderAsLinks(); this._updateButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Update'), undefined, WebInspector.UIString('Update')); + new UI.ToolbarButton(Common.UIString('Update'), undefined, Common.UIString('Update')); this._updateButton.addEventListener('click', this._updateButtonClicked.bind(this)); this._toolbar.appendToolbarItem(this._updateButton); - this._pushButton = new WebInspector.ToolbarButton( - WebInspector.UIString('Emulate push event'), undefined, WebInspector.UIString('Push')); + this._pushButton = new UI.ToolbarButton( + Common.UIString('Emulate push event'), undefined, Common.UIString('Push')); this._pushButton.addEventListener('click', this._pushButtonClicked.bind(this)); this._toolbar.appendToolbarItem(this._pushButton); - this._syncButton = new WebInspector.ToolbarButton( - WebInspector.UIString('Emulate background sync event'), undefined, WebInspector.UIString('Sync')); + this._syncButton = new UI.ToolbarButton( + Common.UIString('Emulate background sync event'), undefined, Common.UIString('Sync')); this._syncButton.addEventListener('click', this._syncButtonClicked.bind(this)); this._toolbar.appendToolbarItem(this._syncButton); - this._deleteButton = new WebInspector.ToolbarButton( - WebInspector.UIString('Unregister service worker'), undefined, WebInspector.UIString('Unregister')); + this._deleteButton = new UI.ToolbarButton( + Common.UIString('Unregister service worker'), undefined, Common.UIString('Unregister')); this._deleteButton.addEventListener('click', this._unregisterButtonClicked.bind(this)); this._toolbar.appendToolbarItem(this._deleteButton); // Preserve the order. - this._section.appendField(WebInspector.UIString('Source')); - this._section.appendField(WebInspector.UIString('Status')); - this._section.appendField(WebInspector.UIString('Clients')); - this._section.appendField(WebInspector.UIString('Errors')); + this._section.appendField(Common.UIString('Source')); + this._section.appendField(Common.UIString('Status')); + this._section.appendField(Common.UIString('Clients')); + this._section.appendField(Common.UIString('Errors')); this._errorsList = this._wrapWidget(this._section.appendRow()); this._errorsList.classList.add('service-worker-error-stack', 'monospace', 'hidden'); - this._linkifier = new WebInspector.Linkifier(); - /** @type {!Map<string, !WebInspector.TargetInfo>} */ + this._linkifier = new Components.Linkifier(); + /** @type {!Map<string, !SDK.TargetInfo>} */ this._clientInfoCache = new Map(); for (var error of registration.errors) this._addError(error); - this._throttler = new WebInspector.Throttler(500); + this._throttler = new Common.Throttler(500); } _scheduleUpdate() { - if (WebInspector.ServiceWorkersView._noThrottle) { + if (Resources.ServiceWorkersView._noThrottle) { this._update(); return; } @@ -196,7 +196,7 @@ /** * @param {string} versionId - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ _targetForVersionId(versionId) { var version = this._manager.findVersion(versionId); @@ -217,48 +217,48 @@ this._toolbar.setEnabled(!this._registration.isDeleted); var versions = this._registration.versionsByMode(); - var title = this._registration.isDeleted ? WebInspector.UIString('%s - deleted', this._registration.scopeURL) : + var title = this._registration.isDeleted ? Common.UIString('%s - deleted', this._registration.scopeURL) : this._registration.scopeURL; this._section.setTitle(title); - var active = versions.get(WebInspector.ServiceWorkerVersion.Modes.Active); - var waiting = versions.get(WebInspector.ServiceWorkerVersion.Modes.Waiting); - var installing = versions.get(WebInspector.ServiceWorkerVersion.Modes.Installing); + var active = versions.get(SDK.ServiceWorkerVersion.Modes.Active); + var waiting = versions.get(SDK.ServiceWorkerVersion.Modes.Waiting); + var installing = versions.get(SDK.ServiceWorkerVersion.Modes.Installing); - var statusValue = this._wrapWidget(this._section.appendField(WebInspector.UIString('Status'))); + var statusValue = this._wrapWidget(this._section.appendField(Common.UIString('Status'))); statusValue.removeChildren(); var versionsStack = statusValue.createChild('div', 'service-worker-version-stack'); versionsStack.createChild('div', 'service-worker-version-stack-bar'); if (active) { - var scriptElement = this._section.appendField(WebInspector.UIString('Source')); + var scriptElement = this._section.appendField(Common.UIString('Source')); scriptElement.removeChildren(); - var fileName = WebInspector.ParsedURL.extractName(active.scriptURL); - scriptElement.appendChild(WebInspector.linkifyURLAsNode(active.scriptURL, fileName)); + var fileName = Common.ParsedURL.extractName(active.scriptURL); + scriptElement.appendChild(UI.linkifyURLAsNode(active.scriptURL, fileName)); scriptElement.createChild('div', 'report-field-value-subtitle').textContent = - WebInspector.UIString('Received %s', new Date(active.scriptResponseTime * 1000).toLocaleString()); + Common.UIString('Received %s', new Date(active.scriptResponseTime * 1000).toLocaleString()); var activeEntry = versionsStack.createChild('div', 'service-worker-version'); activeEntry.createChild('div', 'service-worker-active-circle'); activeEntry.createChild('span').textContent = - WebInspector.UIString('#%s activated and is %s', active.id, active.runningStatus); + Common.UIString('#%s activated and is %s', active.id, active.runningStatus); if (active.isRunning() || active.isStarting()) { - createLink(activeEntry, WebInspector.UIString('stop'), this._stopButtonClicked.bind(this, active.id)); + createLink(activeEntry, Common.UIString('stop'), this._stopButtonClicked.bind(this, active.id)); if (!this._targetForVersionId(active.id)) - createLink(activeEntry, WebInspector.UIString('inspect'), this._inspectButtonClicked.bind(this, active.id)); + createLink(activeEntry, Common.UIString('inspect'), this._inspectButtonClicked.bind(this, active.id)); } else if (active.isStartable()) { - createLink(activeEntry, WebInspector.UIString('start'), this._startButtonClicked.bind(this)); + createLink(activeEntry, Common.UIString('start'), this._startButtonClicked.bind(this)); } - var clientsList = this._wrapWidget(this._section.appendField(WebInspector.UIString('Clients'))); + var clientsList = this._wrapWidget(this._section.appendField(Common.UIString('Clients'))); clientsList.removeChildren(); - this._section.setFieldVisible(WebInspector.UIString('Clients'), active.controlledClients.length); + this._section.setFieldVisible(Common.UIString('Clients'), active.controlledClients.length); for (var client of active.controlledClients) { var clientLabelText = clientsList.createChild('div', 'service-worker-client'); if (this._clientInfoCache.has(client)) this._updateClientInfo( - clientLabelText, /** @type {!WebInspector.TargetInfo} */ (this._clientInfoCache.get(client))); + clientLabelText, /** @type {!SDK.TargetInfo} */ (this._clientInfoCache.get(client))); this._subTargetsManager.getTargetInfo(client, this._onClientInfo.bind(this, clientLabelText)); } } @@ -266,34 +266,34 @@ if (waiting) { var waitingEntry = versionsStack.createChild('div', 'service-worker-version'); waitingEntry.createChild('div', 'service-worker-waiting-circle'); - waitingEntry.createChild('span').textContent = WebInspector.UIString('#%s waiting to activate', waiting.id); - createLink(waitingEntry, WebInspector.UIString('skipWaiting'), this._skipButtonClicked.bind(this)); + waitingEntry.createChild('span').textContent = Common.UIString('#%s waiting to activate', waiting.id); + createLink(waitingEntry, Common.UIString('skipWaiting'), this._skipButtonClicked.bind(this)); waitingEntry.createChild('div', 'service-worker-subtitle').textContent = new Date(waiting.scriptResponseTime * 1000).toLocaleString(); if (!this._targetForVersionId(waiting.id) && (waiting.isRunning() || waiting.isStarting())) - createLink(waitingEntry, WebInspector.UIString('inspect'), this._inspectButtonClicked.bind(this, waiting.id)); + createLink(waitingEntry, Common.UIString('inspect'), this._inspectButtonClicked.bind(this, waiting.id)); } if (installing) { var installingEntry = versionsStack.createChild('div', 'service-worker-version'); installingEntry.createChild('div', 'service-worker-installing-circle'); - installingEntry.createChild('span').textContent = WebInspector.UIString('#%s installing', installing.id); + installingEntry.createChild('span').textContent = Common.UIString('#%s installing', installing.id); installingEntry.createChild('div', 'service-worker-subtitle').textContent = new Date(installing.scriptResponseTime * 1000).toLocaleString(); if (!this._targetForVersionId(installing.id) && (installing.isRunning() || installing.isStarting())) createLink( - installingEntry, WebInspector.UIString('inspect'), this._inspectButtonClicked.bind(this, installing.id)); + installingEntry, Common.UIString('inspect'), this._inspectButtonClicked.bind(this, installing.id)); } - this._section.setFieldVisible(WebInspector.UIString('Errors'), !!this._registration.errors.length); - var errorsValue = this._wrapWidget(this._section.appendField(WebInspector.UIString('Errors'))); + this._section.setFieldVisible(Common.UIString('Errors'), !!this._registration.errors.length); + var errorsValue = this._wrapWidget(this._section.appendField(Common.UIString('Errors'))); var errorsLabel = createLabel(String(this._registration.errors.length), 'smallicon-error'); errorsLabel.classList.add('service-worker-errors-label'); errorsValue.appendChild(errorsLabel); this._moreButton = createLink( - errorsValue, this._errorsList.classList.contains('hidden') ? WebInspector.UIString('details') : - WebInspector.UIString('hide'), + errorsValue, this._errorsList.classList.contains('hidden') ? Common.UIString('details') : + Common.UIString('hide'), this._moreErrorsButtonClicked.bind(this)); - createLink(errorsValue, WebInspector.UIString('clear'), this._clearErrorsButtonClicked.bind(this)); + createLink(errorsValue, Common.UIString('clear'), this._clearErrorsButtonClicked.bind(this)); /** * @param {!Element} parent @@ -343,7 +343,7 @@ /** * @param {!Element} element - * @param {?WebInspector.TargetInfo} targetInfo + * @param {?SDK.TargetInfo} targetInfo */ _onClientInfo(element, targetInfo) { if (!targetInfo) @@ -354,7 +354,7 @@ /** * @param {!Element} element - * @param {!WebInspector.TargetInfo} targetInfo + * @param {!SDK.TargetInfo} targetInfo */ _updateClientInfo(element, targetInfo) { if (!targetInfo.canActivate) { @@ -392,7 +392,7 @@ _moreErrorsButtonClicked() { var newVisible = this._errorsList.classList.contains('hidden'); - this._moreButton.textContent = newVisible ? WebInspector.UIString('hide') : WebInspector.UIString('details'); + this._moreButton.textContent = newVisible ? Common.UIString('hide') : Common.UIString('details'); this._errorsList.classList.toggle('hidden', !newVisible); } @@ -416,8 +416,8 @@ * @return {!Element} */ _wrapWidget(container) { - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(container); - WebInspector.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(container); + UI.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); var contentElement = createElement('div'); shadowRoot.appendChild(contentElement); return contentElement;
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/module.json b/third_party/WebKit/Source/devtools/front_end/resources/module.json index ec672bf6..6c61d22cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/resources/module.json +++ b/third_party/WebKit/Source/devtools/front_end/resources/module.json
@@ -6,12 +6,12 @@ "id": "resources", "title": "Application", "order": 70, - "className": "WebInspector.ResourcesPanel" + "className": "Resources.ResourcesPanel" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.Resource"], - "className": "WebInspector.ResourcesPanel.ResourceRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.Resource"], + "className": "Resources.ResourcesPanel.ResourceRevealer" } ], "dependencies": ["source_frame", "ui_lazy", "components_lazy"],
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/ASTService.js b/third_party/WebKit/Source/devtools/front_end/sass/ASTService.js index 7143441..ac8412f 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/ASTService.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/ASTService.js
@@ -4,22 +4,22 @@ /** * @unrestricted */ -WebInspector.ASTService = class { +Sass.ASTService = class { /** * @param {string} url * @param {string} text - * @return {!Promise<!WebInspector.SASSSupport.AST>} + * @return {!Promise<!Sass.SASSSupport.AST>} */ parseCSS(url, text) { - return WebInspector.SASSSupport.parseSCSS(url, text); + return Sass.SASSSupport.parseSCSS(url, text); } /** * @param {string} url * @param {string} text - * @return {!Promise<!WebInspector.SASSSupport.AST>} + * @return {!Promise<!Sass.SASSSupport.AST>} */ parseSCSS(url, text) { - return WebInspector.SASSSupport.parseSCSS(url, text); + return Sass.SASSSupport.parseSCSS(url, text); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/ASTSourceMap.js b/third_party/WebKit/Source/devtools/front_end/sass/ASTSourceMap.js index 17b21fe..95bc707 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/ASTSourceMap.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/ASTSourceMap.js
@@ -2,25 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.SourceMap} + * @implements {SDK.SourceMap} * @unrestricted */ -WebInspector.ASTSourceMap = class { +Sass.ASTSourceMap = class { /** * @param {string} compiledURL * @param {string} sourceMapURL - * @param {!Map<string, !WebInspector.SASSSupport.AST>} models - * @param {?function(!WebInspector.ASTSourceMap, !Array<!WebInspector.TextRange>, !Array<string>):!Promise<?WebInspector.SourceMap.EditResult>} editCallback + * @param {!Map<string, !Sass.SASSSupport.AST>} models + * @param {?function(!Sass.ASTSourceMap, !Array<!Common.TextRange>, !Array<string>):!Promise<?SDK.SourceMap.EditResult>} editCallback */ constructor(compiledURL, sourceMapURL, models, editCallback) { this._editCallback = editCallback; this._compiledURL = compiledURL; this._sourceMapURL = sourceMapURL; - /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */ + /** @type {!Map<string, !Sass.SASSSupport.AST>} */ this._models = models; - /** @type {!Map<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} */ + /** @type {!Map<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} */ this._compiledToSource = new Map(); - /** @type {!Multimap<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} */ + /** @type {!Multimap<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} */ this._sourceToCompiled = new Multimap(); } @@ -51,13 +51,13 @@ /** * @override * @param {string} sourceURL - * @param {!WebInspector.ResourceType} contentType - * @return {!WebInspector.ContentProvider} + * @param {!Common.ResourceType} contentType + * @return {!Common.ContentProvider} */ sourceContentProvider(sourceURL, contentType) { var model = this.modelForURL(sourceURL); var sourceContent = model ? model.document.text.value() : ''; - return WebInspector.StaticContentProvider.fromString(sourceURL, contentType, sourceContent); + return Common.StaticContentProvider.fromString(sourceURL, contentType, sourceContent); } /** @@ -74,7 +74,7 @@ * @override * @param {number} lineNumber * @param {number=} columnNumber - * @return {?WebInspector.SourceMapEntry} + * @return {?SDK.SourceMapEntry} */ findEntry(lineNumber, columnNumber) { columnNumber = columnNumber || 0; @@ -84,7 +84,7 @@ var sourceNode = this.toSourceNode(compiledNode); if (!sourceNode) return null; - return new WebInspector.SourceMapEntry( + return new SDK.SourceMapEntry( lineNumber, columnNumber, sourceNode.document.url, sourceNode.range.startLine, sourceNode.range.startColumn); } @@ -98,48 +98,48 @@ /** * @override - * @param {!Array<!WebInspector.TextRange>} ranges + * @param {!Array<!Common.TextRange>} ranges * @param {!Array<string>} texts - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @return {!Promise<?SDK.SourceMap.EditResult>} */ editCompiled(ranges, texts) { return this._editCallback.call(null, this, ranges, texts); } /** - * @return {!WebInspector.SASSSupport.AST} + * @return {!Sass.SASSSupport.AST} */ compiledModel() { - return /** @type {!WebInspector.SASSSupport.AST} */ (this._models.get(this._compiledURL)); + return /** @type {!Sass.SASSSupport.AST} */ (this._models.get(this._compiledURL)); } /** - * @return {!Map<string, !WebInspector.SASSSupport.AST>} + * @return {!Map<string, !Sass.SASSSupport.AST>} */ sourceModels() { - var sourceModels = /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */ (new Map(this._models)); + var sourceModels = /** @type {!Map<string, !Sass.SASSSupport.AST>} */ (new Map(this._models)); sourceModels.delete(this._compiledURL); return sourceModels; } /** - * @return {!Map<string, !WebInspector.SASSSupport.AST>} + * @return {!Map<string, !Sass.SASSSupport.AST>} */ models() { - return /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */ (new Map(this._models)); + return /** @type {!Map<string, !Sass.SASSSupport.AST>} */ (new Map(this._models)); } /** * @param {string} url - * @return {?WebInspector.SASSSupport.AST} + * @return {?Sass.SASSSupport.AST} */ modelForURL(url) { return this._models.get(url) || null; } /** - * @param {!WebInspector.SASSSupport.TextNode} compiled - * @param {!WebInspector.SASSSupport.TextNode} source + * @param {!Sass.SASSSupport.TextNode} compiled + * @param {!Sass.SASSSupport.TextNode} source */ addMapping(compiled, source) { this._compiledToSource.set(compiled, source); @@ -147,8 +147,8 @@ } /** - * @param {!WebInspector.SASSSupport.TextNode} compiled - * @param {!WebInspector.SASSSupport.TextNode} source + * @param {!Sass.SASSSupport.TextNode} compiled + * @param {!Sass.SASSSupport.TextNode} source */ removeMapping(compiled, source) { this._compiledToSource.delete(compiled); @@ -156,16 +156,16 @@ } /** - * @param {!WebInspector.SASSSupport.TextNode} compiled - * @return {?WebInspector.SASSSupport.TextNode} + * @param {!Sass.SASSSupport.TextNode} compiled + * @return {?Sass.SASSSupport.TextNode} */ toSourceNode(compiled) { return this._compiledToSource.get(compiled) || null; } /** - * @param {!WebInspector.SASSSupport.TextNode} source - * @return {!Array<!WebInspector.SASSSupport.TextNode>} + * @param {!Sass.SASSSupport.TextNode} source + * @return {!Array<!Sass.SASSSupport.TextNode>} */ toCompiledNodes(source) { var compiledNodes = this._sourceToCompiled.get(source); @@ -173,15 +173,15 @@ } /** - * @param {!Array<!WebInspector.SASSSupport.AST>} updated - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>=} outNodeMapping - * @return {?WebInspector.ASTSourceMap} + * @param {!Array<!Sass.SASSSupport.AST>} updated + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>=} outNodeMapping + * @return {?Sass.ASTSourceMap} */ rebase(updated, outNodeMapping) { outNodeMapping = outNodeMapping || new Map(); outNodeMapping.clear(); - var models = /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */ (new Map(this._models)); + var models = /** @type {!Map<string, !Sass.SASSSupport.AST>} */ (new Map(this._models)); for (var newAST of updated) { var oldAST = models.get(newAST.document.url); if (!oldAST.match(newAST, outNodeMapping)) @@ -189,15 +189,15 @@ models.set(newAST.document.url, newAST); } - var newMap = new WebInspector.ASTSourceMap(this._compiledURL, this._sourceMapURL, models, this._editCallback); + var newMap = new Sass.ASTSourceMap(this._compiledURL, this._sourceMapURL, models, this._editCallback); var compiledNodes = this._compiledToSource.keysArray(); for (var i = 0; i < compiledNodes.length; ++i) { var compiledNode = compiledNodes[i]; - var sourceNode = /** @type {!WebInspector.SASSSupport.TextNode} */ (this._compiledToSource.get(compiledNode)); + var sourceNode = /** @type {!Sass.SASSSupport.TextNode} */ (this._compiledToSource.get(compiledNode)); var mappedCompiledNode = - /** @type {!WebInspector.SASSSupport.TextNode} */ (outNodeMapping.get(compiledNode) || compiledNode); + /** @type {!Sass.SASSSupport.TextNode} */ (outNodeMapping.get(compiledNode) || compiledNode); var mappedSourceNode = - /** @type {!WebInspector.SASSSupport.TextNode} */ (outNodeMapping.get(sourceNode) || sourceNode); + /** @type {!Sass.SASSSupport.TextNode} */ (outNodeMapping.get(sourceNode) || sourceNode); newMap.addMapping(mappedCompiledNode, mappedSourceNode); } return newMap;
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/SASSProcessor.js b/third_party/WebKit/Source/devtools/front_end/sass/SASSProcessor.js index 427e203..dbba03e 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/SASSProcessor.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/SASSProcessor.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.SASSProcessor = class { +Sass.SASSProcessor = class { /** - * @param {!WebInspector.ASTService} astService - * @param {!WebInspector.ASTSourceMap} map - * @param {!Array<!WebInspector.SASSProcessor.EditOperation>} editOperations + * @param {!Sass.ASTService} astService + * @param {!Sass.ASTSourceMap} map + * @param {!Array<!Sass.SASSProcessor.EditOperation>} editOperations */ constructor(astService, map, editOperations) { this._astService = astService; @@ -17,9 +17,9 @@ } /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.Property} cssProperty - * @return {?WebInspector.SASSSupport.Property} + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.Property} cssProperty + * @return {?Sass.SASSSupport.Property} */ static _toSASSProperty(map, cssProperty) { var sassName = map.toSourceNode(cssProperty.name); @@ -27,39 +27,39 @@ } /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.Property} sassProperty - * @return {!Array<!WebInspector.SASSSupport.Property>} + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.Property} sassProperty + * @return {!Array<!Sass.SASSSupport.Property>} */ static _toCSSProperties(map, sassProperty) { return map.toCompiledNodes(sassProperty.name).map(name => name.parent); } /** - * @param {!WebInspector.ASTService} astService - * @param {!WebInspector.ASTSourceMap} map - * @param {!Array<!WebInspector.TextRange>} ranges + * @param {!Sass.ASTService} astService + * @param {!Sass.ASTSourceMap} map + * @param {!Array<!Common.TextRange>} ranges * @param {!Array<string>} newTexts - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @return {!Promise<?SDK.SourceMap.EditResult>} */ static processCSSEdits(astService, map, ranges, newTexts) { console.assert(ranges.length === newTexts.length); var cssURL = map.compiledURL(); var cssText = map.compiledModel().document.text; for (var i = 0; i < ranges.length; ++i) - cssText = new WebInspector.Text(cssText.replaceRange(ranges[i], newTexts[i])); + cssText = new Common.Text(cssText.replaceRange(ranges[i], newTexts[i])); return astService.parseCSS(cssURL, cssText.value()).then(onCSSParsed); /** - * @param {!WebInspector.SASSSupport.AST} newCSSAST - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @param {!Sass.SASSSupport.AST} newCSSAST + * @return {!Promise<?SDK.SourceMap.EditResult>} */ function onCSSParsed(newCSSAST) { if (newCSSAST.rules.length !== map.compiledModel().rules.length) - return Promise.resolve(/** @type {?WebInspector.SourceMap.EditResult} */ (null)); + return Promise.resolve(/** @type {?SDK.SourceMap.EditResult} */ (null)); // TODO(lushnikov): only diff changed styles. - var cssDiff = WebInspector.SASSSupport.diffModels(map.compiledModel(), newCSSAST); - var edits = WebInspector.SASSProcessor._editsFromCSSDiff(cssDiff, map); + var cssDiff = Sass.SASSSupport.diffModels(map.compiledModel(), newCSSAST); + var edits = Sass.SASSProcessor._editsFromCSSDiff(cssDiff, map); // Determine AST trees which will change and clone them. var changedURLs = new Set(edits.map(edit => edit.sassURL)); @@ -70,35 +70,35 @@ // Rebase map and edits onto a cloned AST trees. var nodeMapping = new Map(); - var rebasedMap = /** @type {!WebInspector.ASTSourceMap} */ (map.rebase(clonedModels, nodeMapping)); + var rebasedMap = /** @type {!Sass.ASTSourceMap} */ (map.rebase(clonedModels, nodeMapping)); console.assert(rebasedMap); var rebasedEdits = edits.map(edit => edit.rebase(rebasedMap, nodeMapping)); - return new WebInspector.SASSProcessor(astService, rebasedMap, rebasedEdits)._mutate(); + return new Sass.SASSProcessor(astService, rebasedMap, rebasedEdits)._mutate(); } } /** - * @param {!WebInspector.SASSSupport.ASTDiff} cssDiff - * @param {!WebInspector.ASTSourceMap} map - * @return {!Array<!WebInspector.SASSProcessor.EditOperation>} + * @param {!Sass.SASSSupport.ASTDiff} cssDiff + * @param {!Sass.ASTSourceMap} map + * @return {!Array<!Sass.SASSProcessor.EditOperation>} */ static _editsFromCSSDiff(cssDiff, map) { - var T = WebInspector.SASSSupport.PropertyChangeType; + var T = Sass.SASSSupport.PropertyChangeType; var operations = []; for (var i = 0; i < cssDiff.changes.length; ++i) { var change = cssDiff.changes[i]; var operation = null; if (change.type === T.ValueChanged || change.type === T.NameChanged) - operation = WebInspector.SASSProcessor.SetTextOperation.fromCSSChange(change, map); + operation = Sass.SASSProcessor.SetTextOperation.fromCSSChange(change, map); else if (change.type === T.PropertyToggled) - operation = WebInspector.SASSProcessor.TogglePropertyOperation.fromCSSChange(change, map); + operation = Sass.SASSProcessor.TogglePropertyOperation.fromCSSChange(change, map); else if (change.type === T.PropertyRemoved) - operation = WebInspector.SASSProcessor.RemovePropertyOperation.fromCSSChange(change, map); + operation = Sass.SASSProcessor.RemovePropertyOperation.fromCSSChange(change, map); else if (change.type === T.PropertyAdded) - operation = WebInspector.SASSProcessor.InsertPropertiesOperation.fromCSSChange(change, map); + operation = Sass.SASSProcessor.InsertPropertiesOperation.fromCSSChange(change, map); if (!operation) { - WebInspector.console.error('Operation ignored: ' + change.type); + Common.console.error('Operation ignored: ' + change.type); continue; } @@ -112,10 +112,10 @@ } /** - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @return {!Promise<?SDK.SourceMap.EditResult>} */ _mutate() { - /** @type {!Set<!WebInspector.SASSSupport.Rule>} */ + /** @type {!Set<!Sass.SASSSupport.Rule>} */ var changedCSSRules = new Set(); for (var editOperation of this._editOperations) { var rules = editOperation.perform(); @@ -139,9 +139,9 @@ } /** - * @param {!Set<!WebInspector.SASSSupport.Rule>} changedCSSRules - * @param {!Array<!WebInspector.SASSSupport.AST>} changedModels - * @return {?WebInspector.SourceMap.EditResult} + * @param {!Set<!Sass.SASSSupport.Rule>} changedCSSRules + * @param {!Array<!Sass.SASSSupport.AST>} changedModels + * @return {?SDK.SourceMap.EditResult} */ _onFinished(changedCSSRules, changedModels) { var nodeMapping = new Map(); @@ -154,7 +154,7 @@ var oldRange = rule.styleRange; var newRule = nodeMapping.get(rule); var newText = newRule.document.text.extract(newRule.styleRange); - cssEdits.push(new WebInspector.SourceEdit(newRule.document.url, oldRange, newText)); + cssEdits.push(new Common.SourceEdit(newRule.document.url, oldRange, newText)); } /** @type {!Map<string, string>} */ @@ -164,7 +164,7 @@ continue; newSASSSources.set(model.document.url, model.document.text.value()); } - return new WebInspector.SourceMap.EditResult(map, cssEdits, newSASSSources); + return new SDK.SourceMap.EditResult(map, cssEdits, newSASSSources); } }; @@ -172,9 +172,9 @@ /** * @unrestricted */ -WebInspector.SASSProcessor.EditOperation = class { +Sass.SASSProcessor.EditOperation = class { /** - * @param {!WebInspector.ASTSourceMap} map + * @param {!Sass.ASTSourceMap} map * @param {string} sassURL */ constructor(map, sassURL) { @@ -183,7 +183,7 @@ } /** - * @param {!WebInspector.SASSProcessor.EditOperation} other + * @param {!Sass.SASSProcessor.EditOperation} other * @return {boolean} */ merge(other) { @@ -191,16 +191,16 @@ } /** - * @return {!Array<!WebInspector.SASSSupport.Rule>} + * @return {!Array<!Sass.SASSSupport.Rule>} */ perform() { return []; } /** - * @param {!WebInspector.ASTSourceMap} newMap - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>} nodeMapping - * @return {!WebInspector.SASSProcessor.EditOperation} + * @param {!Sass.ASTSourceMap} newMap + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>} nodeMapping + * @return {!Sass.SASSProcessor.EditOperation} */ rebase(newMap, nodeMapping) { return this; @@ -210,10 +210,10 @@ /** * @unrestricted */ -WebInspector.SASSProcessor.SetTextOperation = class extends WebInspector.SASSProcessor.EditOperation { +Sass.SASSProcessor.SetTextOperation = class extends Sass.SASSProcessor.EditOperation { /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.TextNode} sassNode + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.TextNode} sassNode * @param {string} newText */ constructor(map, sassNode, newText) { @@ -223,17 +223,17 @@ } /** - * @param {!WebInspector.SASSSupport.PropertyChange} change - * @param {!WebInspector.ASTSourceMap} map - * @return {?WebInspector.SASSProcessor.SetTextOperation} + * @param {!Sass.SASSSupport.PropertyChange} change + * @param {!Sass.ASTSourceMap} map + * @return {?Sass.SASSProcessor.SetTextOperation} */ static fromCSSChange(change, map) { - var oldProperty = /** @type {!WebInspector.SASSSupport.Property} */ (change.oldProperty()); - var newProperty = /** @type {!WebInspector.SASSSupport.Property} */ (change.newProperty()); + var oldProperty = /** @type {!Sass.SASSSupport.Property} */ (change.oldProperty()); + var newProperty = /** @type {!Sass.SASSSupport.Property} */ (change.newProperty()); console.assert(oldProperty && newProperty, 'SetTextOperation must have both oldProperty and newProperty'); var newValue = null; var sassNode = null; - if (change.type === WebInspector.SASSSupport.PropertyChangeType.NameChanged) { + if (change.type === Sass.SASSSupport.PropertyChangeType.NameChanged) { newValue = newProperty.name.text; sassNode = map.toSourceNode(oldProperty.name); } else { @@ -242,23 +242,23 @@ } if (!sassNode) return null; - return new WebInspector.SASSProcessor.SetTextOperation(map, sassNode, newValue); + return new Sass.SASSProcessor.SetTextOperation(map, sassNode, newValue); } /** * @override - * @param {!WebInspector.SASSProcessor.EditOperation} other + * @param {!Sass.SASSProcessor.EditOperation} other * @return {boolean} */ merge(other) { - if (!(other instanceof WebInspector.SASSProcessor.SetTextOperation)) + if (!(other instanceof Sass.SASSProcessor.SetTextOperation)) return false; return this._sassNode === other._sassNode; } /** * @override - * @return {!Array<!WebInspector.SASSSupport.Rule>} + * @return {!Array<!Sass.SASSSupport.Rule>} */ perform() { this._sassNode.setText(this._newText); @@ -272,14 +272,14 @@ /** * @override - * @param {!WebInspector.ASTSourceMap} newMap - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>} nodeMapping - * @return {!WebInspector.SASSProcessor.SetTextOperation} + * @param {!Sass.ASTSourceMap} newMap + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>} nodeMapping + * @return {!Sass.SASSProcessor.SetTextOperation} */ rebase(newMap, nodeMapping) { var sassNode = - /** @type {?WebInspector.SASSSupport.TextNode} */ (nodeMapping.get(this._sassNode)) || this._sassNode; - return new WebInspector.SASSProcessor.SetTextOperation(newMap, sassNode, this._newText); + /** @type {?Sass.SASSSupport.TextNode} */ (nodeMapping.get(this._sassNode)) || this._sassNode; + return new Sass.SASSProcessor.SetTextOperation(newMap, sassNode, this._newText); } }; @@ -287,10 +287,10 @@ /** * @unrestricted */ -WebInspector.SASSProcessor.TogglePropertyOperation = class extends WebInspector.SASSProcessor.EditOperation { +Sass.SASSProcessor.TogglePropertyOperation = class extends Sass.SASSProcessor.EditOperation { /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.Property} sassProperty + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.Property} sassProperty * @param {boolean} newDisabled */ constructor(map, sassProperty, newDisabled) { @@ -300,38 +300,38 @@ } /** - * @param {!WebInspector.SASSSupport.PropertyChange} change - * @param {!WebInspector.ASTSourceMap} map - * @return {?WebInspector.SASSProcessor.TogglePropertyOperation} + * @param {!Sass.SASSSupport.PropertyChange} change + * @param {!Sass.ASTSourceMap} map + * @return {?Sass.SASSProcessor.TogglePropertyOperation} */ static fromCSSChange(change, map) { - var oldCSSProperty = /** @type {!WebInspector.SASSSupport.Property} */ (change.oldProperty()); + var oldCSSProperty = /** @type {!Sass.SASSSupport.Property} */ (change.oldProperty()); console.assert(oldCSSProperty, 'TogglePropertyOperation must have old CSS property'); - var sassProperty = WebInspector.SASSProcessor._toSASSProperty(map, oldCSSProperty); + var sassProperty = Sass.SASSProcessor._toSASSProperty(map, oldCSSProperty); if (!sassProperty) return null; var newDisabled = change.newProperty().disabled; - return new WebInspector.SASSProcessor.TogglePropertyOperation(map, sassProperty, newDisabled); + return new Sass.SASSProcessor.TogglePropertyOperation(map, sassProperty, newDisabled); } /** * @override - * @param {!WebInspector.SASSProcessor.EditOperation} other + * @param {!Sass.SASSProcessor.EditOperation} other * @return {boolean} */ merge(other) { - if (!(other instanceof WebInspector.SASSProcessor.TogglePropertyOperation)) + if (!(other instanceof Sass.SASSProcessor.TogglePropertyOperation)) return false; return this._sassProperty === other._sassProperty; } /** * @override - * @return {!Array<!WebInspector.SASSSupport.Rule>} + * @return {!Array<!Sass.SASSSupport.Rule>} */ perform() { this._sassProperty.setDisabled(this._newDisabled); - var cssProperties = WebInspector.SASSProcessor._toCSSProperties(this.map, this._sassProperty); + var cssProperties = Sass.SASSProcessor._toCSSProperties(this.map, this._sassProperty); for (var property of cssProperties) property.setDisabled(this._newDisabled); @@ -341,14 +341,14 @@ /** * @override - * @param {!WebInspector.ASTSourceMap} newMap - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>} nodeMapping - * @return {!WebInspector.SASSProcessor.TogglePropertyOperation} + * @param {!Sass.ASTSourceMap} newMap + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>} nodeMapping + * @return {!Sass.SASSProcessor.TogglePropertyOperation} */ rebase(newMap, nodeMapping) { var sassProperty = - /** @type {?WebInspector.SASSSupport.Property} */ (nodeMapping.get(this._sassProperty)) || this._sassProperty; - return new WebInspector.SASSProcessor.TogglePropertyOperation(newMap, sassProperty, this._newDisabled); + /** @type {?Sass.SASSSupport.Property} */ (nodeMapping.get(this._sassProperty)) || this._sassProperty; + return new Sass.SASSProcessor.TogglePropertyOperation(newMap, sassProperty, this._newDisabled); } }; @@ -356,10 +356,10 @@ /** * @unrestricted */ -WebInspector.SASSProcessor.RemovePropertyOperation = class extends WebInspector.SASSProcessor.EditOperation { +Sass.SASSProcessor.RemovePropertyOperation = class extends Sass.SASSProcessor.EditOperation { /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.Property} sassProperty + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.Property} sassProperty */ constructor(map, sassProperty) { super(map, sassProperty.document.url); @@ -367,36 +367,36 @@ } /** - * @param {!WebInspector.SASSSupport.PropertyChange} change - * @param {!WebInspector.ASTSourceMap} map - * @return {?WebInspector.SASSProcessor.RemovePropertyOperation} + * @param {!Sass.SASSSupport.PropertyChange} change + * @param {!Sass.ASTSourceMap} map + * @return {?Sass.SASSProcessor.RemovePropertyOperation} */ static fromCSSChange(change, map) { - var removedProperty = /** @type {!WebInspector.SASSSupport.Property} */ (change.oldProperty()); + var removedProperty = /** @type {!Sass.SASSSupport.Property} */ (change.oldProperty()); console.assert(removedProperty, 'RemovePropertyOperation must have removed CSS property'); - var sassProperty = WebInspector.SASSProcessor._toSASSProperty(map, removedProperty); + var sassProperty = Sass.SASSProcessor._toSASSProperty(map, removedProperty); if (!sassProperty) return null; - return new WebInspector.SASSProcessor.RemovePropertyOperation(map, sassProperty); + return new Sass.SASSProcessor.RemovePropertyOperation(map, sassProperty); } /** * @override - * @param {!WebInspector.SASSProcessor.EditOperation} other + * @param {!Sass.SASSProcessor.EditOperation} other * @return {boolean} */ merge(other) { - if (!(other instanceof WebInspector.SASSProcessor.RemovePropertyOperation)) + if (!(other instanceof Sass.SASSProcessor.RemovePropertyOperation)) return false; return this._sassProperty === other._sassProperty; } /** * @override - * @return {!Array<!WebInspector.SASSSupport.Rule>} + * @return {!Array<!Sass.SASSSupport.Rule>} */ perform() { - var cssProperties = WebInspector.SASSProcessor._toCSSProperties(this.map, this._sassProperty); + var cssProperties = Sass.SASSProcessor._toCSSProperties(this.map, this._sassProperty); var cssRules = cssProperties.map(property => property.parent); this._sassProperty.remove(); for (var cssProperty of cssProperties) { @@ -410,14 +410,14 @@ /** * @override - * @param {!WebInspector.ASTSourceMap} newMap - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>} nodeMapping - * @return {!WebInspector.SASSProcessor.RemovePropertyOperation} + * @param {!Sass.ASTSourceMap} newMap + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>} nodeMapping + * @return {!Sass.SASSProcessor.RemovePropertyOperation} */ rebase(newMap, nodeMapping) { var sassProperty = - /** @type {?WebInspector.SASSSupport.Property} */ (nodeMapping.get(this._sassProperty)) || this._sassProperty; - return new WebInspector.SASSProcessor.RemovePropertyOperation(newMap, sassProperty); + /** @type {?Sass.SASSSupport.Property} */ (nodeMapping.get(this._sassProperty)) || this._sassProperty; + return new Sass.SASSProcessor.RemovePropertyOperation(newMap, sassProperty); } }; @@ -425,11 +425,11 @@ /** * @unrestricted */ -WebInspector.SASSProcessor.InsertPropertiesOperation = class extends WebInspector.SASSProcessor.EditOperation { +Sass.SASSProcessor.InsertPropertiesOperation = class extends Sass.SASSProcessor.EditOperation { /** - * @param {!WebInspector.ASTSourceMap} map - * @param {!WebInspector.SASSSupport.Rule} sassRule - * @param {?WebInspector.SASSSupport.Property} afterSASSProperty + * @param {!Sass.ASTSourceMap} map + * @param {!Sass.SASSSupport.Rule} sassRule + * @param {?Sass.SASSSupport.Property} afterSASSProperty * @param {!Array<string>} propertyNames * @param {!Array<string>} propertyValues * @param {!Array<boolean>} disabledStates @@ -445,9 +445,9 @@ } /** - * @param {!WebInspector.SASSSupport.PropertyChange} change - * @param {!WebInspector.ASTSourceMap} map - * @return {?WebInspector.SASSProcessor.InsertPropertiesOperation} + * @param {!Sass.SASSSupport.PropertyChange} change + * @param {!Sass.ASTSourceMap} map + * @return {?Sass.SASSProcessor.InsertPropertiesOperation} */ static fromCSSChange(change, map) { var sassRule = null; @@ -464,22 +464,22 @@ } if (!sassRule) return null; - var insertedProperty = /** @type {!WebInspector.SASSSupport.Property} */ (change.newProperty()); + var insertedProperty = /** @type {!Sass.SASSSupport.Property} */ (change.newProperty()); console.assert(insertedProperty, 'InsertPropertiesOperation must have inserted CSS property'); var names = [insertedProperty.name.text]; var values = [insertedProperty.value.text]; var disabledStates = [insertedProperty.disabled]; - return new WebInspector.SASSProcessor.InsertPropertiesOperation( + return new Sass.SASSProcessor.InsertPropertiesOperation( map, sassRule, afterSASSProperty, names, values, disabledStates); } /** * @override - * @param {!WebInspector.SASSProcessor.EditOperation} other + * @param {!Sass.SASSProcessor.EditOperation} other * @return {boolean} */ merge(other) { - if (!(other instanceof WebInspector.SASSProcessor.InsertPropertiesOperation)) + if (!(other instanceof Sass.SASSProcessor.InsertPropertiesOperation)) return false; if (this._sassRule !== other._sassRule || this._afterSASSProperty !== other._afterSASSProperty) return false; @@ -497,7 +497,7 @@ /** * @override - * @return {!Array<!WebInspector.SASSSupport.Rule>} + * @return {!Array<!Sass.SASSSupport.Rule>} */ perform() { var newSASSProperties = this._sassRule.insertProperties( @@ -505,7 +505,7 @@ var cssRules = []; var afterCSSProperties = []; if (this._afterSASSProperty) { - afterCSSProperties = WebInspector.SASSProcessor._toCSSProperties(this.map, this._afterSASSProperty); + afterCSSProperties = Sass.SASSProcessor._toCSSProperties(this.map, this._afterSASSProperty); cssRules = afterCSSProperties.map(property => property.parent); } else { cssRules = this.map.toCompiledNodes(this._sassRule.blockStart).map(blockStart => blockStart.parent); @@ -525,17 +525,17 @@ /** * @override - * @param {!WebInspector.ASTSourceMap} newMap - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>} nodeMapping - * @return {!WebInspector.SASSProcessor.InsertPropertiesOperation} + * @param {!Sass.ASTSourceMap} newMap + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>} nodeMapping + * @return {!Sass.SASSProcessor.InsertPropertiesOperation} */ rebase(newMap, nodeMapping) { - var sassRule = /** @type {?WebInspector.SASSSupport.Rule} */ (nodeMapping.get(this._sassRule)) || this._sassRule; + var sassRule = /** @type {?Sass.SASSSupport.Rule} */ (nodeMapping.get(this._sassRule)) || this._sassRule; var afterSASSProperty = this._afterSASSProperty ? - /** @type {?WebInspector.SASSSupport.Property} */ (nodeMapping.get(this._afterSASSProperty)) || + /** @type {?Sass.SASSSupport.Property} */ (nodeMapping.get(this._afterSASSProperty)) || this._afterSASSProperty : null; - return new WebInspector.SASSProcessor.InsertPropertiesOperation( + return new Sass.SASSProcessor.InsertPropertiesOperation( newMap, sassRule, afterSASSProperty, this._nameTexts, this._valueTexts, this._disabledStates); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js b/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js index fffaa53f..5375c2b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/SASSSourceMapFactory.js
@@ -2,35 +2,35 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.SourceMapFactory} + * @implements {SDK.SourceMapFactory} * @unrestricted */ -WebInspector.SASSSourceMapFactory = class { +Sass.SASSSourceMapFactory = class { constructor() { - this._astService = new WebInspector.ASTService(); + this._astService = new Sass.ASTService(); } /** * @override - * @param {!WebInspector.Target} target - * @param {!WebInspector.SourceMap} sourceMap - * @return {!Promise<?WebInspector.SourceMap>} + * @param {!SDK.Target} target + * @param {!SDK.SourceMap} sourceMap + * @return {!Promise<?SDK.SourceMap>} */ editableSourceMap(target, sourceMap) { - var cssModel = WebInspector.CSSModel.fromTarget(target); + var cssModel = SDK.CSSModel.fromTarget(target); if (!cssModel) - return Promise.resolve(/** @type {?WebInspector.SourceMap} */ (null)); + return Promise.resolve(/** @type {?SDK.SourceMap} */ (null)); var header = cssModel.styleSheetHeaders().find(styleSheetHeader => styleSheetHeader.sourceMapURL === sourceMap.url()); if (!header) - return Promise.resolve(/** @type {?WebInspector.SourceMap} */ (null)); + return Promise.resolve(/** @type {?SDK.SourceMap} */ (null)); - /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */ + /** @type {!Map<string, !Sass.SASSSupport.AST>} */ var models = new Map(); var promises = []; for (let url of sourceMap.sourceURLs()) { - var contentProvider = sourceMap.sourceContentProvider(url, WebInspector.resourceTypes.SourceMapStyleSheet); + var contentProvider = sourceMap.sourceContentProvider(url, Common.resourceTypes.SourceMapStyleSheet); var sassPromise = contentProvider.requestContent() .then(text => this._astService.parseSCSS(url, text || '')) .then(ast => models.set(ast.document.url, ast)); @@ -45,28 +45,28 @@ return Promise.all(promises) .then(this._onSourcesParsed.bind(this, sourceMap, models)) - .catchException(/** @type {?WebInspector.SourceMap} */ (null)); + .catchException(/** @type {?SDK.SourceMap} */ (null)); } /** - * @param {!WebInspector.SourceMap} sourceMap - * @param {!Map<string, !WebInspector.SASSSupport.AST>} models - * @return {?WebInspector.SourceMap} + * @param {!SDK.SourceMap} sourceMap + * @param {!Map<string, !Sass.SASSSupport.AST>} models + * @return {?SDK.SourceMap} */ _onSourcesParsed(sourceMap, models) { - var editCallback = WebInspector.SASSProcessor.processCSSEdits.bind(WebInspector.SASSProcessor, this._astService); - var map = new WebInspector.ASTSourceMap(sourceMap.compiledURL(), sourceMap.url(), models, editCallback); + var editCallback = Sass.SASSProcessor.processCSSEdits.bind(Sass.SASSProcessor, this._astService); + var map = new Sass.ASTSourceMap(sourceMap.compiledURL(), sourceMap.url(), models, editCallback); var valid = true; map.compiledModel().visit(onNode); return valid ? map : null; /** - * @param {!WebInspector.SASSSupport.Node} cssNode + * @param {!Sass.SASSSupport.Node} cssNode */ function onNode(cssNode) { if (!valid) return; - if (!(cssNode instanceof WebInspector.SASSSupport.TextNode)) + if (!(cssNode instanceof Sass.SASSSupport.TextNode)) return; var entry = sourceMap.findEntry(cssNode.range.startLine, cssNode.range.startColumn); if (!entry || !entry.sourceURL || typeof entry.sourceLineNumber === 'undefined' || @@ -78,7 +78,7 @@ var sassNode = sassAST.findNodeForPosition(entry.sourceLineNumber, entry.sourceColumnNumber); if (!sassNode) return; - if (cssNode.parent && (cssNode.parent instanceof WebInspector.SASSSupport.Property) && + if (cssNode.parent && (cssNode.parent instanceof Sass.SASSSupport.Property) && cssNode === cssNode.parent.name && cssNode.text.trim() !== sassNode.text.trim()) { valid = false; reportError(cssNode, sassNode); @@ -88,17 +88,17 @@ } /** - * @param {!WebInspector.SASSSupport.TextNode} cssNode - * @param {!WebInspector.SASSSupport.TextNode} sassNode + * @param {!Sass.SASSSupport.TextNode} cssNode + * @param {!Sass.SASSSupport.TextNode} sassNode */ function reportError(cssNode, sassNode) { - var text = WebInspector.UIString('LiveSASS failed to start: %s', sourceMap.url()); - text += WebInspector.UIString('\nSourceMap is misaligned: %s != %s', cssNode.text.trim(), sassNode.text.trim()); + var text = Common.UIString('LiveSASS failed to start: %s', sourceMap.url()); + text += Common.UIString('\nSourceMap is misaligned: %s != %s', cssNode.text.trim(), sassNode.text.trim()); text += '\ncompiled: ' + cssNode.document.url + ':' + (cssNode.range.startLine + 1) + ':' + (cssNode.range.startColumn + 1); text += '\nsource: ' + sassNode.document.url + ':' + (sassNode.range.startLine + 1) + ':' + (sassNode.range.startColumn + 1); - WebInspector.console.error(text); + Common.console.error(text); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js b/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js index c3dfe42..2cc6587 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js +++ b/third_party/WebKit/Source/devtools/front_end/sass/SASSSupport.js
@@ -1,46 +1,46 @@ // Copyright 2015 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. -WebInspector.SASSSupport = {}; +Sass.SASSSupport = {}; /** * @param {string} url * @param {string} content - * @return {!Promise<!WebInspector.SASSSupport.AST>} + * @return {!Promise<!Sass.SASSSupport.AST>} */ -WebInspector.SASSSupport.parseSCSS = function(url, content) { - var text = new WebInspector.Text(content); - var document = new WebInspector.SASSSupport.ASTDocument(url, text); +Sass.SASSSupport.parseSCSS = function(url, content) { + var text = new Common.Text(content); + var document = new Sass.SASSSupport.ASTDocument(url, text); - return WebInspector.formatterWorkerPool.runTask('parseSCSS', {content: content}).then(onParsed); + return Common.formatterWorkerPool.runTask('parseSCSS', {content: content}).then(onParsed); /** * @param {?MessageEvent} event - * @return {!WebInspector.SASSSupport.AST} + * @return {!Sass.SASSSupport.AST} */ function onParsed(event) { if (!event) - return new WebInspector.SASSSupport.AST(document, []); + return new Sass.SASSSupport.AST(document, []); var data = /** @type {!Array<!Object>} */ (event.data); var rules = []; for (var i = 0; i < data.length; ++i) { var rulePayload = data[i]; var selectors = rulePayload.selectors.map(createTextNode); var properties = rulePayload.properties.map(createProperty); - var range = WebInspector.TextRange.fromObject(rulePayload.styleRange); - var rule = new WebInspector.SASSSupport.Rule(document, selectors, range, properties); + var range = Common.TextRange.fromObject(rulePayload.styleRange); + var rule = new Sass.SASSSupport.Rule(document, selectors, range, properties); rules.push(rule); } - return new WebInspector.SASSSupport.AST(document, rules); + return new Sass.SASSSupport.AST(document, rules); } /** * @param {!Object} payload */ function createTextNode(payload) { - var range = WebInspector.TextRange.fromObject(payload); + var range = Common.TextRange.fromObject(payload); var value = text.extract(range); - return new WebInspector.SASSSupport.TextNode(document, text.extract(range), range); + return new Sass.SASSSupport.TextNode(document, text.extract(range), range); } /** @@ -49,18 +49,18 @@ function createProperty(payload) { var name = createTextNode(payload.name); var value = createTextNode(payload.value); - return new WebInspector.SASSSupport.Property( - document, name, value, WebInspector.TextRange.fromObject(payload.range), payload.disabled); + return new Sass.SASSSupport.Property( + document, name, value, Common.TextRange.fromObject(payload.range), payload.disabled); } }; /** * @unrestricted */ -WebInspector.SASSSupport.ASTDocument = class { +Sass.SASSSupport.ASTDocument = class { /** * @param {string} url - * @param {!WebInspector.Text} text + * @param {!Common.Text} text */ constructor(url, text) { this.url = url; @@ -69,10 +69,10 @@ } /** - * @return {!WebInspector.SASSSupport.ASTDocument} + * @return {!Sass.SASSSupport.ASTDocument} */ clone() { - return new WebInspector.SASSSupport.ASTDocument(this.url, this.text); + return new Sass.SASSSupport.ASTDocument(this.url, this.text); } /** @@ -83,7 +83,7 @@ } /** - * @return {!WebInspector.Text} + * @return {!Common.Text} */ newText() { this.edits.stableSort(sequentialOrder); @@ -91,13 +91,13 @@ for (var i = this.edits.length - 1; i >= 0; --i) { var range = this.edits[i].oldRange; var newText = this.edits[i].newText; - text = new WebInspector.Text(text.replaceRange(range, newText)); + text = new Common.Text(text.replaceRange(range, newText)); } return text; /** - * @param {!WebInspector.SourceEdit} edit1 - * @param {!WebInspector.SourceEdit} edit2 + * @param {!Common.SourceEdit} edit1 + * @param {!Common.SourceEdit} edit2 * @return {number} */ function sequentialOrder(edit1, edit2) { @@ -113,9 +113,9 @@ /** * @unrestricted */ -WebInspector.SASSSupport.Node = class { +Sass.SASSSupport.Node = class { /** - * @param {!WebInspector.SASSSupport.ASTDocument} document + * @param {!Sass.SASSSupport.ASTDocument} document */ constructor(document) { this.document = document; @@ -125,11 +125,11 @@ /** * @unrestricted */ -WebInspector.SASSSupport.TextNode = class extends WebInspector.SASSSupport.Node { +Sass.SASSSupport.TextNode = class extends Sass.SASSSupport.Node { /** - * @param {!WebInspector.SASSSupport.ASTDocument} document + * @param {!Sass.SASSSupport.ASTDocument} document * @param {string} text - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range */ constructor(document, text, range) { super(document); @@ -144,20 +144,20 @@ if (this.text === newText) return; this.text = newText; - this.document.edits.push(new WebInspector.SourceEdit(this.document.url, this.range, newText)); + this.document.edits.push(new Common.SourceEdit(this.document.url, this.range, newText)); } /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @return {!WebInspector.SASSSupport.TextNode} + * @param {!Sass.SASSSupport.ASTDocument} document + * @return {!Sass.SASSSupport.TextNode} */ clone(document) { - return new WebInspector.SASSSupport.TextNode(document, this.text, this.range.clone()); + return new Sass.SASSSupport.TextNode(document, this.text, this.range.clone()); } /** - * @param {!WebInspector.SASSSupport.TextNode} other - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>=} outNodeMapping + * @param {!Sass.SASSSupport.TextNode} other + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>=} outNodeMapping * @return {boolean} */ match(other, outNodeMapping) { @@ -172,12 +172,12 @@ /** * @unrestricted */ -WebInspector.SASSSupport.Property = class extends WebInspector.SASSSupport.Node { +Sass.SASSSupport.Property = class extends Sass.SASSSupport.Node { /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @param {!WebInspector.SASSSupport.TextNode} name - * @param {!WebInspector.SASSSupport.TextNode} value - * @param {!WebInspector.TextRange} range + * @param {!Sass.SASSSupport.ASTDocument} document + * @param {!Sass.SASSSupport.TextNode} name + * @param {!Sass.SASSSupport.TextNode} value + * @param {!Common.TextRange} range * @param {boolean} disabled */ constructor(document, name, value, range, disabled) { @@ -191,16 +191,16 @@ } /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @return {!WebInspector.SASSSupport.Property} + * @param {!Sass.SASSSupport.ASTDocument} document + * @return {!Sass.SASSSupport.Property} */ clone(document) { - return new WebInspector.SASSSupport.Property( + return new Sass.SASSSupport.Property( document, this.name.clone(document), this.value.clone(document), this.range.clone(), this.disabled); } /** - * @param {function(!WebInspector.SASSSupport.Node)} callback + * @param {function(!Sass.SASSSupport.Node)} callback */ visit(callback) { callback(this); @@ -209,8 +209,8 @@ } /** - * @param {!WebInspector.SASSSupport.Property} other - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>=} outNodeMapping + * @param {!Sass.SASSSupport.Property} other + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>=} outNodeMapping * @return {boolean} */ match(other, outNodeMapping) { @@ -229,23 +229,23 @@ return; this.disabled = disabled; if (disabled) { - var oldRange1 = WebInspector.TextRange.createFromLocation(this.range.startLine, this.range.startColumn); - var edit1 = new WebInspector.SourceEdit(this.document.url, oldRange1, '/* '); - var oldRange2 = WebInspector.TextRange.createFromLocation(this.range.endLine, this.range.endColumn); - var edit2 = new WebInspector.SourceEdit(this.document.url, oldRange2, ' */'); + var oldRange1 = Common.TextRange.createFromLocation(this.range.startLine, this.range.startColumn); + var edit1 = new Common.SourceEdit(this.document.url, oldRange1, '/* '); + var oldRange2 = Common.TextRange.createFromLocation(this.range.endLine, this.range.endColumn); + var edit2 = new Common.SourceEdit(this.document.url, oldRange2, ' */'); this.document.edits.push(edit1, edit2); return; } - var oldRange1 = new WebInspector.TextRange( + var oldRange1 = new Common.TextRange( this.range.startLine, this.range.startColumn, this.range.startLine, this.name.range.startColumn); - var edit1 = new WebInspector.SourceEdit(this.document.url, oldRange1, ''); + var edit1 = new Common.SourceEdit(this.document.url, oldRange1, ''); var propertyText = this.document.text.extract(this.range); var endsWithSemicolon = propertyText.slice(0, -2).trim().endsWith(';'); - var oldRange2 = new WebInspector.TextRange( + var oldRange2 = new Common.TextRange( this.range.endLine, this.value.range.endColumn + (endsWithSemicolon ? 1 : 0), this.range.endLine, this.range.endColumn); - var edit2 = new WebInspector.SourceEdit(this.document.url, oldRange2, ''); + var edit2 = new Common.SourceEdit(this.document.url, oldRange2, ''); this.document.edits.push(edit1, edit2); } @@ -256,25 +256,25 @@ rule.properties.splice(index, 1); this.parent = null; - var lineRange = new WebInspector.TextRange(this.range.startLine, 0, this.range.endLine + 1, 0); + var lineRange = new Common.TextRange(this.range.startLine, 0, this.range.endLine + 1, 0); var oldRange; if (this.document.text.extract(lineRange).trim() === this.document.text.extract(this.range).trim()) oldRange = lineRange; else oldRange = this.range; - this.document.edits.push(new WebInspector.SourceEdit(this.document.url, oldRange, '')); + this.document.edits.push(new Common.SourceEdit(this.document.url, oldRange, '')); } }; /** * @unrestricted */ -WebInspector.SASSSupport.Rule = class extends WebInspector.SASSSupport.Node { +Sass.SASSSupport.Rule = class extends Sass.SASSSupport.Node { /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @param {!Array<!WebInspector.SASSSupport.TextNode>} selectors - * @param {!WebInspector.TextRange} styleRange - * @param {!Array<!WebInspector.SASSSupport.Property>} properties + * @param {!Sass.SASSSupport.ASTDocument} document + * @param {!Array<!Sass.SASSSupport.TextNode>} selectors + * @param {!Common.TextRange} styleRange + * @param {!Array<!Sass.SASSSupport.Property>} properties */ constructor(document, selectors, styleRange, properties) { super(document); @@ -285,7 +285,7 @@ var blockStartRange = styleRange.collapseToStart(); blockStartRange.startColumn -= 1; this.blockStart = - new WebInspector.SASSSupport.TextNode(document, this.document.text.extract(blockStartRange), blockStartRange); + new Sass.SASSSupport.TextNode(document, this.document.text.extract(blockStartRange), blockStartRange); this.blockStart.parent = this; for (var i = 0; i < this.properties.length; ++i) @@ -296,8 +296,8 @@ } /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @return {!WebInspector.SASSSupport.Rule} + * @param {!Sass.SASSSupport.ASTDocument} document + * @return {!Sass.SASSSupport.Rule} */ clone(document) { var properties = []; @@ -306,11 +306,11 @@ var selectors = []; for (var i = 0; i < this.selectors.length; ++i) selectors.push(this.selectors[i].clone(document)); - return new WebInspector.SASSSupport.Rule(document, selectors, this.styleRange.clone(), properties); + return new Sass.SASSSupport.Rule(document, selectors, this.styleRange.clone(), properties); } /** - * @param {function(!WebInspector.SASSSupport.Node)} callback + * @param {function(!Sass.SASSSupport.Node)} callback */ visit(callback) { callback(this); @@ -322,8 +322,8 @@ } /** - * @param {!WebInspector.SASSSupport.Rule} other - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>=} outNodeMapping + * @param {!Sass.SASSSupport.Rule} other + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>=} outNodeMapping * @return {boolean} */ match(other, outNodeMapping) { @@ -346,15 +346,15 @@ return; this._hasTrailingSemicolon = true; this.document.edits.push( - new WebInspector.SourceEdit(this.document.url, this.properties.peekLast().range.collapseToEnd(), ';')); + new Common.SourceEdit(this.document.url, this.properties.peekLast().range.collapseToEnd(), ';')); } /** - * @param {?WebInspector.SASSSupport.Property} anchorProperty + * @param {?Sass.SASSSupport.Property} anchorProperty * @param {!Array<string>} nameTexts * @param {!Array<string>} valueTexts * @param {!Array<boolean>} disabledStates - * @return {!Array<!WebInspector.SASSSupport.Property>} + * @return {!Array<!Sass.SASSSupport.Property>} */ insertProperties(anchorProperty, nameTexts, valueTexts, disabledStates) { console.assert( @@ -370,12 +370,12 @@ var disabled = disabledStates[i]; this.document.edits.push(this._insertPropertyEdit(anchorProperty, nameText, valueText, disabled)); - var name = new WebInspector.SASSSupport.TextNode( - this.document, nameText, WebInspector.TextRange.createFromLocation(0, 0)); - var value = new WebInspector.SASSSupport.TextNode( - this.document, valueText, WebInspector.TextRange.createFromLocation(0, 0)); - var newProperty = new WebInspector.SASSSupport.Property( - this.document, name, value, WebInspector.TextRange.createFromLocation(0, 0), disabled); + var name = new Sass.SASSSupport.TextNode( + this.document, nameText, Common.TextRange.createFromLocation(0, 0)); + var value = new Sass.SASSSupport.TextNode( + this.document, valueText, Common.TextRange.createFromLocation(0, 0)); + var newProperty = new Sass.SASSSupport.Property( + this.document, name, value, Common.TextRange.createFromLocation(0, 0), disabled); this.properties.splice(index + i + 1, 0, newProperty); newProperty.parent = this; @@ -385,11 +385,11 @@ } /** - * @param {?WebInspector.SASSSupport.Property} anchorProperty + * @param {?Sass.SASSSupport.Property} anchorProperty * @param {string} nameText * @param {string} valueText * @param {boolean} disabled - * @return {!WebInspector.SourceEdit} + * @return {!Common.SourceEdit} */ _insertPropertyEdit(anchorProperty, nameText, valueText, disabled) { var anchorRange = anchorProperty ? anchorProperty.range : this.blockStart.range; @@ -397,7 +397,7 @@ var leftComment = disabled ? '/* ' : ''; var rightComment = disabled ? ' */' : ''; var newText = String.sprintf('\n%s%s%s: %s;%s', indent, leftComment, nameText, valueText, rightComment); - return new WebInspector.SourceEdit(this.document.url, anchorRange.collapseToEnd(), newText); + return new Common.SourceEdit(this.document.url, anchorRange.collapseToEnd(), newText); } /** @@ -407,13 +407,13 @@ var indentProperty = this.properties.find(property => !property.range.isEmpty()); var result = ''; if (indentProperty) { - result = this.document.text.extract(new WebInspector.TextRange( + result = this.document.text.extract(new Common.TextRange( indentProperty.range.startLine, 0, indentProperty.range.startLine, indentProperty.range.startColumn)); } else { var lineNumber = this.blockStart.range.startLine; var columnNumber = this.blockStart.range.startColumn; - var baseLine = this.document.text.extract(new WebInspector.TextRange(lineNumber, 0, lineNumber, columnNumber)); - result = WebInspector.TextUtils.lineIndent(baseLine) + WebInspector.moduleSetting('textEditorIndent').get(); + var baseLine = this.document.text.extract(new Common.TextRange(lineNumber, 0, lineNumber, columnNumber)); + result = Common.TextUtils.lineIndent(baseLine) + Common.moduleSetting('textEditorIndent').get(); } return result.isWhitespace() ? result : ''; } @@ -422,10 +422,10 @@ /** * @unrestricted */ -WebInspector.SASSSupport.AST = class extends WebInspector.SASSSupport.Node { +Sass.SASSSupport.AST = class extends Sass.SASSSupport.Node { /** - * @param {!WebInspector.SASSSupport.ASTDocument} document - * @param {!Array<!WebInspector.SASSSupport.Rule>} rules + * @param {!Sass.SASSSupport.ASTDocument} document + * @param {!Array<!Sass.SASSSupport.Rule>} rules */ constructor(document, rules) { super(document); @@ -435,19 +435,19 @@ } /** - * @return {!WebInspector.SASSSupport.AST} + * @return {!Sass.SASSSupport.AST} */ clone() { var document = this.document.clone(); var rules = []; for (var i = 0; i < this.rules.length; ++i) rules.push(this.rules[i].clone(document)); - return new WebInspector.SASSSupport.AST(document, rules); + return new Sass.SASSSupport.AST(document, rules); } /** - * @param {!WebInspector.SASSSupport.AST} other - * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.Node>=} outNodeMapping + * @param {!Sass.SASSSupport.AST} other + * @param {!Map<!Sass.SASSSupport.Node, !Sass.SASSSupport.Node>=} outNodeMapping * @return {boolean} */ match(other, outNodeMapping) { @@ -464,7 +464,7 @@ } /** - * @param {function(!WebInspector.SASSSupport.Node)} callback + * @param {function(!Sass.SASSSupport.Node)} callback */ visit(callback) { callback(this); @@ -475,7 +475,7 @@ /** * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.SASSSupport.TextNode} + * @return {?Sass.SASSSupport.TextNode} */ findNodeForPosition(lineNumber, columnNumber) { this._ensureNodePositionsIndex(); @@ -487,7 +487,7 @@ /** * @param {!{lineNumber: number, columnNumber: number}} position - * @param {!WebInspector.SASSSupport.TextNode} textNode + * @param {!Sass.SASSSupport.TextNode} textNode * @return {number} */ function nodeComparator(position, textNode) { @@ -503,28 +503,28 @@ this._sortedTextNodes.sort(nodeComparator); /** - * @param {!WebInspector.SASSSupport.Node} node - * @this {WebInspector.SASSSupport.AST} + * @param {!Sass.SASSSupport.Node} node + * @this {Sass.SASSSupport.AST} */ function onNode(node) { - if (!(node instanceof WebInspector.SASSSupport.TextNode)) + if (!(node instanceof Sass.SASSSupport.TextNode)) return; this._sortedTextNodes.push(node); } /** - * @param {!WebInspector.SASSSupport.TextNode} text1 - * @param {!WebInspector.SASSSupport.TextNode} text2 + * @param {!Sass.SASSSupport.TextNode} text1 + * @param {!Sass.SASSSupport.TextNode} text2 * @return {number} */ function nodeComparator(text1, text2) { - return WebInspector.TextRange.comparator(text1.range, text2.range); + return Common.TextRange.comparator(text1.range, text2.range); } } }; /** @enum {string} */ -WebInspector.SASSSupport.PropertyChangeType = { +Sass.SASSSupport.PropertyChangeType = { PropertyAdded: 'PropertyAdded', PropertyRemoved: 'PropertyRemoved', PropertyToggled: 'PropertyToggled', @@ -535,11 +535,11 @@ /** * @unrestricted */ -WebInspector.SASSSupport.PropertyChange = class { +Sass.SASSSupport.PropertyChange = class { /** - * @param {!WebInspector.SASSSupport.PropertyChangeType} type - * @param {!WebInspector.SASSSupport.Rule} oldRule - * @param {!WebInspector.SASSSupport.Rule} newRule + * @param {!Sass.SASSSupport.PropertyChangeType} type + * @param {!Sass.SASSSupport.Rule} oldRule + * @param {!Sass.SASSSupport.Rule} newRule * @param {number} oldPropertyIndex * @param {number} newPropertyIndex */ @@ -552,14 +552,14 @@ } /** - * @return {?WebInspector.SASSSupport.Property} + * @return {?Sass.SASSSupport.Property} */ oldProperty() { return this.oldRule.properties[this.oldPropertyIndex] || null; } /** - * @return {?WebInspector.SASSSupport.Property} + * @return {?Sass.SASSSupport.Property} */ newProperty() { return this.newRule.properties[this.newPropertyIndex] || null; @@ -569,13 +569,13 @@ /** * @unrestricted */ -WebInspector.SASSSupport.ASTDiff = class { +Sass.SASSSupport.ASTDiff = class { /** * @param {string} url - * @param {!WebInspector.SASSSupport.AST} oldAST - * @param {!WebInspector.SASSSupport.AST} newAST - * @param {!Map<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} mapping - * @param {!Array<!WebInspector.SASSSupport.PropertyChange>} changes + * @param {!Sass.SASSSupport.AST} oldAST + * @param {!Sass.SASSSupport.AST} newAST + * @param {!Map<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} mapping + * @param {!Array<!Sass.SASSSupport.PropertyChange>} changes */ constructor(url, oldAST, newAST, mapping, changes) { this.url = url; @@ -587,40 +587,40 @@ }; /** - * @param {!WebInspector.SASSSupport.AST} oldAST - * @param {!WebInspector.SASSSupport.AST} newAST - * @return {!WebInspector.SASSSupport.ASTDiff} + * @param {!Sass.SASSSupport.AST} oldAST + * @param {!Sass.SASSSupport.AST} newAST + * @return {!Sass.SASSSupport.ASTDiff} */ -WebInspector.SASSSupport.diffModels = function(oldAST, newAST) { +Sass.SASSSupport.diffModels = function(oldAST, newAST) { console.assert(oldAST.rules.length === newAST.rules.length, 'Not implemented for rule diff.'); console.assert(oldAST.document.url === newAST.document.url, 'Diff makes sense for models with the same url.'); - var T = WebInspector.SASSSupport.PropertyChangeType; + var T = Sass.SASSSupport.PropertyChangeType; var changes = []; - /** @type {!Map<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} */ + /** @type {!Map<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} */ var mapping = new Map(); for (var i = 0; i < oldAST.rules.length; ++i) { var oldRule = oldAST.rules[i]; var newRule = newAST.rules[i]; computeRuleDiff(mapping, oldRule, newRule); } - return new WebInspector.SASSSupport.ASTDiff(oldAST.document.url, oldAST, newAST, mapping, changes); + return new Sass.SASSSupport.ASTDiff(oldAST.document.url, oldAST, newAST, mapping, changes); /** - * @param {!WebInspector.SASSSupport.PropertyChangeType} type - * @param {!WebInspector.SASSSupport.Rule} oldRule - * @param {!WebInspector.SASSSupport.Rule} newRule + * @param {!Sass.SASSSupport.PropertyChangeType} type + * @param {!Sass.SASSSupport.Rule} oldRule + * @param {!Sass.SASSSupport.Rule} newRule * @param {number} oldPropertyIndex * @param {number} newPropertyIndex */ function addChange(type, oldRule, newRule, oldPropertyIndex, newPropertyIndex) { changes.push( - new WebInspector.SASSSupport.PropertyChange(type, oldRule, newRule, oldPropertyIndex, newPropertyIndex)); + new Sass.SASSSupport.PropertyChange(type, oldRule, newRule, oldPropertyIndex, newPropertyIndex)); } /** - * @param {!Map<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} mapping - * @param {!WebInspector.SASSSupport.Rule} oldRule - * @param {!WebInspector.SASSSupport.Rule} newRule + * @param {!Map<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} mapping + * @param {!Sass.SASSSupport.Rule} oldRule + * @param {!Sass.SASSSupport.Rule} newRule */ function computeRuleDiff(mapping, oldRule, newRule) { var oldLines = []; @@ -629,16 +629,16 @@ var newLines = []; for (var i = 0; i < newRule.properties.length; ++i) newLines.push(newRule.properties[i].name.text.trim() + ':' + newRule.properties[i].value.text.trim()); - var diff = WebInspector.Diff.lineDiff(oldLines, newLines); - diff = WebInspector.Diff.convertToEditDiff(diff); + var diff = Diff.Diff.lineDiff(oldLines, newLines); + diff = Diff.Diff.convertToEditDiff(diff); var p1 = 0, p2 = 0; for (var i = 0; i < diff.length; ++i) { var token = diff[i]; - if (token[0] === WebInspector.Diff.Operation.Delete) { + if (token[0] === Diff.Diff.Operation.Delete) { for (var j = 0; j < token[1]; ++j) addChange(T.PropertyRemoved, oldRule, newRule, p1++, p2); - } else if (token[0] === WebInspector.Diff.Operation.Insert) { + } else if (token[0] === Diff.Diff.Operation.Insert) { for (var j = 0; j < token[1]; ++j) addChange(T.PropertyAdded, oldRule, newRule, p1, p2++); } else { @@ -649,9 +649,9 @@ } /** - * @param {!Map<!WebInspector.SASSSupport.TextNode, !WebInspector.SASSSupport.TextNode>} mapping - * @param {!WebInspector.SASSSupport.Rule} oldRule - * @param {!WebInspector.SASSSupport.Rule} newRule + * @param {!Map<!Sass.SASSSupport.TextNode, !Sass.SASSSupport.TextNode>} mapping + * @param {!Sass.SASSSupport.Rule} oldRule + * @param {!Sass.SASSSupport.Rule} newRule * @param {number} oldPropertyIndex * @param {number} newPropertyIndex */
diff --git a/third_party/WebKit/Source/devtools/front_end/sass/module.json b/third_party/WebKit/Source/devtools/front_end/sass/module.json index b4983d2..6777bc4 100644 --- a/third_party/WebKit/Source/devtools/front_end/sass/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sass/module.json
@@ -9,8 +9,8 @@ ], "extensions": [ { - "type": "@WebInspector.SourceMapFactory", - "className": "WebInspector.SASSSourceMapFactory", + "type": "@SDK.SourceMapFactory", + "className": "Sass.SASSSourceMapFactory", "experiment": "liveSASS", "extensions": [ "scss"
diff --git a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js index cd36101e..c0ed3349 100644 --- a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js +++ b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js
@@ -2,27 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.App} - * @implements {WebInspector.TargetManager.Observer} + * @implements {Common.App} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ScreencastApp = class { +Screencast.ScreencastApp = class { constructor() { - this._enabledSetting = WebInspector.settings.createSetting('screencastEnabled', true); + this._enabledSetting = Common.settings.createSetting('screencastEnabled', true); this._toggleButton = - new WebInspector.ToolbarToggle(WebInspector.UIString('Toggle screencast'), 'largeicon-phone'); + new UI.ToolbarToggle(Common.UIString('Toggle screencast'), 'largeicon-phone'); this._toggleButton.setToggled(this._enabledSetting.get()); this._toggleButton.addEventListener('click', this._toggleButtonClicked, this); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** - * @return {!WebInspector.ScreencastApp} + * @return {!Screencast.ScreencastApp} */ static _instance() { - if (!WebInspector.ScreencastApp._appInstance) - WebInspector.ScreencastApp._appInstance = new WebInspector.ScreencastApp(); - return WebInspector.ScreencastApp._appInstance; + if (!Screencast.ScreencastApp._appInstance) + Screencast.ScreencastApp._appInstance = new Screencast.ScreencastApp(); + return Screencast.ScreencastApp._appInstance; } /** @@ -30,31 +30,31 @@ * @param {!Document} document */ presentUI(document) { - var rootView = new WebInspector.RootView(); + var rootView = new UI.RootView(); this._rootSplitWidget = - new WebInspector.SplitWidget(false, true, 'InspectorView.screencastSplitViewState', 300, 300); + new UI.SplitWidget(false, true, 'InspectorView.screencastSplitViewState', 300, 300); this._rootSplitWidget.setVertical(true); this._rootSplitWidget.setSecondIsSidebar(true); this._rootSplitWidget.show(rootView.element); this._rootSplitWidget.hideMain(); - this._rootSplitWidget.setSidebarWidget(WebInspector.inspectorView); + this._rootSplitWidget.setSidebarWidget(UI.inspectorView); rootView.attachToDocument(document); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._target) return; this._target = target; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) { - this._screencastView = new WebInspector.ScreencastView(target, resourceTreeModel); + this._screencastView = new Screencast.ScreencastView(target, resourceTreeModel); this._rootSplitWidget.setMainWidget(this._screencastView); this._screencastView.initialize(); } else { @@ -65,7 +65,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (this._target === target) { @@ -97,34 +97,34 @@ } }; -/** @type {!WebInspector.ScreencastApp} */ -WebInspector.ScreencastApp._appInstance; +/** @type {!Screencast.ScreencastApp} */ +Screencast.ScreencastApp._appInstance; /** - * @implements {WebInspector.ToolbarItem.Provider} + * @implements {UI.ToolbarItem.Provider} * @unrestricted */ -WebInspector.ScreencastApp.ToolbarButtonProvider = class { +Screencast.ScreencastApp.ToolbarButtonProvider = class { /** * @override - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item() { - return WebInspector.ScreencastApp._instance()._toggleButton; + return Screencast.ScreencastApp._instance()._toggleButton; } }; /** - * @implements {WebInspector.AppProvider} + * @implements {Common.AppProvider} * @unrestricted */ -WebInspector.ScreencastAppProvider = class { +Screencast.ScreencastAppProvider = class { /** * @override - * @return {!WebInspector.App} + * @return {!Common.App} */ createApp() { - return WebInspector.ScreencastApp._instance(); + return Screencast.ScreencastApp._instance(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js index 4bf1ff8..509a78ec 100644 --- a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js +++ b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
@@ -28,18 +28,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.DOMNodeHighlighter} + * @implements {SDK.DOMNodeHighlighter} * @unrestricted */ -WebInspector.ScreencastView = class extends WebInspector.VBox { +Screencast.ScreencastView = class extends UI.VBox { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.Target} target + * @param {!SDK.ResourceTreeModel} resourceTreeModel */ constructor(target, resourceTreeModel) { super(); this._target = target; - this._domModel = WebInspector.DOMModel.fromTarget(target); + this._domModel = SDK.DOMModel.fromTarget(target); this._resourceTreeModel = resourceTreeModel; this.setMinimumSize(150, 150); @@ -87,16 +87,16 @@ this._checkerboardPattern = this._createCheckerboardPattern(this._context); this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); - this._shortcuts[WebInspector.KeyboardShortcut.makeKey('l', WebInspector.KeyboardShortcut.Modifiers.Ctrl)] = + this._shortcuts[UI.KeyboardShortcut.makeKey('l', UI.KeyboardShortcut.Modifiers.Ctrl)] = this._focusNavigationBar.bind(this); this._resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.ScreencastFrame, this._screencastFrame, this); + SDK.ResourceTreeModel.Events.ScreencastFrame, this._screencastFrame, this); this._resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.ScreencastVisibilityChanged, this._screencastVisibilityChanged, this); + SDK.ResourceTreeModel.Events.ScreencastVisibilityChanged, this._screencastVisibilityChanged, this); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChange, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChange, this); this._updateGlasspane(); } @@ -115,7 +115,7 @@ } _startCasting() { - if (WebInspector.targetManager.allTargetsSuspended()) + if (SDK.targetManager.allTargetsSuspended()) return; if (this._isCasting) return; @@ -145,7 +145,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _screencastFrame(event) { var metadata = /** type {Protocol.Page.ScreencastFrameMetadata} */ (event.data.metadata); @@ -163,7 +163,7 @@ dimensionsCSS.width / this._imageElement.naturalWidth, dimensionsCSS.height / (this._imageElement.naturalWidth * deviceSizeRatio)); this._viewportElement.classList.remove('hidden'); - var bordersSize = WebInspector.ScreencastView._bordersSize; + var bordersSize = Screencast.ScreencastView._bordersSize; if (this._imageZoom < 1.01 / window.devicePixelRatio) this._imageZoom = 1 / window.devicePixelRatio; this._screenZoom = this._imageElement.naturalWidth * this._imageZoom / metadata.deviceWidth; @@ -178,7 +178,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _screencastVisibilityChanged(event) { this._targetInactive = !event.data.visible; @@ -186,10 +186,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSuspendStateChange(event) { - if (WebInspector.targetManager.allTargetsSuspended()) + if (SDK.targetManager.allTargetsSuspended()) this._stopCasting(); else this._startCasting(); @@ -198,10 +198,10 @@ _updateGlasspane() { if (this._targetInactive) { - this._glassPaneElement.textContent = WebInspector.UIString('The tab is inactive'); + this._glassPaneElement.textContent = Common.UIString('The tab is inactive'); this._glassPaneElement.classList.remove('hidden'); - } else if (WebInspector.targetManager.allTargetsSuspended()) { - this._glassPaneElement.textContent = WebInspector.UIString('Profiling in progress'); + } else if (SDK.targetManager.allTargetsSuspended()) { + this._glassPaneElement.textContent = Common.UIString('Profiling in progress'); this._glassPaneElement.classList.remove('hidden'); } else { this._glassPaneElement.classList.add('hidden'); @@ -234,8 +234,8 @@ position.y / this._pageScaleFactor + this._scrollOffsetY, callback.bind(this)); /** - * @param {?WebInspector.DOMNode} node - * @this {WebInspector.ScreencastView} + * @param {?SDK.DOMNode} node + * @this {Screencast.ScreencastView} */ function callback(node) { if (!node) @@ -244,7 +244,7 @@ this.highlightDOMNode(node, this._inspectModeConfig); this._domModel.nodeHighlightRequested(node.id); } else if (event.type === 'click') { - WebInspector.Revealer.reveal(node); + Common.Revealer.reveal(node); } } } @@ -258,7 +258,7 @@ return; } - var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(/** @type {!KeyboardEvent} */ (event)); + var shortcutKey = UI.KeyboardShortcut.makeKeyFromEvent(/** @type {!KeyboardEvent} */ (event)); var handler = this._shortcuts[shortcutKey]; if (handler && handler(event)) { event.consume(); @@ -416,7 +416,7 @@ /** * @override - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {?Protocol.DOM.HighlightConfig} config * @param {!Protocol.DOM.BackendNodeId=} backendNodeId * @param {!Protocol.Runtime.RemoteObjectId=} objectId @@ -438,7 +438,7 @@ /** * @param {?Protocol.DOM.BoxModel} model - * @this {WebInspector.ScreencastView} + * @this {Screencast.ScreencastView} */ function callback(model) { if (!model || !this._pageScaleFactor) { @@ -458,7 +458,7 @@ _scaleModel(model) { /** * @param {!Protocol.DOM.Quad} quad - * @this {WebInspector.ScreencastView} + * @this {Screencast.ScreencastView} */ function scaleQuad(quad) { for (var i = 0; i < quad.length; i += 2) { @@ -532,7 +532,7 @@ _cssColor(color) { if (!color) return 'transparent'; - return WebInspector.Color.fromRGBA([color.r, color.g, color.b, color.a]).asString(WebInspector.Color.Format.RGBA) || + return Common.Color.fromRGBA([color.r, color.g, color.b, color.a]).asString(Common.Color.Format.RGBA) || ''; } @@ -662,9 +662,9 @@ */ _viewportDimensions() { const gutterSize = 30; - const bordersSize = WebInspector.ScreencastView._bordersSize; + const bordersSize = Screencast.ScreencastView._bordersSize; var width = this.element.offsetWidth - bordersSize - gutterSize; - var height = this.element.offsetHeight - bordersSize - gutterSize - WebInspector.ScreencastView._navBarHeight; + var height = this.element.offsetHeight - bordersSize - gutterSize - Screencast.ScreencastView._navBarHeight; return {width: width, height: height}; } @@ -725,11 +725,11 @@ this._navigationUrl.addEventListener('keyup', this._navigationUrlKeyUp.bind(this), true); this._navigationProgressBar = - new WebInspector.ScreencastView.ProgressTracker(this._navigationBar.createChild('div', 'progress')); + new Screencast.ScreencastView.ProgressTracker(this._navigationBar.createChild('div', 'progress')); this._requestNavigationHistory(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.InspectedURLChanged, this._requestNavigationHistory, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.InspectedURLChanged, this._requestNavigationHistory, this); } _navigateToHistoryEntry(offset) { @@ -750,7 +750,7 @@ var url = this._navigationUrl.value; if (!url) return; - if (!url.match(WebInspector.ScreencastView._SchemeRegex)) + if (!url.match(Screencast.ScreencastView._SchemeRegex)) url = 'http://' + url; this._target.pageAgent().navigate(url); this._canvasElement.focus(); @@ -771,7 +771,7 @@ this._navigationForward.disabled = currentIndex === (entries.length - 1); var url = entries[currentIndex].url; - var match = url.match(WebInspector.ScreencastView._HttpRegex); + var match = url.match(Screencast.ScreencastView._HttpRegex); if (match) url = match[1]; InspectorFrontendHost.inspectedURLChanged(url); @@ -785,33 +785,33 @@ } }; -WebInspector.ScreencastView._bordersSize = 44; +Screencast.ScreencastView._bordersSize = 44; -WebInspector.ScreencastView._navBarHeight = 29; +Screencast.ScreencastView._navBarHeight = 29; -WebInspector.ScreencastView._HttpRegex = /^http:\/\/(.+)/; +Screencast.ScreencastView._HttpRegex = /^http:\/\/(.+)/; -WebInspector.ScreencastView._SchemeRegex = /^(https?|about|chrome):/; +Screencast.ScreencastView._SchemeRegex = /^(https?|about|chrome):/; /** * @unrestricted */ -WebInspector.ScreencastView.ProgressTracker = class { +Screencast.ScreencastView.ProgressTracker = class { /** * @param {!Element} element */ constructor(element) { this._element = element; - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.MainFrameNavigated, + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated, this); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.Load, this._onLoad, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); - WebInspector.targetManager.addModelListener( - WebInspector.NetworkManager, WebInspector.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._onLoad, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); + SDK.targetManager.addModelListener( + SDK.NetworkManager, SDK.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); } _onMainFrameNavigated() { @@ -838,9 +838,9 @@ _onRequestStarted(event) { if (!this._navigationProgressVisible()) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway. - if (request.type === WebInspector.resourceTypes.WebSocket) + if (request.type === Common.resourceTypes.WebSocket) return; this._requestIds[request.requestId] = request; ++this._startedRequests; @@ -849,7 +849,7 @@ _onRequestFinished(event) { if (!this._navigationProgressVisible()) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); if (!(request.requestId in this._requestIds)) return; ++this._finishedRequests;
diff --git a/third_party/WebKit/Source/devtools/front_end/screencast/module.json b/third_party/WebKit/Source/devtools/front_end/screencast/module.json index e2d451f..82a01226 100644 --- a/third_party/WebKit/Source/devtools/front_end/screencast/module.json +++ b/third_party/WebKit/Source/devtools/front_end/screencast/module.json
@@ -1,13 +1,13 @@ { "extensions": [ { - "type": "@WebInspector.AppProvider", - "className": "WebInspector.ScreencastAppProvider", + "type": "@Common.AppProvider", + "className": "Screencast.ScreencastAppProvider", "order": 1 }, { - "type": "@WebInspector.ToolbarItem.Provider", - "className": "WebInspector.ScreencastApp.ToolbarButtonProvider", + "type": "@UI.ToolbarItem.Provider", + "className": "Screencast.ScreencastApp.ToolbarButtonProvider", "order": 1, "location": "main-toolbar-left" },
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js index 59d7398..0252af47 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js
@@ -29,21 +29,21 @@ /** * @unrestricted */ -WebInspector.ApplicationCacheModel = class extends WebInspector.SDKModel { +SDK.ApplicationCacheModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel + * @param {!SDK.Target} target + * @param {!SDK.ResourceTreeModel} resourceTreeModel */ constructor(target, resourceTreeModel) { - super(WebInspector.ApplicationCacheModel, target); + super(SDK.ApplicationCacheModel, target); - target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher(this)); + target.registerApplicationCacheDispatcher(new SDK.ApplicationCacheDispatcher(this)); this._agent = target.applicationCacheAgent(); this._agent.enable(); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); + SDK.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); this._statuses = {}; this._manifestURLsByFrame = {}; @@ -53,15 +53,15 @@ } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.ApplicationCacheModel} + * @param {!SDK.Target} target + * @return {?SDK.ApplicationCacheModel} */ static fromTarget(target) { - return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebInspector.ApplicationCacheModel)); + return /** @type {?SDK.ApplicationCacheModel} */ (target.model(SDK.ApplicationCacheModel)); } _frameNavigated(event) { - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); if (frame.isMainFrame()) { this._mainFrameNavigated(); return; @@ -71,17 +71,17 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _frameDetached(event) { - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); this._frameManifestRemoved(frame.id); } reset() { this._statuses = {}; this._manifestURLsByFrame = {}; - this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.FrameManifestsReset); + this.dispatchEventToListeners(SDK.ApplicationCacheModel.Events.FrameManifestsReset); } _mainFrameNavigated() { @@ -140,11 +140,11 @@ if (!this._manifestURLsByFrame[frameId]) { this._manifestURLsByFrame[frameId] = manifestURL; - this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.FrameManifestAdded, frameId); + this.dispatchEventToListeners(SDK.ApplicationCacheModel.Events.FrameManifestAdded, frameId); } if (statusChanged) - this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.FrameManifestStatusUpdated, frameId); + this.dispatchEventToListeners(SDK.ApplicationCacheModel.Events.FrameManifestStatusUpdated, frameId); } /** @@ -157,7 +157,7 @@ delete this._manifestURLsByFrame[frameId]; delete this._statuses[frameId]; - this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.FrameManifestRemoved, frameId); + this.dispatchEventToListeners(SDK.ApplicationCacheModel.Events.FrameManifestRemoved, frameId); } /** @@ -219,12 +219,12 @@ */ _networkStateUpdated(isNowOnline) { this._onLine = isNowOnline; - this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.NetworkStateChanged, isNowOnline); + this.dispatchEventToListeners(SDK.ApplicationCacheModel.Events.NetworkStateChanged, isNowOnline); } }; /** @enum {symbol} */ -WebInspector.ApplicationCacheModel.Events = { +SDK.ApplicationCacheModel.Events = { FrameManifestStatusUpdated: Symbol('FrameManifestStatusUpdated'), FrameManifestAdded: Symbol('FrameManifestAdded'), FrameManifestRemoved: Symbol('FrameManifestRemoved'), @@ -236,7 +236,7 @@ * @implements {Protocol.ApplicationCacheDispatcher} * @unrestricted */ -WebInspector.ApplicationCacheDispatcher = class { +SDK.ApplicationCacheDispatcher = class { constructor(applicationCacheModel) { this._applicationCacheModel = applicationCacheModel; }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js index 3047ee6b..fc16787b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.CPUProfileNode = class extends WebInspector.ProfileNode { +SDK.CPUProfileNode = class extends SDK.ProfileNode { /** * @param {!Protocol.Profiler.ProfileNode} node * @param {number} sampleTime @@ -30,7 +30,7 @@ /** * @unrestricted */ -WebInspector.CPUProfileDataModel = class extends WebInspector.ProfileTreeModel { +SDK.CPUProfileDataModel = class extends SDK.ProfileTreeModel { /** * @param {!Protocol.Profiler.Profile} profile */ @@ -101,7 +101,7 @@ /** * @param {!Array<!Protocol.Profiler.ProfileNode>} nodes - * @return {!WebInspector.CPUProfileNode} + * @return {!SDK.CPUProfileNode} */ _translateProfileTree(nodes) { /** @@ -138,11 +138,11 @@ buildChildrenFromParents(nodes); this.totalHitCount = nodes.reduce((acc, node) => acc + node.hitCount, 0); var sampleTime = (this.profileEndTime - this.profileStartTime) / this.totalHitCount; - var keepNatives = !!WebInspector.moduleSetting('showNativeFunctionsInJSProfile').get(); + var keepNatives = !!Common.moduleSetting('showNativeFunctionsInJSProfile').get(); var root = nodes[0]; /** @type {!Map<number, number>} */ var idMap = new Map([[root.id, root.id]]); - var resultRoot = new WebInspector.CPUProfileNode(root, sampleTime); + var resultRoot = new SDK.CPUProfileNode(root, sampleTime); var parentNodeStack = root.children.map(() => resultRoot); var sourceNodeStack = root.children.map(id => nodeByIdMap.get(id)); while (sourceNodeStack.length) { @@ -150,7 +150,7 @@ var sourceNode = sourceNodeStack.pop(); if (!sourceNode.children) sourceNode.children = []; - var targetNode = new WebInspector.CPUProfileNode(sourceNode, sampleTime); + var targetNode = new SDK.CPUProfileNode(sourceNode, sampleTime); if (keepNatives || !isNativeNode(sourceNode)) { parentNode.children.push(targetNode); parentNode = targetNode; @@ -218,7 +218,7 @@ } _buildIdToNodeMap() { - /** @type {!Map<number, !WebInspector.CPUProfileNode>} */ + /** @type {!Map<number, !SDK.CPUProfileNode>} */ this._idToNode = new Map(); var idToNode = this._idToNode; var stack = [this.profileHead]; @@ -243,8 +243,8 @@ } /** - * @param {function(number, !WebInspector.CPUProfileNode, number)} openFrameCallback - * @param {function(number, !WebInspector.CPUProfileNode, number, number, number)} closeFrameCallback + * @param {function(number, !SDK.CPUProfileNode, number)} openFrameCallback + * @param {function(number, !SDK.CPUProfileNode, number, number, number)} closeFrameCallback * @param {number=} startTime * @param {number=} stopTime */ @@ -315,7 +315,7 @@ var duration = sampleTime - start; stackChildrenDuration[stackTop - 1] += duration; closeFrameCallback( - prevNode.depth, /** @type {!WebInspector.CPUProfileNode} */ (prevNode), start, duration, + prevNode.depth, /** @type {!SDK.CPUProfileNode} */ (prevNode), start, duration, duration - stackChildrenDuration[stackTop]); --stackTop; if (node.depth === prevNode.depth) { @@ -349,7 +349,7 @@ var duration = sampleTime - start; stackChildrenDuration[stackTop - 1] += duration; closeFrameCallback( - node.depth, /** @type {!WebInspector.CPUProfileNode} */ (node), start, duration, + node.depth, /** @type {!SDK.CPUProfileNode} */ (node), start, duration, duration - stackChildrenDuration[stackTop]); --stackTop; } @@ -357,7 +357,7 @@ /** * @param {number} index - * @return {?WebInspector.CPUProfileNode} + * @return {?SDK.CPUProfileNode} */ nodeByIndex(index) { return this._idToNode.get(this.samples[index]) || null;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js index 4bcb526..6393c51 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfilerModel.js
@@ -29,23 +29,23 @@ * @implements {Protocol.ProfilerDispatcher} * @unrestricted */ -WebInspector.CPUProfilerModel = class extends WebInspector.SDKModel { +SDK.CPUProfilerModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.CPUProfilerModel, target); + super(SDK.CPUProfilerModel, target); this._isRecording = false; target.registerProfilerDispatcher(this); target.profilerAgent().enable(); this._configureCpuProfilerSamplingInterval(); - WebInspector.moduleSetting('highResolutionCpuProfiling') + Common.moduleSetting('highResolutionCpuProfiling') .addChangeListener(this._configureCpuProfilerSamplingInterval, this); } _configureCpuProfilerSamplingInterval() { - var intervalUs = WebInspector.moduleSetting('highResolutionCpuProfiling').get() ? 100 : 1000; + var intervalUs = Common.moduleSetting('highResolutionCpuProfiling').get() ? 100 : 1000; this.target().profilerAgent().setSamplingInterval(intervalUs); } @@ -56,7 +56,7 @@ * @param {string=} title */ consoleProfileStarted(id, scriptLocation, title) { - this._dispatchProfileEvent(WebInspector.CPUProfilerModel.Events.ConsoleProfileStarted, id, scriptLocation, title); + this._dispatchProfileEvent(SDK.CPUProfilerModel.Events.ConsoleProfileStarted, id, scriptLocation, title); } /** @@ -68,7 +68,7 @@ */ consoleProfileFinished(id, scriptLocation, cpuProfile, title) { this._dispatchProfileEvent( - WebInspector.CPUProfilerModel.Events.ConsoleProfileFinished, id, scriptLocation, title, cpuProfile); + SDK.CPUProfilerModel.Events.ConsoleProfileFinished, id, scriptLocation, title, cpuProfile); } /** @@ -82,10 +82,10 @@ // Make sure ProfilesPanel is initialized and CPUProfileType is created. self.runtime.loadModulePromise('profiler').then(_ => { var debuggerModel = - /** @type {!WebInspector.DebuggerModel} */ (WebInspector.DebuggerModel.fromTarget(this.target())); - var debuggerLocation = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel, scriptLocation); + /** @type {!SDK.DebuggerModel} */ (SDK.DebuggerModel.fromTarget(this.target())); + var debuggerLocation = SDK.DebuggerModel.Location.fromPayload(debuggerModel, scriptLocation); var globalId = this.target().id() + '.' + id; - var data = /** @type {!WebInspector.CPUProfilerModel.EventData} */ ( + var data = /** @type {!SDK.CPUProfilerModel.EventData} */ ( {id: globalId, scriptLocation: debuggerLocation, cpuProfile: cpuProfile, title: title}); this.dispatchEventToListeners(eventName, data); }); @@ -101,7 +101,7 @@ startRecording() { this._isRecording = true; this.target().profilerAgent().start(); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ProfilesCPUProfileTaken); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ProfilesCPUProfileTaken); } /** @@ -124,16 +124,16 @@ * @override */ dispose() { - WebInspector.moduleSetting('highResolutionCpuProfiling') + Common.moduleSetting('highResolutionCpuProfiling') .removeChangeListener(this._configureCpuProfilerSamplingInterval, this); } }; /** @enum {symbol} */ -WebInspector.CPUProfilerModel.Events = { +SDK.CPUProfilerModel.Events = { ConsoleProfileStarted: Symbol('ConsoleProfileStarted'), ConsoleProfileFinished: Symbol('ConsoleProfileFinished') }; -/** @typedef {!{id: string, scriptLocation: !WebInspector.DebuggerModel.Location, title: (string|undefined), cpuProfile: (!Protocol.Profiler.Profile|undefined)}} */ -WebInspector.CPUProfilerModel.EventData; +/** @typedef {!{id: string, scriptLocation: !SDK.DebuggerModel.Location, title: (string|undefined), cpuProfile: (!Protocol.Profiler.Profile|undefined)}} */ +SDK.CPUProfilerModel.EventData;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMatchedStyles.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMatchedStyles.js index 7c7c703..09801b82 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMatchedStyles.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMatchedStyles.js
@@ -4,10 +4,10 @@ /** * @unrestricted */ -WebInspector.CSSMatchedStyles = class { +SDK.CSSMatchedStyles = class { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {!WebInspector.DOMNode} node + * @param {!SDK.CSSModel} cssModel + * @param {!SDK.DOMNode} node * @param {?Protocol.CSS.CSSStyle} inlinePayload * @param {?Protocol.CSS.CSSStyle} attributesPayload * @param {!Array.<!Protocol.CSS.RuleMatch>} matchedPayload @@ -34,21 +34,21 @@ this._matchingSelectors = new Map(); /** - * @this {WebInspector.CSSMatchedStyles} + * @this {SDK.CSSMatchedStyles} */ function addAttributesStyle() { if (!attributesPayload) return; - var style = new WebInspector.CSSStyleDeclaration( - cssModel, null, attributesPayload, WebInspector.CSSStyleDeclaration.Type.Attributes); + var style = new SDK.CSSStyleDeclaration( + cssModel, null, attributesPayload, SDK.CSSStyleDeclaration.Type.Attributes); this._nodeForStyle.set(style, this._node); this._nodeStyles.push(style); } // Inline style has the greatest specificity. if (inlinePayload && this._node.nodeType() === Node.ELEMENT_NODE) { - var style = new WebInspector.CSSStyleDeclaration( - cssModel, null, inlinePayload, WebInspector.CSSStyleDeclaration.Type.Inline); + var style = new SDK.CSSStyleDeclaration( + cssModel, null, inlinePayload, SDK.CSSStyleDeclaration.Type.Inline); this._nodeForStyle.set(style, this._node); this._nodeStyles.push(style); } @@ -56,7 +56,7 @@ // Add rules in reverse order to match the cascade order. var addedAttributesStyle; for (var i = matchedPayload.length - 1; i >= 0; --i) { - var rule = new WebInspector.CSSStyleRule(cssModel, matchedPayload[i].rule); + var rule = new SDK.CSSStyleRule(cssModel, matchedPayload[i].rule); if ((rule.isInjected() || rule.isUserAgent()) && !addedAttributesStyle) { // Show element's Style Attributes after all author rules. addedAttributesStyle = true; @@ -75,8 +75,8 @@ for (var i = 0; parentNode && inheritedPayload && i < inheritedPayload.length; ++i) { var entryPayload = inheritedPayload[i]; var inheritedInlineStyle = entryPayload.inlineStyle ? - new WebInspector.CSSStyleDeclaration( - cssModel, null, entryPayload.inlineStyle, WebInspector.CSSStyleDeclaration.Type.Inline) : + new SDK.CSSStyleDeclaration( + cssModel, null, entryPayload.inlineStyle, SDK.CSSStyleDeclaration.Type.Inline) : null; if (inheritedInlineStyle && this._containsInherited(inheritedInlineStyle)) { this._nodeForStyle.set(inheritedInlineStyle, parentNode); @@ -86,7 +86,7 @@ var inheritedMatchedCSSRules = entryPayload.matchedCSSRules || []; for (var j = inheritedMatchedCSSRules.length - 1; j >= 0; --j) { - var inheritedRule = new WebInspector.CSSStyleRule(cssModel, inheritedMatchedCSSRules[j].rule); + var inheritedRule = new SDK.CSSStyleRule(cssModel, inheritedMatchedCSSRules[j].rule); addMatchingSelectors.call(this, parentNode, inheritedRule, inheritedMatchedCSSRules[j].matchingSelectors); if (!this._containsInherited(inheritedRule.style)) continue; @@ -107,7 +107,7 @@ var pseudoStyles = []; var rules = entryPayload.matches || []; for (var j = rules.length - 1; j >= 0; --j) { - var pseudoRule = new WebInspector.CSSStyleRule(cssModel, rules[j].rule); + var pseudoRule = new SDK.CSSStyleRule(cssModel, rules[j].rule); pseudoStyles.push(pseudoRule.style); this._nodeForStyle.set(pseudoRule.style, pseudoElement); if (pseudoElement) @@ -118,15 +118,15 @@ } if (animationsPayload) - this._keyframes = animationsPayload.map(rule => new WebInspector.CSSKeyframesRule(cssModel, rule)); + this._keyframes = animationsPayload.map(rule => new SDK.CSSKeyframesRule(cssModel, rule)); this.resetActiveProperties(); /** - * @param {!WebInspector.DOMNode} node - * @param {!WebInspector.CSSStyleRule} rule + * @param {!SDK.DOMNode} node + * @param {!SDK.CSSStyleRule} rule * @param {!Array<number>} matchingSelectorIndices - * @this {WebInspector.CSSMatchedStyles} + * @this {SDK.CSSMatchedStyles} */ function addMatchingSelectors(node, rule, matchingSelectorIndices) { for (var matchingSelectorIndex of matchingSelectorIndices) { @@ -137,21 +137,21 @@ } /** - * @return {!WebInspector.DOMNode} + * @return {!SDK.DOMNode} */ node() { return this._node; } /** - * @return {!WebInspector.CSSModel} + * @return {!SDK.CSSModel} */ cssModel() { return this._cssModel; } /** - * @param {!WebInspector.CSSStyleRule} rule + * @param {!SDK.CSSStyleRule} rule * @return {boolean} */ hasMatchingSelectors(rule) { @@ -160,7 +160,7 @@ } /** - * @param {!WebInspector.CSSStyleRule} rule + * @param {!SDK.CSSStyleRule} rule * @return {!Array<number>} */ matchingSelectors(rule) { @@ -179,7 +179,7 @@ } /** - * @param {!WebInspector.CSSStyleRule} rule + * @param {!SDK.CSSStyleRule} rule * @return {!Promise} */ recomputeMatchingSelectors(rule) { @@ -192,10 +192,10 @@ return Promise.all(promises); /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {string} selectorText * @return {!Promise} - * @this {WebInspector.CSSMatchedStyles} + * @this {SDK.CSSMatchedStyles} */ function querySelector(node, selectorText) { var ownerDocument = node.ownerDocument || null; @@ -213,11 +213,11 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {string} selectorText * @param {function()} callback * @param {!Array.<!Protocol.DOM.NodeId>=} matchingNodeIds - * @this {WebInspector.CSSMatchedStyles} + * @this {SDK.CSSMatchedStyles} */ function onQueryComplete(node, selectorText, callback, matchingNodeIds) { if (matchingNodeIds) @@ -227,8 +227,8 @@ } /** - * @param {!WebInspector.CSSStyleRule} rule - * @param {!WebInspector.DOMNode} node + * @param {!SDK.CSSStyleRule} rule + * @param {!SDK.DOMNode} node * @return {!Promise} */ addNewRule(rule, node) { @@ -237,7 +237,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {string} selectorText * @param {boolean} value */ @@ -251,7 +251,7 @@ } /** - * @param {!WebInspector.CSSStyleDeclaration} style + * @param {!SDK.CSSStyleDeclaration} style * @return {boolean} */ mediaMatches(style) { @@ -264,28 +264,28 @@ } /** - * @return {!Array<!WebInspector.CSSStyleDeclaration>} + * @return {!Array<!SDK.CSSStyleDeclaration>} */ nodeStyles() { return this._nodeStyles; } /** - * @return {!Array.<!WebInspector.CSSKeyframesRule>} + * @return {!Array.<!SDK.CSSKeyframesRule>} */ keyframes() { return this._keyframes; } /** - * @return {!Map.<!Protocol.DOM.PseudoType, !Array<!WebInspector.CSSStyleDeclaration>>} + * @return {!Map.<!Protocol.DOM.PseudoType, !Array<!SDK.CSSStyleDeclaration>>} */ pseudoStyles() { return this._pseudoStyles; } /** - * @param {!WebInspector.CSSStyleDeclaration} style + * @param {!SDK.CSSStyleDeclaration} style * @return {boolean} */ _containsInherited(style) { @@ -293,22 +293,22 @@ for (var i = 0; i < properties.length; ++i) { var property = properties[i]; // Does this style contain non-overridden inherited property? - if (property.activeInStyle() && WebInspector.cssMetadata().isPropertyInherited(property.name)) + if (property.activeInStyle() && SDK.cssMetadata().isPropertyInherited(property.name)) return true; } return false; } /** - * @param {!WebInspector.CSSStyleDeclaration} style - * @return {?WebInspector.DOMNode} + * @param {!SDK.CSSStyleDeclaration} style + * @return {?SDK.DOMNode} */ nodeForStyle(style) { return this._nodeForStyle.get(style) || null; } /** - * @param {!WebInspector.CSSStyleDeclaration} style + * @param {!SDK.CSSStyleDeclaration} style * @return {boolean} */ isInherited(style) { @@ -316,8 +316,8 @@ } /** - * @param {!WebInspector.CSSProperty} property - * @return {?WebInspector.CSSMatchedStyles.PropertyState} + * @param {!SDK.CSSProperty} property + * @return {?SDK.CSSMatchedStyles.PropertyState} */ propertyState(property) { if (this._propertiesState.size === 0) { @@ -329,20 +329,20 @@ } resetActiveProperties() { - /** @type {!Map<!WebInspector.CSSProperty, !WebInspector.CSSMatchedStyles.PropertyState>} */ + /** @type {!Map<!SDK.CSSProperty, !SDK.CSSMatchedStyles.PropertyState>} */ this._propertiesState = new Map(); } /** - * @param {!Array<!WebInspector.CSSStyleDeclaration>} styles - * @param {!Map<!WebInspector.CSSProperty, !WebInspector.CSSMatchedStyles.PropertyState>} result + * @param {!Array<!SDK.CSSStyleDeclaration>} styles + * @param {!Map<!SDK.CSSProperty, !SDK.CSSMatchedStyles.PropertyState>} result */ _computeActiveProperties(styles, result) { /** @type {!Set.<string>} */ var foundImportantProperties = new Set(); - /** @type {!Map.<string, !Map<string, !WebInspector.CSSProperty>>} */ + /** @type {!Map.<string, !Map<string, !SDK.CSSProperty>>} */ var propertyToEffectiveRule = new Map(); - /** @type {!Map.<string, !WebInspector.DOMNode>} */ + /** @type {!Map.<string, !SDK.DOMNode>} */ var inheritedPropertyToNode = new Map(); /** @type {!Set<string>} */ var allUsedProperties = new Set(); @@ -350,12 +350,12 @@ var style = styles[i]; var rule = style.parentRule; // Compute cascade for CSSStyleRules only. - if (rule && !(rule instanceof WebInspector.CSSStyleRule)) + if (rule && !(rule instanceof SDK.CSSStyleRule)) continue; if (rule && !this.hasMatchingSelectors(rule)) continue; - /** @type {!Map<string, !WebInspector.CSSProperty>} */ + /** @type {!Map<string, !SDK.CSSProperty>} */ var styleActiveProperties = new Map(); var allProperties = style.allProperties; for (var j = 0; j < allProperties.length; ++j) { @@ -363,22 +363,22 @@ // Do not pick non-inherited properties from inherited styles. var inherited = this.isInherited(style); - if (inherited && !WebInspector.cssMetadata().isPropertyInherited(property.name)) + if (inherited && !SDK.cssMetadata().isPropertyInherited(property.name)) continue; if (!property.activeInStyle()) { - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Overloaded); continue; } - var canonicalName = WebInspector.cssMetadata().canonicalPropertyName(property.name); + var canonicalName = SDK.cssMetadata().canonicalPropertyName(property.name); if (foundImportantProperties.has(canonicalName)) { - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Overloaded); continue; } if (!property.important && allUsedProperties.has(canonicalName)) { - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Overloaded); continue; } @@ -389,15 +389,15 @@ if (property.important) { if (inherited && isKnownProperty && inheritedFromNode !== inheritedPropertyToNode.get(canonicalName)) { - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Overloaded); continue; } foundImportantProperties.add(canonicalName); if (isKnownProperty) { - var overloaded = /** @type {!WebInspector.CSSProperty} */ ( + var overloaded = /** @type {!SDK.CSSProperty} */ ( propertyToEffectiveRule.get(canonicalName).get(canonicalName)); - result.set(overloaded, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(overloaded, SDK.CSSMatchedStyles.PropertyState.Overloaded); propertyToEffectiveRule.get(canonicalName).delete(canonicalName); } } @@ -405,12 +405,12 @@ styleActiveProperties.set(canonicalName, property); allUsedProperties.add(canonicalName); propertyToEffectiveRule.set(canonicalName, styleActiveProperties); - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Active); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Active); } // If every longhand of the shorthand is not active, then the shorthand is not active too. for (var property of style.leadingProperties()) { - var canonicalName = WebInspector.cssMetadata().canonicalPropertyName(property.name); + var canonicalName = SDK.cssMetadata().canonicalPropertyName(property.name); if (!styleActiveProperties.has(canonicalName)) continue; var longhands = style.longhandProperties(property.name); @@ -418,21 +418,21 @@ continue; var notUsed = true; for (var longhand of longhands) { - var longhandCanonicalName = WebInspector.cssMetadata().canonicalPropertyName(longhand.name); + var longhandCanonicalName = SDK.cssMetadata().canonicalPropertyName(longhand.name); notUsed = notUsed && !styleActiveProperties.has(longhandCanonicalName); } if (!notUsed) continue; styleActiveProperties.delete(canonicalName); allUsedProperties.delete(canonicalName); - result.set(property, WebInspector.CSSMatchedStyles.PropertyState.Overloaded); + result.set(property, SDK.CSSMatchedStyles.PropertyState.Overloaded); } } } }; /** @enum {string} */ -WebInspector.CSSMatchedStyles.PropertyState = { +SDK.CSSMatchedStyles.PropertyState = { Active: 'Active', Overloaded: 'Overloaded' };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMedia.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMedia.js index f222e9e..b69e6ad 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMedia.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMedia.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.CSSMediaQuery = class { +SDK.CSSMediaQuery = class { /** * @param {!Protocol.CSS.MediaQuery} payload */ @@ -12,15 +12,15 @@ this._active = payload.active; this._expressions = []; for (var j = 0; j < payload.expressions.length; ++j) - this._expressions.push(WebInspector.CSSMediaQueryExpression.parsePayload(payload.expressions[j])); + this._expressions.push(SDK.CSSMediaQueryExpression.parsePayload(payload.expressions[j])); } /** * @param {!Protocol.CSS.MediaQuery} payload - * @return {!WebInspector.CSSMediaQuery} + * @return {!SDK.CSSMediaQuery} */ static parsePayload(payload) { - return new WebInspector.CSSMediaQuery(payload); + return new SDK.CSSMediaQuery(payload); } /** @@ -31,7 +31,7 @@ } /** - * @return {!Array.<!WebInspector.CSSMediaQueryExpression>} + * @return {!Array.<!SDK.CSSMediaQueryExpression>} */ expressions() { return this._expressions; @@ -42,7 +42,7 @@ /** * @unrestricted */ -WebInspector.CSSMediaQueryExpression = class { +SDK.CSSMediaQueryExpression = class { /** * @param {!Protocol.CSS.MediaQueryExpression} payload */ @@ -50,16 +50,16 @@ this._value = payload.value; this._unit = payload.unit; this._feature = payload.feature; - this._valueRange = payload.valueRange ? WebInspector.TextRange.fromObject(payload.valueRange) : null; + this._valueRange = payload.valueRange ? Common.TextRange.fromObject(payload.valueRange) : null; this._computedLength = payload.computedLength || null; } /** * @param {!Protocol.CSS.MediaQueryExpression} payload - * @return {!WebInspector.CSSMediaQueryExpression} + * @return {!SDK.CSSMediaQueryExpression} */ static parsePayload(payload) { - return new WebInspector.CSSMediaQueryExpression(payload); + return new SDK.CSSMediaQueryExpression(payload); } /** @@ -84,7 +84,7 @@ } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ valueRange() { return this._valueRange; @@ -102,9 +102,9 @@ /** * @unrestricted */ -WebInspector.CSSMedia = class { +SDK.CSSMedia = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSMedia} payload */ constructor(cssModel, payload) { @@ -113,23 +113,23 @@ } /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSMedia} payload - * @return {!WebInspector.CSSMedia} + * @return {!SDK.CSSMedia} */ static parsePayload(cssModel, payload) { - return new WebInspector.CSSMedia(cssModel, payload); + return new SDK.CSSMedia(cssModel, payload); } /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Array.<!Protocol.CSS.CSSMedia>} payload - * @return {!Array.<!WebInspector.CSSMedia>} + * @return {!Array.<!SDK.CSSMedia>} */ static parseMediaArrayPayload(cssModel, payload) { var result = []; for (var i = 0; i < payload.length; ++i) - result.push(WebInspector.CSSMedia.parsePayload(cssModel, payload[i])); + result.push(SDK.CSSMedia.parsePayload(cssModel, payload[i])); return result; } @@ -140,18 +140,18 @@ this.text = payload.text; this.source = payload.source; this.sourceURL = payload.sourceURL || ''; - this.range = payload.range ? WebInspector.TextRange.fromObject(payload.range) : null; + this.range = payload.range ? Common.TextRange.fromObject(payload.range) : null; this.styleSheetId = payload.styleSheetId; this.mediaList = null; if (payload.mediaList) { this.mediaList = []; for (var i = 0; i < payload.mediaList.length; ++i) - this.mediaList.push(WebInspector.CSSMediaQuery.parsePayload(payload.mediaList[i])); + this.mediaList.push(SDK.CSSMediaQuery.parsePayload(payload.mediaList[i])); } } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.styleSheetId !== edit.styleSheetId || !this.range) @@ -163,7 +163,7 @@ } /** - * @param {!WebInspector.CSSMedia} other + * @param {!SDK.CSSMedia} other * @return {boolean} */ equal(other) { @@ -210,25 +210,25 @@ } /** - * @return {?WebInspector.CSSStyleSheetHeader} + * @return {?SDK.CSSStyleSheetHeader} */ header() { return this.styleSheetId ? this._cssModel.styleSheetHeaderForId(this.styleSheetId) : null; } /** - * @return {?WebInspector.CSSLocation} + * @return {?SDK.CSSLocation} */ rawLocation() { var header = this.header(); if (!header || this.lineNumberInSource() === undefined) return null; var lineNumber = Number(this.lineNumberInSource()); - return new WebInspector.CSSLocation(header, lineNumber, this.columnNumberInSource()); + return new SDK.CSSLocation(header, lineNumber, this.columnNumberInSource()); } }; -WebInspector.CSSMedia.Source = { +SDK.CSSMedia.Source = { LINKED_SHEET: 'linkedSheet', INLINE_SHEET: 'inlineSheet', MEDIA_RULE: 'mediaRule',
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js index 36d5b94..a6d1c6a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSMetadata.js
@@ -33,7 +33,7 @@ /** * @unrestricted */ -WebInspector.CSSMetadata = class { +SDK.CSSMetadata = class { /** * @param {!Array.<!{name: string, longhands: !Array.<string>}>} properties */ @@ -101,7 +101,7 @@ * @return {boolean} */ isColorAwareProperty(propertyName) { - return !!WebInspector.CSSMetadata._colorAwareProperties.has(propertyName.toLowerCase()) || + return !!SDK.CSSMetadata._colorAwareProperties.has(propertyName.toLowerCase()) || this.isCustomProperty(propertyName.toLowerCase()); } @@ -113,7 +113,7 @@ propertyName = propertyName.toLowerCase(); if (propertyName === 'line-height') return false; - return WebInspector.CSSMetadata._distanceProperties.has(propertyName) || propertyName.startsWith('margin') || + return SDK.CSSMetadata._distanceProperties.has(propertyName) || propertyName.startsWith('margin') || propertyName.startsWith('padding') || propertyName.indexOf('width') !== -1 || propertyName.indexOf('height') !== -1; } @@ -124,7 +124,7 @@ */ isBezierAwareProperty(propertyName) { propertyName = propertyName.toLowerCase(); - return !!WebInspector.CSSMetadata._bezierAwareProperties.has(propertyName) || this.isCustomProperty(propertyName); + return !!SDK.CSSMetadata._bezierAwareProperties.has(propertyName) || this.isCustomProperty(propertyName); } /** @@ -178,13 +178,13 @@ var acceptedKeywords = ['inherit', 'initial']; propertyName = propertyName.toLowerCase(); var unprefixedName = propertyName.replace(/^-webkit-/, ''); - var entry = WebInspector.CSSMetadata._propertyDataMap[propertyName] || - WebInspector.CSSMetadata._propertyDataMap[unprefixedName]; + var entry = SDK.CSSMetadata._propertyDataMap[propertyName] || + SDK.CSSMetadata._propertyDataMap[unprefixedName]; if (entry && entry.values) acceptedKeywords.pushAll(entry.values); if (this.isColorAwareProperty(propertyName)) { acceptedKeywords.push('currentColor'); - for (var color in WebInspector.Color.Nicknames) + for (var color in Common.Color.Nicknames) acceptedKeywords.push(color); } return acceptedKeywords.sort(); @@ -198,9 +198,9 @@ var maxWeight = 0; var index = 0; for (var i = 0; i < properties.length; i++) { - var weight = WebInspector.CSSMetadata.Weight[properties[i]]; + var weight = SDK.CSSMetadata.Weight[properties[i]]; if (!weight) - weight = WebInspector.CSSMetadata.Weight[this.canonicalPropertyName(properties[i])]; + weight = SDK.CSSMetadata.Weight[this.canonicalPropertyName(properties[i])]; if (weight > maxWeight) { maxWeight = weight; index = i; @@ -210,30 +210,30 @@ } }; -WebInspector.CSSMetadata.VariableRegex = /(var\(--.*?\))/g; -WebInspector.CSSMetadata.URLRegex = /url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g; +SDK.CSSMetadata.VariableRegex = /(var\(--.*?\))/g; +SDK.CSSMetadata.URLRegex = /url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g; /** - * @return {!WebInspector.CSSMetadata} + * @return {!SDK.CSSMetadata} */ -WebInspector.cssMetadata = function() { - if (!WebInspector.CSSMetadata._instance) - WebInspector.CSSMetadata._instance = - new WebInspector.CSSMetadata(WebInspector.CSSMetadata._generatedProperties || []); - return WebInspector.CSSMetadata._instance; +SDK.cssMetadata = function() { + if (!SDK.CSSMetadata._instance) + SDK.CSSMetadata._instance = + new SDK.CSSMetadata(SDK.CSSMetadata._generatedProperties || []); + return SDK.CSSMetadata._instance; }; -WebInspector.CSSMetadata._distanceProperties = new Set([ +SDK.CSSMetadata._distanceProperties = new Set([ 'background-position', 'border-spacing', 'bottom', 'font-size', 'height', 'left', 'letter-spacing', 'max-height', 'max-width', 'min-height', 'min-width', 'right', 'text-indent', 'top', 'width', 'word-spacing' ]); -WebInspector.CSSMetadata._bezierAwareProperties = new Set([ +SDK.CSSMetadata._bezierAwareProperties = new Set([ 'animation', 'animation-timing-function', 'transition', 'transition-timing-function', '-webkit-animation', '-webkit-animation-timing-function', '-webkit-transition', '-webkit-transition-timing-function' ]); -WebInspector.CSSMetadata._colorAwareProperties = new Set([ +SDK.CSSMetadata._colorAwareProperties = new Set([ 'backdrop-filter', 'background', 'background-color', @@ -287,7 +287,7 @@ '-webkit-text-stroke-color' ]); -WebInspector.CSSMetadata._propertyDataMap = { +SDK.CSSMetadata._propertyDataMap = { 'table-layout': {values: ['auto', 'fixed']}, 'visibility': {values: ['hidden', 'visible', 'collapse']}, 'background-repeat': {values: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']}, @@ -700,7 +700,7 @@ }; // Weight of CSS properties based on their usage from https://www.chromestatus.com/metrics/css/popularity -WebInspector.CSSMetadata.Weight = { +SDK.CSSMetadata.Weight = { 'align-content': 57, 'align-items': 129, 'align-self': 55,
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js index 2dbfba9d..d7531e0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
@@ -31,36 +31,36 @@ /** * @unrestricted */ -WebInspector.CSSModel = class extends WebInspector.SDKModel { +SDK.CSSModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.DOMModel} domModel + * @param {!SDK.Target} target + * @param {!SDK.DOMModel} domModel */ constructor(target, domModel) { - super(WebInspector.CSSModel, target); + super(SDK.CSSModel, target); this._domModel = domModel; this._agent = target.cssAgent(); - this._styleLoader = new WebInspector.CSSModel.ComputedStyleLoader(this); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this); - target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this)); + this._styleLoader = new SDK.CSSModel.ComputedStyleLoader(this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this); + target.registerCSSDispatcher(new SDK.CSSDispatcher(this)); this._agent.enable().then(this._wasEnabled.bind(this)); - /** @type {!Map.<string, !WebInspector.CSSStyleSheetHeader>} */ + /** @type {!Map.<string, !SDK.CSSStyleSheetHeader>} */ this._styleSheetIdToHeader = new Map(); /** @type {!Map.<string, !Object.<!Protocol.Page.FrameId, !Array.<!Protocol.CSS.StyleSheetId>>>} */ this._styleSheetIdsForURL = new Map(); - /** @type {!Map.<!WebInspector.CSSStyleSheetHeader, !Promise<string>>} */ + /** @type {!Map.<!SDK.CSSStyleSheetHeader, !Promise<string>>} */ this._originalStyleSheetText = new Map(); /** @type {!Multimap<string, !Protocol.CSS.StyleSheetId>} */ this._sourceMapLoadingStyleSheetsIds = new Multimap(); - /** @type {!Map<string, !WebInspector.SourceMap>} */ + /** @type {!Map<string, !SDK.SourceMap>} */ this._sourceMapByURL = new Map(); - /** @type {!Multimap<string, !WebInspector.CSSStyleSheetHeader>} */ + /** @type {!Multimap<string, !SDK.CSSStyleSheetHeader>} */ this._sourceMapURLToHeaders = new Multimap(); - WebInspector.moduleSetting('cssSourceMapsEnabled').addChangeListener(this._toggleSourceMapSupport, this); + Common.moduleSetting('cssSourceMapsEnabled').addChangeListener(this._toggleSourceMapSupport, this); } /** @@ -85,23 +85,23 @@ } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.CSSModel} + * @param {!SDK.Target} target + * @return {?SDK.CSSModel} */ static fromTarget(target) { - return /** @type {?WebInspector.CSSModel} */ (target.model(WebInspector.CSSModel)); + return /** @type {?SDK.CSSModel} */ (target.model(SDK.CSSModel)); } /** - * @param {!WebInspector.DOMNode} node - * @return {!WebInspector.CSSModel} + * @param {!SDK.DOMNode} node + * @return {!SDK.CSSModel} */ static fromNode(node) { - return /** @type {!WebInspector.CSSModel} */ (WebInspector.CSSModel.fromTarget(node.target())); + return /** @type {!SDK.CSSModel} */ (SDK.CSSModel.fromTarget(node.target())); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _toggleSourceMapSupport(event) { var enabled = /** @type {boolean} */ (event.data); @@ -115,8 +115,8 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header - * @return {?WebInspector.SourceMap} + * @param {!SDK.CSSStyleSheetHeader} header + * @return {?SDK.SourceMap} */ sourceMapForHeader(header) { return this._sourceMapByURL.get(header.sourceMapURL) || null; @@ -126,26 +126,26 @@ } /** - * @param {!WebInspector.SourceMap} sourceMap - * @return {!Array<!WebInspector.CSSStyleSheetHeader>} + * @param {!SDK.SourceMap} sourceMap + * @return {!Array<!SDK.CSSStyleSheetHeader>} */ headersForSourceMap(sourceMap) { return this._sourceMapURLToHeaders.get(sourceMap.url()).valuesArray(); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ _attachSourceMap(header) { var sourceMapURL = header.sourceMapURL; - if (!sourceMapURL || !WebInspector.moduleSetting('cssSourceMapsEnabled').get()) + if (!sourceMapURL || !Common.moduleSetting('cssSourceMapsEnabled').get()) return; if (this._sourceMapByURL.has(sourceMapURL)) { attach.call(this, sourceMapURL, header); return; } if (!this._sourceMapLoadingStyleSheetsIds.has(sourceMapURL)) { - WebInspector.TextSourceMap.load(sourceMapURL, header.sourceURL) + SDK.TextSourceMap.load(sourceMapURL, header.sourceURL) .then(onTextSourceMapLoaded.bind(this, sourceMapURL)) .then(onSourceMap.bind(this, sourceMapURL)); } @@ -153,26 +153,26 @@ /** * @param {string} sourceMapURL - * @param {?WebInspector.TextSourceMap} sourceMap - * @return {!Promise<?WebInspector.SourceMap>} - * @this {WebInspector.CSSModel} + * @param {?SDK.TextSourceMap} sourceMap + * @return {!Promise<?SDK.SourceMap>} + * @this {SDK.CSSModel} */ function onTextSourceMapLoaded(sourceMapURL, sourceMap) { if (!sourceMap) - return Promise.resolve(/** @type {?WebInspector.SourceMap} */ (null)); + return Promise.resolve(/** @type {?SDK.SourceMap} */ (null)); var factoryExtension = this._factoryForSourceMap(sourceMap); if (!factoryExtension) - return Promise.resolve(/** @type {?WebInspector.SourceMap} */ (sourceMap)); + return Promise.resolve(/** @type {?SDK.SourceMap} */ (sourceMap)); return factoryExtension.instance() .then(factory => factory.editableSourceMap(this.target(), sourceMap)) .then(map => map || sourceMap) - .catchException(/** @type {?WebInspector.SourceMap} */ (null)); + .catchException(/** @type {?SDK.SourceMap} */ (null)); } /** * @param {string} sourceMapURL - * @param {?WebInspector.SourceMap} sourceMap - * @this {WebInspector.CSSModel} + * @param {?SDK.SourceMap} sourceMap + * @this {SDK.CSSModel} */ function onSourceMap(sourceMapURL, sourceMap) { this._sourceMapLoadedForTest(); @@ -195,24 +195,24 @@ /** * @param {string} sourceMapURL - * @param {!WebInspector.CSSStyleSheetHeader} header - * @this {WebInspector.CSSModel} + * @param {!SDK.CSSStyleSheetHeader} header + * @this {SDK.CSSModel} */ function attach(sourceMapURL, header) { this._sourceMapURLToHeaders.set(sourceMapURL, header); - this.dispatchEventToListeners(WebInspector.CSSModel.Events.SourceMapAttached, header); + this.dispatchEventToListeners(SDK.CSSModel.Events.SourceMapAttached, header); } } /** - * @param {!WebInspector.SourceMap} sourceMap + * @param {!SDK.SourceMap} sourceMap * @return {?Runtime.Extension} */ _factoryForSourceMap(sourceMap) { var sourceExtensions = new Set(); for (var url of sourceMap.sourceURLs()) - sourceExtensions.add(WebInspector.ParsedURL.extractExtension(url)); - for (var runtimeExtension of self.runtime.extensions(WebInspector.SourceMapFactory)) { + sourceExtensions.add(Common.ParsedURL.extractExtension(url)); + for (var runtimeExtension of self.runtime.extensions(SDK.SourceMapFactory)) { var supportedExtensions = new Set(runtimeExtension.descriptor()['extensions']); if (supportedExtensions.containsAll(sourceExtensions)) return runtimeExtension; @@ -221,7 +221,7 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ _detachSourceMap(header) { if (!header.sourceMapURL || !this._sourceMapURLToHeaders.hasValue(header.sourceMapURL, header)) @@ -229,11 +229,11 @@ this._sourceMapURLToHeaders.remove(header.sourceMapURL, header); if (!this._sourceMapURLToHeaders.has(header.sourceMapURL)) this._sourceMapByURL.delete(header.sourceMapURL); - this.dispatchEventToListeners(WebInspector.CSSModel.Events.SourceMapDetached, header); + this.dispatchEventToListeners(SDK.CSSModel.Events.SourceMapDetached, header); } /** - * @return {!WebInspector.DOMModel} + * @return {!SDK.DOMModel} */ domModel() { return this._domModel; @@ -241,7 +241,7 @@ /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} text * @param {boolean} majorChange * @return {!Promise<boolean>} @@ -265,9 +265,9 @@ sourceMap.editCompiled([range], [text]).then(onEditingDone.bind(this)).catch(onError.bind(this, header))); /** - * @param {?WebInspector.SourceMap.EditResult} editResult + * @param {?SDK.SourceMap.EditResult} editResult * @return {!Promise<boolean>} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function onEditingDone(editResult) { if (!editResult) @@ -277,7 +277,7 @@ if (!edits.length) return onCSSPatched.call(this, editResult, true); - edits.sort(WebInspector.SourceEdit.comparator); + edits.sort(Common.SourceEdit.comparator); edits = edits.reverse(); var styleSheetIds = []; @@ -293,10 +293,10 @@ } /** - * @param {!WebInspector.SourceMap.EditResult} editResult + * @param {!SDK.SourceMap.EditResult} editResult * @param {boolean} success * @return {!Promise<boolean>} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function onCSSPatched(editResult, success) { if (!success) @@ -304,28 +304,28 @@ this._sourceMapByURL.set(header.sourceMapURL, editResult.map); this.dispatchEventToListeners( - WebInspector.CSSModel.Events.SourceMapChanged, + SDK.CSSModel.Events.SourceMapChanged, {sourceMap: editResult.map, newSources: editResult.newSources}); return Promise.resolve(true); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @param {*} error * @return {!Promise<boolean>} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function onError(header, error) { - WebInspector.console.error(WebInspector.UIString('LiveSASS failed: %s', sourceMap.compiledURL())); + Common.console.error(Common.UIString('LiveSASS failed: %s', sourceMap.compiledURL())); console.error(error); this._detachSourceMap(header); return original(); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @return {!Promise<boolean>} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function originalAndDetachIfSuccess(header) { return this._innerSetStyleTexts([styleSheetId], [range], [text], majorChange).then(detachIfSuccess.bind(this)); @@ -333,7 +333,7 @@ /** * @param {boolean} success * @return {boolean} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function detachIfSuccess(success) { if (success) @@ -345,7 +345,7 @@ /** * @param {!Array<!Protocol.CSS.StyleSheetId>} styleSheetIds - * @param {!Array<!WebInspector.TextRange>} ranges + * @param {!Array<!Common.TextRange>} ranges * @param {!Array<string>} texts * @param {boolean} majorChange * @return {!Promise<boolean>} @@ -355,7 +355,7 @@ * @param {?Protocol.Error} error * @param {?Array<!Protocol.CSS.CSSStyle>} stylePayloads * @return {boolean} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function parsePayload(error, stylePayloads) { if (error || !stylePayloads || stylePayloads.length !== ranges.length) @@ -364,7 +364,7 @@ if (majorChange) this._domModel.markUndoableState(); for (var i = 0; i < ranges.length; ++i) { - var edit = new WebInspector.CSSModel.Edit(styleSheetIds[i], ranges[i], texts[i], stylePayloads[i]); + var edit = new SDK.CSSModel.Edit(styleSheetIds[i], ranges[i], texts[i], stylePayloads[i]); this._fireStyleSheetChanged(styleSheetIds[i], edit); } return true; @@ -386,7 +386,7 @@ /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} text * @return {!Promise<boolean>} */ @@ -395,18 +395,18 @@ * @param {?Protocol.Error} error * @param {?Protocol.CSS.SelectorList} selectorPayload * @return {boolean} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function callback(error, selectorPayload) { if (error || !selectorPayload) return false; this._domModel.markUndoableState(); - var edit = new WebInspector.CSSModel.Edit(styleSheetId, range, text, selectorPayload); + var edit = new SDK.CSSModel.Edit(styleSheetId, range, text, selectorPayload); this._fireStyleSheetChanged(styleSheetId, edit); return true; } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited); return this._ensureOriginalStyleSheetText(styleSheetId) .then(() => this._agent.setRuleSelector(styleSheetId, range, text, callback.bind(this))) .catchException(false); @@ -414,7 +414,7 @@ /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} text * @return {!Promise<boolean>} */ @@ -423,18 +423,18 @@ * @param {?Protocol.Error} error * @param {!Protocol.CSS.Value} payload * @return {boolean} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function callback(error, payload) { if (error || !payload) return false; this._domModel.markUndoableState(); - var edit = new WebInspector.CSSModel.Edit(styleSheetId, range, text, payload); + var edit = new SDK.CSSModel.Edit(styleSheetId, range, text, payload); this._fireStyleSheetChanged(styleSheetId, edit); return true; } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited); return this._ensureOriginalStyleSheetText(styleSheetId) .then(() => this._agent.setKeyframeKey(styleSheetId, range, text, callback.bind(this))) .catchException(false); @@ -445,13 +445,13 @@ } /** - * @return {!Promise<!Array<!WebInspector.CSSModel.RuleUsage>>} + * @return {!Promise<!Array<!SDK.CSSModel.RuleUsage>>} */ ruleListPromise() { /** * @param {?string} error * @param {!Array<!Protocol.CSS.RuleUsage>=} ruleUsage - * @return {!Array<!WebInspector.CSSModel.RuleUsage>} + * @return {!Array<!SDK.CSSModel.RuleUsage>} */ function usedRulesCallback(error, ruleUsage) { if (error || !ruleUsage) @@ -464,17 +464,17 @@ } /** - * @return {!Promise.<!Array.<!WebInspector.CSSMedia>>} + * @return {!Promise.<!Array.<!SDK.CSSMedia>>} */ mediaQueriesPromise() { /** * @param {?Protocol.Error} error * @param {?Array.<!Protocol.CSS.CSSMedia>} payload - * @return {!Array.<!WebInspector.CSSMedia>} - * @this {!WebInspector.CSSModel} + * @return {!Array.<!SDK.CSSMedia>} + * @this {!SDK.CSSModel} */ function parsePayload(error, payload) { - return !error && payload ? WebInspector.CSSMedia.parseMediaArrayPayload(this, payload) : []; + return !error && payload ? SDK.CSSMedia.parseMediaArrayPayload(this, payload) : []; } return this._agent.getMediaQueries(parsePayload.bind(this)); @@ -496,12 +496,12 @@ return; } this._isEnabled = true; - this.dispatchEventToListeners(WebInspector.CSSModel.Events.ModelWasEnabled); + this.dispatchEventToListeners(SDK.CSSModel.Events.ModelWasEnabled); } /** * @param {!Protocol.DOM.NodeId} nodeId - * @return {!Promise.<?WebInspector.CSSMatchedStyles>} + * @return {!Promise.<?SDK.CSSMatchedStyles>} */ matchedStylesPromise(nodeId) { /** @@ -512,8 +512,8 @@ * @param {!Array.<!Protocol.CSS.PseudoElementMatches>=} pseudoPayload * @param {!Array.<!Protocol.CSS.InheritedStyleEntry>=} inheritedPayload * @param {!Array.<!Protocol.CSS.CSSKeyframesRule>=} animationsPayload - * @return {?WebInspector.CSSMatchedStyles} - * @this {WebInspector.CSSModel} + * @return {?SDK.CSSMatchedStyles} + * @this {SDK.CSSModel} */ function callback( error, inlinePayload, attributesPayload, matchedPayload, pseudoPayload, inheritedPayload, animationsPayload) { @@ -524,7 +524,7 @@ if (!node) return null; - return new WebInspector.CSSMatchedStyles( + return new SDK.CSSMatchedStyles( this, node, inlinePayload || null, attributesPayload || null, matchedPayload || [], pseudoPayload || [], inheritedPayload || [], animationsPayload || []); } @@ -590,13 +590,13 @@ } /** - * @return {!Array.<!WebInspector.CSSStyleSheetHeader>} + * @return {!Array.<!SDK.CSSStyleSheetHeader>} */ allStyleSheets() { var values = this._styleSheetIdToHeader.valuesArray(); /** - * @param {!WebInspector.CSSStyleSheetHeader} a - * @param {!WebInspector.CSSStyleSheetHeader} b + * @param {!SDK.CSSStyleSheetHeader} a + * @param {!SDK.CSSStyleSheetHeader} b * @return {number} */ function styleSheetComparator(a, b) { @@ -613,73 +613,73 @@ /** * @param {!Protocol.DOM.NodeId} nodeId - * @return {!Promise.<?WebInspector.CSSModel.InlineStyleResult>} + * @return {!Promise.<?SDK.CSSModel.InlineStyleResult>} */ inlineStylesPromise(nodeId) { /** * @param {?Protocol.Error} error * @param {?Protocol.CSS.CSSStyle=} inlinePayload * @param {?Protocol.CSS.CSSStyle=} attributesStylePayload - * @return {?WebInspector.CSSModel.InlineStyleResult} - * @this {WebInspector.CSSModel} + * @return {?SDK.CSSModel.InlineStyleResult} + * @this {SDK.CSSModel} */ function callback(error, inlinePayload, attributesStylePayload) { if (error || !inlinePayload) return null; var inlineStyle = inlinePayload ? - new WebInspector.CSSStyleDeclaration( - this, null, inlinePayload, WebInspector.CSSStyleDeclaration.Type.Inline) : + new SDK.CSSStyleDeclaration( + this, null, inlinePayload, SDK.CSSStyleDeclaration.Type.Inline) : null; var attributesStyle = attributesStylePayload ? - new WebInspector.CSSStyleDeclaration( - this, null, attributesStylePayload, WebInspector.CSSStyleDeclaration.Type.Attributes) : + new SDK.CSSStyleDeclaration( + this, null, attributesStylePayload, SDK.CSSStyleDeclaration.Type.Attributes) : null; - return new WebInspector.CSSModel.InlineStyleResult(inlineStyle, attributesStyle); + return new SDK.CSSModel.InlineStyleResult(inlineStyle, attributesStyle); } return this._agent.getInlineStylesForNode(nodeId, callback.bind(this)); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {string} pseudoClass * @param {boolean} enable * @return {boolean} */ forcePseudoState(node, pseudoClass, enable) { - var pseudoClasses = node.marker(WebInspector.CSSModel.PseudoStateMarker) || []; + var pseudoClasses = node.marker(SDK.CSSModel.PseudoStateMarker) || []; if (enable) { if (pseudoClasses.indexOf(pseudoClass) >= 0) return false; pseudoClasses.push(pseudoClass); - node.setMarker(WebInspector.CSSModel.PseudoStateMarker, pseudoClasses); + node.setMarker(SDK.CSSModel.PseudoStateMarker, pseudoClasses); } else { if (pseudoClasses.indexOf(pseudoClass) < 0) return false; pseudoClasses.remove(pseudoClass); if (pseudoClasses.length) - node.setMarker(WebInspector.CSSModel.PseudoStateMarker, pseudoClasses); + node.setMarker(SDK.CSSModel.PseudoStateMarker, pseudoClasses); else - node.setMarker(WebInspector.CSSModel.PseudoStateMarker, null); + node.setMarker(SDK.CSSModel.PseudoStateMarker, null); } this._agent.forcePseudoState(node.id, pseudoClasses); this.dispatchEventToListeners( - WebInspector.CSSModel.Events.PseudoStateForced, {node: node, pseudoClass: pseudoClass, enable: enable}); + SDK.CSSModel.Events.PseudoStateForced, {node: node, pseudoClass: pseudoClass, enable: enable}); return true; } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {?Array<string>} state */ pseudoState(node) { - return node.marker(WebInspector.CSSModel.PseudoStateMarker) || []; + return node.marker(SDK.CSSModel.PseudoStateMarker) || []; } /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} newMediaText * @return {!Promise<boolean>} */ @@ -688,18 +688,18 @@ * @param {?Protocol.Error} error * @param {!Protocol.CSS.CSSMedia} mediaPayload * @return {boolean} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function parsePayload(error, mediaPayload) { if (!mediaPayload) return false; this._domModel.markUndoableState(); - var edit = new WebInspector.CSSModel.Edit(styleSheetId, range, newMediaText, mediaPayload); + var edit = new SDK.CSSModel.Edit(styleSheetId, range, newMediaText, mediaPayload); this._fireStyleSheetChanged(styleSheetId, edit); return true; } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited); return this._ensureOriginalStyleSheetText(styleSheetId) .then(() => this._agent.setMediaText(styleSheetId, range, newMediaText, parsePayload.bind(this))) .catchException(false); @@ -708,36 +708,36 @@ /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId * @param {string} ruleText - * @param {!WebInspector.TextRange} ruleLocation - * @return {!Promise<?WebInspector.CSSStyleRule>} + * @param {!Common.TextRange} ruleLocation + * @return {!Promise<?SDK.CSSStyleRule>} */ addRule(styleSheetId, ruleText, ruleLocation) { return this._ensureOriginalStyleSheetText(styleSheetId) .then(() => this._agent.addRule(styleSheetId, ruleText, ruleLocation, parsePayload.bind(this))) - .catchException(/** @type {?WebInspector.CSSStyleRule} */ (null)); + .catchException(/** @type {?SDK.CSSStyleRule} */ (null)); /** * @param {?Protocol.Error} error * @param {?Protocol.CSS.CSSRule} rulePayload - * @return {?WebInspector.CSSStyleRule} - * @this {WebInspector.CSSModel} + * @return {?SDK.CSSStyleRule} + * @this {SDK.CSSModel} */ function parsePayload(error, rulePayload) { if (error || !rulePayload) return null; this._domModel.markUndoableState(); - var edit = new WebInspector.CSSModel.Edit(styleSheetId, ruleLocation, ruleText, rulePayload); + var edit = new SDK.CSSModel.Edit(styleSheetId, ruleLocation, ruleText, rulePayload); this._fireStyleSheetChanged(styleSheetId, edit); - return new WebInspector.CSSStyleRule(this, rulePayload); + return new SDK.CSSStyleRule(this, rulePayload); } } /** - * @param {!WebInspector.DOMNode} node - * @param {function(?WebInspector.CSSStyleSheetHeader)} userCallback + * @param {!SDK.DOMNode} node + * @param {function(?SDK.CSSStyleSheetHeader)} userCallback */ requestViaInspectorStylesheet(node, userCallback) { - var frameId = node.frameId() || WebInspector.ResourceTreeModel.fromTarget(this.target()).mainFrame.id; + var frameId = node.frameId() || SDK.ResourceTreeModel.fromTarget(this.target()).mainFrame.id; var headers = this._styleSheetIdToHeader.valuesArray(); for (var i = 0; i < headers.length; ++i) { var styleSheetHeader = headers[i]; @@ -750,8 +750,8 @@ /** * @param {?Protocol.Error} error * @param {?Protocol.CSS.StyleSheetId} styleSheetId - * @return {?WebInspector.CSSStyleSheetHeader} - * @this {WebInspector.CSSModel} + * @return {?SDK.CSSStyleSheetHeader} + * @this {SDK.CSSModel} */ function innerCallback(error, styleSheetId) { return !error && styleSheetId ? this._styleSheetIdToHeader.get(styleSheetId) || null : null; @@ -761,23 +761,23 @@ } mediaQueryResultChanged() { - this.dispatchEventToListeners(WebInspector.CSSModel.Events.MediaQueryResultChanged); + this.dispatchEventToListeners(SDK.CSSModel.Events.MediaQueryResultChanged); } fontsUpdated() { - this.dispatchEventToListeners(WebInspector.CSSModel.Events.FontsUpdated); + this.dispatchEventToListeners(SDK.CSSModel.Events.FontsUpdated); } /** * @param {!Protocol.CSS.StyleSheetId} id - * @return {?WebInspector.CSSStyleSheetHeader} + * @return {?SDK.CSSStyleSheetHeader} */ styleSheetHeaderForId(id) { return this._styleSheetIdToHeader.get(id) || null; } /** - * @return {!Array.<!WebInspector.CSSStyleSheetHeader>} + * @return {!Array.<!SDK.CSSStyleSheetHeader>} */ styleSheetHeaders() { return this._styleSheetIdToHeader.valuesArray(); @@ -785,11 +785,11 @@ /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.CSSModel.Edit=} edit + * @param {!SDK.CSSModel.Edit=} edit */ _fireStyleSheetChanged(styleSheetId, edit) { this.dispatchEventToListeners( - WebInspector.CSSModel.Events.StyleSheetChanged, {styleSheetId: styleSheetId, edit: edit}); + SDK.CSSModel.Events.StyleSheetChanged, {styleSheetId: styleSheetId, edit: edit}); } /** @@ -810,13 +810,13 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ _originalContentRequestedForTest(header) { } /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @return {!Promise<string>} */ originalStyleSheetText(header) { @@ -828,7 +828,7 @@ */ _styleSheetAdded(header) { console.assert(!this._styleSheetIdToHeader.get(header.styleSheetId)); - var styleSheetHeader = new WebInspector.CSSStyleSheetHeader(this, header); + var styleSheetHeader = new SDK.CSSStyleSheetHeader(this, header); this._styleSheetIdToHeader.set(header.styleSheetId, styleSheetHeader); var url = styleSheetHeader.resourceURL(); if (!this._styleSheetIdsForURL.get(url)) @@ -841,7 +841,7 @@ } styleSheetIds.push(styleSheetHeader.id); this._attachSourceMap(styleSheetHeader); - this.dispatchEventToListeners(WebInspector.CSSModel.Events.StyleSheetAdded, styleSheetHeader); + this.dispatchEventToListeners(SDK.CSSModel.Events.StyleSheetAdded, styleSheetHeader); } /** @@ -865,7 +865,7 @@ } this._originalStyleSheetText.remove(header); this._detachSourceMap(header); - this.dispatchEventToListeners(WebInspector.CSSModel.Events.StyleSheetRemoved, header); + this.dispatchEventToListeners(SDK.CSSModel.Events.StyleSheetRemoved, header); } /** @@ -890,9 +890,9 @@ * @return {!Promise.<?Protocol.Error>} */ setStyleSheetText(styleSheetId, newText, majorChange) { - var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (this._styleSheetIdToHeader.get(styleSheetId)); + var header = /** @type {!SDK.CSSStyleSheetHeader} */ (this._styleSheetIdToHeader.get(styleSheetId)); console.assert(header); - newText = WebInspector.CSSModel.trimSourceURL(newText); + newText = SDK.CSSModel.trimSourceURL(newText); if (header.hasSourceURL) newText += '\n/*# sourceURL=' + header.sourceURL + ' */'; return this._ensureOriginalStyleSheetText(styleSheetId) @@ -902,7 +902,7 @@ * @param {?Protocol.Error} error * @param {string=} sourceMapURL * @return {?Protocol.Error} - * @this {WebInspector.CSSModel} + * @this {SDK.CSSModel} */ function callback(error, sourceMapURL) { this._detachSourceMap(header); @@ -933,14 +933,14 @@ text = ''; // Fall through. } - return WebInspector.CSSModel.trimSourceURL(text); + return SDK.CSSModel.trimSourceURL(text); } return this._agent.getStyleSheetText(styleSheetId, textCallback).catchException(/** @type {string} */ ('')); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _mainFrameNavigated(event) { if (event.data.target() !== this.target()) @@ -954,7 +954,7 @@ this._styleSheetIdToHeader.clear(); for (var i = 0; i < headers.length; ++i) { this._detachSourceMap(headers[i]); - this.dispatchEventToListeners(WebInspector.CSSModel.Events.StyleSheetRemoved, headers[i]); + this.dispatchEventToListeners(SDK.CSSModel.Events.StyleSheetRemoved, headers[i]); } this._sourceMapByURL.clear(); this._sourceMapURLToHeaders.clear(); @@ -983,7 +983,7 @@ * @param {!Protocol.CSS.SourceRange} range */ _layoutEditorChange(id, range) { - this.dispatchEventToListeners(WebInspector.CSSModel.Events.LayoutEditorChange, {id: id, range: range}); + this.dispatchEventToListeners(SDK.CSSModel.Events.LayoutEditorChange, {id: id, range: range}); } /** @@ -996,8 +996,8 @@ } /** - * @param {!WebInspector.DOMNode} node - * @return {!Promise.<?WebInspector.CSSMatchedStyles>} + * @param {!SDK.DOMNode} node + * @return {!Promise.<?SDK.CSSMatchedStyles>} */ cachedMatchedCascadeForNode(node) { if (this._cachedMatchedCascadeNode !== node) @@ -1015,10 +1015,10 @@ }; /** @typedef {!{range: !Protocol.CSS.SourceRange, styleSheetId: !Protocol.CSS.StyleSheetId, wasUsed: boolean}} */ -WebInspector.CSSModel.RuleUsage; +SDK.CSSModel.RuleUsage; /** @enum {symbol} */ -WebInspector.CSSModel.Events = { +SDK.CSSModel.Events = { LayoutEditorChange: Symbol('LayoutEditorChange'), FontsUpdated: Symbol('FontsUpdated'), MediaQueryResultChanged: Symbol('MediaQueryResultChanged'), @@ -1032,25 +1032,25 @@ SourceMapChanged: Symbol('SourceMapChanged') }; -WebInspector.CSSModel.MediaTypes = +SDK.CSSModel.MediaTypes = ['all', 'braille', 'embossed', 'handheld', 'print', 'projection', 'screen', 'speech', 'tty', 'tv']; -WebInspector.CSSModel.PseudoStateMarker = 'pseudo-state-marker'; +SDK.CSSModel.PseudoStateMarker = 'pseudo-state-marker'; /** * @unrestricted */ -WebInspector.CSSModel.Edit = class { +SDK.CSSModel.Edit = class { /** * @param {!Protocol.CSS.StyleSheetId} styleSheetId - * @param {!WebInspector.TextRange} oldRange + * @param {!Common.TextRange} oldRange * @param {string} newText * @param {?Object} payload */ constructor(styleSheetId, oldRange, newText, payload) { this.styleSheetId = styleSheetId; this.oldRange = oldRange; - this.newRange = WebInspector.TextRange.fromEdit(oldRange, newText); + this.newRange = Common.TextRange.fromEdit(oldRange, newText); this.payload = payload; } }; @@ -1059,9 +1059,9 @@ /** * @unrestricted */ -WebInspector.CSSLocation = class extends WebInspector.SDKObject { +SDK.CSSLocation = class extends SDK.SDKObject { /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header * @param {number} lineNumber * @param {number=} columnNumber */ @@ -1075,14 +1075,14 @@ } /** - * @return {!WebInspector.CSSModel} + * @return {!SDK.CSSModel} */ cssModel() { return this._header.cssModel(); } /** - * @return {!WebInspector.CSSStyleSheetHeader} + * @return {!SDK.CSSStyleSheetHeader} */ header() { return this._header; @@ -1093,9 +1093,9 @@ * @implements {Protocol.CSSDispatcher} * @unrestricted */ -WebInspector.CSSDispatcher = class { +SDK.CSSDispatcher = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel */ constructor(cssModel) { this._cssModel = cssModel; @@ -1152,9 +1152,9 @@ /** * @unrestricted */ -WebInspector.CSSModel.ComputedStyleLoader = class { +SDK.CSSModel.ComputedStyleLoader = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel */ constructor(cssModel) { this._cssModel = cssModel; @@ -1190,7 +1190,7 @@ /** * @param {?Map.<string, string>} computedStyle * @return {?Map.<string, string>} - * @this {WebInspector.CSSModel.ComputedStyleLoader} + * @this {SDK.CSSModel.ComputedStyleLoader} */ function cleanUp(computedStyle) { this._nodeIdToPromise.delete(nodeId); @@ -1203,10 +1203,10 @@ /** * @unrestricted */ -WebInspector.CSSModel.InlineStyleResult = class { +SDK.CSSModel.InlineStyleResult = class { /** - * @param {?WebInspector.CSSStyleDeclaration} inlineStyle - * @param {?WebInspector.CSSStyleDeclaration} attributesStyle + * @param {?SDK.CSSStyleDeclaration} inlineStyle + * @param {?SDK.CSSStyleDeclaration} attributesStyle */ constructor(inlineStyle, attributesStyle) { this.inlineStyle = inlineStyle;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSParser.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSParser.js index 68b497f..755be91 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSParser.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSParser.js
@@ -7,7 +7,7 @@ /** * @unrestricted */ -WebInspector.CSSParser = class extends WebInspector.Object { +SDK.CSSParser = class extends Common.Object { constructor() { super(); this._rules = []; @@ -15,8 +15,8 @@ } /** - * @param {!WebInspector.CSSStyleSheetHeader} styleSheetHeader - * @param {function(!Array.<!WebInspector.CSSParser.Rule>)=} callback + * @param {!SDK.CSSStyleSheetHeader} styleSheetHeader + * @param {function(!Array.<!SDK.CSSParser.Rule>)=} callback */ fetchAndParse(styleSheetHeader, callback) { this._lock(); @@ -26,7 +26,7 @@ /** * @param {string} text - * @param {function(!Array.<!WebInspector.CSSParser.Rule>)=} callback + * @param {function(!Array.<!SDK.CSSParser.Rule>)=} callback */ parse(text, callback) { this._lock(); @@ -36,7 +36,7 @@ /** * @param {string} text - * @return {!Promise<!Array.<!WebInspector.CSSParser.Rule>>} + * @return {!Promise<!Array.<!SDK.CSSParser.Rule>>} */ parsePromise(text) { return new Promise(promiseConstructor.bind(this)); @@ -44,7 +44,7 @@ /** * @param {function()} succ * @param {function()} fail - * @this {WebInspector.CSSParser} + * @this {SDK.CSSParser} */ function promiseConstructor(succ, fail) { this.parse(text, succ); @@ -59,7 +59,7 @@ } /** - * @return {!Array.<!WebInspector.CSSParser.Rule>} + * @return {!Array.<!SDK.CSSParser.Rule>} */ rules() { return this._rules; @@ -80,7 +80,7 @@ _innerParse(text) { this._rules = []; var params = {content: text}; - WebInspector.formatterWorkerPool.runChunkedTask('parseCSS', params, this._onRuleChunk.bind(this)); + Common.formatterWorkerPool.runChunkedTask('parseCSS', params, this._onRuleChunk.bind(this)); } /** @@ -91,17 +91,17 @@ return; if (!event) { this._onFinishedParsing(); - this.dispatchEventToListeners(WebInspector.CSSParser.Events.RulesParsed); + this.dispatchEventToListeners(SDK.CSSParser.Events.RulesParsed); return; } - var data = /** @type {!WebInspector.CSSParser.DataChunk} */ (event.data); + var data = /** @type {!SDK.CSSParser.DataChunk} */ (event.data); var chunk = data.chunk; for (var i = 0; i < chunk.length; ++i) this._rules.push(chunk[i]); if (data.isLastChunk) this._onFinishedParsing(); - this.dispatchEventToListeners(WebInspector.CSSParser.Events.RulesParsed); + this.dispatchEventToListeners(SDK.CSSParser.Events.RulesParsed); } _onFinishedParsing() { @@ -110,7 +110,7 @@ } /** - * @param {!Array<!WebInspector.CSSRule>} rules + * @param {!Array<!SDK.CSSRule>} rules */ _runFinishedCallback(rules) { var callback = this._finishedCallback; @@ -121,29 +121,29 @@ }; /** @enum {symbol} */ -WebInspector.CSSParser.Events = { +SDK.CSSParser.Events = { RulesParsed: Symbol('RulesParsed') }; /** - * @typedef {{isLastChunk: boolean, chunk: !Array.<!WebInspector.CSSParser.Rule>}} + * @typedef {{isLastChunk: boolean, chunk: !Array.<!SDK.CSSParser.Rule>}} */ -WebInspector.CSSParser.DataChunk; +SDK.CSSParser.DataChunk; /** * @unrestricted */ -WebInspector.CSSParser.StyleRule = class { +SDK.CSSParser.StyleRule = class { constructor() { /** @type {string} */ this.selectorText; - /** @type {!WebInspector.CSSParser.Range} */ + /** @type {!SDK.CSSParser.Range} */ this.styleRange; /** @type {number} */ this.lineNumber; /** @type {number} */ this.columnNumber; - /** @type {!Array.<!WebInspector.CSSParser.Property>} */ + /** @type {!Array.<!SDK.CSSParser.Property>} */ this.properties; } }; @@ -151,32 +151,32 @@ /** * @typedef {{atRule: string, lineNumber: number, columnNumber: number}} */ -WebInspector.CSSParser.AtRule; +SDK.CSSParser.AtRule; /** - * @typedef {(WebInspector.CSSParser.StyleRule|WebInspector.CSSParser.AtRule)} + * @typedef {(SDK.CSSParser.StyleRule|SDK.CSSParser.AtRule)} */ -WebInspector.CSSParser.Rule; +SDK.CSSParser.Rule; /** * @typedef {{startLine: number, startColumn: number, endLine: number, endColumn: number}} */ -WebInspector.CSSParser.Range; +SDK.CSSParser.Range; /** * @unrestricted */ -WebInspector.CSSParser.Property = class { +SDK.CSSParser.Property = class { constructor() { /** @type {string} */ this.name; - /** @type {!WebInspector.CSSParser.Range} */ + /** @type {!SDK.CSSParser.Range} */ this.nameRange; /** @type {string} */ this.value; - /** @type {!WebInspector.CSSParser.Range} */ + /** @type {!SDK.CSSParser.Range} */ this.valueRange; - /** @type {!WebInspector.CSSParser.Range} */ + /** @type {!SDK.CSSParser.Range} */ this.range; /** @type {(boolean|undefined)} */ this.disabled;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSProperty.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSProperty.js index 99941ba..149b5759 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSProperty.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSProperty.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.CSSProperty = class { +SDK.CSSProperty = class { /** - * @param {!WebInspector.CSSStyleDeclaration} ownerStyle + * @param {!SDK.CSSStyleDeclaration} ownerStyle * @param {number} index * @param {string} name * @param {string} value @@ -27,17 +27,17 @@ this.parsedOk = parsedOk; this.implicit = implicit; // A longhand, implicitly set by missing values of shorthand. this.text = text; - this.range = range ? WebInspector.TextRange.fromObject(range) : null; + this.range = range ? Common.TextRange.fromObject(range) : null; this._active = true; this._nameRange = null; this._valueRange = null; } /** - * @param {!WebInspector.CSSStyleDeclaration} ownerStyle + * @param {!SDK.CSSStyleDeclaration} ownerStyle * @param {number} index * @param {!Protocol.CSS.CSSProperty} payload - * @return {!WebInspector.CSSProperty} + * @return {!SDK.CSSProperty} */ static parsePayload(ownerStyle, index, payload) { // The following default field values are used in the payload: @@ -45,7 +45,7 @@ // parsedOk: true // implicit: false // disabled: false - var result = new WebInspector.CSSProperty( + var result = new SDK.CSSProperty( ownerStyle, index, payload.name, payload.value, payload.important || false, payload.disabled || false, ('parsedOk' in payload) ? !!payload.parsedOk : true, !!payload.implicit, payload.text, payload.range); return result; @@ -55,7 +55,7 @@ if (this._nameRange && this._valueRange) return; var range = this.range; - var text = this.text ? new WebInspector.Text(this.text) : null; + var text = this.text ? new Common.Text(this.text) : null; if (!range || !text) return; @@ -64,17 +64,17 @@ if (nameIndex === -1 || valueIndex === -1 || nameIndex > valueIndex) return; - var nameSourceRange = new WebInspector.SourceRange(nameIndex, this.name.length); - var valueSourceRange = new WebInspector.SourceRange(valueIndex, this.value.length); + var nameSourceRange = new Common.SourceRange(nameIndex, this.name.length); + var valueSourceRange = new Common.SourceRange(valueIndex, this.value.length); this._nameRange = rebase(text.toTextRange(nameSourceRange), range.startLine, range.startColumn); this._valueRange = rebase(text.toTextRange(valueSourceRange), range.startLine, range.startColumn); /** - * @param {!WebInspector.TextRange} oneLineRange + * @param {!Common.TextRange} oneLineRange * @param {number} lineOffset * @param {number} columnOffset - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ function rebase(oneLineRange, lineOffset, columnOffset) { if (oneLineRange.startLine === 0) { @@ -88,7 +88,7 @@ } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ nameRange() { this._ensureRanges(); @@ -96,7 +96,7 @@ } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ valueRange() { this._ensureRanges(); @@ -104,7 +104,7 @@ } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.ownerStyle.styleSheetId !== edit.styleSheetId) @@ -153,7 +153,7 @@ return Promise.reject(new Error('Style not editable')); if (majorChange) - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleEdited); if (overwrite && propertyText === this.propertyText) { if (majorChange) @@ -163,19 +163,19 @@ var range = this.range.relativeTo(this.ownerStyle.range.startLine, this.ownerStyle.range.startColumn); var indentation = this.ownerStyle.cssText ? this._detectIndentation(this.ownerStyle.cssText) : - WebInspector.moduleSetting('textEditorIndent').get(); + Common.moduleSetting('textEditorIndent').get(); var endIndentation = this.ownerStyle.cssText ? indentation.substring(0, this.ownerStyle.range.endColumn) : ''; - var text = new WebInspector.Text(this.ownerStyle.cssText || ''); + var text = new Common.Text(this.ownerStyle.cssText || ''); var newStyleText = text.replaceRange(range, String.sprintf(';%s;', propertyText)); - return self.runtime.extension(WebInspector.TokenizerFactory) + return self.runtime.extension(Common.TokenizerFactory) .instance() .then(this._formatStyle.bind(this, newStyleText, indentation, endIndentation)) .then(setStyleText.bind(this)); /** * @param {string} styleText - * @this {WebInspector.CSSProperty} + * @this {SDK.CSSProperty} * @return {!Promise.<boolean>} */ function setStyleText(styleText) { @@ -187,7 +187,7 @@ * @param {string} styleText * @param {string} indentation * @param {string} endIndentation - * @param {!WebInspector.TokenizerFactory} tokenizerFactory + * @param {!Common.TokenizerFactory} tokenizerFactory * @return {string} */ _formatStyle(styleText, indentation, endIndentation, tokenizerFactory) { @@ -245,7 +245,7 @@ if (colon === -1) return false; var propertyName = text.substring(2, colon).trim(); - return WebInspector.cssMetadata().isCSSPropertyName(propertyName); + return SDK.cssMetadata().isCSSPropertyName(propertyName); } } @@ -257,7 +257,7 @@ var lines = text.split('\n'); if (lines.length < 2) return ''; - return WebInspector.TextUtils.lineIndent(lines[1]); + return Common.TextUtils.lineIndent(lines[1]); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSRule.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSRule.js index 4b08212..40edbb5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSRule.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSRule.js
@@ -4,18 +4,18 @@ /** * @unrestricted */ -WebInspector.CSSValue = class { +SDK.CSSValue = class { /** * @param {!Protocol.CSS.Value} payload */ constructor(payload) { this.text = payload.text; if (payload.range) - this.range = WebInspector.TextRange.fromObject(payload.range); + this.range = Common.TextRange.fromObject(payload.range); } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (!this.range) @@ -27,9 +27,9 @@ /** * @unrestricted */ -WebInspector.CSSRule = class { +SDK.CSSRule = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {{style: !Protocol.CSS.CSSStyle, styleSheetId: (string|undefined), origin: !Protocol.CSS.StyleSheetOrigin}} payload */ constructor(cssModel, payload) { @@ -41,12 +41,12 @@ this.sourceURL = styleSheetHeader.sourceURL; } this.origin = payload.origin; - this.style = new WebInspector.CSSStyleDeclaration( - this._cssModel, this, payload.style, WebInspector.CSSStyleDeclaration.Type.Regular); + this.style = new SDK.CSSStyleDeclaration( + this._cssModel, this, payload.style, SDK.CSSStyleDeclaration.Type.Regular); } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.styleSheetId !== edit.styleSheetId) @@ -96,9 +96,9 @@ /** * @unrestricted */ -WebInspector.CSSStyleRule = class extends WebInspector.CSSRule { +SDK.CSSStyleRule = class extends SDK.CSSRule { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSRule} payload * @param {boolean=} wasUsed */ @@ -106,14 +106,14 @@ super(cssModel, payload); this._reinitializeSelectors(payload.selectorList); - this.media = payload.media ? WebInspector.CSSMedia.parseMediaArrayPayload(cssModel, payload.media) : []; + this.media = payload.media ? SDK.CSSMedia.parseMediaArrayPayload(cssModel, payload.media) : []; this.wasUsed = wasUsed || false; } /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {string} selectorText - * @return {!WebInspector.CSSStyleRule} + * @return {!SDK.CSSStyleRule} */ static createDummyRule(cssModel, selectorText) { var dummyPayload = { @@ -121,19 +121,19 @@ selectors: [{text: selectorText}], }, style: - {styleSheetId: '0', range: new WebInspector.TextRange(0, 0, 0, 0), shorthandEntries: [], cssProperties: []} + {styleSheetId: '0', range: new Common.TextRange(0, 0, 0, 0), shorthandEntries: [], cssProperties: []} }; - return new WebInspector.CSSStyleRule(cssModel, /** @type {!Protocol.CSS.CSSRule} */ (dummyPayload)); + return new SDK.CSSStyleRule(cssModel, /** @type {!Protocol.CSS.CSSRule} */ (dummyPayload)); } /** * @param {!Protocol.CSS.SelectorList} selectorList */ _reinitializeSelectors(selectorList) { - /** @type {!Array.<!WebInspector.CSSValue>} */ + /** @type {!Array.<!SDK.CSSValue>} */ this.selectors = []; for (var i = 0; i < selectorList.selectors.length; ++i) - this.selectors.push(new WebInspector.CSSValue(selectorList.selectors[i])); + this.selectors.push(new SDK.CSSValue(selectorList.selectors[i])); } /** @@ -158,14 +158,14 @@ } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ selectorRange() { var firstRange = this.selectors[0].range; if (!firstRange) return null; var lastRange = this.selectors.peekLast().range; - return new WebInspector.TextRange( + return new Common.TextRange( firstRange.startLine, firstRange.startColumn, lastRange.endLine, lastRange.endColumn); } @@ -196,7 +196,7 @@ /** * @override - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.styleSheetId !== edit.styleSheetId) @@ -218,26 +218,26 @@ /** * @unrestricted */ -WebInspector.CSSKeyframesRule = class { +SDK.CSSKeyframesRule = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSKeyframesRule} payload */ constructor(cssModel, payload) { this._cssModel = cssModel; - this._animationName = new WebInspector.CSSValue(payload.animationName); - this._keyframes = payload.keyframes.map(keyframeRule => new WebInspector.CSSKeyframeRule(cssModel, keyframeRule)); + this._animationName = new SDK.CSSValue(payload.animationName); + this._keyframes = payload.keyframes.map(keyframeRule => new SDK.CSSKeyframeRule(cssModel, keyframeRule)); } /** - * @return {!WebInspector.CSSValue} + * @return {!SDK.CSSValue} */ name() { return this._animationName; } /** - * @return {!Array.<!WebInspector.CSSKeyframeRule>} + * @return {!Array.<!SDK.CSSKeyframeRule>} */ keyframes() { return this._keyframes; @@ -247,9 +247,9 @@ /** * @unrestricted */ -WebInspector.CSSKeyframeRule = class extends WebInspector.CSSRule { +SDK.CSSKeyframeRule = class extends SDK.CSSRule { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSKeyframeRule} payload */ constructor(cssModel, payload) { @@ -258,7 +258,7 @@ } /** - * @return {!WebInspector.CSSValue} + * @return {!SDK.CSSValue} */ key() { return this._keyText; @@ -268,12 +268,12 @@ * @param {!Protocol.CSS.Value} payload */ _reinitializeKey(payload) { - this._keyText = new WebInspector.CSSValue(payload); + this._keyText = new SDK.CSSValue(payload); } /** * @override - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.styleSheetId !== edit.styleSheetId || !this._keyText.range)
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleDeclaration.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleDeclaration.js index 0cf300a7..4762fbf 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleDeclaration.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleDeclaration.js
@@ -4,12 +4,12 @@ /** * @unrestricted */ -WebInspector.CSSStyleDeclaration = class { +SDK.CSSStyleDeclaration = class { /** - * @param {!WebInspector.CSSModel} cssModel - * @param {?WebInspector.CSSRule} parentRule + * @param {!SDK.CSSModel} cssModel + * @param {?SDK.CSSRule} parentRule * @param {!Protocol.CSS.CSSStyle} payload - * @param {!WebInspector.CSSStyleDeclaration.Type} type + * @param {!SDK.CSSStyleDeclaration.Type} type */ constructor(cssModel, parentRule, payload, type) { this._cssModel = cssModel; @@ -19,7 +19,7 @@ } /** - * @param {!WebInspector.CSSModel.Edit} edit + * @param {!SDK.CSSModel.Edit} edit */ rebase(edit) { if (this.styleSheetId !== edit.styleSheetId || !this.range) @@ -38,7 +38,7 @@ */ _reinitialize(payload) { this.styleSheetId = payload.styleSheetId; - this.range = payload.range ? WebInspector.TextRange.fromObject(payload.range) : null; + this.range = payload.range ? Common.TextRange.fromObject(payload.range) : null; var shorthandEntries = payload.shorthandEntries; /** @type {!Map.<string, string>} */ @@ -53,7 +53,7 @@ this._allProperties = []; for (var i = 0; i < payload.cssProperties.length; ++i) { - var property = WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]); + var property = SDK.CSSProperty.parsePayload(this, i, payload.cssProperties[i]); this._allProperties.push(property); } @@ -86,7 +86,7 @@ // For style-based properties, generate shorthands with values when possible. for (var property of this._allProperties) { // For style-based properties, try generating shorthands. - var shorthands = WebInspector.cssMetadata().shorthands(property.name) || []; + var shorthands = SDK.cssMetadata().shorthands(property.name) || []; for (var shorthand of shorthands) { if (propertiesSet.has(shorthand)) continue; // There already is a shorthand this longhands falls under. @@ -96,7 +96,7 @@ // Generate synthetic shorthand we have a value for. var shorthandImportance = !!this._shorthandIsImportant.has(shorthand); - var shorthandProperty = new WebInspector.CSSProperty( + var shorthandProperty = new SDK.CSSProperty( this, this.allProperties.length, shorthand, shorthandValue, shorthandImportance, false, true, false); generatedProperties.push(shorthandProperty); propertiesSet.add(shorthand); @@ -106,11 +106,11 @@ } /** - * @return {!Array.<!WebInspector.CSSProperty>} + * @return {!Array.<!SDK.CSSProperty>} */ _computeLeadingProperties() { /** - * @param {!WebInspector.CSSProperty} property + * @param {!SDK.CSSProperty} property * @return {boolean} */ function propertyHasRange(property) { @@ -122,7 +122,7 @@ var leadingProperties = []; for (var property of this._allProperties) { - var shorthands = WebInspector.cssMetadata().shorthands(property.name) || []; + var shorthands = SDK.cssMetadata().shorthands(property.name) || []; var belongToAnyShorthand = false; for (var shorthand of shorthands) { if (this._shorthandValues.get(shorthand)) { @@ -138,7 +138,7 @@ } /** - * @return {!Array.<!WebInspector.CSSProperty>} + * @return {!Array.<!SDK.CSSProperty>} */ leadingProperties() { if (!this._leadingProperties) @@ -147,14 +147,14 @@ } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._cssModel.target(); } /** - * @return {!WebInspector.CSSModel} + * @return {!SDK.CSSModel} */ cssModel() { return this._cssModel; @@ -168,7 +168,7 @@ property._setActive(false); continue; } - var canonicalName = WebInspector.cssMetadata().canonicalPropertyName(property.name); + var canonicalName = SDK.cssMetadata().canonicalPropertyName(property.name); var activeProperty = activeProperties[canonicalName]; if (!activeProperty) { activeProperties[canonicalName] = property; @@ -205,10 +205,10 @@ /** * @param {string} name - * @return {!Array.<!WebInspector.CSSProperty>} + * @return {!Array.<!SDK.CSSProperty>} */ longhandProperties(name) { - var longhands = WebInspector.cssMetadata().longhands(name); + var longhands = SDK.cssMetadata().longhands(name); var result = []; for (var i = 0; longhands && i < longhands.length; ++i) { var property = this._activePropertyMap.get(longhands[i]); @@ -220,7 +220,7 @@ /** * @param {number} index - * @return {?WebInspector.CSSProperty} + * @return {?SDK.CSSProperty} */ propertyAt(index) { return (index < this.allProperties.length) ? this.allProperties[index] : null; @@ -239,7 +239,7 @@ /** * @param {number} index - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ _insertionRange(index) { var property = this.propertyAt(index); @@ -248,12 +248,12 @@ /** * @param {number=} index - * @return {!WebInspector.CSSProperty} + * @return {!SDK.CSSProperty} */ newBlankProperty(index) { index = (typeof index === 'undefined') ? this.pastLastSourcePropertyIndex() : index; var property = - new WebInspector.CSSProperty(this, index, '', '', false, false, true, false, '', this._insertionRange(index)); + new SDK.CSSProperty(this, index, '', '', false, false, true, false, '', this._insertionRange(index)); return property; } @@ -287,7 +287,7 @@ }; /** @enum {string} */ -WebInspector.CSSStyleDeclaration.Type = { +SDK.CSSStyleDeclaration.Type = { Regular: 'Regular', Inline: 'Inline', Attributes: 'Attributes'
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js index 0e0f1f3..d067b6d 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.CSSStyleSheetHeader = class { +SDK.CSSStyleSheetHeader = class { /** - * @param {!WebInspector.CSSModel} cssModel + * @param {!SDK.CSSModel} cssModel * @param {!Protocol.CSS.CSSStyleSheetHeader} payload */ constructor(cssModel, payload) { @@ -23,18 +23,18 @@ this.startLine = payload.startLine; this.startColumn = payload.startColumn; if (payload.ownerNode) - this.ownerNode = new WebInspector.DeferredDOMNode(cssModel.target(), payload.ownerNode); + this.ownerNode = new SDK.DeferredDOMNode(cssModel.target(), payload.ownerNode); this.setSourceMapURL(payload.sourceMapURL); } /** - * @return {!WebInspector.ContentProvider} + * @return {!Common.ContentProvider} */ originalContentProvider() { if (!this._originalContentProvider) { var lazyContent = this._cssModel.originalStyleSheetText.bind(this._cssModel, this); this._originalContentProvider = - new WebInspector.StaticContentProvider(this.contentURL(), this.contentType(), lazyContent); + new Common.StaticContentProvider(this.contentURL(), this.contentType(), lazyContent); } return this._originalContentProvider; } @@ -44,20 +44,20 @@ */ setSourceMapURL(sourceMapURL) { var completeSourceMapURL = this.sourceURL && sourceMapURL ? - WebInspector.ParsedURL.completeURL(this.sourceURL, sourceMapURL) : + Common.ParsedURL.completeURL(this.sourceURL, sourceMapURL) : sourceMapURL; this.sourceMapURL = completeSourceMapURL; } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._cssModel.target(); } /** - * @return {!WebInspector.CSSModel} + * @return {!SDK.CSSModel} */ cssModel() { return this._cssModel; @@ -74,10 +74,10 @@ * @return {string} */ _viaInspectorResourceURL() { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this.target()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(this.target()); var frame = resourceTreeModel.frameForId(this.frameId); console.assert(frame); - var parsedURL = new WebInspector.ParsedURL(frame.url); + var parsedURL = new Common.ParsedURL(frame.url); var fakeURL = 'inspector://' + parsedURL.host + parsedURL.folderPathComponents; if (!fakeURL.endsWith('/')) fakeURL += '/'; @@ -112,10 +112,10 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { - return WebInspector.resourceTypes.Stylesheet; + return Common.resourceTypes.Stylesheet; } /** @@ -131,11 +131,11 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { function performSearch(content) { - callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); + callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); } // searchInContent should call back later. @@ -151,12 +151,12 @@ }; /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.CSSStyleSheetHeader.OriginalContentProvider = class { +SDK.CSSStyleSheetHeader.OriginalContentProvider = class { /** - * @param {!WebInspector.CSSStyleSheetHeader} header + * @param {!SDK.CSSStyleSheetHeader} header */ constructor(header) { this._header = header; @@ -172,7 +172,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._header.contentType(); @@ -191,7 +191,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { /** @@ -199,7 +199,7 @@ */ function performSearch(content) { var searchResults = - content ? WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : []; + content ? Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : []; callback(searchResults); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Connections.js b/third_party/WebKit/Source/devtools/front_end/sdk/Connections.js index 07b5839..4fa18c43 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Connections.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Connections.js
@@ -5,7 +5,7 @@ * @implements {InspectorBackendClass.Connection} * @unrestricted */ -WebInspector.MainConnection = class { +SDK.MainConnection = class { /** * @param {!InspectorBackendClass.Connection.Params} params */ @@ -33,14 +33,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _dispatchMessage(event) { this._onMessage.call(null, /** @type {string} */ (event.data)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _dispatchMessageChunk(event) { var messageChunk = /** @type {string} */ (event.data['messageChunk']); @@ -58,7 +58,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _evaluateForTestInFrontend(event) { if (!InspectorFrontendHost.isUnderTest()) @@ -88,7 +88,7 @@ */ disconnect() { var onDisconnect = this._onDisconnect; - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); this._onDisconnect = null; this._onMessage = null; this._disconnected = true; @@ -107,7 +107,7 @@ * @implements {InspectorBackendClass.Connection} * @unrestricted */ -WebInspector.WebSocketConnection = class { +SDK.WebSocketConnection = class { /** * @param {string} url * @param {function()} onWebSocketDisconnect @@ -190,7 +190,7 @@ * @implements {InspectorBackendClass.Connection} * @unrestricted */ -WebInspector.StubConnection = class { +SDK.StubConnection = class { /** * @param {!InspectorBackendClass.Connection.Params} params */
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js index 652fbaa..a8e15f18 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
@@ -31,24 +31,24 @@ /** * @unrestricted */ -WebInspector.ConsoleModel = class extends WebInspector.SDKModel { +SDK.ConsoleModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {?Protocol.LogAgent} logAgent */ constructor(target, logAgent) { - super(WebInspector.ConsoleModel, target); + super(SDK.ConsoleModel, target); - /** @type {!Array.<!WebInspector.ConsoleMessage>} */ + /** @type {!Array.<!SDK.ConsoleMessage>} */ this._messages = []; - /** @type {!Map<number, !WebInspector.ConsoleMessage>} */ + /** @type {!Map<number, !SDK.ConsoleMessage>} */ this._messageByExceptionId = new Map(); this._warnings = 0; this._errors = 0; this._revokedErrors = 0; this._logAgent = logAgent; if (this._logAgent) { - target.registerLogDispatcher(new WebInspector.LogDispatcher(this)); + target.registerLogDispatcher(new SDK.LogDispatcher(this)); this._logAgent.enable(); if (!InspectorFrontendHost.isUnderTest()) { this._logAgent.startViolationsReport([ @@ -60,7 +60,7 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @param {string} text * @param {boolean=} useCommandLineAPI */ @@ -68,24 +68,24 @@ var target = executionContext.target(); var requestedText = text; - var commandMessage = new WebInspector.ConsoleMessage( - target, WebInspector.ConsoleMessage.MessageSource.JS, null, text, - WebInspector.ConsoleMessage.MessageType.Command); + var commandMessage = new SDK.ConsoleMessage( + target, SDK.ConsoleMessage.MessageSource.JS, null, text, + SDK.ConsoleMessage.MessageType.Command); commandMessage.setExecutionContextId(executionContext.id); target.consoleModel.addMessage(commandMessage); /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ function printResult(result, exceptionDetails) { if (!result) return; - WebInspector.console.showPromise().then(reportUponEvaluation); + Common.console.showPromise().then(reportUponEvaluation); function reportUponEvaluation() { target.consoleModel.dispatchEventToListeners( - WebInspector.ConsoleModel.Events.CommandEvaluated, + SDK.ConsoleModel.Events.CommandEvaluated, {result: result, text: requestedText, commandMessage: commandMessage, exceptionDetails: exceptionDetails}); } } @@ -117,32 +117,32 @@ text = '(' + text + ')'; executionContext.evaluate(text, 'console', !!useCommandLineAPI, false, false, true, true, printResult); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ConsoleEvaluated); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConsoleEvaluated); } /** - * @param {!WebInspector.ConsoleMessage} msg + * @param {!SDK.ConsoleMessage} msg */ addMessage(msg) { if (this._isBlacklisted(msg)) return; - if (msg.source === WebInspector.ConsoleMessage.MessageSource.Worker && msg.target().subTargetsManager && + if (msg.source === SDK.ConsoleMessage.MessageSource.Worker && msg.target().subTargetsManager && msg.target().subTargetsManager.targetForId(msg.workerId)) return; - if (msg.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI && - msg.type === WebInspector.ConsoleMessage.MessageType.Clear) + if (msg.source === SDK.ConsoleMessage.MessageSource.ConsoleAPI && + msg.type === SDK.ConsoleMessage.MessageType.Clear) this.clear(); - if (msg.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError && msg._revokedExceptionId) { + if (msg.level === SDK.ConsoleMessage.MessageLevel.RevokedError && msg._revokedExceptionId) { var exceptionMessage = this._messageByExceptionId.get(msg._revokedExceptionId); if (!exceptionMessage) return; this._errors--; this._revokedErrors++; - exceptionMessage.level = WebInspector.ConsoleMessage.MessageLevel.RevokedError; - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageUpdated, exceptionMessage); + exceptionMessage.level = SDK.ConsoleMessage.MessageLevel.RevokedError; + this.dispatchEventToListeners(SDK.ConsoleModel.Events.MessageUpdated, exceptionMessage); return; } @@ -150,33 +150,33 @@ if (msg._exceptionId) this._messageByExceptionId.set(msg._exceptionId, msg); this._incrementErrorWarningCount(msg); - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageAdded, msg); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.MessageAdded, msg); } /** - * @param {!WebInspector.ConsoleMessage} msg + * @param {!SDK.ConsoleMessage} msg */ _incrementErrorWarningCount(msg) { switch (msg.level) { - case WebInspector.ConsoleMessage.MessageLevel.Warning: + case SDK.ConsoleMessage.MessageLevel.Warning: this._warnings++; break; - case WebInspector.ConsoleMessage.MessageLevel.Error: + case SDK.ConsoleMessage.MessageLevel.Error: this._errors++; break; - case WebInspector.ConsoleMessage.MessageLevel.RevokedError: + case SDK.ConsoleMessage.MessageLevel.RevokedError: this._revokedErrors++; break; } } /** - * @param {!WebInspector.ConsoleMessage} msg + * @param {!SDK.ConsoleMessage} msg * @return {boolean} */ _isBlacklisted(msg) { - if (msg.source !== WebInspector.ConsoleMessage.MessageSource.Network || - msg.level !== WebInspector.ConsoleMessage.MessageLevel.Error || !msg.url || + if (msg.source !== SDK.ConsoleMessage.MessageSource.Network || + msg.level !== SDK.ConsoleMessage.MessageLevel.Error || !msg.url || !msg.url.startsWith('chrome-extension')) return false; @@ -194,7 +194,7 @@ } /** - * @return {!Array.<!WebInspector.ConsoleMessage>} + * @return {!Array.<!SDK.ConsoleMessage>} */ messages() { return this._messages; @@ -211,7 +211,7 @@ this._errors = 0; this._revokedErrors = 0; this._warnings = 0; - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCleared); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.ConsoleCleared); } /** @@ -237,7 +237,7 @@ }; /** @enum {symbol} */ -WebInspector.ConsoleModel.Events = { +SDK.ConsoleModel.Events = { ConsoleCleared: Symbol('ConsoleCleared'), MessageAdded: Symbol('MessageAdded'), MessageUpdated: Symbol('MessageUpdated'), @@ -248,9 +248,9 @@ /** * @unrestricted */ -WebInspector.ConsoleMessage = class { +SDK.ConsoleMessage = class { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {string} source * @param {?string} level * @param {string} messageText @@ -286,7 +286,7 @@ this.source = source; this.level = level; this.messageText = messageText; - this.type = type || WebInspector.ConsoleMessage.MessageType.Log; + this.type = type || SDK.ConsoleMessage.MessageType.Log; /** @type {string|undefined} */ this.url = url || undefined; /** @type {number} */ @@ -301,7 +301,7 @@ this.scriptId = scriptId || null; this.workerId = workerId || null; - var networkLog = target && WebInspector.NetworkLog.fromTarget(target); + var networkLog = target && SDK.NetworkLog.fromTarget(target); this.request = (requestId && networkLog) ? networkLog.requestForId(requestId) : null; if (this.request) { @@ -317,8 +317,8 @@ } /** - * @param {!WebInspector.ConsoleMessage} a - * @param {!WebInspector.ConsoleMessage} b + * @param {!SDK.ConsoleMessage} a + * @param {!SDK.ConsoleMessage} b * @return {number} */ static timestampComparator(a, b) { @@ -341,33 +341,33 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Runtime.ExceptionDetails} exceptionDetails * @param {string=} messageType * @param {number=} timestamp * @param {string=} forceUrl - * @return {!WebInspector.ConsoleMessage} + * @return {!SDK.ConsoleMessage} */ static fromException(target, exceptionDetails, messageType, timestamp, forceUrl) { - return new WebInspector.ConsoleMessage( - target, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Error, - WebInspector.ConsoleMessage.simpleTextFromException(exceptionDetails), messageType, + return new SDK.ConsoleMessage( + target, SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Error, + SDK.ConsoleMessage.simpleTextFromException(exceptionDetails), messageType, forceUrl || exceptionDetails.url, exceptionDetails.lineNumber, exceptionDetails.columnNumber, undefined, exceptionDetails.exception ? - [WebInspector.RemoteObject.fromLocalObject(exceptionDetails.text), exceptionDetails.exception] : + [SDK.RemoteObject.fromLocalObject(exceptionDetails.text), exceptionDetails.exception] : undefined, exceptionDetails.stackTrace, timestamp, exceptionDetails.executionContextId, exceptionDetails.scriptId); } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._target; } /** - * @param {!WebInspector.ConsoleMessage} originatingMessage + * @param {!SDK.ConsoleMessage} originatingMessage */ setOriginatingMessage(originatingMessage) { this._originatingConsoleMessage = originatingMessage; @@ -396,7 +396,7 @@ } /** - * @return {?WebInspector.ConsoleMessage} + * @return {?SDK.ConsoleMessage} */ originatingMessage() { return this._originatingConsoleMessage; @@ -406,17 +406,17 @@ * @return {boolean} */ isGroupMessage() { - return this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || - this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed || - this.type === WebInspector.ConsoleMessage.MessageType.EndGroup; + return this.type === SDK.ConsoleMessage.MessageType.StartGroup || + this.type === SDK.ConsoleMessage.MessageType.StartGroupCollapsed || + this.type === SDK.ConsoleMessage.MessageType.EndGroup; } /** * @return {boolean} */ isGroupStartMessage() { - return this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || - this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed; + return this.type === SDK.ConsoleMessage.MessageType.StartGroup || + this.type === SDK.ConsoleMessage.MessageType.StartGroupCollapsed; } /** @@ -424,12 +424,12 @@ */ isErrorOrWarning() { return ( - this.level === WebInspector.ConsoleMessage.MessageLevel.Warning || - this.level === WebInspector.ConsoleMessage.MessageLevel.Error); + this.level === SDK.ConsoleMessage.MessageLevel.Warning || + this.level === SDK.ConsoleMessage.MessageLevel.Error); } /** - * @param {?WebInspector.ConsoleMessage} msg + * @param {?SDK.ConsoleMessage} msg * @return {boolean} */ isEqual(msg) { @@ -490,7 +490,7 @@ /** * @enum {string} */ -WebInspector.ConsoleMessage.MessageSource = { +SDK.ConsoleMessage.MessageSource = { XML: 'xml', JS: 'javascript', Network: 'network', @@ -509,7 +509,7 @@ /** * @enum {string} */ -WebInspector.ConsoleMessage.MessageType = { +SDK.ConsoleMessage.MessageType = { Log: 'log', Debug: 'debug', Info: 'info', @@ -533,7 +533,7 @@ /** * @enum {string} */ -WebInspector.ConsoleMessage.MessageLevel = { +SDK.ConsoleMessage.MessageLevel = { Log: 'log', Info: 'info', Warning: 'warning', @@ -547,9 +547,9 @@ * @implements {Protocol.LogDispatcher} * @unrestricted */ -WebInspector.LogDispatcher = class { +SDK.LogDispatcher = class { /** - * @param {!WebInspector.ConsoleModel} console + * @param {!SDK.ConsoleModel} console */ constructor(console) { this._console = console; @@ -560,7 +560,7 @@ * @param {!Protocol.Log.LogEntry} payload */ entryAdded(payload) { - var consoleMessage = new WebInspector.ConsoleMessage( + var consoleMessage = new SDK.ConsoleMessage( this._console.target(), payload.source, payload.level, payload.text, undefined, payload.url, payload.lineNumber, undefined, payload.networkRequestId, undefined, payload.stackTrace, payload.timestamp, undefined, undefined, payload.workerId); @@ -569,49 +569,49 @@ }; /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.MultitargetConsoleModel = class extends WebInspector.Object { +SDK.MultitargetConsoleModel = class extends Common.Object { constructor() { super(); - WebInspector.targetManager.observeTargets(this); - WebInspector.targetManager.addModelListener( - WebInspector.ConsoleModel, WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); - WebInspector.targetManager.addModelListener( - WebInspector.ConsoleModel, WebInspector.ConsoleModel.Events.MessageUpdated, this._consoleMessageUpdated, this); - WebInspector.targetManager.addModelListener( - WebInspector.ConsoleModel, WebInspector.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this); + SDK.targetManager.observeTargets(this); + SDK.targetManager.addModelListener( + SDK.ConsoleModel, SDK.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); + SDK.targetManager.addModelListener( + SDK.ConsoleModel, SDK.ConsoleModel.Events.MessageUpdated, this._consoleMessageUpdated, this); + SDK.targetManager.addModelListener( + SDK.ConsoleModel, SDK.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (!this._mainTarget) { this._mainTarget = target; - target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); + target.consoleModel.addEventListener(SDK.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); } } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (this._mainTarget === target) { delete this._mainTarget; target.consoleModel.removeEventListener( - WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); + SDK.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this); } } /** - * @return {!Array.<!WebInspector.ConsoleMessage>} + * @return {!Array.<!SDK.ConsoleMessage>} */ messages() { - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); var result = []; for (var i = 0; i < targets.length; ++i) result = result.concat(targets[i].consoleModel.messages()); @@ -619,32 +619,32 @@ } _consoleCleared() { - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCleared); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.ConsoleCleared); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _consoleMessageAdded(event) { - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageAdded, event.data); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.MessageAdded, event.data); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _consoleMessageUpdated(event) { - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageUpdated, event.data); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.MessageUpdated, event.data); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _commandEvaluated(event) { - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEvaluated, event.data); + this.dispatchEventToListeners(SDK.ConsoleModel.Events.CommandEvaluated, event.data); } }; /** - * @type {!WebInspector.MultitargetConsoleModel} + * @type {!SDK.MultitargetConsoleModel} */ -WebInspector.multitargetConsoleModel; +SDK.multitargetConsoleModel;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js index 5288f26..c6d0b0c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js
@@ -28,13 +28,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.CompilerSourceMappingContentProvider = class { +SDK.CompilerSourceMappingContentProvider = class { /** * @param {string} sourceURL - * @param {!WebInspector.ResourceType} contentType + * @param {!Common.ResourceType} contentType */ constructor(sourceURL, contentType) { this._sourceURL = sourceURL; @@ -51,7 +51,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._contentType; @@ -64,14 +64,14 @@ requestContent() { var callback; var promise = new Promise(fulfill => callback = fulfill); - WebInspector.multitargetNetworkManager.loadResource(this._sourceURL, contentLoaded.bind(this)); + SDK.multitargetNetworkManager.loadResource(this._sourceURL, contentLoaded.bind(this)); return promise; /** * @param {number} statusCode * @param {!Object.<string, string>} headers * @param {string} content - * @this {WebInspector.CompilerSourceMappingContentProvider} + * @this {SDK.CompilerSourceMappingContentProvider} */ function contentLoaded(statusCode, headers, content) { if (statusCode >= 400) { @@ -91,7 +91,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { this.requestContent().then(contentLoaded); @@ -105,7 +105,7 @@ return; } - callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); + callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js b/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js index 476b890..90cd748 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js
@@ -37,34 +37,34 @@ /** * @unrestricted */ -WebInspector.CookieParser = class { +SDK.CookieParser = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { this._target = target; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string|undefined} header - * @return {?Array.<!WebInspector.Cookie>} + * @return {?Array.<!SDK.Cookie>} */ static parseCookie(target, header) { - return (new WebInspector.CookieParser(target)).parseCookie(header); + return (new SDK.CookieParser(target)).parseCookie(header); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string|undefined} header - * @return {?Array.<!WebInspector.Cookie>} + * @return {?Array.<!SDK.Cookie>} */ static parseSetCookie(target, header) { - return (new WebInspector.CookieParser(target)).parseSetCookie(header); + return (new SDK.CookieParser(target)).parseSetCookie(header); } /** - * @return {!Array.<!WebInspector.Cookie>} + * @return {!Array.<!SDK.Cookie>} */ cookies() { return this._cookies; @@ -72,7 +72,7 @@ /** * @param {string|undefined} cookieHeader - * @return {?Array.<!WebInspector.Cookie>} + * @return {?Array.<!SDK.Cookie>} */ parseCookie(cookieHeader) { if (!this._initialize(cookieHeader)) @@ -82,7 +82,7 @@ if (kv.key.charAt(0) === '$' && this._lastCookie) this._lastCookie.addAttribute(kv.key.slice(1), kv.value); else if (kv.key.toLowerCase() !== '$version' && typeof kv.value === 'string') - this._addCookie(kv, WebInspector.Cookie.Type.Request); + this._addCookie(kv, SDK.Cookie.Type.Request); this._advanceAndCheckCookieDelimiter(); } this._flushCookie(); @@ -91,7 +91,7 @@ /** * @param {string|undefined} setCookieHeader - * @return {?Array.<!WebInspector.Cookie>} + * @return {?Array.<!SDK.Cookie>} */ parseSetCookie(setCookieHeader) { if (!this._initialize(setCookieHeader)) @@ -100,7 +100,7 @@ if (this._lastCookie) this._lastCookie.addAttribute(kv.key, kv.value); else - this._addCookie(kv, WebInspector.Cookie.Type.Response); + this._addCookie(kv, SDK.Cookie.Type.Response); if (this._advanceAndCheckCookieDelimiter()) this._flushCookie(); } @@ -129,7 +129,7 @@ } /** - * @return {?WebInspector.CookieParser.KeyValue} + * @return {?SDK.CookieParser.KeyValue} */ _extractKeyValue() { if (!this._input || !this._input.length) @@ -145,7 +145,7 @@ return null; } - var result = new WebInspector.CookieParser.KeyValue( + var result = new SDK.CookieParser.KeyValue( keyValueMatch[1], keyValueMatch[2] && keyValueMatch[2].trim(), this._originalInputLength - this._input.length); this._input = this._input.slice(keyValueMatch[0].length); return result; @@ -163,8 +163,8 @@ } /** - * @param {!WebInspector.CookieParser.KeyValue} keyValue - * @param {!WebInspector.Cookie.Type} type + * @param {!SDK.CookieParser.KeyValue} keyValue + * @param {!SDK.Cookie.Type} type */ _addCookie(keyValue, type) { if (this._lastCookie) @@ -172,8 +172,8 @@ // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o "=") as // specifying a value for a cookie with empty name. this._lastCookie = typeof keyValue.value === 'string' ? - new WebInspector.Cookie(this._target, keyValue.key, keyValue.value, type) : - new WebInspector.Cookie(this._target, '', keyValue.key, type); + new SDK.Cookie(this._target, keyValue.key, keyValue.value, type) : + new SDK.Cookie(this._target, '', keyValue.key, type); this._lastCookiePosition = keyValue.position; this._cookies.push(this._lastCookie); } @@ -182,7 +182,7 @@ /** * @unrestricted */ -WebInspector.CookieParser.KeyValue = class { +SDK.CookieParser.KeyValue = class { /** * @param {string} key * @param {string|undefined} value @@ -199,12 +199,12 @@ /** * @unrestricted */ -WebInspector.Cookie = class { +SDK.Cookie = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} name * @param {string} value - * @param {?WebInspector.Cookie.Type} type + * @param {?SDK.Cookie.Type} type */ constructor(target, name, value, type) { this._target = target; @@ -229,7 +229,7 @@ } /** - * @return {?WebInspector.Cookie.Type} + * @return {?SDK.Cookie.Type} */ type() { return this._type; @@ -357,20 +357,20 @@ /** * @enum {number} */ -WebInspector.Cookie.Type = { +SDK.Cookie.Type = { Request: 0, Response: 1 }; -WebInspector.Cookies = {}; +SDK.Cookies = {}; /** - * @param {function(!Array.<!WebInspector.Cookie>)} callback + * @param {function(!Array.<!SDK.Cookie>)} callback */ -WebInspector.Cookies.getCookiesAsync = function(callback) { +SDK.Cookies.getCookiesAsync = function(callback) { var allCookies = []; /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {?Protocol.Error} error * @param {!Array.<!Protocol.Network.Cookie>} cookies */ @@ -380,22 +380,22 @@ return; } for (var i = 0; i < cookies.length; ++i) - allCookies.push(WebInspector.Cookies._parseProtocolCookie(target, cookies[i])); + allCookies.push(SDK.Cookies._parseProtocolCookie(target, cookies[i])); } var barrier = new CallbackBarrier(); - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Network)) + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Network)) target.networkAgent().getCookies(barrier.createCallback(mycallback.bind(null, target))); barrier.callWhenDone(callback.bind(null, allCookies)); }; /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Network.Cookie} protocolCookie - * @return {!WebInspector.Cookie} + * @return {!SDK.Cookie} */ -WebInspector.Cookies._parseProtocolCookie = function(target, protocolCookie) { - var cookie = new WebInspector.Cookie(target, protocolCookie.name, protocolCookie.value, null); +SDK.Cookies._parseProtocolCookie = function(target, protocolCookie) { + var cookie = new SDK.Cookie(target, protocolCookie.name, protocolCookie.value, null); cookie.addAttribute('domain', protocolCookie['domain']); cookie.addAttribute('path', protocolCookie['path']); cookie.addAttribute('port', protocolCookie['port']); @@ -412,13 +412,13 @@ }; /** - * @param {!WebInspector.Cookie} cookie + * @param {!SDK.Cookie} cookie * @param {string} resourceURL * @return {boolean} */ -WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL) { +SDK.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL) { var url = resourceURL.asParsedURL(); - if (!url || !WebInspector.Cookies.cookieDomainMatchesResourceDomain(cookie.domain(), url.host)) + if (!url || !SDK.Cookies.cookieDomainMatchesResourceDomain(cookie.domain(), url.host)) return false; return ( url.path.startsWith(cookie.path()) && (!cookie.port() || url.port === cookie.port()) && @@ -430,7 +430,7 @@ * @param {string} resourceDomain * @return {boolean} */ -WebInspector.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain) { +SDK.Cookies.cookieDomainMatchesResourceDomain = function(cookieDomain, resourceDomain) { if (cookieDomain.charAt(0) !== '.') return resourceDomain === cookieDomain; return !!resourceDomain.match(new RegExp('^([^\\.]+\\.)*' + cookieDomain.substring(1).escapeForRegExp() + '$', 'i'));
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js index 6b830e82..1acb20d0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
@@ -32,9 +32,9 @@ /** * @unrestricted */ -WebInspector.DOMNode = class extends WebInspector.SDKObject { +SDK.DOMNode = class extends SDK.SDKObject { /** - * @param {!WebInspector.DOMModel} domModel + * @param {!SDK.DOMModel} domModel */ constructor(domModel) { super(domModel.target()); @@ -42,20 +42,20 @@ } /** - * @param {!WebInspector.DOMModel} domModel - * @param {?WebInspector.DOMDocument} doc + * @param {!SDK.DOMModel} domModel + * @param {?SDK.DOMDocument} doc * @param {boolean} isInShadowTree * @param {!Protocol.DOM.Node} payload - * @return {!WebInspector.DOMNode} + * @return {!SDK.DOMNode} */ static create(domModel, doc, isInShadowTree, payload) { - var node = new WebInspector.DOMNode(domModel); + var node = new SDK.DOMNode(domModel); node._init(doc, isInShadowTree, payload); return node; } /** - * @param {?WebInspector.DOMDocument} doc + * @param {?SDK.DOMDocument} doc * @param {boolean} isInShadowTree * @param {!Protocol.DOM.Node} payload */ @@ -99,7 +99,7 @@ if (payload.shadowRoots) { for (var i = 0; i < payload.shadowRoots.length; ++i) { var root = payload.shadowRoots[i]; - var node = WebInspector.DOMNode.create(this._domModel, this.ownerDocument, true, root); + var node = SDK.DOMNode.create(this._domModel, this.ownerDocument, true, root); this._shadowRoots.push(node); node.parentNode = this; } @@ -107,13 +107,13 @@ if (payload.templateContent) { this._templateContent = - WebInspector.DOMNode.create(this._domModel, this.ownerDocument, true, payload.templateContent); + SDK.DOMNode.create(this._domModel, this.ownerDocument, true, payload.templateContent); this._templateContent.parentNode = this; } if (payload.importedDocument) { this._importedDocument = - WebInspector.DOMNode.create(this._domModel, this.ownerDocument, true, payload.importedDocument); + SDK.DOMNode.create(this._domModel, this.ownerDocument, true, payload.importedDocument); this._importedDocument.parentNode = this; } @@ -126,7 +126,7 @@ this._setPseudoElements(payload.pseudoElements); if (payload.contentDocument) { - this._contentDocument = new WebInspector.DOMDocument(this._domModel, payload.contentDocument); + this._contentDocument = new SDK.DOMDocument(this._domModel, payload.contentDocument); this._children = [this._contentDocument]; this._renumber(); } @@ -148,7 +148,7 @@ } /** - * @return {!WebInspector.DOMModel} + * @return {!SDK.DOMModel} */ domModel() { return this._domModel; @@ -162,7 +162,7 @@ } /** - * @return {?Array.<!WebInspector.DOMNode>} + * @return {?Array.<!SDK.DOMNode>} */ children() { return this._children ? this._children.slice() : null; @@ -190,21 +190,21 @@ } /** - * @return {!Array.<!WebInspector.DOMNode>} + * @return {!Array.<!SDK.DOMNode>} */ shadowRoots() { return this._shadowRoots.slice(); } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ templateContent() { return this._templateContent || null; } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ importedDocument() { return this._importedDocument || null; @@ -239,28 +239,28 @@ } /** - * @return {!Map<string, !WebInspector.DOMNode>} + * @return {!Map<string, !SDK.DOMNode>} */ pseudoElements() { return this._pseudoElements; } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ beforePseudoElement() { if (!this._pseudoElements) return null; - return this._pseudoElements.get(WebInspector.DOMNode.PseudoElementNames.Before); + return this._pseudoElements.get(SDK.DOMNode.PseudoElementNames.Before); } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ afterPseudoElement() { if (!this._pseudoElements) return null; - return this._pseudoElements.get(WebInspector.DOMNode.PseudoElementNames.After); + return this._pseudoElements.get(SDK.DOMNode.PseudoElementNames.After); } /** @@ -272,7 +272,7 @@ } /** - * @return {!Array.<!WebInspector.DOMNodeShortcut>} + * @return {!Array.<!SDK.DOMNodeShortcut>} */ distributedNodes() { return this._distributedNodes || []; @@ -286,7 +286,7 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ ancestorShadowHost() { var ancestorShadowRoot = this.ancestorShadowRoot(); @@ -294,7 +294,7 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ ancestorShadowRoot() { if (!this._isInShadowTree) @@ -307,13 +307,13 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ ancestorUserAgentShadowRoot() { var ancestorShadowRoot = this.ancestorShadowRoot(); if (!ancestorShadowRoot) return null; - return ancestorShadowRoot.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent ? ancestorShadowRoot : + return ancestorShadowRoot.shadowRootType() === SDK.DOMNode.ShadowRootTypes.UserAgent ? ancestorShadowRoot : null; } @@ -409,7 +409,7 @@ } /** - * @return {!Array<!WebInspector.DOMNode.Attribute>} + * @return {!Array<!SDK.DOMNode.Attribute>} */ attributes() { return this._attributes; @@ -422,7 +422,7 @@ removeAttribute(name, callback) { /** * @param {?Protocol.Error} error - * @this {WebInspector.DOMNode} + * @this {SDK.DOMNode} */ function mycallback(error) { if (!error) { @@ -441,7 +441,7 @@ } /** - * @param {function(?Array.<!WebInspector.DOMNode>)=} callback + * @param {function(?Array.<!SDK.DOMNode>)=} callback */ getChildNodes(callback) { if (this._children) { @@ -451,7 +451,7 @@ } /** - * @this {WebInspector.DOMNode} + * @this {SDK.DOMNode} * @param {?Protocol.Error} error */ function mycallback(error) { @@ -464,11 +464,11 @@ /** * @param {number} depth - * @param {function(?Array.<!WebInspector.DOMNode>)=} callback + * @param {function(?Array.<!SDK.DOMNode>)=} callback */ getSubtree(depth, callback) { /** - * @this {WebInspector.DOMNode} + * @this {SDK.DOMNode} * @param {?Protocol.Error} error */ function mycallback(error) { @@ -519,7 +519,7 @@ */ path() { /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ function canPush(node) { return node && ('index' in node || (node.isShadowRoot() && node.parentNode)) && node._nodeName.length; @@ -530,7 +530,7 @@ while (canPush(node)) { var index = typeof node.index === 'number' ? node.index : - (node.shadowRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent ? 'u' : 'a'); + (node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.UserAgent ? 'u' : 'a'); path.push([index, node._nodeName]); node = node.parentNode; } @@ -539,7 +539,7 @@ } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @return {boolean} */ isAncestor(node) { @@ -556,7 +556,7 @@ } /** - * @param {!WebInspector.DOMNode} descendant + * @param {!SDK.DOMNode} descendant * @return {boolean} */ isDescendant(descendant) { @@ -599,19 +599,19 @@ } /** - * @param {!WebInspector.DOMNode} prev + * @param {!SDK.DOMNode} prev * @param {!Protocol.DOM.Node} payload - * @return {!WebInspector.DOMNode} + * @return {!SDK.DOMNode} */ _insertChild(prev, payload) { - var node = WebInspector.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payload); + var node = SDK.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payload); this._children.splice(this._children.indexOf(prev) + 1, 0, node); this._renumber(); return node; } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _removeChild(node) { if (node.pseudoType()) { @@ -628,7 +628,7 @@ node.parentNode = null; this._subtreeMarkerCount -= node._subtreeMarkerCount; if (node._subtreeMarkerCount) - this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged, this); + this._domModel.dispatchEventToListeners(SDK.DOMModel.Events.MarkersChanged, this); this._renumber(); } @@ -643,7 +643,7 @@ this._children = []; for (var i = 0; i < payloads.length; ++i) { var payload = payloads[i]; - var node = WebInspector.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payload); + var node = SDK.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payload); this._children.push(node); } this._renumber(); @@ -658,7 +658,7 @@ return; for (var i = 0; i < payloads.length; ++i) { - var node = WebInspector.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payloads[i]); + var node = SDK.DOMNode.create(this._domModel, this.ownerDocument, this._isInShadowTree, payloads[i]); node.parentNode = this; this._pseudoElements.set(node.pseudoType(), node); } @@ -670,7 +670,7 @@ _setDistributedNodePayloads(payloads) { this._distributedNodes = []; for (var payload of payloads) - this._distributedNodes.push(new WebInspector.DOMNodeShortcut( + this._distributedNodes.push(new SDK.DOMNodeShortcut( this._domModel.target(), payload.backendNodeId, payload.nodeType, payload.nodeName)); } @@ -726,8 +726,8 @@ } /** - * @param {!WebInspector.DOMNode} targetNode - * @param {?WebInspector.DOMNode} anchorNode + * @param {!SDK.DOMNode} targetNode + * @param {?SDK.DOMNode} anchorNode * @param {function(?Protocol.Error, !Protocol.DOM.NodeId=)=} callback */ copyTo(targetNode, anchorNode, callback) { @@ -736,8 +736,8 @@ } /** - * @param {!WebInspector.DOMNode} targetNode - * @param {?WebInspector.DOMNode} anchorNode + * @param {!SDK.DOMNode} targetNode + * @param {?SDK.DOMNode} anchorNode * @param {function(?Protocol.Error, !Protocol.DOM.NodeId=)=} callback */ moveTo(targetNode, anchorNode, callback) { @@ -765,7 +765,7 @@ for (var node = this; node; node = node.parentNode) --node._subtreeMarkerCount; for (var node = this; node; node = node.parentNode) - this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged, node); + this._domModel.dispatchEventToListeners(SDK.DOMModel.Events.MarkersChanged, node); return; } @@ -775,7 +775,7 @@ } this._markers.set(name, value); for (var node = this; node; node = node.parentNode) - this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged, node); + this._domModel.dispatchEventToListeners(SDK.DOMModel.Events.MarkersChanged, node); } /** @@ -788,11 +788,11 @@ } /** - * @param {function(!WebInspector.DOMNode, string)} visitor + * @param {function(!SDK.DOMNode, string)} visitor */ traverseMarkers(visitor) { /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ function traverse(node) { if (!node._subtreeMarkerCount) @@ -816,7 +816,7 @@ return url; for (var frameOwnerCandidate = this; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) { if (frameOwnerCandidate.baseURL) - return WebInspector.ParsedURL.completeURL(frameOwnerCandidate.baseURL, url); + return Common.ParsedURL.completeURL(frameOwnerCandidate.baseURL, url); } return null; } @@ -835,7 +835,7 @@ /** * @param {string=} objectGroup - * @param {function(?WebInspector.RemoteObject)=} callback + * @param {function(?SDK.RemoteObject)=} callback */ resolveToObject(objectGroup, callback) { this._agent.resolveNode(this.id, objectGroup, mycallback.bind(this)); @@ -843,7 +843,7 @@ /** * @param {?Protocol.Error} error * @param {!Protocol.Runtime.RemoteObject} object - * @this {WebInspector.DOMNode} + * @this {SDK.DOMNode} */ function mycallback(error, object) { if (!callback) @@ -858,14 +858,14 @@ /** * @param {string=} objectGroup - * @return {!Promise<!WebInspector.RemoteObject>} + * @return {!Promise<!SDK.RemoteObject>} */ resolveToObjectPromise(objectGroup) { return new Promise(resolveToObject.bind(this)); /** * @param {function(?)} fulfill * @param {function(*)} reject - * @this {WebInspector.DOMNode} + * @this {SDK.DOMNode} */ function resolveToObject(fulfill, reject) { this.resolveToObject(objectGroup, mycallback); @@ -901,7 +901,7 @@ } /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ enclosingElementOrSelf() { var node = this; @@ -917,7 +917,7 @@ /** * @enum {string} */ -WebInspector.DOMNode.PseudoElementNames = { +SDK.DOMNode.PseudoElementNames = { Before: 'before', After: 'after' }; @@ -925,30 +925,30 @@ /** * @enum {string} */ -WebInspector.DOMNode.ShadowRootTypes = { +SDK.DOMNode.ShadowRootTypes = { UserAgent: 'user-agent', Open: 'open', Closed: 'closed' }; -/** @typedef {{name: string, value: string, _node: WebInspector.DOMNode}} */ -WebInspector.DOMNode.Attribute; +/** @typedef {{name: string, value: string, _node: SDK.DOMNode}} */ +SDK.DOMNode.Attribute; /** * @unrestricted */ -WebInspector.DeferredDOMNode = class { +SDK.DeferredDOMNode = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {number} backendNodeId */ constructor(target, backendNodeId) { - this._domModel = WebInspector.DOMModel.fromTarget(target); + this._domModel = SDK.DOMModel.fromTarget(target); this._backendNodeId = backendNodeId; } /** - * @param {function(?WebInspector.DOMNode)} callback + * @param {function(?SDK.DOMNode)} callback */ resolve(callback) { if (!this._domModel) { @@ -959,8 +959,8 @@ this._domModel.pushNodesByBackendIdsToFrontend(new Set([this._backendNodeId]), onGotNode.bind(this)); /** - * @param {?Map<number, ?WebInspector.DOMNode>} nodeIds - * @this {WebInspector.DeferredDOMNode} + * @param {?Map<number, ?SDK.DOMNode>} nodeIds + * @this {SDK.DeferredDOMNode} */ function onGotNode(nodeIds) { callback(nodeIds && (nodeIds.get(this._backendNodeId) || null)); @@ -968,17 +968,17 @@ } /** - * @return {!Promise.<!WebInspector.DOMNode>} + * @return {!Promise.<!SDK.DOMNode>} */ resolvePromise() { /** * @param {function(?)} fulfill * @param {function(*)} reject - * @this {WebInspector.DeferredDOMNode} + * @this {SDK.DeferredDOMNode} */ function resolveNode(fulfill, reject) { /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ function mycallback(node) { fulfill(node); @@ -1004,9 +1004,9 @@ /** * @unrestricted */ -WebInspector.DOMNodeShortcut = class { +SDK.DOMNodeShortcut = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {number} backendNodeId * @param {number} nodeType * @param {string} nodeName @@ -1014,16 +1014,16 @@ constructor(target, backendNodeId, nodeType, nodeName) { this.nodeType = nodeType; this.nodeName = nodeName; - this.deferredNode = new WebInspector.DeferredDOMNode(target, backendNodeId); + this.deferredNode = new SDK.DeferredDOMNode(target, backendNodeId); } }; /** * @unrestricted */ -WebInspector.DOMDocument = class extends WebInspector.DOMNode { +SDK.DOMDocument = class extends SDK.DOMNode { /** - * @param {!WebInspector.DOMModel} domModel + * @param {!SDK.DOMModel} domModel * @param {!Protocol.DOM.Node} payload */ constructor(domModel, payload) { @@ -1038,47 +1038,47 @@ /** * @unrestricted */ -WebInspector.DOMModel = class extends WebInspector.SDKModel { +SDK.DOMModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.DOMModel, target); + super(SDK.DOMModel, target); this._agent = target.domAgent(); - /** @type {!Object.<number, !WebInspector.DOMNode>} */ + /** @type {!Object.<number, !SDK.DOMNode>} */ this._idToDOMNode = {}; - /** @type {?WebInspector.DOMDocument} */ + /** @type {?SDK.DOMDocument} */ this._document = null; /** @type {!Object.<number, boolean>} */ this._attributeLoadNodeIds = {}; - target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)); + target.registerDOMDispatcher(new SDK.DOMDispatcher(this)); this._inspectModeEnabled = false; - this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._agent); + this._defaultHighlighter = new SDK.DefaultDOMNodeHighlighter(this._agent); this._highlighter = this._defaultHighlighter; this._agent.enable(); } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ static highlightObjectAsDOMNode(object) { - var domModel = WebInspector.DOMModel.fromTarget(object.target()); + var domModel = SDK.DOMModel.fromTarget(object.target()); if (domModel) domModel.highlightDOMNode(undefined, undefined, undefined, object.objectId); } /** - * @return {!Array<!WebInspector.DOMModel>} + * @return {!Array<!SDK.DOMModel>} */ static instances() { var result = []; - for (var target of WebInspector.targetManager.targets()) { - var domModel = WebInspector.DOMModel.fromTarget(target); + for (var target of SDK.targetManager.targets()) { + var domModel = SDK.DOMModel.fromTarget(target); if (domModel) result.push(domModel); } @@ -1086,57 +1086,57 @@ } static hideDOMNodeHighlight() { - for (var domModel of WebInspector.DOMModel.instances()) + for (var domModel of SDK.DOMModel.instances()) domModel.highlightDOMNode(0); } static muteHighlight() { - WebInspector.DOMModel.hideDOMNodeHighlight(); - WebInspector.DOMModel._highlightDisabled = true; + SDK.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel._highlightDisabled = true; } static unmuteHighlight() { - WebInspector.DOMModel._highlightDisabled = false; + SDK.DOMModel._highlightDisabled = false; } static cancelSearch() { - for (var domModel of WebInspector.DOMModel.instances()) + for (var domModel of SDK.DOMModel.instances()) domModel._cancelSearch(); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.DOMModel} + * @param {!SDK.Target} target + * @return {?SDK.DOMModel} */ static fromTarget(target) { - return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMModel)); + return /** @type {?SDK.DOMModel} */ (target.model(SDK.DOMModel)); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _scheduleMutationEvent(node) { - if (!this.hasEventListeners(WebInspector.DOMModel.Events.DOMMutated)) + if (!this.hasEventListeners(SDK.DOMModel.Events.DOMMutated)) return; this._lastMutationId = (this._lastMutationId || 0) + 1; Promise.resolve().then(callObserve.bind(this, node, this._lastMutationId)); /** - * @this {WebInspector.DOMModel} - * @param {!WebInspector.DOMNode} node + * @this {SDK.DOMModel} + * @param {!SDK.DOMNode} node * @param {number} mutationId */ function callObserve(node, mutationId) { - if (!this.hasEventListeners(WebInspector.DOMModel.Events.DOMMutated) || this._lastMutationId !== mutationId) + if (!this.hasEventListeners(SDK.DOMModel.Events.DOMMutated) || this._lastMutationId !== mutationId) return; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.DOMMutated, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.DOMMutated, node); } } /** - * @param {function(!WebInspector.DOMDocument)=} callback + * @param {function(!SDK.DOMDocument)=} callback */ requestDocument(callback) { if (this._document) { @@ -1153,7 +1153,7 @@ this._pendingDocumentRequestCallbacks = [callback]; /** - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} * @param {?Protocol.Error} error * @param {!Protocol.DOM.Node} root */ @@ -1173,7 +1173,7 @@ } /** - * @return {?WebInspector.DOMDocument} + * @return {?SDK.DOMDocument} */ existingDocument() { return this._document; @@ -1181,12 +1181,12 @@ /** * @param {!Protocol.Runtime.RemoteObjectId} objectId - * @param {function(?WebInspector.DOMNode)=} callback + * @param {function(?SDK.DOMNode)=} callback */ pushNodeToFrontend(objectId, callback) { /** * @param {?Protocol.DOM.NodeId} nodeId - * @this {!WebInspector.DOMModel} + * @this {!SDK.DOMModel} */ function mycallback(nodeId) { callback(nodeId ? this.nodeForId(nodeId) : null); @@ -1204,20 +1204,20 @@ /** * @param {!Set<number>} backendNodeIds - * @param {function(?Map<number, ?WebInspector.DOMNode>)} callback + * @param {function(?Map<number, ?SDK.DOMNode>)} callback */ pushNodesByBackendIdsToFrontend(backendNodeIds, callback) { var backendNodeIdsArray = backendNodeIds.valuesArray(); /** * @param {?Array<!Protocol.DOM.NodeId>} nodeIds - * @this {!WebInspector.DOMModel} + * @this {!SDK.DOMModel} */ function mycallback(nodeIds) { if (!nodeIds) { callback(null); return; } - /** @type {!Map<number, ?WebInspector.DOMNode>} */ + /** @type {!Map<number, ?SDK.DOMNode>} */ var map = new Map(); for (var i = 0; i < nodeIds.length; ++i) { if (nodeIds[i]) @@ -1258,7 +1258,7 @@ var callbackWrapper = this._wrapClientCallback(callback); /** - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function onDocumentAvailable() { if (this._document) @@ -1282,7 +1282,7 @@ return; node._setAttribute(name, value); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrModified, {node: node, name: name}); + this.dispatchEventToListeners(SDK.DOMModel.Events.AttrModified, {node: node, name: name}); this._scheduleMutationEvent(node); } @@ -1295,7 +1295,7 @@ if (!node) return; node._removeAttribute(name); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrRemoved, {node: node, name: name}); + this.dispatchEventToListeners(SDK.DOMModel.Events.AttrRemoved, {node: node, name: name}); this._scheduleMutationEvent(node); } @@ -1312,7 +1312,7 @@ _loadNodeAttributes() { /** - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} * @param {!Protocol.DOM.NodeId} nodeId * @param {?Protocol.Error} error * @param {!Array.<string>} attributes @@ -1325,7 +1325,7 @@ var node = this._idToDOMNode[nodeId]; if (node) { if (node._setAttributesPayload(attributes)) { - this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrModified, {node: node, name: 'style'}); + this.dispatchEventToListeners(SDK.DOMModel.Events.AttrModified, {node: node, name: 'style'}); this._scheduleMutationEvent(node); } } @@ -1347,13 +1347,13 @@ _characterDataModified(nodeId, newValue) { var node = this._idToDOMNode[nodeId]; node._nodeValue = newValue; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.CharacterDataModified, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.CharacterDataModified, node); this._scheduleMutationEvent(node); } /** * @param {!Protocol.DOM.NodeId} nodeId - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ nodeForId(nodeId) { return this._idToDOMNode[nodeId] || null; @@ -1369,10 +1369,10 @@ _setDocument(payload) { this._idToDOMNode = {}; if (payload && 'nodeId' in payload) - this._document = new WebInspector.DOMDocument(this, payload); + this._document = new SDK.DOMDocument(this, payload); else this._document = null; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.DocumentUpdated, this._document); + this.dispatchEventToListeners(SDK.DOMModel.Events.DocumentUpdated, this._document); } /** @@ -1380,9 +1380,9 @@ */ _setDetachedRoot(payload) { if (payload.nodeName === '#document') - new WebInspector.DOMDocument(this, payload); + new SDK.DOMDocument(this, payload); else - WebInspector.DOMNode.create(this, null, false, payload); + SDK.DOMNode.create(this, null, false, payload); } /** @@ -1406,7 +1406,7 @@ _childNodeCountUpdated(nodeId, newValue) { var node = this._idToDOMNode[nodeId]; node._childNodeCount = newValue; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.ChildNodeCountUpdated, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.ChildNodeCountUpdated, node); this._scheduleMutationEvent(node); } @@ -1420,7 +1420,7 @@ var prev = this._idToDOMNode[prevId]; var node = parent._insertChild(prev, payload); this._idToDOMNode[node.id] = node; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeInserted, node); this._scheduleMutationEvent(node); } @@ -1433,7 +1433,7 @@ var node = this._idToDOMNode[nodeId]; parent._removeChild(node); this._unbind(node); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved, {node: node, parent: parent}); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeRemoved, {node: node, parent: parent}); this._scheduleMutationEvent(node); } @@ -1445,11 +1445,11 @@ var host = this._idToDOMNode[hostId]; if (!host) return; - var node = WebInspector.DOMNode.create(this, host.ownerDocument, true, root); + var node = SDK.DOMNode.create(this, host.ownerDocument, true, root); node.parentNode = host; this._idToDOMNode[node.id] = node; host._shadowRoots.unshift(node); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeInserted, node); this._scheduleMutationEvent(node); } @@ -1466,7 +1466,7 @@ return; host._removeChild(root); this._unbind(root); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved, {node: root, parent: host}); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeRemoved, {node: root, parent: host}); this._scheduleMutationEvent(root); } @@ -1478,12 +1478,12 @@ var parent = this._idToDOMNode[parentId]; if (!parent) return; - var node = WebInspector.DOMNode.create(this, parent.ownerDocument, false, pseudoElement); + var node = SDK.DOMNode.create(this, parent.ownerDocument, false, pseudoElement); node.parentNode = parent; this._idToDOMNode[node.id] = node; console.assert(!parent._pseudoElements.get(node.pseudoType())); parent._pseudoElements.set(node.pseudoType(), node); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeInserted, node); this._scheduleMutationEvent(node); } @@ -1500,7 +1500,7 @@ return; parent._removeChild(pseudoElement); this._unbind(pseudoElement); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved, {node: pseudoElement, parent: parent}); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeRemoved, {node: pseudoElement, parent: parent}); this._scheduleMutationEvent(pseudoElement); } @@ -1513,12 +1513,12 @@ if (!insertionPoint) return; insertionPoint._setDistributedNodePayloads(distributedNodes); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.DistributedNodesChanged, insertionPoint); + this.dispatchEventToListeners(SDK.DOMModel.Events.DistributedNodesChanged, insertionPoint); this._scheduleMutationEvent(insertionPoint); } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node */ _unbind(node) { delete this._idToDOMNode[node.id]; @@ -1537,8 +1537,8 @@ * @param {!Protocol.DOM.BackendNodeId} backendNodeId */ _inspectNodeRequested(backendNodeId) { - var deferredNode = new WebInspector.DeferredDOMNode(this.target(), backendNodeId); - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInspected, deferredNode); + var deferredNode = new SDK.DeferredDOMNode(this.target(), backendNodeId); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeInspected, deferredNode); } /** @@ -1547,13 +1547,13 @@ * @param {function(number)} searchCallback */ performSearch(query, includeUserAgentShadowDOM, searchCallback) { - WebInspector.DOMModel.cancelSearch(); + SDK.DOMModel.cancelSearch(); /** * @param {?Protocol.Error} error * @param {string} searchId * @param {number} resultsCount - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function callback(error, searchId, resultsCount) { this._searchId = searchId; @@ -1572,7 +1572,7 @@ /** * @param {function(number)} resolve - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function performSearch(resolve) { this._agent.performSearch(query, includeUserAgentShadowDOM, callback.bind(this)); @@ -1581,7 +1581,7 @@ * @param {?Protocol.Error} error * @param {string} searchId * @param {number} resultsCount - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function callback(error, searchId, resultsCount) { if (!error) @@ -1593,7 +1593,7 @@ /** * @param {number} index - * @param {?function(?WebInspector.DOMNode)} callback + * @param {?function(?SDK.DOMNode)} callback */ searchResult(index, callback) { if (this._searchId) @@ -1604,7 +1604,7 @@ /** * @param {?Protocol.Error} error * @param {!Array.<number>} nodeIds - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function searchResultsCallback(error, nodeIds) { if (error) { @@ -1635,7 +1635,7 @@ /** * @param {function(!Array<string>)} fulfill - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function promiseBody(fulfill) { this._agent.collectClassNamesFromSubtree(nodeId, classNamesCallback); @@ -1688,7 +1688,7 @@ * @param {!Protocol.Runtime.RemoteObjectId=} objectId */ highlightDOMNodeWithConfig(nodeId, config, backendNodeId, objectId) { - if (WebInspector.DOMModel._highlightDisabled) + if (SDK.DOMModel._highlightDisabled) return; config = config || {mode: 'all', showInfo: undefined, selectors: undefined}; if (this._hideDOMNodeHighlightTimeout) { @@ -1709,14 +1709,14 @@ highlightDOMNodeForTwoSeconds(nodeId) { this.highlightDOMNode(nodeId); this._hideDOMNodeHighlightTimeout = - setTimeout(WebInspector.DOMModel.hideDOMNodeHighlight.bind(WebInspector.DOMModel), 2000); + setTimeout(SDK.DOMModel.hideDOMNodeHighlight.bind(SDK.DOMModel), 2000); } /** * @param {!Protocol.Page.FrameId} frameId */ highlightFrame(frameId) { - if (WebInspector.DOMModel._highlightDisabled) + if (SDK.DOMModel._highlightDisabled) return; this._highlighter.highlightFrame(frameId); } @@ -1727,11 +1727,11 @@ */ setInspectMode(mode, callback) { /** - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function onDocumentAvailable() { this._inspectModeEnabled = mode !== Protocol.DOM.InspectMode.None; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeEnabled); + this.dispatchEventToListeners(SDK.DOMModel.Events.InspectModeWillBeToggled, this._inspectModeEnabled); this._highlighter.setInspectMode(mode, this._buildHighlightConfig(), callback); } this.requestDocument(onDocumentAvailable.bind(this)); @@ -1750,31 +1750,31 @@ */ _buildHighlightConfig(mode) { mode = mode || 'all'; - var showRulers = WebInspector.moduleSetting('showMetricsRulers').get(); + var showRulers = Common.moduleSetting('showMetricsRulers').get(); var highlightConfig = {showInfo: mode === 'all', showRulers: showRulers, showExtensionLines: showRulers}; if (mode === 'all' || mode === 'content') - highlightConfig.contentColor = WebInspector.Color.PageHighlight.Content.toProtocolRGBA(); + highlightConfig.contentColor = Common.Color.PageHighlight.Content.toProtocolRGBA(); if (mode === 'all' || mode === 'padding') - highlightConfig.paddingColor = WebInspector.Color.PageHighlight.Padding.toProtocolRGBA(); + highlightConfig.paddingColor = Common.Color.PageHighlight.Padding.toProtocolRGBA(); if (mode === 'all' || mode === 'border') - highlightConfig.borderColor = WebInspector.Color.PageHighlight.Border.toProtocolRGBA(); + highlightConfig.borderColor = Common.Color.PageHighlight.Border.toProtocolRGBA(); if (mode === 'all' || mode === 'margin') - highlightConfig.marginColor = WebInspector.Color.PageHighlight.Margin.toProtocolRGBA(); + highlightConfig.marginColor = Common.Color.PageHighlight.Margin.toProtocolRGBA(); if (mode === 'all') { - highlightConfig.eventTargetColor = WebInspector.Color.PageHighlight.EventTarget.toProtocolRGBA(); - highlightConfig.shapeColor = WebInspector.Color.PageHighlight.Shape.toProtocolRGBA(); - highlightConfig.shapeMarginColor = WebInspector.Color.PageHighlight.ShapeMargin.toProtocolRGBA(); + highlightConfig.eventTargetColor = Common.Color.PageHighlight.EventTarget.toProtocolRGBA(); + highlightConfig.shapeColor = Common.Color.PageHighlight.Shape.toProtocolRGBA(); + highlightConfig.shapeMarginColor = Common.Color.PageHighlight.ShapeMargin.toProtocolRGBA(); highlightConfig.displayAsMaterial = Runtime.experiments.isEnabled('inspectTooltip'); } return highlightConfig; } /** - * @param {!WebInspector.DOMNode} node + * @param {!SDK.DOMNode} node * @param {function(?Protocol.Error, ...)=} callback * @return {function(...)} * @template T @@ -1782,7 +1782,7 @@ _markRevision(node, callback) { /** * @param {?Protocol.Error} error - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function wrapperFunction(error) { if (!error) @@ -1804,14 +1804,14 @@ undo(callback) { /** * @param {?Protocol.Error} error - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function mycallback(error) { - this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoCompleted); + this.dispatchEventToListeners(SDK.DOMModel.Events.UndoRedoCompleted); callback(error); } - this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoRequested); + this.dispatchEventToListeners(SDK.DOMModel.Events.UndoRedoRequested); this._agent.undo(callback); } @@ -1821,19 +1821,19 @@ redo(callback) { /** * @param {?Protocol.Error} error - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function mycallback(error) { - this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoCompleted); + this.dispatchEventToListeners(SDK.DOMModel.Events.UndoRedoCompleted); callback(error); } - this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoRequested); + this.dispatchEventToListeners(SDK.DOMModel.Events.UndoRedoRequested); this._agent.redo(callback); } /** - * @param {?WebInspector.DOMNodeHighlighter} highlighter + * @param {?SDK.DOMNodeHighlighter} highlighter */ setHighlighter(highlighter) { this._highlighter = highlighter || this._defaultHighlighter; @@ -1842,7 +1842,7 @@ /** * @param {number} x * @param {number} y - * @param {function(?WebInspector.DOMNode)} callback + * @param {function(?SDK.DOMNode)} callback */ nodeForLocation(x, y, callback) { this._agent.getNodeForLocation(x, y, mycallback.bind(this)); @@ -1850,7 +1850,7 @@ /** * @param {?Protocol.Error} error * @param {number} nodeId - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function mycallback(error, nodeId) { if (error) { @@ -1862,8 +1862,8 @@ } /** - * @param {!WebInspector.RemoteObject} object - * @param {function(?WebInspector.DOMNode)} callback + * @param {!SDK.RemoteObject} object + * @param {function(?SDK.DOMNode)} callback */ pushObjectAsNodeToFrontend(object, callback) { if (object.isNode()) @@ -1881,13 +1881,13 @@ /** * @param {function()} fulfill - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function promiseBody(fulfill) { this._agent.disable(callback.bind(this)); /** - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function callback() { this._setDocument(null); @@ -1905,7 +1905,7 @@ /** * @param {function()} fulfill - * @this {WebInspector.DOMModel} + * @this {SDK.DOMModel} */ function promiseBody(fulfill) { this._agent.enable(fulfill); @@ -1920,12 +1920,12 @@ if (!node) return; - this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeHighlightedInOverlay, node); + this.dispatchEventToListeners(SDK.DOMModel.Events.NodeHighlightedInOverlay, node); } }; /** @enum {symbol} */ -WebInspector.DOMModel.Events = { +SDK.DOMModel.Events = { AttrModified: Symbol('AttrModified'), AttrRemoved: Symbol('AttrRemoved'), CharacterDataModified: Symbol('CharacterDataModified'), @@ -1949,9 +1949,9 @@ * @implements {Protocol.DOMDispatcher} * @unrestricted */ -WebInspector.DOMDispatcher = class { +SDK.DOMDispatcher = class { /** - * @param {!WebInspector.DOMModel} domModel + * @param {!SDK.DOMModel} domModel */ constructor(domModel) { this._domModel = domModel; @@ -2102,11 +2102,11 @@ /** * @interface */ -WebInspector.DOMNodeHighlighter = function() {}; +SDK.DOMNodeHighlighter = function() {}; -WebInspector.DOMNodeHighlighter.prototype = { +SDK.DOMNodeHighlighter.prototype = { /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {!Protocol.DOM.HighlightConfig} config * @param {!Protocol.DOM.BackendNodeId=} backendNodeId * @param {!Protocol.Runtime.RemoteObjectId=} objectId @@ -2127,10 +2127,10 @@ }; /** - * @implements {WebInspector.DOMNodeHighlighter} + * @implements {SDK.DOMNodeHighlighter} * @unrestricted */ -WebInspector.DefaultDOMNodeHighlighter = class { +SDK.DefaultDOMNodeHighlighter = class { /** * @param {!Protocol.DOMAgent} agent */ @@ -2140,7 +2140,7 @@ /** * @override - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node * @param {!Protocol.DOM.HighlightConfig} config * @param {!Protocol.DOM.BackendNodeId=} backendNodeId * @param {!Protocol.Runtime.RemoteObjectId=} objectId @@ -2168,7 +2168,7 @@ */ highlightFrame(frameId) { this._agent.highlightFrame( - frameId, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), - WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA()); + frameId, Common.Color.PageHighlight.Content.toProtocolRGBA(), + Common.Color.PageHighlight.ContentOutline.toProtocolRGBA()); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js index 9885451..19e6640 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -31,30 +31,30 @@ /** * @unrestricted */ -WebInspector.DebuggerModel = class extends WebInspector.SDKModel { +SDK.DebuggerModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.DebuggerModel, target); + super(SDK.DebuggerModel, target); - target.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this)); + target.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); this._agent = target.debuggerAgent(); - /** @type {?WebInspector.DebuggerPausedDetails} */ + /** @type {?SDK.DebuggerPausedDetails} */ this._debuggerPausedDetails = null; - /** @type {!Object.<string, !WebInspector.Script>} */ + /** @type {!Object.<string, !SDK.Script>} */ this._scripts = {}; - /** @type {!Map.<string, !Array.<!WebInspector.Script>>} */ + /** @type {!Map.<string, !Array.<!SDK.Script>>} */ this._scriptsBySourceURL = new Map(); - /** @type {!WebInspector.Object} */ - this._breakpointResolvedEventTarget = new WebInspector.Object(); + /** @type {!Common.Object} */ + this._breakpointResolvedEventTarget = new Common.Object(); this._isPausing = false; - WebInspector.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._pauseOnExceptionStateChanged, this); - WebInspector.moduleSetting('pauseOnCaughtException').addChangeListener(this._pauseOnExceptionStateChanged, this); - WebInspector.moduleSetting('enableAsyncStackTraces').addChangeListener(this.asyncStackTracesStateChanged, this); + Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._pauseOnExceptionStateChanged, this); + Common.moduleSetting('pauseOnCaughtException').addChangeListener(this._pauseOnExceptionStateChanged, this); + Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this.asyncStackTracesStateChanged, this); /** @type {!Map<string, string>} */ this._fileURLToNodeJSPath = new Map(); @@ -62,12 +62,12 @@ } /** - * @return {!Array<!WebInspector.DebuggerModel>} + * @return {!Array<!SDK.DebuggerModel>} */ static instances() { var result = []; - for (var target of WebInspector.targetManager.targets()) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + for (var target of SDK.targetManager.targets()) { + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel) result.push(debuggerModel); } @@ -75,13 +75,13 @@ } /** - * @param {?WebInspector.Target} target - * @return {?WebInspector.DebuggerModel} + * @param {?SDK.Target} target + * @return {?SDK.DebuggerModel} */ static fromTarget(target) { if (!target || !target.hasJSCapability()) return null; - return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector.DebuggerModel)); + return /** @type {?SDK.DebuggerModel} */ (target.model(SDK.DebuggerModel)); } /** @@ -104,7 +104,7 @@ this._debuggerEnabled = true; this._pauseOnExceptionStateChanged(); this.asyncStackTracesStateChanged(); - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasEnabled); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerWasEnabled); } /** @@ -122,7 +122,7 @@ this._isPausing = false; this.asyncStackTracesStateChanged(); this.globalObjectCleared(); - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasDisabled); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerWasDisabled); } /** @@ -149,19 +149,19 @@ _pauseOnExceptionStateChanged() { var state; - if (!WebInspector.moduleSetting('pauseOnExceptionEnabled').get()) { - state = WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions; - } else if (WebInspector.moduleSetting('pauseOnCaughtException').get()) { - state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions; + if (!Common.moduleSetting('pauseOnExceptionEnabled').get()) { + state = SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions; + } else if (Common.moduleSetting('pauseOnCaughtException').get()) { + state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions; } else { - state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions; + state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions; } this._agent.setPauseOnExceptions(state); } asyncStackTracesStateChanged() { const maxAsyncStackChainDepth = 4; - var enabled = WebInspector.moduleSetting('enableAsyncStackTraces').get() && this._debuggerEnabled; + var enabled = Common.moduleSetting('enableAsyncStackTraces').get() && this._debuggerEnabled; this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0); } @@ -200,7 +200,7 @@ * @param {number} lineNumber * @param {number=} columnNumber * @param {string=} condition - * @param {function(?Protocol.Debugger.BreakpointId, !Array.<!WebInspector.DebuggerModel.Location>)=} callback + * @param {function(?Protocol.Debugger.BreakpointId, !Array.<!SDK.DebuggerModel.Location>)=} callback */ setBreakpointByURL(url, lineNumber, columnNumber, condition, callback) { // Convert file url to node-js path. @@ -221,13 +221,13 @@ * @param {?Protocol.Error} error * @param {!Protocol.Debugger.BreakpointId} breakpointId * @param {!Array.<!Protocol.Debugger.Location>} locations - * @this {WebInspector.DebuggerModel} + * @this {SDK.DebuggerModel} */ function didSetBreakpoint(error, breakpointId, locations) { if (callback) { var rawLocations = locations ? locations.map( - WebInspector.DebuggerModel.Location.fromPayload.bind(WebInspector.DebuggerModel.Location, this)) : + SDK.DebuggerModel.Location.fromPayload.bind(SDK.DebuggerModel.Location, this)) : []; callback(error ? null : breakpointId, rawLocations); } @@ -236,15 +236,15 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} rawLocation + * @param {!SDK.DebuggerModel.Location} rawLocation * @param {string} condition - * @param {function(?Protocol.Debugger.BreakpointId, !Array.<!WebInspector.DebuggerModel.Location>)=} callback + * @param {function(?Protocol.Debugger.BreakpointId, !Array.<!SDK.DebuggerModel.Location>)=} callback */ setBreakpointBySourceId(rawLocation, condition, callback) { var target = this.target(); /** - * @this {WebInspector.DebuggerModel} + * @this {SDK.DebuggerModel} * @param {?Protocol.Error} error * @param {!Protocol.Debugger.BreakpointId} breakpointId * @param {!Protocol.Debugger.Location} actualLocation @@ -255,7 +255,7 @@ callback(null, []); return; } - callback(breakpointId, [WebInspector.DebuggerModel.Location.fromPayload(this, actualLocation)]); + callback(breakpointId, [SDK.DebuggerModel.Location.fromPayload(this, actualLocation)]); } } this._agent.setBreakpoint(rawLocation.payload(), condition, didSetBreakpoint.bind(this)); @@ -280,9 +280,9 @@ } /** - * @param {!WebInspector.DebuggerModel.Location} startLocation - * @param {!WebInspector.DebuggerModel.Location} endLocation - * @return {!Promise<!Array<!WebInspector.DebuggerModel.Location>>} + * @param {!SDK.DebuggerModel.Location} startLocation + * @param {!SDK.DebuggerModel.Location} endLocation + * @return {!Promise<!Array<!SDK.DebuggerModel.Location>>} */ getPossibleBreakpoints(startLocation, endLocation) { var fulfill; @@ -291,7 +291,7 @@ return promise; /** - * @this {!WebInspector.DebuggerModel} + * @this {!SDK.DebuggerModel} * @param {?Protocol.Error} error * @param {?Array<!Protocol.Debugger.Location>} locations */ @@ -300,7 +300,7 @@ fulfill([]); return; } - fulfill(locations.map(location => WebInspector.DebuggerModel.Location.fromPayload(this, location))); + fulfill(locations.map(location => SDK.DebuggerModel.Location.fromPayload(this, location))); } } @@ -310,14 +310,14 @@ */ _breakpointResolved(breakpointId, location) { this._breakpointResolvedEventTarget.dispatchEventToListeners( - breakpointId, WebInspector.DebuggerModel.Location.fromPayload(this, location)); + breakpointId, SDK.DebuggerModel.Location.fromPayload(this, location)); } globalObjectCleared() { this._setDebuggerPausedDetails(null); this._reset(); // TODO(dgozman): move clients to ExecutionContextDestroyed/ScriptCollected events. - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.GlobalObjectCleared); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.GlobalObjectCleared); } _reset() { @@ -326,7 +326,7 @@ } /** - * @return {!Object.<string, !WebInspector.Script>} + * @return {!Object.<string, !SDK.Script>} */ get scripts() { return this._scripts; @@ -334,14 +334,14 @@ /** * @param {!Protocol.Runtime.ScriptId} scriptId - * @return {?WebInspector.Script} + * @return {?SDK.Script} */ scriptForId(scriptId) { return this._scripts[scriptId] || null; } /** - * @return {!Array.<!WebInspector.Script>} + * @return {!Array.<!SDK.Script>} */ scriptsForSourceURL(sourceURL) { if (!sourceURL) @@ -391,21 +391,21 @@ } /** - * @return {?Array.<!WebInspector.DebuggerModel.CallFrame>} + * @return {?Array.<!SDK.DebuggerModel.CallFrame>} */ get callFrames() { return this._debuggerPausedDetails ? this._debuggerPausedDetails.callFrames : null; } /** - * @return {?WebInspector.DebuggerPausedDetails} + * @return {?SDK.DebuggerPausedDetails} */ debuggerPausedDetails() { return this._debuggerPausedDetails; } /** - * @param {?WebInspector.DebuggerPausedDetails} debuggerPausedDetails + * @param {?SDK.DebuggerPausedDetails} debuggerPausedDetails * @return {boolean} */ _setDebuggerPausedDetails(debuggerPausedDetails) { @@ -414,11 +414,11 @@ if (this._debuggerPausedDetails) { if (Runtime.experiments.isEnabled('emptySourceMapAutoStepping')) { if (this.dispatchEventToListeners( - WebInspector.DebuggerModel.Events.BeforeDebuggerPaused, this._debuggerPausedDetails)) { + SDK.DebuggerModel.Events.BeforeDebuggerPaused, this._debuggerPausedDetails)) { return false; } } - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPausedDetails); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerPaused, this._debuggerPausedDetails); } if (debuggerPausedDetails) this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); @@ -436,7 +436,7 @@ */ _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { var pausedDetails = - new WebInspector.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpointIds, asyncStackTrace); + new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpointIds, asyncStackTrace); if (this._setDebuggerPausedDetails(pausedDetails)) { if (this._pendingLiveEditCallback) { var callback = this._pendingLiveEditCallback; @@ -450,7 +450,7 @@ _resumedScript() { this._setDebuggerPausedDetails(null); - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerResumed); } /** @@ -467,7 +467,7 @@ * @param {string=} sourceMapURL * @param {boolean=} hasSourceURL * @param {boolean=} hasSyntaxError - * @return {!WebInspector.Script} + * @return {!SDK.Script} */ _parsedScriptSource( scriptId, @@ -489,22 +489,22 @@ // Support file URL for node.js. if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) { var nodeJSPath = sourceURL; - sourceURL = WebInspector.ParsedURL.platformPathToURL(nodeJSPath); + sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath); this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath); } - var script = new WebInspector.Script( + var script = new SDK.Script( this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isLiveEdit, sourceMapURL, hasSourceURL); this._registerScript(script); if (!hasSyntaxError) - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource, script); else - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.FailedToParseScriptSource, script); return script; } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script */ _registerScript(script) { this._scripts[script.scriptId] = script; @@ -520,22 +520,22 @@ } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ createRawLocation(script, lineNumber, columnNumber) { if (script.sourceURL) return this.createRawLocationByURL(script.sourceURL, lineNumber, columnNumber); - return new WebInspector.DebuggerModel.Location(this, script.scriptId, lineNumber, columnNumber); + return new SDK.DebuggerModel.Location(this, script.scriptId, lineNumber, columnNumber); } /** * @param {string} sourceURL * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ createRawLocationByURL(sourceURL, lineNumber, columnNumber) { var closestScript = null; @@ -552,7 +552,7 @@ break; } return closestScript ? - new WebInspector.DebuggerModel.Location(this, closestScript.scriptId, lineNumber, columnNumber) : + new SDK.DebuggerModel.Location(this, closestScript.scriptId, lineNumber, columnNumber) : null; } @@ -560,7 +560,7 @@ * @param {!Protocol.Runtime.ScriptId} scriptId * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ createRawLocationByScriptId(scriptId, lineNumber, columnNumber) { var script = this.scriptForId(scriptId); @@ -569,7 +569,7 @@ /** * @param {!Protocol.Runtime.StackTrace} stackTrace - * @return {!Array<!WebInspector.DebuggerModel.Location>} + * @return {!Array<!SDK.DebuggerModel.Location>} */ createRawLocationsByStackTrace(stackTrace) { var frames = []; @@ -603,18 +603,18 @@ } /** - * @param {?WebInspector.DebuggerModel.CallFrame} callFrame + * @param {?SDK.DebuggerModel.CallFrame} callFrame */ setSelectedCallFrame(callFrame) { this._selectedCallFrame = callFrame; if (!this._selectedCallFrame) return; - this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.CallFrameSelected, callFrame); + this.dispatchEventToListeners(SDK.DebuggerModel.Events.CallFrameSelected, callFrame); } /** - * @return {?WebInspector.DebuggerModel.CallFrame} + * @return {?SDK.DebuggerModel.CallFrame} */ selectedCallFrame() { return this._selectedCallFrame; @@ -627,7 +627,7 @@ * @param {boolean} silent * @param {boolean} returnByValue * @param {boolean} generatePreview - * @param {function(?WebInspector.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback + * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback */ evaluateOnSelectedCallFrame( code, @@ -640,7 +640,7 @@ /** * @param {?Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.DebuggerModel} + * @this {SDK.DebuggerModel} */ function didEvaluate(result, exceptionDetails) { if (!result) @@ -654,16 +654,16 @@ } /** - * @param {!WebInspector.RemoteObject} remoteObject - * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>} + * @param {!SDK.RemoteObject} remoteObject + * @return {!Promise<?SDK.DebuggerModel.FunctionDetails>} */ functionDetailsPromise(remoteObject) { return remoteObject.getAllPropertiesPromise(/* accessorPropertiesOnly */ false).then(buildDetails.bind(this)); /** - * @param {!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}} response - * @return {?WebInspector.DebuggerModel.FunctionDetails} - * @this {!WebInspector.DebuggerModel} + * @param {!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}} response + * @return {?SDK.DebuggerModel.FunctionDetails} + * @this {!SDK.DebuggerModel} */ function buildDetails(response) { if (!response) @@ -721,7 +721,7 @@ /** * @param {!Protocol.Debugger.BreakpointId} breakpointId - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ addBreakpointListener(breakpointId, listener, thisObject) { @@ -730,7 +730,7 @@ /** * @param {!Protocol.Debugger.BreakpointId} breakpointId - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeBreakpointListener(breakpointId, listener, thisObject) { @@ -761,10 +761,10 @@ * @override */ dispose() { - WebInspector.moduleSetting('pauseOnExceptionEnabled') + Common.moduleSetting('pauseOnExceptionEnabled') .removeChangeListener(this._pauseOnExceptionStateChanged, this); - WebInspector.moduleSetting('pauseOnCaughtException').removeChangeListener(this._pauseOnExceptionStateChanged, this); - WebInspector.moduleSetting('enableAsyncStackTraces').removeChangeListener(this.asyncStackTracesStateChanged, this); + Common.moduleSetting('pauseOnCaughtException').removeChangeListener(this._pauseOnExceptionStateChanged, this); + Common.moduleSetting('enableAsyncStackTraces').removeChangeListener(this.asyncStackTracesStateChanged, this); } /** @@ -776,7 +776,7 @@ /** * @param {function()} fulfill - * @this {WebInspector.DebuggerModel} + * @this {SDK.DebuggerModel} */ function promiseBody(fulfill) { this.disableDebugger(fulfill); @@ -792,7 +792,7 @@ /** * @param {function()} fulfill - * @this {WebInspector.DebuggerModel} + * @this {SDK.DebuggerModel} */ function promiseBody(fulfill) { this.enableDebugger(fulfill); @@ -800,22 +800,22 @@ } }; -/** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: string}} */ -WebInspector.DebuggerModel.FunctionDetails; +/** @typedef {{location: ?SDK.DebuggerModel.Location, functionName: string}} */ +SDK.DebuggerModel.FunctionDetails; /** * Keep these in sync with WebCore::V8Debugger * * @enum {string} */ -WebInspector.DebuggerModel.PauseOnExceptionsState = { +SDK.DebuggerModel.PauseOnExceptionsState = { DontPauseOnExceptions: 'none', PauseOnAllExceptions: 'all', PauseOnUncaughtExceptions: 'uncaught' }; /** @enum {symbol} */ -WebInspector.DebuggerModel.Events = { +SDK.DebuggerModel.Events = { DebuggerWasEnabled: Symbol('DebuggerWasEnabled'), DebuggerWasDisabled: Symbol('DebuggerWasDisabled'), BeforeDebuggerPaused: Symbol('BeforeDebuggerPaused'), @@ -829,7 +829,7 @@ }; /** @enum {string} */ -WebInspector.DebuggerModel.BreakReason = { +SDK.DebuggerModel.BreakReason = { DOM: 'DOM', EventListener: 'EventListener', XHR: 'XHR', @@ -840,7 +840,7 @@ Other: 'other' }; -WebInspector.DebuggerEventTypes = { +SDK.DebuggerEventTypes = { JavaScriptPause: 0, JavaScriptBreakpoint: 1, NativeBreakpoint: 2 @@ -850,9 +850,9 @@ * @implements {Protocol.DebuggerDispatcher} * @unrestricted */ -WebInspector.DebuggerDispatcher = class { +SDK.DebuggerDispatcher = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel */ constructor(debuggerModel) { this._debuggerModel = debuggerModel; @@ -954,9 +954,9 @@ /** * @unrestricted */ -WebInspector.DebuggerModel.Location = class extends WebInspector.SDKObject { +SDK.DebuggerModel.Location = class extends SDK.SDKObject { /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @param {string} scriptId * @param {number} lineNumber * @param {number=} columnNumber @@ -970,12 +970,12 @@ } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @param {!Protocol.Debugger.Location} payload - * @return {!WebInspector.DebuggerModel.Location} + * @return {!SDK.DebuggerModel.Location} */ static fromPayload(debuggerModel, payload) { - return new WebInspector.DebuggerModel.Location( + return new SDK.DebuggerModel.Location( debuggerModel, payload.scriptId, payload.lineNumber, payload.columnNumber); } @@ -987,7 +987,7 @@ } /** - * @return {?WebInspector.Script} + * @return {?SDK.Script} */ script() { return this._debuggerModel.scriptForId(this.scriptId); @@ -1009,10 +1009,10 @@ /** * @unrestricted */ -WebInspector.DebuggerModel.CallFrame = class extends WebInspector.SDKObject { +SDK.DebuggerModel.CallFrame = class extends SDK.SDKObject { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.Script} script + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!SDK.Script} script * @param {!Protocol.Debugger.CallFrame} payload */ constructor(debuggerModel, script, payload) { @@ -1022,23 +1022,23 @@ this._debuggerAgent = debuggerModel._agent; this._script = script; this._payload = payload; - this._location = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel, payload.location); + this._location = SDK.DebuggerModel.Location.fromPayload(debuggerModel, payload.location); this._scopeChain = []; this._localScope = null; for (var i = 0; i < payload.scopeChain.length; ++i) { - var scope = new WebInspector.DebuggerModel.Scope(this, i); + var scope = new SDK.DebuggerModel.Scope(this, i); this._scopeChain.push(scope); if (scope.type() === Protocol.Debugger.ScopeType.Local) this._localScope = scope; } if (payload.functionLocation) - this._functionLocation = WebInspector.DebuggerModel.Location.fromPayload(debuggerModel, payload.functionLocation); + this._functionLocation = SDK.DebuggerModel.Location.fromPayload(debuggerModel, payload.functionLocation); } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames - * @return {!Array.<!WebInspector.DebuggerModel.CallFrame>} + * @return {!Array.<!SDK.DebuggerModel.CallFrame>} */ static fromPayloadArray(debuggerModel, callFrames) { var result = []; @@ -1046,13 +1046,13 @@ var callFrame = callFrames[i]; var script = debuggerModel.scriptForId(callFrame.location.scriptId); if (script) - result.push(new WebInspector.DebuggerModel.CallFrame(debuggerModel, script, callFrame)); + result.push(new SDK.DebuggerModel.CallFrame(debuggerModel, script, callFrame)); } return result; } /** - * @return {!WebInspector.Script} + * @return {!SDK.Script} */ get script() { return this._script; @@ -1066,28 +1066,28 @@ } /** - * @return {!Array.<!WebInspector.DebuggerModel.Scope>} + * @return {!Array.<!SDK.DebuggerModel.Scope>} */ scopeChain() { return this._scopeChain; } /** - * @return {?WebInspector.DebuggerModel.Scope} + * @return {?SDK.DebuggerModel.Scope} */ localScope() { return this._localScope; } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ thisObject() { return this._payload.this ? this.target().runtimeModel.createRemoteObject(this._payload.this) : null; } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ returnValue() { return this._payload.returnValue ? this.target().runtimeModel.createRemoteObject(this._payload.returnValue) : null; @@ -1101,14 +1101,14 @@ } /** - * @return {!WebInspector.DebuggerModel.Location} + * @return {!SDK.DebuggerModel.Location} */ location() { return this._location; } /** - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ functionLocation() { return this._functionLocation || null; @@ -1150,7 +1150,7 @@ * @param {?Protocol.Error} error * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace - * @this {WebInspector.DebuggerModel.CallFrame} + * @this {SDK.DebuggerModel.CallFrame} */ function protocolCallback(error, callFrames, asyncStackTrace) { if (!error) @@ -1188,9 +1188,9 @@ /** * @unrestricted */ -WebInspector.DebuggerModel.Scope = class { +SDK.DebuggerModel.Scope = class { /** - * @param {!WebInspector.DebuggerModel.CallFrame} callFrame + * @param {!SDK.DebuggerModel.CallFrame} callFrame * @param {number} ordinal */ constructor(callFrame, ordinal) { @@ -1200,15 +1200,15 @@ this._name = this._payload.name; this._ordinal = ordinal; this._startLocation = this._payload.startLocation ? - WebInspector.DebuggerModel.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) : + SDK.DebuggerModel.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) : null; this._endLocation = this._payload.endLocation ? - WebInspector.DebuggerModel.Location.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : + SDK.DebuggerModel.Location.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : null; } /** - * @return {!WebInspector.DebuggerModel.CallFrame} + * @return {!SDK.DebuggerModel.CallFrame} */ callFrame() { return this._callFrame; @@ -1229,21 +1229,21 @@ } /** - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ startLocation() { return this._startLocation; } /** - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ endLocation() { return this._endLocation; } /** - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ object() { if (this._object) @@ -1253,7 +1253,7 @@ var declarativeScope = this._type !== Protocol.Debugger.ScopeType.With && this._type !== Protocol.Debugger.ScopeType.Global; if (declarativeScope) this._object = runtimeModel.createScopeRemoteObject( - this._payload.object, new WebInspector.ScopeRef(this._ordinal, this._callFrame.id)); + this._payload.object, new SDK.ScopeRef(this._ordinal, this._callFrame.id)); else this._object = runtimeModel.createRemoteObject(this._payload.object); @@ -1272,9 +1272,9 @@ /** * @unrestricted */ -WebInspector.DebuggerPausedDetails = class extends WebInspector.SDKObject { +SDK.DebuggerPausedDetails = class extends SDK.SDKObject { /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames * @param {string} reason * @param {!Object|undefined} auxData @@ -1284,7 +1284,7 @@ constructor(debuggerModel, callFrames, reason, auxData, breakpointIds, asyncStackTrace) { super(debuggerModel.target()); this.debuggerModel = debuggerModel; - this.callFrames = WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel, callFrames); + this.callFrames = SDK.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel, callFrames); this.reason = reason; this.auxData = auxData; this.breakpointIds = breakpointIds; @@ -1293,11 +1293,11 @@ } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ exception() { - if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception && - this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) + if (this.reason !== SDK.DebuggerModel.BreakReason.Exception && + this.reason !== SDK.DebuggerModel.BreakReason.PromiseRejection) return null; return this.target().runtimeModel.createRemoteObject(/** @type {!Protocol.Runtime.RemoteObject} */ (this.auxData)); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js b/third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js index 4853397..7bbee79 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/HAREntry.js
@@ -36,9 +36,9 @@ /** * @unrestricted */ -WebInspector.HAREntry = class { +SDK.HAREntry = class { /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ constructor(request) { this._request = request; @@ -62,8 +62,8 @@ ipAddress = ipAddress.substr(0, portPositionInString); var entry = { - startedDateTime: WebInspector.HARLog.pseudoWallTime(this._request, this._request.startTime), - time: this._request.timing ? WebInspector.HAREntry._toMilliseconds(this._request.duration) : 0, + startedDateTime: SDK.HARLog.pseudoWallTime(this._request, this._request.startTime), + time: this._request.timing ? SDK.HAREntry._toMilliseconds(this._request.duration) : 0, request: this._buildRequest(), response: this._buildResponse(), cache: {}, // Not supported yet. @@ -166,7 +166,7 @@ var send = timing.sendEnd - timing.sendStart; var wait = timing.receiveHeadersEnd - timing.sendEnd; - var receive = WebInspector.HAREntry._toMilliseconds(this._request.duration) - timing.receiveHeadersEnd; + var receive = SDK.HAREntry._toMilliseconds(this._request.duration) - timing.receiveHeadersEnd; var ssl = -1; if (timing.sslStart >= 0 && timing.sslEnd >= 0) @@ -202,7 +202,7 @@ } /** - * @param {!Array.<!WebInspector.Cookie>} cookies + * @param {!Array.<!SDK.Cookie>} cookies * @return {!Array.<!Object>} */ _buildCookies(cookies) { @@ -210,7 +210,7 @@ } /** - * @param {!WebInspector.Cookie} cookie + * @param {!SDK.Cookie} cookie * @return {!Object} */ _buildCookie(cookie) { @@ -219,7 +219,7 @@ value: cookie.value(), path: cookie.path(), domain: cookie.domain(), - expires: cookie.expiresDate(WebInspector.HARLog.pseudoWallTime(this._request, this._request.startTime)), + expires: cookie.expiresDate(SDK.HARLog.pseudoWallTime(this._request, this._request.startTime)), httpOnly: cookie.httpOnly(), secure: cookie.secure() }; @@ -262,16 +262,16 @@ /** * @unrestricted */ -WebInspector.HARLog = class { +SDK.HARLog = class { /** - * @param {!Array.<!WebInspector.NetworkRequest>} requests + * @param {!Array.<!SDK.NetworkRequest>} requests */ constructor(requests) { this._requests = requests; } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @param {number} monotonicTime * @return {!Date} */ @@ -315,13 +315,13 @@ } /** - * @param {!WebInspector.PageLoad} page - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.PageLoad} page + * @param {!SDK.NetworkRequest} request * @return {!Object} */ _convertPage(page, request) { return { - startedDateTime: WebInspector.HARLog.pseudoWallTime(request, page.startTime), + startedDateTime: SDK.HARLog.pseudoWallTime(request, page.startTime), id: 'page_' + page.id, title: page.url, // We don't have actual page title here. URL is probably better than nothing. pageTimings: { @@ -332,15 +332,15 @@ } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request * @return {!Object} */ _convertResource(request) { - return (new WebInspector.HAREntry(request)).build(); + return (new SDK.HAREntry(request)).build(); } /** - * @param {!WebInspector.PageLoad} page + * @param {!SDK.PageLoad} page * @param {number} time * @return {number} */ @@ -348,6 +348,6 @@ var startTime = page.startTime; if (time === -1 || startTime === -1) return -1; - return WebInspector.HAREntry._toMilliseconds(time - startTime); + return SDK.HAREntry._toMilliseconds(time - startTime); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js index b80eb0f..5062e3a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js
@@ -1,13 +1,13 @@ /** * @unrestricted */ -WebInspector.HeapProfilerModel = class extends WebInspector.SDKModel { +SDK.HeapProfilerModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.HeapProfilerModel, target); - target.registerHeapProfilerDispatcher(new WebInspector.HeapProfilerDispatcher(this)); + super(SDK.HeapProfilerModel, target); + target.registerHeapProfilerDispatcher(new SDK.HeapProfilerDispatcher(this)); this._enabled = false; this._heapProfilerAgent = target.heapProfilerAgent(); } @@ -36,7 +36,7 @@ * @param {!Array.<number>} samples */ heapStatsUpdate(samples) { - this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.HeapStatsUpdate, samples); + this.dispatchEventToListeners(SDK.HeapProfilerModel.Events.HeapStatsUpdate, samples); } /** @@ -45,7 +45,7 @@ */ lastSeenObjectId(lastSeenObjectId, timestamp) { this.dispatchEventToListeners( - WebInspector.HeapProfilerModel.Events.LastSeenObjectId, + SDK.HeapProfilerModel.Events.LastSeenObjectId, {lastSeenObjectId: lastSeenObjectId, timestamp: timestamp}); } @@ -53,7 +53,7 @@ * @param {string} chunk */ addHeapSnapshotChunk(chunk) { - this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk, chunk); + this.dispatchEventToListeners(SDK.HeapProfilerModel.Events.AddHeapSnapshotChunk, chunk); } /** @@ -63,17 +63,17 @@ */ reportHeapSnapshotProgress(done, total, finished) { this.dispatchEventToListeners( - WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress, + SDK.HeapProfilerModel.Events.ReportHeapSnapshotProgress, {done: done, total: total, finished: finished}); } resetProfiles() { - this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.ResetProfiles); + this.dispatchEventToListeners(SDK.HeapProfilerModel.Events.ResetProfiles); } }; /** @enum {symbol} */ -WebInspector.HeapProfilerModel.Events = { +SDK.HeapProfilerModel.Events = { HeapStatsUpdate: Symbol('HeapStatsUpdate'), LastSeenObjectId: Symbol('LastSeenObjectId'), AddHeapSnapshotChunk: Symbol('AddHeapSnapshotChunk'), @@ -85,7 +85,7 @@ * @implements {Protocol.HeapProfilerDispatcher} * @unrestricted */ -WebInspector.HeapProfilerDispatcher = class { +SDK.HeapProfilerDispatcher = class { constructor(model) { this._heapProfilerModel = model; }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackendHostedMode.js b/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackendHostedMode.js index a3be15e..79de893 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackendHostedMode.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/InspectorBackendHostedMode.js
@@ -3,16 +3,16 @@ // found in the LICENSE file. // This should be executed immediately after InspectorBackend and InspectorBackendCommands -WebInspector.InspectorBackendHostedMode = {}; +SDK.InspectorBackendHostedMode = {}; -WebInspector.InspectorBackendHostedMode.loadFromJSONIfNeeded = function() { +SDK.InspectorBackendHostedMode.loadFromJSONIfNeeded = function() { if (InspectorBackend.isInitialized()) return; for (var url of Object.keys(Runtime.cachedResources)) { if (url.indexOf('protocol.json') !== -1) { var protocol = Runtime.cachedResources[url]; - var code = WebInspector.InspectorBackendHostedMode.generateCommands(JSON.parse(protocol)); + var code = SDK.InspectorBackendHostedMode.generateCommands(JSON.parse(protocol)); eval(code); } } @@ -22,7 +22,7 @@ * @param {*} schema * @return {string} */ -WebInspector.InspectorBackendHostedMode.generateCommands = function(schema) { +SDK.InspectorBackendHostedMode.generateCommands = function(schema) { var jsTypes = {integer: 'number', array: 'object'}; var rawTypes = {}; var result = []; @@ -125,4 +125,4 @@ return result.join('\n'); }; -WebInspector.InspectorBackendHostedMode.loadFromJSONIfNeeded(); +SDK.InspectorBackendHostedMode.loadFromJSONIfNeeded();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeBase.js b/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeBase.js index 09278198..c956802c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeBase.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeBase.js
@@ -3,17 +3,17 @@ // found in the LICENSE file. /** @typedef {!{ rect: !Protocol.DOM.Rect, - snapshot: !WebInspector.PaintProfilerSnapshot + snapshot: !SDK.PaintProfilerSnapshot }} */ -WebInspector.SnapshotWithRect; +SDK.SnapshotWithRect; /** * @interface */ -WebInspector.Layer = function() {}; +SDK.Layer = function() {}; -WebInspector.Layer.prototype = { +SDK.Layer.prototype = { /** * @return {string} */ @@ -25,7 +25,7 @@ parentId: function() {}, /** - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ parent: function() {}, @@ -35,22 +35,22 @@ isRoot: function() {}, /** - * @return {!Array.<!WebInspector.Layer>} + * @return {!Array.<!SDK.Layer>} */ children: function() {}, /** - * @param {!WebInspector.Layer} child + * @param {!SDK.Layer} child */ addChild: function(child) {}, /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node: function() {}, /** - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ nodeForSelfOrAncestor: function() {}, @@ -125,12 +125,12 @@ drawsContent: function() {}, /** - * @return {!Array<!Promise<?WebInspector.SnapshotWithRect>>} + * @return {!Array<!Promise<?SDK.SnapshotWithRect>>} */ snapshots: function() {} }; -WebInspector.Layer.ScrollRectType = { +SDK.Layer.ScrollRectType = { NonFastScrollable: 'NonFastScrollable', TouchEventHandler: 'TouchEventHandler', WheelEventHandler: 'WheelEventHandler', @@ -140,36 +140,36 @@ /** * @unrestricted */ -WebInspector.LayerTreeBase = class { +SDK.LayerTreeBase = class { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ constructor(target) { this._target = target; - this._domModel = target ? WebInspector.DOMModel.fromTarget(target) : null; + this._domModel = target ? SDK.DOMModel.fromTarget(target) : null; this._layersById = {}; this._root = null; this._contentRoot = null; - /** @type Map<number, ?WebInspector.DOMNode> */ + /** @type Map<number, ?SDK.DOMNode> */ this._backendNodeIdToNode = new Map(); } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._target; } /** - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ root() { return this._root; } /** - * @param {?WebInspector.Layer} root + * @param {?SDK.Layer} root * @protected */ setRoot(root) { @@ -177,14 +177,14 @@ } /** - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ contentRoot() { return this._contentRoot; } /** - * @param {?WebInspector.Layer} contentRoot + * @param {?SDK.Layer} contentRoot * @protected */ setContentRoot(contentRoot) { @@ -192,8 +192,8 @@ } /** - * @param {function(!WebInspector.Layer)} callback - * @param {?WebInspector.Layer=} root + * @param {function(!SDK.Layer)} callback + * @param {?SDK.Layer=} root * @return {boolean} */ forEachLayer(callback, root) { @@ -207,7 +207,7 @@ /** * @param {string} id - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ layerById(id) { return this._layersById[id] || null; @@ -226,8 +226,8 @@ this._domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, populateBackendNodeMap.bind(this)); /** - * @this {WebInspector.LayerTreeBase} - * @param {?Map<number, ?WebInspector.DOMNode>} nodesMap + * @this {SDK.LayerTreeBase} + * @param {?Map<number, ?SDK.DOMNode>} nodesMap */ function populateBackendNodeMap(nodesMap) { if (nodesMap) { @@ -254,7 +254,7 @@ /** * @param {number} id - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ _nodeForId(id) { return this._domModel ? this._domModel.nodeForId(id) : null;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkLog.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkLog.js index 9b2e37e50..3fc4922bd 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkLog.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkLog.js
@@ -31,40 +31,40 @@ /** * @unrestricted */ -WebInspector.NetworkLog = class extends WebInspector.SDKModel { +SDK.NetworkLog = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.ResourceTreeModel} resourceTreeModel - * @param {!WebInspector.NetworkManager} networkManager + * @param {!SDK.Target} target + * @param {!SDK.ResourceTreeModel} resourceTreeModel + * @param {!SDK.NetworkManager} networkManager */ constructor(target, resourceTreeModel, networkManager) { - super(WebInspector.NetworkLog, target); + super(SDK.NetworkLog, target); this._requests = []; this._requestForId = {}; - networkManager.addEventListener(WebInspector.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); + networkManager.addEventListener(SDK.NetworkManager.Events.RequestStarted, this._onRequestStarted, this); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated, this); - resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Load, this._onLoad, this); + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated, this); + resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.Load, this._onLoad, this); resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.DOMContentLoaded, this._onDOMContentLoaded, this); + SDK.ResourceTreeModel.Events.DOMContentLoaded, this._onDOMContentLoaded, this); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.NetworkLog} + * @param {!SDK.Target} target + * @return {?SDK.NetworkLog} */ static fromTarget(target) { - return /** @type {?WebInspector.NetworkLog} */ (target.model(WebInspector.NetworkLog)); + return /** @type {?SDK.NetworkLog} */ (target.model(SDK.NetworkLog)); } /** * @param {string} url - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ static requestForURL(url) { - for (var target of WebInspector.targetManager.targets()) { - var networkLog = WebInspector.NetworkLog.fromTarget(target); + for (var target of SDK.targetManager.targets()) { + var networkLog = SDK.NetworkLog.fromTarget(target); var result = networkLog && networkLog.requestForURL(url); if (result) return result; @@ -73,12 +73,12 @@ } /** - * @return {!Array.<!WebInspector.NetworkRequest>} + * @return {!Array.<!SDK.NetworkRequest>} */ static requests() { var result = []; - for (var target of WebInspector.targetManager.targets()) { - var networkLog = WebInspector.NetworkLog.fromTarget(target); + for (var target of SDK.targetManager.targets()) { + var networkLog = SDK.NetworkLog.fromTarget(target); if (networkLog) result = result.concat(networkLog.requests()); } @@ -86,7 +86,7 @@ } /** - * @return {!Array.<!WebInspector.NetworkRequest>} + * @return {!Array.<!SDK.NetworkRequest>} */ requests() { return this._requests; @@ -94,7 +94,7 @@ /** * @param {string} url - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ requestForURL(url) { for (var i = 0; i < this._requests.length; ++i) { @@ -105,18 +105,18 @@ } /** - * @param {!WebInspector.NetworkRequest} request - * @return {!WebInspector.PageLoad} + * @param {!SDK.NetworkRequest} request + * @return {!SDK.PageLoad} */ pageLoadForRequest(request) { return request.__page; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onMainFrameNavigated(event) { - var mainFrame = /** type {WebInspector.ResourceTreeFrame} */ event.data; + var mainFrame = /** type {SDK.ResourceTreeFrame} */ event.data; // Preserve requests from the new session. this._currentPageLoad = null; var oldRequests = this._requests.splice(0, this._requests.length); @@ -125,7 +125,7 @@ var request = oldRequests[i]; if (request.loaderId === mainFrame.loaderId) { if (!this._currentPageLoad) - this._currentPageLoad = new WebInspector.PageLoad(request); + this._currentPageLoad = new SDK.PageLoad(request); this._requests.push(request); this._requestForId[request.requestId] = request; request.__page = this._currentPageLoad; @@ -134,17 +134,17 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestStarted(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._requests.push(request); this._requestForId[request.requestId] = request; request.__page = this._currentPageLoad; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onDOMContentLoaded(event) { if (this._currentPageLoad) @@ -152,7 +152,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onLoad(event) { if (this._currentPageLoad) @@ -161,7 +161,7 @@ /** * @param {!Protocol.Network.RequestId} requestId - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ requestForId(requestId) { return this._requestForId[requestId]; @@ -172,15 +172,15 @@ /** * @unrestricted */ -WebInspector.PageLoad = class { +SDK.PageLoad = class { /** - * @param {!WebInspector.NetworkRequest} mainRequest + * @param {!SDK.NetworkRequest} mainRequest */ constructor(mainRequest) { - this.id = ++WebInspector.PageLoad._lastIdentifier; + this.id = ++SDK.PageLoad._lastIdentifier; this.url = mainRequest.url; this.startTime = mainRequest.startTime; } }; -WebInspector.PageLoad._lastIdentifier = 0; +SDK.PageLoad._lastIdentifier = 0;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js index 99d6d68..0a8fce5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -31,19 +31,19 @@ /** * @unrestricted */ -WebInspector.NetworkManager = class extends WebInspector.SDKModel { +SDK.NetworkManager = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.NetworkManager, target); - this._dispatcher = new WebInspector.NetworkDispatcher(this); + super(SDK.NetworkManager, target); + this._dispatcher = new SDK.NetworkDispatcher(this); this._target = target; this._networkAgent = target.networkAgent(); target.registerNetworkDispatcher(this._dispatcher); - if (WebInspector.moduleSetting('cacheDisabled').get()) + if (Common.moduleSetting('cacheDisabled').get()) this._networkAgent.setCacheDisabled(true); - if (WebInspector.moduleSetting('monitoringXHREnabled').get()) + if (Common.moduleSetting('monitoringXHREnabled').get()) this._networkAgent.setMonitoringXHREnabled(true); // Limit buffer when talking to a remote device. @@ -52,34 +52,34 @@ else this._networkAgent.enable(); - this._bypassServiceWorkerSetting = WebInspector.settings.createSetting('bypassServiceWorker', false); + this._bypassServiceWorkerSetting = Common.settings.createSetting('bypassServiceWorker', false); if (this._bypassServiceWorkerSetting.get()) this._bypassServiceWorkerChanged(); this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorkerChanged, this); - WebInspector.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledSettingChanged, this); + Common.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledSettingChanged, this); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.NetworkManager} + * @param {!SDK.Target} target + * @return {?SDK.NetworkManager} */ static fromTarget(target) { - return /** @type {?WebInspector.NetworkManager} */ (target.model(WebInspector.NetworkManager)); + return /** @type {?SDK.NetworkManager} */ (target.model(SDK.NetworkManager)); } /** - * @param {!WebInspector.NetworkManager.Conditions} conditions + * @param {!SDK.NetworkManager.Conditions} conditions * @return {!Protocol.Network.ConnectionType} * TODO(allada): this belongs to NetworkConditionsSelector, which should hardcode/guess it. */ static _connectionType(conditions) { if (!conditions.download && !conditions.upload) return Protocol.Network.ConnectionType.None; - var types = WebInspector.NetworkManager._connectionTypes; + var types = SDK.NetworkManager._connectionTypes; if (!types) { - WebInspector.NetworkManager._connectionTypes = []; - types = WebInspector.NetworkManager._connectionTypes; + SDK.NetworkManager._connectionTypes = []; + types = SDK.NetworkManager._connectionTypes; types.push(['2g', Protocol.Network.ConnectionType.Cellular2g]); types.push(['3g', Protocol.Network.ConnectionType.Cellular3g]); types.push(['4g', Protocol.Network.ConnectionType.Cellular4g]); @@ -96,14 +96,14 @@ /** * @param {string} url - * @return {!WebInspector.NetworkRequest} + * @return {!SDK.NetworkRequest} */ inflightRequestForURL(url) { return this._dispatcher._inflightRequestsByURL[url]; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _cacheDisabledSettingChanged(event) { var enabled = /** @type {boolean} */ (event.data); @@ -114,7 +114,7 @@ * @override */ dispose() { - WebInspector.moduleSetting('cacheDisabled').removeChangeListener(this._cacheDisabledSettingChanged, this); + Common.moduleSetting('cacheDisabled').removeChangeListener(this._cacheDisabledSettingChanged, this); } _bypassServiceWorkerChanged() { @@ -123,7 +123,7 @@ }; /** @enum {symbol} */ -WebInspector.NetworkManager.Events = { +SDK.NetworkManager.Events = { RequestStarted: Symbol('RequestStarted'), RequestUpdated: Symbol('RequestUpdated'), RequestFinished: Symbol('RequestFinished'), @@ -131,7 +131,7 @@ ResponseReceived: Symbol('ResponseReceived') }; -WebInspector.NetworkManager._MIMETypes = { +SDK.NetworkManager._MIMETypes = { 'text/html': {'document': true}, 'text/xml': {'document': true}, 'text/plain': {'document': true}, @@ -144,17 +144,17 @@ /** @typedef {{download: number, upload: number, latency: number, title: string}} */ -WebInspector.NetworkManager.Conditions; -/** @type {!WebInspector.NetworkManager.Conditions} */ -WebInspector.NetworkManager.NoThrottlingConditions = { - title: WebInspector.UIString('No throttling'), +SDK.NetworkManager.Conditions; +/** @type {!SDK.NetworkManager.Conditions} */ +SDK.NetworkManager.NoThrottlingConditions = { + title: Common.UIString('No throttling'), download: -1, upload: -1, latency: 0 }; -/** @type {!WebInspector.NetworkManager.Conditions} */ -WebInspector.NetworkManager.OfflineConditions = { - title: WebInspector.UIString('Offline'), +/** @type {!SDK.NetworkManager.Conditions} */ +SDK.NetworkManager.OfflineConditions = { + title: Common.UIString('Offline'), download: 0, upload: 0, latency: 0 @@ -165,7 +165,7 @@ * @implements {Protocol.NetworkDispatcher} * @unrestricted */ -WebInspector.NetworkDispatcher = class { +SDK.NetworkDispatcher = class { constructor(manager) { this._manager = manager; this._inflightRequestsById = {}; @@ -174,7 +174,7 @@ /** * @param {!Protocol.Network.Headers} headersMap - * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {!Array.<!SDK.NetworkRequest.NameValue>} */ _headersMapToHeadersArray(headersMap) { var result = []; @@ -187,7 +187,7 @@ } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest * @param {!Protocol.Network.Request} request */ _updateNetworkRequestWithRequest(networkRequest, request) { @@ -199,7 +199,7 @@ } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest * @param {!Protocol.Network.Response=} response */ _updateNetworkRequestWithResponse(networkRequest, response) { @@ -236,13 +236,13 @@ if (!this._mimeTypeIsConsistentWithType(networkRequest)) { var consoleModel = this._manager._target.consoleModel; - consoleModel.addMessage(new WebInspector.ConsoleMessage( - consoleModel.target(), WebInspector.ConsoleMessage.MessageSource.Network, - WebInspector.ConsoleMessage.MessageLevel.Log, - WebInspector.UIString( + consoleModel.addMessage(new SDK.ConsoleMessage( + consoleModel.target(), SDK.ConsoleMessage.MessageSource.Network, + SDK.ConsoleMessage.MessageLevel.Log, + Common.UIString( 'Resource interpreted as %s but transferred with MIME type %s: "%s".', networkRequest.resourceType().title(), networkRequest.mimeType, networkRequest.url), - WebInspector.ConsoleMessage.MessageType.Log, '', 0, 0, networkRequest.requestId)); + SDK.ConsoleMessage.MessageType.Log, '', 0, 0, networkRequest.requestId)); } if (response.securityDetails) @@ -250,7 +250,7 @@ } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest * @return {boolean} */ _mimeTypeIsConsistentWithType(networkRequest) { @@ -264,16 +264,16 @@ return true; var resourceType = networkRequest.resourceType(); - if (resourceType !== WebInspector.resourceTypes.Stylesheet && - resourceType !== WebInspector.resourceTypes.Document && resourceType !== WebInspector.resourceTypes.TextTrack) { + if (resourceType !== Common.resourceTypes.Stylesheet && + resourceType !== Common.resourceTypes.Document && resourceType !== Common.resourceTypes.TextTrack) { return true; } if (!networkRequest.mimeType) return true; // Might be not known for cached resources with null responses. - if (networkRequest.mimeType in WebInspector.NetworkManager._MIMETypes) - return resourceType.name() in WebInspector.NetworkManager._MIMETypes[networkRequest.mimeType]; + if (networkRequest.mimeType in SDK.NetworkManager._MIMETypes) + return resourceType.name() in SDK.NetworkManager._MIMETypes[networkRequest.mimeType]; return false; } @@ -326,7 +326,7 @@ networkRequest.hasNetworkData = true; this._updateNetworkRequestWithRequest(networkRequest, request); networkRequest.setIssueTime(time, wallTime); - networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]); + networkRequest.setResourceType(Common.resourceTypes[resourceType]); this._startNetworkRequest(networkRequest); } @@ -364,17 +364,17 @@ eventData.mimeType = response.mimeType; var lastModifiedHeader = response.headers['last-modified']; eventData.lastModified = lastModifiedHeader ? new Date(lastModifiedHeader) : null; - this._manager.dispatchEventToListeners(WebInspector.NetworkManager.Events.RequestUpdateDropped, eventData); + this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.RequestUpdateDropped, eventData); return; } networkRequest.responseReceivedTime = time; - networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]); + networkRequest.setResourceType(Common.resourceTypes[resourceType]); this._updateNetworkRequestWithResponse(networkRequest, response); this._updateNetworkRequest(networkRequest); - this._manager.dispatchEventToListeners(WebInspector.NetworkManager.Events.ResponseReceived, networkRequest); + this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseReceived, networkRequest); } /** @@ -425,17 +425,17 @@ return; networkRequest.failed = true; - networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]); + networkRequest.setResourceType(Common.resourceTypes[resourceType]); networkRequest.canceled = canceled; if (blockedReason) { networkRequest.setBlockedReason(blockedReason); if (blockedReason === Protocol.Network.BlockedReason.Inspector) { var consoleModel = this._manager._target.consoleModel; - consoleModel.addMessage(new WebInspector.ConsoleMessage( - consoleModel.target(), WebInspector.ConsoleMessage.MessageSource.Network, - WebInspector.ConsoleMessage.MessageLevel.Warning, - WebInspector.UIString('Request was blocked by DevTools: "%s".', networkRequest.url), - WebInspector.ConsoleMessage.MessageType.Log, '', 0, 0, networkRequest.requestId)); + consoleModel.addMessage(new SDK.ConsoleMessage( + consoleModel.target(), SDK.ConsoleMessage.MessageSource.Network, + SDK.ConsoleMessage.MessageLevel.Warning, + Common.UIString('Request was blocked by DevTools: "%s".', networkRequest.url), + SDK.ConsoleMessage.MessageType.Log, '', 0, 0, networkRequest.requestId)); } } networkRequest.localizedFailDescription = localizedDescription; @@ -450,8 +450,8 @@ */ webSocketCreated(requestId, requestURL, initiator) { var networkRequest = - new WebInspector.NetworkRequest(this._manager._target, requestId, requestURL, '', '', '', initiator || null); - networkRequest.setResourceType(WebInspector.resourceTypes.WebSocket); + new SDK.NetworkRequest(this._manager._target, requestId, requestURL, '', '', '', initiator || null); + networkRequest.setResourceType(Common.resourceTypes.WebSocket); this._startNetworkRequest(networkRequest); } @@ -581,7 +581,7 @@ * @param {!Protocol.Network.RequestId} requestId * @param {!Protocol.Network.Timestamp} time * @param {string} redirectURL - * @return {!WebInspector.NetworkRequest} + * @return {!SDK.NetworkRequest} */ _appendRedirect(requestId, time, redirectURL) { var originalNetworkRequest = this._inflightRequestsById[requestId]; @@ -599,23 +599,23 @@ } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest */ _startNetworkRequest(networkRequest) { this._inflightRequestsById[networkRequest.requestId] = networkRequest; this._inflightRequestsByURL[networkRequest.url] = networkRequest; - this._dispatchEventToListeners(WebInspector.NetworkManager.Events.RequestStarted, networkRequest); + this._dispatchEventToListeners(SDK.NetworkManager.Events.RequestStarted, networkRequest); } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest */ _updateNetworkRequest(networkRequest) { - this._dispatchEventToListeners(WebInspector.NetworkManager.Events.RequestUpdated, networkRequest); + this._dispatchEventToListeners(SDK.NetworkManager.Events.RequestUpdated, networkRequest); } /** - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest * @param {!Protocol.Network.Timestamp} finishTime * @param {number} encodedDataLength */ @@ -624,14 +624,14 @@ networkRequest.finished = true; if (encodedDataLength >= 0) networkRequest.setTransferSize(encodedDataLength); - this._dispatchEventToListeners(WebInspector.NetworkManager.Events.RequestFinished, networkRequest); + this._dispatchEventToListeners(SDK.NetworkManager.Events.RequestFinished, networkRequest); delete this._inflightRequestsById[networkRequest.requestId]; delete this._inflightRequestsByURL[networkRequest.url]; } /** * @param {string} eventType - * @param {!WebInspector.NetworkRequest} networkRequest + * @param {!SDK.NetworkRequest} networkRequest */ _dispatchEventToListeners(eventType, networkRequest) { this._manager.dispatchEventToListeners(eventType, networkRequest); @@ -646,22 +646,22 @@ * @param {?Protocol.Network.Initiator} initiator */ _createNetworkRequest(requestId, frameId, loaderId, url, documentURL, initiator) { - return new WebInspector.NetworkRequest( + return new SDK.NetworkRequest( this._manager._target, requestId, url, documentURL, frameId, loaderId, initiator); } }; /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.MultitargetNetworkManager = class extends WebInspector.Object { +SDK.MultitargetNetworkManager = class extends Common.Object { constructor() { super(); /** @type {!Set<string>} */ this._blockedURLs = new Set(); - this._blockedSetting = WebInspector.moduleSetting('blockedURLs'); + this._blockedSetting = Common.moduleSetting('blockedURLs'); this._blockedSetting.addChangeListener(this._updateBlockedURLs, this); this._blockedSetting.set([]); this._updateBlockedURLs(); @@ -669,10 +669,10 @@ this._userAgentOverride = ''; /** @type {!Set<!Protocol.NetworkAgent>} */ this._agents = new Set(); - /** @type {!WebInspector.NetworkManager.Conditions} */ - this._networkConditions = WebInspector.NetworkManager.NoThrottlingConditions; + /** @type {!SDK.NetworkManager.Conditions} */ + this._networkConditions = SDK.NetworkManager.NoThrottlingConditions; - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Network); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Network); } /** @@ -690,7 +690,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { var networkAgent = target.networkAgent(); @@ -707,7 +707,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._agents.delete(target.networkAgent()); @@ -729,17 +729,17 @@ } /** - * @param {!WebInspector.NetworkManager.Conditions} conditions + * @param {!SDK.NetworkManager.Conditions} conditions */ setNetworkConditions(conditions) { this._networkConditions = conditions; for (var agent of this._agents) this._updateNetworkConditions(agent); - this.dispatchEventToListeners(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged); + this.dispatchEventToListeners(SDK.MultitargetNetworkManager.Events.ConditionsChanged); } /** - * @return {!WebInspector.NetworkManager.Conditions} + * @return {!SDK.NetworkManager.Conditions} */ networkConditions() { return this._networkConditions; @@ -755,7 +755,7 @@ } else { networkAgent.emulateNetworkConditions( this.isOffline(), conditions.latency, conditions.download < 0 ? 0 : conditions.download, - conditions.upload < 0 ? 0 : conditions.upload, WebInspector.NetworkManager._connectionType(conditions)); + conditions.upload < 0 ? 0 : conditions.upload, SDK.NetworkManager._connectionType(conditions)); } } @@ -777,7 +777,7 @@ _updateUserAgentOverride() { var userAgent = this._currentUserAgent(); - WebInspector.ResourceLoader.targetUserAgent = userAgent; + Host.ResourceLoader.targetUserAgent = userAgent; for (var agent of this._agents) agent.setUserAgentOverride(userAgent); } @@ -791,7 +791,7 @@ this._userAgentOverride = userAgent; if (!this._customUserAgent) this._updateUserAgentOverride(); - this.dispatchEventToListeners(WebInspector.MultitargetNetworkManager.Events.UserAgentChanged); + this.dispatchEventToListeners(SDK.MultitargetNetworkManager.Events.UserAgentChanged); } /** @@ -854,7 +854,7 @@ * @param {function(!Array<string>)} callback */ getCertificate(origin, callback) { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); target.networkAgent().getCertificate(origin, mycallback); /** @@ -877,21 +877,21 @@ if (currentUserAgent) headers['User-Agent'] = currentUserAgent; - if (WebInspector.moduleSetting('cacheDisabled').get()) + if (Common.moduleSetting('cacheDisabled').get()) headers['Cache-Control'] = 'no-cache'; - WebInspector.ResourceLoader.load(url, headers, callback); + Host.ResourceLoader.load(url, headers, callback); } }; /** @enum {symbol} */ -WebInspector.MultitargetNetworkManager.Events = { +SDK.MultitargetNetworkManager.Events = { ConditionsChanged: Symbol('ConditionsChanged'), UserAgentChanged: Symbol('UserAgentChanged') }; /** - * @type {!WebInspector.MultitargetNetworkManager} + * @type {!SDK.MultitargetNetworkManager} */ -WebInspector.multitargetNetworkManager; +SDK.multitargetNetworkManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js index 37a6c9843..f42a9e7 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
@@ -28,13 +28,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.NetworkRequest = class extends WebInspector.SDKObject { +SDK.NetworkRequest = class extends SDK.SDKObject { /** * @param {!Protocol.Network.RequestId} requestId - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} url * @param {string} documentURL * @param {!Protocol.Page.FrameId} frameId @@ -44,8 +44,8 @@ constructor(target, requestId, url, documentURL, frameId, loaderId, initiator) { super(target); - this._networkLog = /** @type {!WebInspector.NetworkLog} */ (WebInspector.NetworkLog.fromTarget(target)); - this._networkManager = /** @type {!WebInspector.NetworkManager} */ (WebInspector.NetworkManager.fromTarget(target)); + this._networkLog = /** @type {!SDK.NetworkLog} */ (SDK.NetworkLog.fromTarget(target)); + this._networkManager = /** @type {!SDK.NetworkManager} */ (SDK.NetworkManager.fromTarget(target)); this._requestId = requestId; this.url = url; this._documentURL = documentURL; @@ -72,13 +72,13 @@ /** @type {?Protocol.Network.ResourcePriority} */ this._currentPriority = null; - /** @type {!WebInspector.ResourceType} */ - this._resourceType = WebInspector.resourceTypes.Other; + /** @type {!Common.ResourceType} */ + this._resourceType = Common.resourceTypes.Other; this._contentEncoded = false; this._pendingContentCallbacks = []; - /** @type {!Array.<!WebInspector.NetworkRequest.WebSocketFrame>} */ + /** @type {!Array.<!SDK.NetworkRequest.WebSocketFrame>} */ this._frames = []; - /** @type {!Array.<!WebInspector.NetworkRequest.EventSourceMessage>} */ + /** @type {!Array.<!SDK.NetworkRequest.EventSourceMessage>} */ this._eventSourceMessages = []; this._responseHeaderValues = {}; @@ -95,7 +95,7 @@ } /** - * @param {!WebInspector.NetworkRequest} other + * @param {!SDK.NetworkRequest} other * @return {number} */ indentityCompare(other) { @@ -135,7 +135,7 @@ return; this._url = x; - this._parsedURL = new WebInspector.ParsedURL(x); + this._parsedURL = new Common.ParsedURL(x); delete this._queryString; delete this._parsedQueryParameters; delete this._name; @@ -173,7 +173,7 @@ */ setRemoteAddress(ip, port) { this._remoteAddress = ip + ':' + port; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RemoteAddressChanged, this); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.RemoteAddressChanged, this); } /** @@ -277,7 +277,7 @@ if (this._responseReceivedTime > x) this._responseReceivedTime = x; } - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged, this); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.TimingChanged, this); } /** @@ -350,7 +350,7 @@ this._finished = x; if (x) { - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.FinishedLoading, this); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.FinishedLoading, this); if (this._pendingContentCallbacks.length) this._innerRequestContent(); } @@ -460,7 +460,7 @@ this._responseReceivedTime = x.requestTime + x.receiveHeadersEnd / 1000.0; this._timing = x; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged, this); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.TimingChanged, this); } } @@ -545,14 +545,14 @@ } /** - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ resourceType() { return this._resourceType; } /** - * @param {!WebInspector.ResourceType} resourceType + * @param {!Common.ResourceType} resourceType */ setResourceType(resourceType) { this._resourceType = resourceType; @@ -573,7 +573,7 @@ } /** - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ get redirectSource() { if (this.redirects && this.redirects.length > 0) @@ -582,7 +582,7 @@ } /** - * @param {?WebInspector.NetworkRequest} x + * @param {?SDK.NetworkRequest} x */ set redirectSource(x) { this._redirectSource = x; @@ -590,20 +590,20 @@ } /** - * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {!Array.<!SDK.NetworkRequest.NameValue>} */ requestHeaders() { return this._requestHeaders || []; } /** - * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} headers + * @param {!Array.<!SDK.NetworkRequest.NameValue>} headers */ setRequestHeaders(headers) { this._requestHeaders = headers; delete this._requestCookies; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.RequestHeadersChanged); } /** @@ -619,7 +619,7 @@ setRequestHeadersText(text) { this._requestHeadersText = text; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.RequestHeadersChanged); } /** @@ -631,11 +631,11 @@ } /** - * @return {!Array.<!WebInspector.Cookie>} + * @return {!Array.<!SDK.Cookie>} */ get requestCookies() { if (!this._requestCookies) - this._requestCookies = WebInspector.CookieParser.parseCookie(this.target(), this.requestHeaderValue('Cookie')); + this._requestCookies = SDK.CookieParser.parseCookie(this.target(), this.requestHeaderValue('Cookie')); return this._requestCookies; } @@ -667,14 +667,14 @@ } /** - * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {!Array.<!SDK.NetworkRequest.NameValue>} */ get responseHeaders() { return this._responseHeaders || []; } /** - * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} x + * @param {!Array.<!SDK.NetworkRequest.NameValue>} x */ set responseHeaders(x) { this._responseHeaders = x; @@ -683,7 +683,7 @@ delete this._responseCookies; this._responseHeaderValues = {}; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.ResponseHeadersChanged); } /** @@ -699,11 +699,11 @@ set responseHeadersText(x) { this._responseHeadersText = x; - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.ResponseHeadersChanged); } /** - * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {!Array.<!SDK.NetworkRequest.NameValue>} */ get sortedResponseHeaders() { if (this._sortedResponseHeaders !== undefined) @@ -730,12 +730,12 @@ } /** - * @return {!Array.<!WebInspector.Cookie>} + * @return {!Array.<!SDK.Cookie>} */ get responseCookies() { if (!this._responseCookies) this._responseCookies = - WebInspector.CookieParser.parseSetCookie(this.target(), this.responseHeaderValue('Set-Cookie')); + SDK.CookieParser.parseSetCookie(this.target(), this.responseHeaderValue('Set-Cookie')); return this._responseCookies; } @@ -747,11 +747,11 @@ } /** - * @return {?Array.<!WebInspector.ServerTiming>} + * @return {?Array.<!SDK.ServerTiming>} */ get serverTimings() { if (typeof this._serverTimings === 'undefined') - this._serverTimings = WebInspector.ServerTiming.parseHeaders(this.responseHeaders); + this._serverTimings = SDK.ServerTiming.parseHeaders(this.responseHeaders); return this._serverTimings; } @@ -776,7 +776,7 @@ } /** - * @return {?Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {?Array.<!SDK.NetworkRequest.NameValue>} */ get queryParameters() { if (this._parsedQueryParameters) @@ -789,7 +789,7 @@ } /** - * @return {?Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {?Array.<!SDK.NetworkRequest.NameValue>} */ get formParameters() { if (this._parsedFormParameters) @@ -817,7 +817,7 @@ /** * @param {string} queryString - * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} + * @return {!Array.<!SDK.NetworkRequest.NameValue>} */ _parseParameters(queryString) { function parseNameValue(pair) { @@ -831,7 +831,7 @@ } /** - * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} headers + * @param {!Array.<!SDK.NetworkRequest.NameValue>} headers * @param {string} headerName * @return {string|undefined} */ @@ -882,7 +882,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._resourceType; @@ -896,7 +896,7 @@ // We do not support content retrieval for WebSockets at the moment. // Since WebSockets are potentially long-living, fail requests immediately // to prevent caller blocking until resource is marked as finished. - if (this._resourceType === WebInspector.resourceTypes.WebSocket) + if (this._resourceType === Common.resourceTypes.WebSocket) return Promise.resolve(/** @type {?string} */ (null)); if (typeof this._content !== 'undefined') return Promise.resolve(/** @type {?string} */ (this.content || null)); @@ -913,7 +913,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { callback([]); @@ -974,10 +974,10 @@ populateImageSource(image) { /** * @param {?string} content - * @this {WebInspector.NetworkRequest} + * @this {SDK.NetworkRequest} */ function onResourceContent(content) { - var imageSrc = WebInspector.ContentProvider.contentAsDataURL(content, this._mimeType, true); + var imageSrc = Common.ContentProvider.contentAsDataURL(content, this._mimeType, true); if (imageSrc === null) imageSrc = this._url; image.src = imageSrc; @@ -996,7 +996,7 @@ content = content.toBase64(); charset = 'utf-8'; } - return WebInspector.ContentProvider.contentAsDataURL(content, this.mimeType, true, charset); + return Common.ContentProvider.contentAsDataURL(content, this.mimeType, true, charset); } _innerRequestContent() { @@ -1008,7 +1008,7 @@ * @param {?Protocol.Error} error * @param {string} content * @param {boolean} contentEncoded - * @this {WebInspector.NetworkRequest} + * @this {SDK.NetworkRequest} */ function onResourceContent(error, content, contentEncoded) { this._content = error ? null : content; @@ -1031,13 +1031,13 @@ } /** - * @return {!{type: !WebInspector.NetworkRequest.InitiatorType, url: string, lineNumber: number, columnNumber: number, scriptId: ?string}} + * @return {!{type: !SDK.NetworkRequest.InitiatorType, url: string, lineNumber: number, columnNumber: number, scriptId: ?string}} */ initiatorInfo() { if (this._initiatorInfo) return this._initiatorInfo; - var type = WebInspector.NetworkRequest.InitiatorType.Other; + var type = SDK.NetworkRequest.InitiatorType.Other; var url = ''; var lineNumber = -Infinity; var columnNumber = -Infinity; @@ -1045,11 +1045,11 @@ var initiator = this._initiator; if (this.redirectSource) { - type = WebInspector.NetworkRequest.InitiatorType.Redirect; + type = SDK.NetworkRequest.InitiatorType.Redirect; url = this.redirectSource.url; } else if (initiator) { if (initiator.type === Protocol.Network.InitiatorType.Parser) { - type = WebInspector.NetworkRequest.InitiatorType.Parser; + type = SDK.NetworkRequest.InitiatorType.Parser; url = initiator.url ? initiator.url : url; lineNumber = initiator.lineNumber ? initiator.lineNumber : lineNumber; } else if (initiator.type === Protocol.Network.InitiatorType.Script) { @@ -1057,8 +1057,8 @@ var topFrame = stack.callFrames.length ? stack.callFrames[0] : null; if (!topFrame) continue; - type = WebInspector.NetworkRequest.InitiatorType.Script; - url = topFrame.url || WebInspector.UIString('<anonymous>'); + type = SDK.NetworkRequest.InitiatorType.Script; + url = topFrame.url || Common.UIString('<anonymous>'); lineNumber = topFrame.lineNumber; columnNumber = topFrame.columnNumber; scriptId = topFrame.scriptId; @@ -1073,7 +1073,7 @@ } /** - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ initiatorRequest() { if (this._initiatorRequest === undefined) @@ -1082,7 +1082,7 @@ } /** - * @return {!WebInspector.NetworkRequest.InitiatorGraph} + * @return {!SDK.NetworkRequest.InitiatorGraph} */ initiatorGraph() { var initiated = new Set(); @@ -1096,7 +1096,7 @@ } /** - * @return {!Set<!WebInspector.NetworkRequest>} + * @return {!Set<!SDK.NetworkRequest>} */ _initiatorChain() { if (this._initiatorChainCache) @@ -1111,7 +1111,7 @@ } /** - * @return {!Array.<!WebInspector.NetworkRequest.WebSocketFrame>} + * @return {!Array.<!SDK.NetworkRequest.WebSocketFrame>} */ frames() { return this._frames; @@ -1123,7 +1123,7 @@ */ addFrameError(errorMessage, time) { this._addFrame({ - type: WebInspector.NetworkRequest.WebSocketFrameType.Error, + type: SDK.NetworkRequest.WebSocketFrameType.Error, text: errorMessage, time: this.pseudoWallTime(time), opCode: -1, @@ -1137,8 +1137,8 @@ * @param {boolean} sent */ addFrame(response, time, sent) { - var type = sent ? WebInspector.NetworkRequest.WebSocketFrameType.Send : - WebInspector.NetworkRequest.WebSocketFrameType.Receive; + var type = sent ? SDK.NetworkRequest.WebSocketFrameType.Send : + SDK.NetworkRequest.WebSocketFrameType.Receive; this._addFrame({ type: type, text: response.payloadData, @@ -1149,15 +1149,15 @@ } /** - * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame + * @param {!SDK.NetworkRequest.WebSocketFrame} frame */ _addFrame(frame) { this._frames.push(frame); - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.WebsocketFrameAdded, frame); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.WebsocketFrameAdded, frame); } /** - * @return {!Array.<!WebInspector.NetworkRequest.EventSourceMessage>} + * @return {!Array.<!SDK.NetworkRequest.EventSourceMessage>} */ eventSourceMessages() { return this._eventSourceMessages; @@ -1172,7 +1172,7 @@ addEventSourceMessage(time, eventName, eventId, data) { var message = {time: this.pseudoWallTime(time), eventName: eventName, eventId: eventId, data: data}; this._eventSourceMessages.push(message); - this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.EventSourceMessageAdded, message); + this.dispatchEventToListeners(SDK.NetworkRequest.Events.EventSourceMessageAdded, message); } replayXHR() { @@ -1180,14 +1180,14 @@ } /** - * @return {!WebInspector.NetworkLog} + * @return {!SDK.NetworkLog} */ networkLog() { return this._networkLog; } /** - * @return {!WebInspector.NetworkManager} + * @return {!SDK.NetworkManager} */ networkManager() { return this._networkManager; @@ -1195,7 +1195,7 @@ }; /** @enum {symbol} */ -WebInspector.NetworkRequest.Events = { +SDK.NetworkRequest.Events = { FinishedLoading: Symbol('FinishedLoading'), TimingChanged: Symbol('TimingChanged'), RemoteAddressChanged: Symbol('RemoteAddressChanged'), @@ -1206,7 +1206,7 @@ }; /** @enum {string} */ -WebInspector.NetworkRequest.InitiatorType = { +SDK.NetworkRequest.InitiatorType = { Other: 'other', Parser: 'parser', Redirect: 'redirect', @@ -1214,20 +1214,20 @@ }; /** @typedef {!{name: string, value: string}} */ -WebInspector.NetworkRequest.NameValue; +SDK.NetworkRequest.NameValue; /** @enum {string} */ -WebInspector.NetworkRequest.WebSocketFrameType = { +SDK.NetworkRequest.WebSocketFrameType = { Send: 'send', Receive: 'receive', Error: 'error' }; -/** @typedef {!{type: WebInspector.NetworkRequest.WebSocketFrameType, time: number, text: string, opCode: number, mask: boolean}} */ -WebInspector.NetworkRequest.WebSocketFrame; +/** @typedef {!{type: SDK.NetworkRequest.WebSocketFrameType, time: number, text: string, opCode: number, mask: boolean}} */ +SDK.NetworkRequest.WebSocketFrame; /** @typedef {!{time: number, eventName: string, eventId: string, data: string}} */ -WebInspector.NetworkRequest.EventSourceMessage; +SDK.NetworkRequest.EventSourceMessage; -/** @typedef {!{initiators: !Set<!WebInspector.NetworkRequest>, initiated: !Set<!WebInspector.NetworkRequest>}} */ -WebInspector.NetworkRequest.InitiatorGraph; +/** @typedef {!{initiators: !Set<!SDK.NetworkRequest>, initiated: !Set<!SDK.NetworkRequest>}} */ +SDK.NetworkRequest.InitiatorGraph;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js b/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js index 7b9823b..b2e478c6 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/PaintProfiler.js
@@ -30,14 +30,14 @@ /** * @typedef {!{x: number, y: number, picture: string}} */ -WebInspector.PictureFragment; +SDK.PictureFragment; /** * @unrestricted */ -WebInspector.PaintProfilerSnapshot = class { +SDK.PaintProfilerSnapshot = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} snapshotId */ constructor(target, snapshotId) { @@ -47,23 +47,23 @@ } /** - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.PictureFragment>} fragments - * @return {!Promise<?WebInspector.PaintProfilerSnapshot>} + * @param {!SDK.Target} target + * @param {!Array.<!SDK.PictureFragment>} fragments + * @return {!Promise<?SDK.PaintProfilerSnapshot>} */ static loadFromFragments(target, fragments) { return target.layerTreeAgent().loadSnapshot( - fragments, (error, snapshotId) => error ? null : new WebInspector.PaintProfilerSnapshot(target, snapshotId)); + fragments, (error, snapshotId) => error ? null : new SDK.PaintProfilerSnapshot(target, snapshotId)); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} encodedPicture - * @return {!Promise<?WebInspector.PaintProfilerSnapshot>} + * @return {!Promise<?SDK.PaintProfilerSnapshot>} */ static load(target, encodedPicture) { var fragment = {x: 0, y: 0, picture: encodedPicture}; - return WebInspector.PaintProfilerSnapshot.loadFromFragments(target, [fragment]); + return SDK.PaintProfilerSnapshot.loadFromFragments(target, [fragment]); } release() { @@ -78,7 +78,7 @@ } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._target; @@ -105,7 +105,7 @@ } /** - * @return {!Promise<?Array<!WebInspector.PaintProfilerLogItem>>} + * @return {!Promise<?Array<!SDK.PaintProfilerLogItem>>} */ commandLog() { return this._target.layerTreeAgent().snapshotCommandLog(this._id, processLog); @@ -118,8 +118,8 @@ if (error) return null; return log.map( - (entry, index) => new WebInspector.PaintProfilerLogItem( - /** @type {!WebInspector.RawPaintProfilerLogItem} */ (entry), index)); + (entry, index) => new SDK.PaintProfilerLogItem( + /** @type {!SDK.RawPaintProfilerLogItem} */ (entry), index)); } } }; @@ -128,14 +128,14 @@ /** * @typedef {!{method: string, params: ?Object<string, *>}} */ -WebInspector.RawPaintProfilerLogItem; +SDK.RawPaintProfilerLogItem; /** * @unrestricted */ -WebInspector.PaintProfilerLogItem = class { +SDK.PaintProfilerLogItem = class { /** - * @param {!WebInspector.RawPaintProfilerLogItem} rawEntry + * @param {!SDK.RawPaintProfilerLogItem} rawEntry * @param {number} commandIndex */ constructor(rawEntry, commandIndex) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js index d5f2f47..de1e2a3 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ProfileTreeModel.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ProfileNode = class { +SDK.ProfileNode = class { /** * @param {!Protocol.Runtime.CallFrame} callFrame */ @@ -19,9 +19,9 @@ this.total = 0; /** @type {number} */ this.id = 0; - /** @type {?WebInspector.ProfileNode} */ + /** @type {?SDK.ProfileNode} */ this.parent = null; - /** @type {!Array<!WebInspector.ProfileNode>} */ + /** @type {!Array<!SDK.ProfileNode>} */ this.children = []; } @@ -64,9 +64,9 @@ /** * @unrestricted */ -WebInspector.ProfileTreeModel = class { +SDK.ProfileTreeModel = class { /** - * @param {!WebInspector.ProfileNode} root + * @param {!SDK.ProfileNode} root * @protected */ initialize(root) { @@ -99,7 +99,7 @@ } /** - * @param {!WebInspector.ProfileNode} root + * @param {!SDK.ProfileNode} root * @return {number} */ _calculateTotals(root) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js index 16618e3e..0fc047a7 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
@@ -28,28 +28,28 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @typedef {{object: ?WebInspector.RemoteObject, wasThrown: (boolean|undefined)}} + * @typedef {{object: ?SDK.RemoteObject, wasThrown: (boolean|undefined)}} */ -WebInspector.CallFunctionResult; +SDK.CallFunctionResult; /** * @unrestricted */ -WebInspector.RemoteObject = class { +SDK.RemoteObject = class { /** - * This may not be an interface due to "instanceof WebInspector.RemoteObject" checks in the code. + * This may not be an interface due to "instanceof SDK.RemoteObject" checks in the code. */ /** * @param {*} value - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ static fromLocalObject(value) { - return new WebInspector.LocalJSONObject(value); + return new SDK.LocalJSONObject(value); } /** - * @param {!WebInspector.RemoteObject} remoteObject + * @param {!SDK.RemoteObject} remoteObject * @return {string} */ static type(remoteObject) { @@ -64,7 +64,7 @@ } /** - * @param {!WebInspector.RemoteObject|!Protocol.Runtime.RemoteObject|!Protocol.Runtime.ObjectPreview} object + * @param {!SDK.RemoteObject|!Protocol.Runtime.RemoteObject|!Protocol.Runtime.ObjectPreview} object * @return {number} */ static arrayLength(object) { @@ -77,7 +77,7 @@ } /** - * @param {!Protocol.Runtime.RemoteObject|!WebInspector.RemoteObject|number|string|boolean|undefined|null} object + * @param {!Protocol.Runtime.RemoteObject|!SDK.RemoteObject|number|string|boolean|undefined|null} object * @return {!Protocol.Runtime.CallArgument} */ static toCallArgument(object) { @@ -116,8 +116,8 @@ } /** - * @param {!WebInspector.RemoteObject} object - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {!SDK.RemoteObject} object + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ static loadFromObjectPerProto(object, callback) { // Combines 2 asynch calls. Doesn't rely on call-back orders (some calls may be loop-back). @@ -157,8 +157,8 @@ } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties */ function allAccessorPropertiesCallback(properties, internalProperties) { savedAccessorProperties = properties; @@ -166,8 +166,8 @@ } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties */ function ownPropertiesCallback(properties, internalProperties) { savedOwnProperties = properties; @@ -214,30 +214,30 @@ } /** - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getOwnProperties(callback) { throw 'Not implemented'; } /** - * @return {!Promise<!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>}>} + * @return {!Promise<!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}>} */ getOwnPropertiesPromise() { return new Promise(promiseConstructor.bind(this)); /** - * @param {function(!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>})} success - * @this {WebInspector.RemoteObject} + * @param {function(!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>})} success + * @this {SDK.RemoteObject} */ function promiseConstructor(success) { this.getOwnProperties(getOwnPropertiesCallback.bind(null, success)); } /** - * @param {function(!{properties: ?Array.<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>})} callback - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {function(!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>})} callback + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties */ function getOwnPropertiesCallback(callback, properties, internalProperties) { callback({properties: properties, internalProperties: internalProperties}); @@ -246,7 +246,7 @@ /** * @param {boolean} accessorPropertiesOnly - * @param {function(?Array<!WebInspector.RemoteObjectProperty>, ?Array<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array<!SDK.RemoteObjectProperty>, ?Array<!SDK.RemoteObjectProperty>)} callback */ getAllProperties(accessorPropertiesOnly, callback) { throw 'Not implemented'; @@ -254,23 +254,23 @@ /** * @param {boolean} accessorPropertiesOnly - * @return {!Promise<!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>}>} + * @return {!Promise<!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}>} */ getAllPropertiesPromise(accessorPropertiesOnly) { return new Promise(promiseConstructor.bind(this)); /** - * @param {function(!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>})} success - * @this {WebInspector.RemoteObject} + * @param {function(!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>})} success + * @this {SDK.RemoteObject} */ function promiseConstructor(success) { this.getAllProperties(accessorPropertiesOnly, getAllPropertiesCallback.bind(null, success)); } /** - * @param {function(!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>})} callback - * @param {?Array<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {function(!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>})} callback + * @param {?Array<!SDK.RemoteObjectProperty>} properties + * @param {?Array<!SDK.RemoteObjectProperty>} internalProperties */ function getAllPropertiesCallback(callback, properties, internalProperties) { callback({properties: properties, internalProperties: internalProperties}); @@ -278,7 +278,7 @@ } /** - * @return {!Promise<?Array<!WebInspector.EventListener>>} + * @return {!Promise<?Array<!SDK.EventListener>>} */ eventListeners() { throw 'Not implemented'; @@ -304,7 +304,7 @@ /** * @param {function(this:Object, ...)} functionDeclaration * @param {!Array<!Protocol.Runtime.CallArgument>=} args - * @param {function(?WebInspector.RemoteObject, boolean=)=} callback + * @param {function(?SDK.RemoteObject, boolean=)=} callback */ callFunction(functionDeclaration, args, callback) { throw 'Not implemented'; @@ -313,22 +313,22 @@ /** * @param {function(this:Object, ...)} functionDeclaration * @param {!Array<!Protocol.Runtime.CallArgument>=} args - * @return {!Promise<!WebInspector.CallFunctionResult>} + * @return {!Promise<!SDK.CallFunctionResult>} */ callFunctionPromise(functionDeclaration, args) { return new Promise(promiseConstructor.bind(this)); /** - * @param {function(!WebInspector.CallFunctionResult)} success - * @this {WebInspector.RemoteObject} + * @param {function(!SDK.CallFunctionResult)} success + * @this {SDK.RemoteObject} */ function promiseConstructor(success) { this.callFunction(functionDeclaration, args, callFunctionCallback.bind(null, success)); } /** - * @param {function(!WebInspector.CallFunctionResult)} callback - * @param {?WebInspector.RemoteObject} object + * @param {function(!SDK.CallFunctionResult)} callback + * @param {?SDK.RemoteObject} object * @param {boolean=} wasThrown */ function callFunctionCallback(callback, object, wasThrown) { @@ -356,7 +356,7 @@ return new Promise(promiseConstructor.bind(this)); /** - * @this {WebInspector.RemoteObject} + * @this {SDK.RemoteObject} */ function promiseConstructor(success) { this.callFunctionJSON(functionDeclaration, args, success); @@ -364,14 +364,14 @@ } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { throw new Error('Target-less object'); } /** - * @return {?WebInspector.DebuggerModel} + * @return {?SDK.DebuggerModel} */ debuggerModel() { throw new Error('DebuggerModel-less object'); @@ -389,9 +389,9 @@ /** * @unrestricted */ -WebInspector.RemoteObjectImpl = class extends WebInspector.RemoteObject { +SDK.RemoteObjectImpl = class extends SDK.RemoteObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string|undefined} objectId * @param {string} type * @param {string|undefined} subtype @@ -406,7 +406,7 @@ this._target = target; this._runtimeAgent = target.runtimeAgent(); - this._debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + this._debuggerModel = SDK.DebuggerModel.fromTarget(target); this._type = type; this._subtype = subtype; @@ -492,7 +492,7 @@ /** * @override - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getOwnProperties(callback) { this.doGetProperties(true, false, false, callback); @@ -501,7 +501,7 @@ /** * @override * @param {boolean} accessorPropertiesOnly - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getAllProperties(accessorPropertiesOnly, callback) { this.doGetProperties(false, accessorPropertiesOnly, false, callback); @@ -509,14 +509,14 @@ /** * @override - * @return {!Promise<?Array<!WebInspector.EventListener>>} + * @return {!Promise<?Array<!SDK.EventListener>>} */ eventListeners() { return new Promise(eventListeners.bind(this)); /** * @param {function(?)} fulfill * @param {function(*)} reject - * @this {WebInspector.RemoteObjectImpl} + * @this {SDK.RemoteObjectImpl} */ function eventListeners(fulfill, reject) { if (!this.target().hasDOMCapability()) { @@ -533,7 +533,7 @@ this.target().domdebuggerAgent().getEventListeners(this._objectId, mycallback.bind(this)); /** - * @this {WebInspector.RemoteObjectImpl} + * @this {SDK.RemoteObjectImpl} * @param {?Protocol.Error} error * @param {!Array<!Protocol.DOMDebugger.EventListener>} payloads */ @@ -546,15 +546,15 @@ } /** - * @this {WebInspector.RemoteObjectImpl} + * @this {SDK.RemoteObjectImpl} * @param {!Protocol.DOMDebugger.EventListener} payload */ function createEventListener(payload) { - return new WebInspector.EventListener( + return new SDK.EventListener( this._target, this, payload.type, payload.useCapture, payload.passive, payload.once, payload.handler ? this.target().runtimeModel.createRemoteObject(payload.handler) : null, payload.originalHandler ? this.target().runtimeModel.createRemoteObject(payload.originalHandler) : null, - /** @type {!WebInspector.DebuggerModel.Location} */ (this._debuggerModel.createRawLocationByScriptId( + /** @type {!SDK.DebuggerModel.Location} */ (this._debuggerModel.createRawLocationByScriptId( payload.scriptId, payload.lineNumber, payload.columnNumber)), payload.removeFunction ? this.target().runtimeModel.createRemoteObject(payload.removeFunction) : null); } @@ -563,7 +563,7 @@ /** * @param {!Array.<string>} propertyPath - * @param {function(?WebInspector.RemoteObject, boolean=)} callback + * @param {function(?SDK.RemoteObject, boolean=)} callback */ getProperty(propertyPath, callback) { /** @@ -587,7 +587,7 @@ * @param {boolean} ownProperties * @param {boolean} accessorPropertiesOnly * @param {boolean} generatePreview - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ doGetProperties(ownProperties, accessorPropertiesOnly, generatePreview, callback) { if (!this._objectId) { @@ -600,7 +600,7 @@ * @param {!Array.<!Protocol.Runtime.PropertyDescriptor>} properties * @param {!Array.<!Protocol.Runtime.InternalPropertyDescriptor>=} internalProperties * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.RemoteObjectImpl} + * @this {SDK.RemoteObjectImpl} */ function remoteObjectBinder(error, properties, internalProperties, exceptionDetails) { if (error) { @@ -609,7 +609,7 @@ } if (exceptionDetails) { this._target.consoleModel.addMessage( - WebInspector.ConsoleMessage.fromException(this._target, exceptionDetails, undefined, undefined, undefined)); + SDK.ConsoleMessage.fromException(this._target, exceptionDetails, undefined, undefined, undefined)); callback(null, null); return; } @@ -618,7 +618,7 @@ var property = properties[i]; var propertyValue = property.value ? this._target.runtimeModel.createRemoteObject(property.value) : null; var propertySymbol = property.symbol ? this._target.runtimeModel.createRemoteObject(property.symbol) : null; - var remoteProperty = new WebInspector.RemoteObjectProperty( + var remoteProperty = new SDK.RemoteObjectProperty( property.name, propertyValue, !!property.enumerable, !!property.writable, !!property.isOwn, !!property.wasThrown, propertySymbol); @@ -640,7 +640,7 @@ continue; var propertyValue = this._target.runtimeModel.createRemoteObject(property.value); internalPropertiesResult.push( - new WebInspector.RemoteObjectProperty(property.name, propertyValue, true, false)); + new SDK.RemoteObjectProperty(property.name, propertyValue, true, false)); } } callback(result, internalPropertiesResult); @@ -667,7 +667,7 @@ * @param {?Protocol.Error} error * @param {!Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.RemoteObject} + * @this {SDK.RemoteObject} */ function evaluatedCallback(error, result, exceptionDetails) { if (error || !!exceptionDetails) { @@ -676,7 +676,7 @@ } if (typeof name === 'string') - name = WebInspector.RemoteObject.toCallArgument(name); + name = SDK.RemoteObject.toCallArgument(name); this.doSetObjectPropertyValue(result, name, callback); @@ -697,7 +697,7 @@ // where property was defined; so do we. var setPropertyValueFunction = 'function(a, b) { this[a] = b; }'; - var argv = [name, WebInspector.RemoteObject.toCallArgument(result)]; + var argv = [name, SDK.RemoteObject.toCallArgument(result)]; this._runtimeAgent.callFunctionOn( this._objectId, setPropertyValueFunction, argv, true, undefined, undefined, undefined, undefined, propertySetCallback); @@ -753,14 +753,14 @@ * @override * @param {function(this:Object, ...)} functionDeclaration * @param {!Array.<!Protocol.Runtime.CallArgument>=} args - * @param {function(?WebInspector.RemoteObject, boolean=)=} callback + * @param {function(?SDK.RemoteObject, boolean=)=} callback */ callFunction(functionDeclaration, args, callback) { /** * @param {?Protocol.Error} error * @param {!Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.RemoteObjectImpl} + * @this {SDK.RemoteObjectImpl} */ function mycallback(error, result, exceptionDetails) { if (!callback) @@ -807,12 +807,12 @@ * @return {number} */ arrayLength() { - return WebInspector.RemoteObject.arrayLength(this); + return SDK.RemoteObject.arrayLength(this); } /** * @override - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._target; @@ -820,7 +820,7 @@ /** * @override - * @return {?WebInspector.DebuggerModel} + * @return {?SDK.DebuggerModel} */ debuggerModel() { return this._debuggerModel; @@ -839,11 +839,11 @@ /** * @unrestricted */ -WebInspector.ScopeRemoteObject = class extends WebInspector.RemoteObjectImpl { +SDK.ScopeRemoteObject = class extends SDK.RemoteObjectImpl { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string|undefined} objectId - * @param {!WebInspector.ScopeRef} scopeRef + * @param {!SDK.ScopeRef} scopeRef * @param {string} type * @param {string|undefined} subtype * @param {*} value @@ -862,7 +862,7 @@ * @param {boolean} ownProperties * @param {boolean} accessorPropertiesOnly * @param {boolean} generatePreview - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ doGetProperties(ownProperties, accessorPropertiesOnly, generatePreview, callback) { if (accessorPropertiesOnly) { @@ -879,9 +879,9 @@ } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties - * @this {WebInspector.ScopeRemoteObject} + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties + * @this {SDK.ScopeRemoteObject} */ function wrappedCallback(properties, internalProperties) { if (this._scopeRef && Array.isArray(properties)) { @@ -909,12 +909,12 @@ doSetObjectPropertyValue(result, argumentName, callback) { var name = /** @type {string} */ (argumentName.value); this._debuggerModel.setVariableValue( - this._scopeRef.number, name, WebInspector.RemoteObject.toCallArgument(result), this._scopeRef.callFrameId, + this._scopeRef.number, name, SDK.RemoteObject.toCallArgument(result), this._scopeRef.callFrameId, setVariableValueCallback.bind(this)); /** * @param {string=} error - * @this {WebInspector.ScopeRemoteObject} + * @this {SDK.ScopeRemoteObject} */ function setVariableValueCallback(error) { if (error) { @@ -935,7 +935,7 @@ /** * @unrestricted */ -WebInspector.ScopeRef = class { +SDK.ScopeRef = class { /** * @param {number} number * @param {string=} callFrameId @@ -949,16 +949,16 @@ /** * @unrestricted */ -WebInspector.RemoteObjectProperty = class { +SDK.RemoteObjectProperty = class { /** * @param {string} name - * @param {?WebInspector.RemoteObject} value + * @param {?SDK.RemoteObject} value * @param {boolean=} enumerable * @param {boolean=} writable * @param {boolean=} isOwn * @param {boolean=} wasThrown * @param {boolean=} synthetic - * @param {?WebInspector.RemoteObject=} symbol + * @param {?SDK.RemoteObject=} symbol */ constructor(name, value, enumerable, writable, isOwn, wasThrown, symbol, synthetic) { this.name = name; @@ -990,7 +990,7 @@ /** * @unrestricted */ -WebInspector.LocalJSONObject = class extends WebInspector.RemoteObject { +SDK.LocalJSONObject = class extends SDK.RemoteObject { /** * @param {*} value */ @@ -1008,18 +1008,18 @@ return this._cachedDescription; /** - * @param {!WebInspector.RemoteObjectProperty} property + * @param {!SDK.RemoteObjectProperty} property * @return {string} - * @this {WebInspector.LocalJSONObject} + * @this {SDK.LocalJSONObject} */ function formatArrayItem(property) { return this._formatValue(property.value); } /** - * @param {!WebInspector.RemoteObjectProperty} property + * @param {!SDK.RemoteObjectProperty} property * @return {string} - * @this {WebInspector.LocalJSONObject} + * @this {SDK.LocalJSONObject} */ function formatObjectItem(property) { var name = property.name; @@ -1050,7 +1050,7 @@ } /** - * @param {?WebInspector.RemoteObject} value + * @param {?SDK.RemoteObject} value * @return {string} */ _formatValue(value) { @@ -1065,7 +1065,7 @@ /** * @param {string} prefix * @param {string} suffix - * @param {function(!WebInspector.RemoteObjectProperty)} formatProperty + * @param {function(!SDK.RemoteObjectProperty)} formatProperty * @return {string} */ _concatenate(prefix, suffix, formatProperty) { @@ -1124,7 +1124,7 @@ /** * @override - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getOwnProperties(callback) { callback(this._children(), null); @@ -1133,7 +1133,7 @@ /** * @override * @param {boolean} accessorPropertiesOnly - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getAllProperties(accessorPropertiesOnly, callback) { if (accessorPropertiesOnly) @@ -1143,7 +1143,7 @@ } /** - * @return {!Array.<!WebInspector.RemoteObjectProperty>} + * @return {!Array.<!SDK.RemoteObjectProperty>} */ _children() { if (!this.hasChildren) @@ -1152,13 +1152,13 @@ /** * @param {string} propName - * @return {!WebInspector.RemoteObjectProperty} + * @return {!SDK.RemoteObjectProperty} */ function buildProperty(propName) { var propValue = value[propName]; - if (!(propValue instanceof WebInspector.RemoteObject)) - propValue = WebInspector.RemoteObject.fromLocalObject(propValue); - return new WebInspector.RemoteObjectProperty(propName, propValue); + if (!(propValue instanceof SDK.RemoteObject)) + propValue = SDK.RemoteObject.fromLocalObject(propValue); + return new SDK.RemoteObjectProperty(propName, propValue); } if (!this._cachedChildren) this._cachedChildren = Object.keys(value).map(buildProperty); @@ -1184,7 +1184,7 @@ * @override * @param {function(this:Object, ...)} functionDeclaration * @param {!Array.<!Protocol.Runtime.CallArgument>=} args - * @param {function(?WebInspector.RemoteObject, boolean=)=} callback + * @param {function(?SDK.RemoteObject, boolean=)=} callback */ callFunction(functionDeclaration, args, callback) { var target = /** @type {?Object} */ (this._value); @@ -1203,7 +1203,7 @@ if (!callback) return; - callback(WebInspector.RemoteObject.fromLocalObject(result), wasThrown); + callback(SDK.RemoteObject.fromLocalObject(result), wasThrown); } /** @@ -1233,34 +1233,34 @@ /** * @unrestricted */ -WebInspector.RemoteArray = class { +SDK.RemoteArray = class { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ constructor(object) { this._object = object; } /** - * @param {?WebInspector.RemoteObject} object - * @return {!WebInspector.RemoteArray} + * @param {?SDK.RemoteObject} object + * @return {!SDK.RemoteArray} */ static objectAsArray(object) { if (!object || object.type !== 'object' || (object.subtype !== 'array' && object.subtype !== 'typedarray')) throw new Error('Object is empty or not an array'); - return new WebInspector.RemoteArray(object); + return new SDK.RemoteArray(object); } /** - * @param {!Array<!WebInspector.RemoteObject>} objects - * @return {!Promise<!WebInspector.RemoteArray>} + * @param {!Array<!SDK.RemoteObject>} objects + * @return {!Promise<!SDK.RemoteArray>} */ static createFromRemoteObjects(objects) { if (!objects.length) throw new Error('Input array is empty'); var objectArguments = []; for (var i = 0; i < objects.length; ++i) - objectArguments.push(WebInspector.RemoteObject.toCallArgument(objects[i])); + objectArguments.push(SDK.RemoteObject.toCallArgument(objects[i])); return objects[0].callFunctionPromise(createArray, objectArguments).then(returnRemoteArray); /** @@ -1273,24 +1273,24 @@ } /** - * @param {!WebInspector.CallFunctionResult} result - * @return {!WebInspector.RemoteArray} + * @param {!SDK.CallFunctionResult} result + * @return {!SDK.RemoteArray} */ function returnRemoteArray(result) { if (result.wasThrown || !result.object) throw new Error('Call function throws exceptions or returns empty value'); - return WebInspector.RemoteArray.objectAsArray(result.object); + return SDK.RemoteArray.objectAsArray(result.object); } } /** * @param {number} index - * @return {!Promise<!WebInspector.RemoteObject>} + * @return {!Promise<!SDK.RemoteObject>} */ at(index) { if (index < 0 || index > this._object.arrayLength()) throw new Error('Out of range'); - return this._object.callFunctionPromise(at, [WebInspector.RemoteObject.toCallArgument(index)]) + return this._object.callFunctionPromise(at, [SDK.RemoteObject.toCallArgument(index)]) .then(assertCallFunctionResult); /** @@ -1304,8 +1304,8 @@ } /** - * @param {!WebInspector.CallFunctionResult} result - * @return {!WebInspector.RemoteObject} + * @param {!SDK.CallFunctionResult} result + * @return {!SDK.RemoteObject} */ function assertCallFunctionResult(result) { if (result.wasThrown || !result.object) @@ -1322,7 +1322,7 @@ } /** - * @param {function(!WebInspector.RemoteObject):!Promise<T>} func + * @param {function(!SDK.RemoteObject):!Promise<T>} func * @return {!Promise<!Array<T>>} * @template T */ @@ -1334,7 +1334,7 @@ } /** - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ object() { return this._object; @@ -1345,34 +1345,34 @@ /** * @unrestricted */ -WebInspector.RemoteFunction = class { +SDK.RemoteFunction = class { /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ constructor(object) { this._object = object; } /** - * @param {?WebInspector.RemoteObject} object - * @return {!WebInspector.RemoteFunction} + * @param {?SDK.RemoteObject} object + * @return {!SDK.RemoteFunction} */ static objectAsFunction(object) { if (!object || object.type !== 'function') throw new Error('Object is empty or not a function'); - return new WebInspector.RemoteFunction(object); + return new SDK.RemoteFunction(object); } /** - * @return {!Promise<!WebInspector.RemoteObject>} + * @return {!Promise<!SDK.RemoteObject>} */ targetFunction() { return this._object.getOwnPropertiesPromise().then(targetFunction.bind(this)); /** - * @param {!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>}} ownProperties - * @return {!WebInspector.RemoteObject} - * @this {WebInspector.RemoteFunction} + * @param {!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}} ownProperties + * @return {!SDK.RemoteObject} + * @this {SDK.RemoteFunction} */ function targetFunction(ownProperties) { if (!ownProperties.internalProperties) @@ -1387,15 +1387,15 @@ } /** - * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>} + * @return {!Promise<?SDK.DebuggerModel.FunctionDetails>} */ targetFunctionDetails() { return this.targetFunction().then(functionDetails.bind(this)); /** - * @param {!WebInspector.RemoteObject} targetFunction - * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>} - * @this {WebInspector.RemoteFunction} + * @param {!SDK.RemoteObject} targetFunction + * @return {!Promise<?SDK.DebuggerModel.FunctionDetails>} + * @this {SDK.RemoteFunction} */ function functionDetails(targetFunction) { var boundReleaseFunctionDetails = @@ -1404,9 +1404,9 @@ } /** - * @param {?WebInspector.RemoteObject} targetFunction - * @param {?WebInspector.DebuggerModel.FunctionDetails} functionDetails - * @return {?WebInspector.DebuggerModel.FunctionDetails} + * @param {?SDK.RemoteObject} targetFunction + * @param {?SDK.DebuggerModel.FunctionDetails} functionDetails + * @return {?SDK.DebuggerModel.FunctionDetails} */ function releaseTargetFunction(targetFunction, functionDetails) { if (targetFunction) @@ -1416,7 +1416,7 @@ } /** - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ object() { return this._object;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js index 35c226c..1f72458a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Resource.js
@@ -26,18 +26,18 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.Resource = class extends WebInspector.SDKObject { +SDK.Resource = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.NetworkRequest} request + * @param {!SDK.Target} target + * @param {?SDK.NetworkRequest} request * @param {string} url * @param {string} documentURL * @param {!Protocol.Page.FrameId} frameId * @param {!Protocol.Network.LoaderId} loaderId - * @param {!WebInspector.ResourceType} type + * @param {!Common.ResourceType} type * @param {string} mimeType * @param {?Date} lastModified * @param {?number} contentSize @@ -49,7 +49,7 @@ this._documentURL = documentURL; this._frameId = frameId; this._loaderId = loaderId; - this._type = type || WebInspector.resourceTypes.Other; + this._type = type || Common.resourceTypes.Other; this._mimeType = mimeType; this._lastModified = lastModified && lastModified.isValid() ? lastModified : null; @@ -59,7 +59,7 @@ /** @type {boolean} */ this._contentEncoded; this._pendingContentCallbacks = []; if (this._request && !this._request.finished) - this._request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._requestFinished, this); + this._request.addEventListener(SDK.NetworkRequest.Events.FinishedLoading, this._requestFinished, this); } /** @@ -84,7 +84,7 @@ } /** - * @return {?WebInspector.NetworkRequest} + * @return {?SDK.NetworkRequest} */ get request() { return this._request; @@ -102,7 +102,7 @@ */ set url(x) { this._url = x; - this._parsedURL = new WebInspector.ParsedURL(x); + this._parsedURL = new Common.ParsedURL(x); } get parsedURL() { @@ -138,7 +138,7 @@ } /** - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ resourceType() { return this._request ? this._request.resourceType() : this._type; @@ -175,11 +175,11 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { - if (this.resourceType() === WebInspector.resourceTypes.Document && this.mimeType.indexOf('javascript') !== -1) - return WebInspector.resourceTypes.Script; + if (this.resourceType() === Common.resourceTypes.Document && this.mimeType.indexOf('javascript') !== -1) + return Common.resourceTypes.Script; return this.resourceType(); } @@ -211,7 +211,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { /** @@ -235,10 +235,10 @@ populateImageSource(image) { /** * @param {?string} content - * @this {WebInspector.Resource} + * @this {SDK.Resource} */ function onResourceContent(content) { - var imageSrc = WebInspector.ContentProvider.contentAsDataURL(content, this._mimeType, true); + var imageSrc = Common.ContentProvider.contentAsDataURL(content, this._mimeType, true); if (imageSrc === null) imageSrc = this._url; image.src = imageSrc; @@ -248,7 +248,7 @@ } _requestFinished() { - this._request.removeEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._requestFinished, this); + this._request.removeEventListener(SDK.NetworkRequest.Events.FinishedLoading, this._requestFinished, this); if (this._pendingContentCallbacks.length) this._innerRequestContent(); } @@ -262,7 +262,7 @@ * @param {?Protocol.Error} error * @param {?string} content * @param {boolean} contentEncoded - * @this {WebInspector.Resource} + * @this {SDK.Resource} */ function contentLoaded(error, content, contentEncoded) { if (error || content === null) { @@ -275,7 +275,7 @@ /** * @param {?string} content * @param {boolean} contentEncoded - * @this {WebInspector.Resource} + * @this {SDK.Resource} */ function replyWithContent(content, contentEncoded) { this._content = content; @@ -291,7 +291,7 @@ * @param {?Protocol.Error} error * @param {string} content * @param {boolean} contentEncoded - * @this {WebInspector.Resource} + * @this {SDK.Resource} */ function resourceContentLoaded(error, content, contentEncoded) { contentLoaded.call(this, error, content, contentEncoded); @@ -304,7 +304,7 @@ /** * @param {?string} content - * @this {WebInspector.Resource} + * @this {SDK.Resource} */ function requestContentLoaded(content) { contentLoaded.call(this, null, content, this.request.contentEncoded); @@ -319,7 +319,7 @@ hasTextContent() { if (this._type.isTextType()) return true; - if (this._type === WebInspector.resourceTypes.Other) + if (this._type === Common.resourceTypes.Other) return !!this._content && !this._contentEncoded; return false; }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js index 3bf2b3c9..48ea293 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -31,19 +31,19 @@ /** * @unrestricted */ -WebInspector.ResourceTreeModel = class extends WebInspector.SDKModel { +SDK.ResourceTreeModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target - * @param {?WebInspector.NetworkManager} networkManager - * @param {!WebInspector.SecurityOriginManager} securityOriginManager + * @param {!SDK.Target} target + * @param {?SDK.NetworkManager} networkManager + * @param {!SDK.SecurityOriginManager} securityOriginManager */ constructor(target, networkManager, securityOriginManager) { - super(WebInspector.ResourceTreeModel, target); + super(SDK.ResourceTreeModel, target); if (networkManager) { networkManager.addEventListener( - WebInspector.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); + SDK.NetworkManager.Events.RequestFinished, this._onRequestFinished, this); networkManager.addEventListener( - WebInspector.NetworkManager.Events.RequestUpdateDropped, this._onRequestUpdateDropped, this); + SDK.NetworkManager.Events.RequestUpdateDropped, this._onRequestUpdateDropped, this); } this._agent = target.pageAgent(); @@ -52,37 +52,37 @@ this._fetchResourceTree(); - target.registerPageDispatcher(new WebInspector.PageDispatcher(this)); + target.registerPageDispatcher(new SDK.PageDispatcher(this)); this._pendingReloadOptions = null; this._reloadSuspensionCount = 0; } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.ResourceTreeModel} + * @param {!SDK.Target} target + * @return {?SDK.ResourceTreeModel} */ static fromTarget(target) { - return /** @type {?WebInspector.ResourceTreeModel} */ (target.model(WebInspector.ResourceTreeModel)); + return /** @type {?SDK.ResourceTreeModel} */ (target.model(SDK.ResourceTreeModel)); } /** - * @return {!Array.<!WebInspector.ResourceTreeFrame>} + * @return {!Array.<!SDK.ResourceTreeFrame>} */ static frames() { var result = []; - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) - result = result.concat(WebInspector.ResourceTreeModel.fromTarget(target)._frames.valuesArray()); + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) + result = result.concat(SDK.ResourceTreeModel.fromTarget(target)._frames.valuesArray()); return result; } /** * @param {string} url - * @return {?WebInspector.Resource} + * @return {?SDK.Resource} */ static resourceForURL(url) { - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM)) { - var mainFrame = WebInspector.ResourceTreeModel.fromTarget(target).mainFrame; + for (var target of SDK.targetManager.targets(SDK.Target.Capability.DOM)) { + var mainFrame = SDK.ResourceTreeModel.fromTarget(target).mainFrame; var result = mainFrame ? mainFrame.resourceForURL(url) : null; if (result) return result; @@ -91,7 +91,7 @@ } _fetchResourceTree() { - /** @type {!Map<string, !WebInspector.ResourceTreeFrame>} */ + /** @type {!Map<string, !SDK.ResourceTreeFrame>} */ this._frames = new Map(); this._cachedResourcesProcessed = false; this._agent.getResourceTree(this._processCachedResources.bind(this)); @@ -99,14 +99,14 @@ _processCachedResources(error, mainFramePayload) { if (!error) { - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.WillLoadCachedResources); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.WillLoadCachedResources); this._addFramesRecursively(null, mainFramePayload); this.target().setInspectedURL(mainFramePayload.frame.url); } this._cachedResourcesProcessed = true; this.target().runtimeModel.setExecutionContextComparator(this._executionContextComparator.bind(this)); this.target().runtimeModel.fireExecutionContextOrderChanged(); - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.CachedResourcesLoaded); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.CachedResourcesLoaded); } /** @@ -117,7 +117,7 @@ } /** - * @param {!WebInspector.ResourceTreeFrame} frame + * @param {!SDK.ResourceTreeFrame} frame * @param {boolean=} aboutToNavigate */ _addFrame(frame, aboutToNavigate) { @@ -126,18 +126,18 @@ this.mainFrame = frame; this._securityOriginManager.setMainSecurityOrigin(frame.url); } - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.FrameAdded, frame); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame); if (!aboutToNavigate) this._securityOriginManager.addSecurityOrigin(frame.securityOrigin); } /** - * @param {!WebInspector.ResourceTreeFrame} mainFrame + * @param {!SDK.ResourceTreeFrame} mainFrame */ _handleMainFrameDetached(mainFrame) { /** - * @param {!WebInspector.ResourceTreeFrame} frame - * @this {WebInspector.ResourceTreeModel} + * @param {!SDK.ResourceTreeFrame} frame + * @this {SDK.ResourceTreeModel} */ function removeOriginForFrame(frame) { for (var i = 0; i < frame.childFrames.length; ++i) @@ -151,7 +151,7 @@ /** * @param {!Protocol.Page.FrameId} frameId * @param {?Protocol.Page.FrameId} parentFrameId - * @return {?WebInspector.ResourceTreeFrame} + * @return {?SDK.ResourceTreeFrame} */ _frameAttached(frameId, parentFrameId) { // Do nothing unless cached resource tree is processed - it will overwrite everything. @@ -161,7 +161,7 @@ return null; var parentFrame = parentFrameId ? (this._frames.get(parentFrameId) || null) : null; - var frame = new WebInspector.ResourceTreeFrame(this, parentFrame, frameId); + var frame = new SDK.ResourceTreeFrame(this, parentFrame, frameId); if (frame.isMainFrame() && this.mainFrame) { this._handleMainFrameDetached(this.mainFrame); // Navigation to the new backend process. @@ -186,17 +186,17 @@ console.assert(frame); } - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.FrameWillNavigate, frame); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameWillNavigate, frame); this._securityOriginManager.removeSecurityOrigin(frame.securityOrigin); frame._navigate(framePayload); var addedOrigin = frame.securityOrigin; - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.FrameNavigated, frame); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, frame); if (frame.isMainFrame()) { - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.MainFrameNavigated, frame); - if (WebInspector.moduleSetting('preserveConsoleLog').get()) - WebInspector.console.log(WebInspector.UIString('Navigated to %s', frame.url)); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNavigated, frame); + if (Common.moduleSetting('preserveConsoleLog').get()) + Common.console.log(Common.UIString('Navigated to %s', frame.url)); else this.target().consoleModel.clear(); } @@ -206,7 +206,7 @@ // Fill frame with retained resources (the ones loaded using new loader). var resources = frame.resources(); for (var i = 0; i < resources.length; ++i) - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.ResourceAdded, resources[i]); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resources[i]); if (frame.isMainFrame()) this.target().setInspectedURL(frame.url); @@ -232,14 +232,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestFinished(event) { if (!this._cachedResourcesProcessed) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); - if (request.failed || request.resourceType() === WebInspector.resourceTypes.XHR) + var request = /** @type {!SDK.NetworkRequest} */ (event.data); + if (request.failed || request.resourceType() === Common.resourceTypes.XHR) return; var frame = this._frames.get(request.frameId); @@ -248,7 +248,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestUpdateDropped(event) { if (!this._cachedResourcesProcessed) @@ -263,22 +263,22 @@ if (frame._resourcesMap[url]) return; - var resource = new WebInspector.Resource( + var resource = new SDK.Resource( this.target(), null, url, frame.url, frameId, event.data.loaderId, - WebInspector.resourceTypes[event.data.resourceType], event.data.mimeType, event.data.lastModified, null); + Common.resourceTypes[event.data.resourceType], event.data.mimeType, event.data.lastModified, null); frame.addResource(resource); } /** * @param {!Protocol.Page.FrameId} frameId - * @return {!WebInspector.ResourceTreeFrame} + * @return {!SDK.ResourceTreeFrame} */ frameForId(frameId) { return this._frames.get(frameId); } /** - * @param {function(!WebInspector.Resource)} callback + * @param {function(!SDK.Resource)} callback * @return {boolean} */ forAllResources(callback) { @@ -288,7 +288,7 @@ } /** - * @return {!Array<!WebInspector.ResourceTreeFrame>} + * @return {!Array<!SDK.ResourceTreeFrame>} */ frames() { return this._frames.valuesArray(); @@ -296,7 +296,7 @@ /** * @param {string} url - * @return {?WebInspector.Resource} + * @return {?SDK.Resource} */ resourceForURL(url) { // Workers call into this with no frames available. @@ -304,16 +304,16 @@ } /** - * @param {?WebInspector.ResourceTreeFrame} parentFrame + * @param {?SDK.ResourceTreeFrame} parentFrame * @param {!Protocol.Page.FrameResourceTree} frameTreePayload */ _addFramesRecursively(parentFrame, frameTreePayload) { var framePayload = frameTreePayload.frame; - var frame = new WebInspector.ResourceTreeFrame(this, parentFrame, framePayload.id, framePayload); + var frame = new SDK.ResourceTreeFrame(this, parentFrame, framePayload.id, framePayload); this._addFrame(frame); var frameResource = this._createResourceFromFramePayload( - framePayload, framePayload.url, WebInspector.resourceTypes.Document, framePayload.mimeType, null, null); + framePayload, framePayload.url, Common.resourceTypes.Document, framePayload.mimeType, null, null); frame.addResource(frameResource); for (var i = 0; frameTreePayload.childFrames && i < frameTreePayload.childFrames.length; ++i) @@ -322,7 +322,7 @@ for (var i = 0; i < frameTreePayload.resources.length; ++i) { var subresource = frameTreePayload.resources[i]; var resource = this._createResourceFromFramePayload( - framePayload, subresource.url, WebInspector.resourceTypes[subresource.type], subresource.mimeType, + framePayload, subresource.url, Common.resourceTypes[subresource.type], subresource.mimeType, subresource.lastModified || null, subresource.contentSize || null); frame.addResource(resource); } @@ -331,15 +331,15 @@ /** * @param {!Protocol.Page.Frame} frame * @param {string} url - * @param {!WebInspector.ResourceType} type + * @param {!Common.ResourceType} type * @param {string} mimeType * @param {?number} lastModifiedTime * @param {?number} contentSize - * @return {!WebInspector.Resource} + * @return {!SDK.Resource} */ _createResourceFromFramePayload(frame, url, type, mimeType, lastModifiedTime, contentSize) { var lastModified = typeof lastModifiedTime === 'number' ? new Date(lastModifiedTime * 1000) : null; - return new WebInspector.Resource( + return new SDK.Resource( this.target(), null, url, frame.url, frame.id, frame.loaderId, type, mimeType, lastModified, contentSize); } @@ -361,13 +361,13 @@ reloadPage(bypassCache, scriptToEvaluateOnLoad) { // Only dispatch PageReloadRequested upon first reload request to simplify client logic. if (!this._pendingReloadOptions) - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.PageReloadRequested); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.PageReloadRequested); if (this._reloadSuspensionCount) { this._pendingReloadOptions = [bypassCache, scriptToEvaluateOnLoad]; return; } this._pendingReloadOptions = null; - this.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.WillReloadPage); + this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.WillReloadPage); this._agent.reload(bypassCache, scriptToEvaluateOnLoad); } @@ -391,13 +391,13 @@ } } /** - * @param {!WebInspector.ExecutionContext} a - * @param {!WebInspector.ExecutionContext} b + * @param {!SDK.ExecutionContext} a + * @param {!SDK.ExecutionContext} b * @return {number} */ _executionContextComparator(a, b) { /** - * @param {!WebInspector.ResourceTreeFrame} frame + * @param {!SDK.ResourceTreeFrame} frame */ function framePath(frame) { var currentFrame = frame; @@ -429,12 +429,12 @@ if (frameA && frameB) { return frameA.id.localeCompare(frameB.id); } - return WebInspector.ExecutionContext.comparator(a, b); + return SDK.ExecutionContext.comparator(a, b); } }; /** @enum {symbol} */ -WebInspector.ResourceTreeModel.Events = { +SDK.ResourceTreeModel.Events = { FrameAdded: Symbol('FrameAdded'), FrameNavigated: Symbol('FrameNavigated'), FrameDetached: Symbol('FrameDetached'), @@ -459,10 +459,10 @@ /** * @unrestricted */ -WebInspector.ResourceTreeFrame = class { +SDK.ResourceTreeFrame = class { /** - * @param {!WebInspector.ResourceTreeModel} model - * @param {?WebInspector.ResourceTreeFrame} parentFrame + * @param {!SDK.ResourceTreeModel} model + * @param {?SDK.ResourceTreeFrame} parentFrame * @param {!Protocol.Page.FrameId} frameId * @param {!Protocol.Page.Frame=} payload */ @@ -481,12 +481,12 @@ } /** - * @type {!Array.<!WebInspector.ResourceTreeFrame>} + * @type {!Array.<!SDK.ResourceTreeFrame>} */ this._childFrames = []; /** - * @type {!Object.<string, !WebInspector.Resource>} + * @type {!Object.<string, !SDK.Resource>} */ this._resourcesMap = {}; @@ -495,11 +495,11 @@ } /** - * @param {!WebInspector.ExecutionContext|!WebInspector.CSSStyleSheetHeader|!WebInspector.Resource} object - * @return {?WebInspector.ResourceTreeFrame} + * @param {!SDK.ExecutionContext|!SDK.CSSStyleSheetHeader|!SDK.Resource} object + * @return {?SDK.ResourceTreeFrame} */ static _fromObject(object) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(object.target()); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(object.target()); var frameId = object.frameId; if (!resourceTreeModel || !frameId) return null; @@ -507,34 +507,34 @@ } /** - * @param {!WebInspector.Script} script - * @return {?WebInspector.ResourceTreeFrame} + * @param {!SDK.Script} script + * @return {?SDK.ResourceTreeFrame} */ static fromScript(script) { var executionContext = script.executionContext(); if (!executionContext) return null; - return WebInspector.ResourceTreeFrame._fromObject(executionContext); + return SDK.ResourceTreeFrame._fromObject(executionContext); } /** - * @param {!WebInspector.CSSStyleSheetHeader} header - * @return {?WebInspector.ResourceTreeFrame} + * @param {!SDK.CSSStyleSheetHeader} header + * @return {?SDK.ResourceTreeFrame} */ static fromStyleSheet(header) { - return WebInspector.ResourceTreeFrame._fromObject(header); + return SDK.ResourceTreeFrame._fromObject(header); } /** - * @param {!WebInspector.Resource} resource - * @return {?WebInspector.ResourceTreeFrame} + * @param {!SDK.Resource} resource + * @return {?SDK.ResourceTreeFrame} */ static fromResource(resource) { - return WebInspector.ResourceTreeFrame._fromObject(resource); + return SDK.ResourceTreeFrame._fromObject(resource); } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._model.target(); @@ -576,14 +576,14 @@ } /** - * @return {?WebInspector.ResourceTreeFrame} + * @return {?SDK.ResourceTreeFrame} */ get parentFrame() { return this._parentFrame; } /** - * @return {!Array.<!WebInspector.ResourceTreeFrame>} + * @return {!Array.<!SDK.ResourceTreeFrame>} */ get childFrames() { return this._childFrames; @@ -614,14 +614,14 @@ } /** - * @return {!WebInspector.Resource} + * @return {!SDK.Resource} */ get mainResource() { return this._resourcesMap[this._url]; } /** - * @param {!WebInspector.ResourceTreeFrame} frame + * @param {!SDK.ResourceTreeFrame} frame */ _removeChildFrame(frame) { this._childFrames.remove(frame); @@ -638,11 +638,11 @@ _remove() { this._removeChildFrames(); this._model._frames.delete(this.id); - this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.FrameDetached, this); + this._model.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameDetached, this); } /** - * @param {!WebInspector.Resource} resource + * @param {!SDK.Resource} resource */ addResource(resource) { if (this._resourcesMap[resource.url] === resource) { @@ -650,11 +650,11 @@ return; } this._resourcesMap[resource.url] = resource; - this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.ResourceAdded, resource); + this._model.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resource); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _addRequest(request) { var resource = this._resourcesMap[request.url]; @@ -662,15 +662,15 @@ // Already in the tree, we just got an extra update. return; } - resource = new WebInspector.Resource( + resource = new SDK.Resource( this.target(), request, request.url, request.documentURL, request.frameId, request.loaderId, request.resourceType(), request.mimeType, null, null); this._resourcesMap[resource.url] = resource; - this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.ResourceAdded, resource); + this._model.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ResourceAdded, resource); } /** - * @return {!Array.<!WebInspector.Resource>} + * @return {!Array.<!SDK.Resource>} */ resources() { var result = []; @@ -681,7 +681,7 @@ /** * @param {string} url - * @return {?WebInspector.Resource} + * @return {?SDK.Resource} */ resourceForURL(url) { var resource = this._resourcesMap[url] || null; @@ -693,7 +693,7 @@ } /** - * @param {function(!WebInspector.Resource)} callback + * @param {function(!SDK.Resource)} callback * @return {boolean} */ _callForFrameResources(callback) { @@ -714,14 +714,14 @@ */ displayName() { if (!this._parentFrame) - return WebInspector.UIString('top'); - var subtitle = new WebInspector.ParsedURL(this._url).displayName; + return Common.UIString('top'); + var subtitle = new Common.ParsedURL(this._url).displayName; if (subtitle) { if (!this._name) return subtitle; return this._name + ' (' + subtitle + ')'; } - return WebInspector.UIString('<iframe>'); + return Common.UIString('<iframe>'); } }; @@ -730,7 +730,7 @@ * @implements {Protocol.PageDispatcher} * @unrestricted */ -WebInspector.PageDispatcher = class { +SDK.PageDispatcher = class { constructor(resourceTreeModel) { this._resourceTreeModel = resourceTreeModel; } @@ -740,7 +740,7 @@ * @param {number} time */ domContentEventFired(time) { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.DOMContentLoaded, time); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.DOMContentLoaded, time); } /** @@ -748,7 +748,7 @@ * @param {number} time */ loadEventFired(time) { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.Load, time); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.Load, time); } /** @@ -809,7 +809,7 @@ * @override */ frameResized() { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.FrameResized, null); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameResized, null); } /** @@ -836,7 +836,7 @@ screencastFrame(data, metadata, sessionId) { this._resourceTreeModel._agent.screencastFrameAck(sessionId); this._resourceTreeModel.dispatchEventToListeners( - WebInspector.ResourceTreeModel.Events.ScreencastFrame, {data: data, metadata: metadata}); + SDK.ResourceTreeModel.Events.ScreencastFrame, {data: data, metadata: metadata}); } /** @@ -845,7 +845,7 @@ */ screencastVisibilityChanged(visible) { this._resourceTreeModel.dispatchEventToListeners( - WebInspector.ResourceTreeModel.Events.ScreencastVisibilityChanged, {visible: visible}); + SDK.ResourceTreeModel.Events.ScreencastVisibilityChanged, {visible: visible}); } /** @@ -853,21 +853,21 @@ * @param {!Protocol.DOM.RGBA} color */ colorPicked(color) { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.ColorPicked, color); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.ColorPicked, color); } /** * @override */ interstitialShown() { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.InterstitialShown); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.InterstitialShown); } /** * @override */ interstitialHidden() { - this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.Events.InterstitialHidden); + this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.InterstitialHidden); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js index 50265c0..127d627b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -31,50 +31,50 @@ /** * @unrestricted */ -WebInspector.RuntimeModel = class extends WebInspector.SDKModel { +SDK.RuntimeModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.RuntimeModel, target); + super(SDK.RuntimeModel, target); this._agent = target.runtimeAgent(); - this.target().registerRuntimeDispatcher(new WebInspector.RuntimeDispatcher(this)); + this.target().registerRuntimeDispatcher(new SDK.RuntimeDispatcher(this)); if (target.hasJSCapability()) this._agent.enable(); - /** @type {!Map<number, !WebInspector.ExecutionContext>} */ + /** @type {!Map<number, !SDK.ExecutionContext>} */ this._executionContextById = new Map(); - this._executionContextComparator = WebInspector.ExecutionContext.comparator; + this._executionContextComparator = SDK.ExecutionContext.comparator; - if (WebInspector.moduleSetting('customFormatters').get()) + if (Common.moduleSetting('customFormatters').get()) this._agent.setCustomObjectFormatterEnabled(true); - WebInspector.moduleSetting('customFormatters').addChangeListener(this._customFormattersStateChanged.bind(this)); + Common.moduleSetting('customFormatters').addChangeListener(this._customFormattersStateChanged.bind(this)); } /** - * @return {!Array.<!WebInspector.ExecutionContext>} + * @return {!Array.<!SDK.ExecutionContext>} */ executionContexts() { return this._executionContextById.valuesArray().sort(this.executionContextComparator()); } /** - * @param {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator + * @param {function(!SDK.ExecutionContext,!SDK.ExecutionContext)} comparator */ setExecutionContextComparator(comparator) { this._executionContextComparator = comparator; } /** - * @return {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator + * @return {function(!SDK.ExecutionContext,!SDK.ExecutionContext)} comparator */ executionContextComparator() { return this._executionContextComparator; } /** - * @return {?WebInspector.ExecutionContext} + * @return {?SDK.ExecutionContext} */ defaultExecutionContext() { for (var context of this._executionContextById.values()) { @@ -86,7 +86,7 @@ /** * @param {!Protocol.Runtime.ExecutionContextId} id - * @return {?WebInspector.ExecutionContext} + * @return {?SDK.ExecutionContext} */ executionContext(id) { return this._executionContextById.get(id) || null; @@ -97,15 +97,15 @@ */ _executionContextCreated(context) { // The private script context should be hidden behind an experiment. - if (context.name === WebInspector.RuntimeModel._privateScript && !context.origin && + if (context.name === SDK.RuntimeModel._privateScript && !context.origin && !Runtime.experiments.isEnabled('privateScriptInspection')) { return; } var data = context.auxData || {isDefault: true}; - var executionContext = new WebInspector.ExecutionContext( + var executionContext = new SDK.ExecutionContext( this.target(), context.id, context.name, context.origin, data['isDefault'], data['frameId']); this._executionContextById.set(executionContext.id, executionContext); - this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextCreated, executionContext); + this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextCreated, executionContext); } /** @@ -116,48 +116,48 @@ if (!executionContext) return; this._executionContextById.delete(executionContextId); - this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, executionContext); + this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextDestroyed, executionContext); } fireExecutionContextOrderChanged() { - this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextOrderChanged, this); + this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextOrderChanged, this); } _executionContextsCleared() { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(this.target()); + var debuggerModel = SDK.DebuggerModel.fromTarget(this.target()); if (debuggerModel) debuggerModel.globalObjectCleared(); var contexts = this.executionContexts(); this._executionContextById.clear(); for (var i = 0; i < contexts.length; ++i) - this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, contexts[i]); + this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextDestroyed, contexts[i]); } /** * @param {!Protocol.Runtime.RemoteObject} payload - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ createRemoteObject(payload) { console.assert(typeof payload === 'object', 'Remote object payload should only be an object'); - return new WebInspector.RemoteObjectImpl( + return new SDK.RemoteObjectImpl( this.target(), payload.objectId, payload.type, payload.subtype, payload.value, payload.unserializableValue, payload.description, payload.preview, payload.customPreview); } /** * @param {!Protocol.Runtime.RemoteObject} payload - * @param {!WebInspector.ScopeRef} scopeRef - * @return {!WebInspector.RemoteObject} + * @param {!SDK.ScopeRef} scopeRef + * @return {!SDK.RemoteObject} */ createScopeRemoteObject(payload, scopeRef) { - return new WebInspector.ScopeRemoteObject( + return new SDK.ScopeRemoteObject( this.target(), payload.objectId, scopeRef, payload.type, payload.subtype, payload.value, payload.unserializableValue, payload.description, payload.preview); } /** * @param {number|string|boolean|undefined} value - * @return {!WebInspector.RemoteObject} + * @return {!SDK.RemoteObject} */ createRemoteObjectFromPrimitiveValue(value) { var type = typeof value; @@ -175,16 +175,16 @@ if (typeof unserializableValue !== 'undefined') value = undefined; } - return new WebInspector.RemoteObjectImpl(this.target(), undefined, type, undefined, value, unserializableValue); + return new SDK.RemoteObjectImpl(this.target(), undefined, type, undefined, value, unserializableValue); } /** * @param {string} name * @param {number|string|boolean} value - * @return {!WebInspector.RemoteObjectProperty} + * @return {!SDK.RemoteObjectProperty} */ createRemotePropertyFromPrimitiveValue(name, value) { - return new WebInspector.RemoteObjectProperty(name, this.createRemoteObjectFromPrimitiveValue(value)); + return new SDK.RemoteObjectProperty(name, this.createRemoteObjectFromPrimitiveValue(value)); } discardConsoleEntries() { @@ -192,7 +192,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _customFormattersStateChanged(event) { var enabled = /** @type {boolean} */ (event.data); @@ -277,29 +277,29 @@ } if (object.isNode()) { - WebInspector.Revealer.revealPromise(object).then(object.release.bind(object)); + Common.Revealer.revealPromise(object).then(object.release.bind(object)); return; } if (object.type === 'function') { - WebInspector.RemoteFunction.objectAsFunction(object).targetFunctionDetails().then(didGetDetails); + SDK.RemoteFunction.objectAsFunction(object).targetFunctionDetails().then(didGetDetails); return; } /** - * @param {?WebInspector.DebuggerModel.FunctionDetails} response + * @param {?SDK.DebuggerModel.FunctionDetails} response */ function didGetDetails(response) { object.release(); if (!response || !response.location) return; - WebInspector.Revealer.reveal(response.location); + Common.Revealer.reveal(response.location); } object.release(); } /** - * @param {!WebInspector.RemoteObject} object + * @param {!SDK.RemoteObject} object */ _copyRequested(object) { if (!object.objectId) { @@ -329,22 +329,22 @@ }; /** @enum {symbol} */ -WebInspector.RuntimeModel.Events = { +SDK.RuntimeModel.Events = { ExecutionContextCreated: Symbol('ExecutionContextCreated'), ExecutionContextDestroyed: Symbol('ExecutionContextDestroyed'), ExecutionContextChanged: Symbol('ExecutionContextChanged'), ExecutionContextOrderChanged: Symbol('ExecutionContextOrderChanged') }; -WebInspector.RuntimeModel._privateScript = 'private script'; +SDK.RuntimeModel._privateScript = 'private script'; /** * @implements {Protocol.RuntimeDispatcher} * @unrestricted */ -WebInspector.RuntimeDispatcher = class { +SDK.RuntimeDispatcher = class { /** - * @param {!WebInspector.RuntimeModel} runtimeModel + * @param {!SDK.RuntimeModel} runtimeModel */ constructor(runtimeModel) { this._runtimeModel = runtimeModel; @@ -379,7 +379,7 @@ * @param {!Protocol.Runtime.ExceptionDetails} exceptionDetails */ exceptionThrown(timestamp, exceptionDetails) { - var consoleMessage = WebInspector.ConsoleMessage.fromException( + var consoleMessage = SDK.ConsoleMessage.fromException( this._runtimeModel.target(), exceptionDetails, undefined, timestamp, undefined); consoleMessage.setExceptionId(exceptionDetails.exceptionId); this._runtimeModel.target().consoleModel.addMessage(consoleMessage); @@ -391,9 +391,9 @@ * @param {number} exceptionId */ exceptionRevoked(reason, exceptionId) { - var consoleMessage = new WebInspector.ConsoleMessage( - this._runtimeModel.target(), WebInspector.ConsoleMessage.MessageSource.JS, - WebInspector.ConsoleMessage.MessageLevel.RevokedError, reason, undefined, undefined, undefined, undefined, + var consoleMessage = new SDK.ConsoleMessage( + this._runtimeModel.target(), SDK.ConsoleMessage.MessageSource.JS, + SDK.ConsoleMessage.MessageLevel.RevokedError, reason, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined); consoleMessage.setRevokedExceptionId(exceptionId); this._runtimeModel.target().consoleModel.addMessage(consoleMessage); @@ -408,24 +408,24 @@ * @param {!Protocol.Runtime.StackTrace=} stackTrace */ consoleAPICalled(type, args, executionContextId, timestamp, stackTrace) { - var level = WebInspector.ConsoleMessage.MessageLevel.Log; - if (type === WebInspector.ConsoleMessage.MessageType.Debug) - level = WebInspector.ConsoleMessage.MessageLevel.Debug; - if (type === WebInspector.ConsoleMessage.MessageType.Error || - type === WebInspector.ConsoleMessage.MessageType.Assert) - level = WebInspector.ConsoleMessage.MessageLevel.Error; - if (type === WebInspector.ConsoleMessage.MessageType.Warning) - level = WebInspector.ConsoleMessage.MessageLevel.Warning; - if (type === WebInspector.ConsoleMessage.MessageType.Info) - level = WebInspector.ConsoleMessage.MessageLevel.Info; + var level = SDK.ConsoleMessage.MessageLevel.Log; + if (type === SDK.ConsoleMessage.MessageType.Debug) + level = SDK.ConsoleMessage.MessageLevel.Debug; + if (type === SDK.ConsoleMessage.MessageType.Error || + type === SDK.ConsoleMessage.MessageType.Assert) + level = SDK.ConsoleMessage.MessageLevel.Error; + if (type === SDK.ConsoleMessage.MessageType.Warning) + level = SDK.ConsoleMessage.MessageLevel.Warning; + if (type === SDK.ConsoleMessage.MessageType.Info) + level = SDK.ConsoleMessage.MessageLevel.Info; var message = ''; if (args.length && typeof args[0].value === 'string') message = args[0].value; else if (args.length && args[0].description) message = args[0].description; var callFrame = stackTrace && stackTrace.callFrames.length ? stackTrace.callFrames[0] : null; - var consoleMessage = new WebInspector.ConsoleMessage( - this._runtimeModel.target(), WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, level, + var consoleMessage = new SDK.ConsoleMessage( + this._runtimeModel.target(), SDK.ConsoleMessage.MessageSource.ConsoleAPI, level, /** @type {string} */ (message), type, callFrame ? callFrame.url : undefined, callFrame ? callFrame.lineNumber : undefined, callFrame ? callFrame.columnNumber : undefined, undefined, args, stackTrace, timestamp, executionContextId, undefined); @@ -445,9 +445,9 @@ /** * @unrestricted */ -WebInspector.ExecutionContext = class extends WebInspector.SDKObject { +SDK.ExecutionContext = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {number} id * @param {string} name * @param {string} origin @@ -461,7 +461,7 @@ this.origin = origin; this.isDefault = isDefault; this.runtimeModel = target.runtimeModel; - this.debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + this.debuggerModel = SDK.DebuggerModel.fromTarget(target); this.frameId = frameId; this._label = name; @@ -471,13 +471,13 @@ } /** - * @param {!WebInspector.ExecutionContext} a - * @param {!WebInspector.ExecutionContext} b + * @param {!SDK.ExecutionContext} a + * @param {!SDK.ExecutionContext} b * @return {number} */ static comparator(a, b) { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {number} */ function targetWeight(target) { @@ -508,7 +508,7 @@ * @param {boolean} returnByValue * @param {boolean} generatePreview * @param {boolean} userGesture - * @param {function(?WebInspector.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback + * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback */ evaluate( expression, @@ -531,7 +531,7 @@ /** * @param {string} objectGroup * @param {boolean} generatePreview - * @param {function(?WebInspector.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback + * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback */ globalObject(objectGroup, generatePreview, callback) { this._evaluateGlobal('this', objectGroup, false, true, false, generatePreview, false, callback); @@ -545,7 +545,7 @@ * @param {boolean} returnByValue * @param {boolean} generatePreview * @param {boolean} userGesture - * @param {function(?WebInspector.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback + * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} callback */ _evaluateGlobal( expression, @@ -562,7 +562,7 @@ } /** - * @this {WebInspector.ExecutionContext} + * @this {SDK.ExecutionContext} * @param {?Protocol.Error} error * @param {!Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails @@ -592,7 +592,7 @@ */ setLabel(label) { this._label = label; - this.runtimeModel.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextChanged, this); + this.runtimeModel.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextChanged, this); } }; @@ -600,18 +600,18 @@ /** * @unrestricted */ -WebInspector.EventListener = class extends WebInspector.SDKObject { +SDK.EventListener = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.RemoteObject} eventTarget + * @param {!SDK.Target} target + * @param {!SDK.RemoteObject} eventTarget * @param {string} type * @param {boolean} useCapture * @param {boolean} passive * @param {boolean} once - * @param {?WebInspector.RemoteObject} handler - * @param {?WebInspector.RemoteObject} originalHandler - * @param {!WebInspector.DebuggerModel.Location} location - * @param {?WebInspector.RemoteObject} removeFunction + * @param {?SDK.RemoteObject} handler + * @param {?SDK.RemoteObject} originalHandler + * @param {!SDK.DebuggerModel.Location} location + * @param {?SDK.RemoteObject} removeFunction * @param {string=} listenerType */ constructor( @@ -670,14 +670,14 @@ } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ handler() { return this._handler; } /** - * @return {!WebInspector.DebuggerModel.Location} + * @return {!SDK.DebuggerModel.Location} */ location() { return this._location; @@ -691,14 +691,14 @@ } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ originalHandler() { return this._originalHandler; } /** - * @return {?WebInspector.RemoteObject} + * @return {?SDK.RemoteObject} */ removeFunction() { return this._removeFunction; @@ -714,10 +714,10 @@ .callFunctionPromise( callCustomRemove, [ - WebInspector.RemoteObject.toCallArgument(this._type), - WebInspector.RemoteObject.toCallArgument(this._originalHandler), - WebInspector.RemoteObject.toCallArgument(this._useCapture), - WebInspector.RemoteObject.toCallArgument(this._passive), + SDK.RemoteObject.toCallArgument(this._type), + SDK.RemoteObject.toCallArgument(this._originalHandler), + SDK.RemoteObject.toCallArgument(this._useCapture), + SDK.RemoteObject.toCallArgument(this._passive), ]) .then(() => undefined); @@ -742,17 +742,17 @@ /** * @param {function()} success - * @this {WebInspector.EventListener} + * @this {SDK.EventListener} */ function promiseConstructor(success) { this._eventTarget .callFunctionPromise( callTogglePassive, [ - WebInspector.RemoteObject.toCallArgument(this._type), - WebInspector.RemoteObject.toCallArgument(this._originalHandler), - WebInspector.RemoteObject.toCallArgument(this._useCapture), - WebInspector.RemoteObject.toCallArgument(this._passive), + SDK.RemoteObject.toCallArgument(this._type), + SDK.RemoteObject.toCallArgument(this._originalHandler), + SDK.RemoteObject.toCallArgument(this._useCapture), + SDK.RemoteObject.toCallArgument(this._passive), ]) .then(success);
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js index 7691c8c..11571ddd 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
@@ -23,12 +23,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.Script = class extends WebInspector.SDKObject { +SDK.Script = class extends SDK.SDKObject { /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel * @param {string} scriptId * @param {string} sourceURL * @param {number} startLine @@ -87,13 +87,13 @@ if (sourceURLLineIndex === -1) return source; var sourceURLLine = source.substr(sourceURLLineIndex + 1).split('\n', 1)[0]; - if (sourceURLLine.search(WebInspector.Script.sourceURLRegex) === -1) + if (sourceURLLine.search(SDK.Script.sourceURLRegex) === -1) return source; return source.substr(0, sourceURLLineIndex) + source.substr(sourceURLLineIndex + sourceURLLine.length + 1); } /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @param {string} source */ static _reportDeprecatedCommentIfNeeded(script, source) { @@ -112,10 +112,10 @@ return; if (sourceTail.search(/^[\040\t]*\/\/@ source(mapping)?url=/mi) === -1) return; - var text = WebInspector.UIString( + var text = Common.UIString( '\'//@ sourceURL\' and \'//@ sourceMappingURL\' are deprecated, please use \'//# sourceURL=\' and \'//# sourceMappingURL=\' instead.'); - var msg = new WebInspector.ConsoleMessage( - script.target(), WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Warning, + var msg = new SDK.ConsoleMessage( + script.target(), SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Warning, text, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, script.scriptId); consoleModel.addMessage(msg); @@ -129,7 +129,7 @@ } /** - * @return {?WebInspector.ExecutionContext} + * @return {?SDK.ExecutionContext} */ executionContext() { return this.target().runtimeModel.executionContext(this._executionContextId); @@ -152,10 +152,10 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { - return WebInspector.resourceTypes.Script; + return Common.resourceTypes.Script; } /** @@ -174,14 +174,14 @@ return promise; /** - * @this {WebInspector.Script} + * @this {SDK.Script} * @param {?Protocol.Error} error * @param {string} source */ function didGetScriptSource(error, source) { if (!error) { - WebInspector.Script._reportDeprecatedCommentIfNeeded(this, source); - this._source = WebInspector.Script._trimSourceURLComment(source); + SDK.Script._reportDeprecatedCommentIfNeeded(this, source); + this._source = SDK.Script._trimSourceURLComment(source); } else { this._source = ''; } @@ -210,7 +210,7 @@ var result = []; for (var i = 0; i < searchMatches.length; ++i) { var searchMatch = - new WebInspector.ContentProvider.SearchMatch(searchMatches[i].lineNumber, searchMatches[i].lineContent); + new Common.ContentProvider.SearchMatch(searchMatches[i].lineNumber, searchMatches[i].lineContent); result.push(searchMatch); } callback(result || []); @@ -240,7 +240,7 @@ */ editSource(newSource, callback) { /** - * @this {WebInspector.Script} + * @this {SDK.Script} * @param {?Protocol.Error} error * @param {!Array.<!Protocol.Debugger.CallFrame>=} callFrames * @param {boolean=} stackChanged @@ -254,7 +254,7 @@ callback(error, exceptionDetails, callFrames, asyncStackTrace, needsStepIn); } - newSource = WebInspector.Script._trimSourceURLComment(newSource); + newSource = SDK.Script._trimSourceURLComment(newSource); // We append correct sourceURL to script for consistency only. It's not actually needed for things to work correctly. newSource = this._appendSourceURLCommentIfNeeded(newSource); @@ -268,10 +268,10 @@ /** * @param {number} lineNumber * @param {number=} columnNumber - * @return {!WebInspector.DebuggerModel.Location} + * @return {!SDK.DebuggerModel.Location} */ rawLocation(lineNumber, columnNumber) { - return new WebInspector.DebuggerModel.Location(this.debuggerModel, this.scriptId, lineNumber, columnNumber || 0); + return new SDK.DebuggerModel.Location(this.debuggerModel, this.scriptId, lineNumber, columnNumber || 0); } /** @@ -289,7 +289,7 @@ if (this.sourceMapURL) return; this.sourceMapURL = sourceMapURL; - this.dispatchEventToListeners(WebInspector.Script.Events.SourceMapURLAdded, this.sourceMapURL); + this.dispatchEventToListeners(SDK.Script.Events.SourceMapURLAdded, this.sourceMapURL); } /** @@ -316,7 +316,7 @@ /** * @param {function(?)} fulfill * @param {function(*)} reject - * @this {WebInspector.Script} + * @this {SDK.Script} */ function setBlackboxedRanges(fulfill, reject) { this.target().debuggerAgent().setBlackboxedRanges(this.scriptId, positions, callback); @@ -333,9 +333,9 @@ }; /** @enum {symbol} */ -WebInspector.Script.Events = { +SDK.Script.Events = { ScriptEdited: Symbol('ScriptEdited'), SourceMapURLAdded: Symbol('SourceMapURLAdded') }; -WebInspector.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; +SDK.Script.sourceURLRegex = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SecurityOriginManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/SecurityOriginManager.js index 8589f4d..fe60be7 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/SecurityOriginManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/SecurityOriginManager.js
@@ -4,26 +4,26 @@ /** * @unrestricted */ -WebInspector.SecurityOriginManager = class extends WebInspector.SDKModel { +SDK.SecurityOriginManager = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.SecurityOriginManager, target); + super(SDK.SecurityOriginManager, target); this._securityOriginCounter = new Map(); this._mainSecurityOrigin = ''; } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.SecurityOriginManager} + * @param {!SDK.Target} target + * @return {!SDK.SecurityOriginManager} */ static fromTarget(target) { var securityOriginManager = - /** @type {?WebInspector.SecurityOriginManager} */ (target.model(WebInspector.SecurityOriginManager)); + /** @type {?SDK.SecurityOriginManager} */ (target.model(SDK.SecurityOriginManager)); if (!securityOriginManager) - securityOriginManager = new WebInspector.SecurityOriginManager(target); + securityOriginManager = new SDK.SecurityOriginManager(target); return securityOriginManager; } @@ -34,7 +34,7 @@ var currentCount = this._securityOriginCounter.get(securityOrigin); if (!currentCount) { this._securityOriginCounter.set(securityOrigin, 1); - this.dispatchEventToListeners(WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, securityOrigin); + this.dispatchEventToListeners(SDK.SecurityOriginManager.Events.SecurityOriginAdded, securityOrigin); return; } this._securityOriginCounter.set(securityOrigin, currentCount + 1); @@ -47,7 +47,7 @@ var currentCount = this._securityOriginCounter.get(securityOrigin); if (currentCount === 1) { this._securityOriginCounter.delete(securityOrigin); - this.dispatchEventToListeners(WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, securityOrigin); + this.dispatchEventToListeners(SDK.SecurityOriginManager.Events.SecurityOriginRemoved, securityOrigin); return; } this._securityOriginCounter.set(securityOrigin, currentCount - 1); @@ -72,12 +72,12 @@ */ setMainSecurityOrigin(securityOrigin) { this._mainSecurityOrigin = securityOrigin; - this.dispatchEventToListeners(WebInspector.SecurityOriginManager.Events.MainSecurityOriginChanged, securityOrigin); + this.dispatchEventToListeners(SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, securityOrigin); } }; /** @enum {symbol} */ -WebInspector.SecurityOriginManager.Events = { +SDK.SecurityOriginManager.Events = { SecurityOriginAdded: Symbol('SecurityOriginAdded'), SecurityOriginRemoved: Symbol('SecurityOriginRemoved'), MainSecurityOriginChanged: Symbol('MainSecurityOriginChanged')
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js index b457dd54..04a3296 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ServerTiming = class { +SDK.ServerTiming = class { /** * @param {string} metric * @param {number} value @@ -17,8 +17,8 @@ } /** - * @param {!Array<!WebInspector.NetworkRequest.NameValue>} headers - * @return {?Array<!WebInspector.ServerTiming>} + * @param {!Array<!SDK.NetworkRequest.NameValue>} headers + * @return {?Array<!SDK.ServerTiming>} */ static parseHeaders(headers) { var rawServerTimingHeaders = headers.filter(item => item.name.toLowerCase() === 'server-timing'); @@ -27,7 +27,7 @@ /** * @param {?string} valueString - * @return {?Array<!WebInspector.ServerTiming>} + * @return {?Array<!SDK.ServerTiming>} */ function createFromHeaderValue(valueString) { // https://www.w3.org/TR/server-timing/ @@ -42,7 +42,7 @@ if (value !== null) value = Math.abs(parseFloat(metricMatch[2])); valueString = metricMatch[5]; // comma delimited headers - result.push(new WebInspector.ServerTiming(metric, value, description)); + result.push(new SDK.ServerTiming(metric, value, description)); } return result; }
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js index 461c67e8..66a1570 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerCacheModel.js
@@ -4,16 +4,16 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerCacheModel = class extends WebInspector.SDKModel { +SDK.ServiceWorkerCacheModel = class extends SDK.SDKModel { /** * Invariant: This model can only be constructed on a ServiceWorker target. - * @param {!WebInspector.Target} target - * @param {!WebInspector.SecurityOriginManager} securityOriginManager + * @param {!SDK.Target} target + * @param {!SDK.SecurityOriginManager} securityOriginManager */ constructor(target, securityOriginManager) { - super(WebInspector.ServiceWorkerCacheModel, target); + super(SDK.ServiceWorkerCacheModel, target); - /** @type {!Map<string, !WebInspector.ServiceWorkerCacheModel.Cache>} */ + /** @type {!Map<string, !SDK.ServiceWorkerCacheModel.Cache>} */ this._caches = new Map(); this._agent = target.cacheStorageAgent(); @@ -25,17 +25,17 @@ } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.ServiceWorkerCacheModel} + * @param {!SDK.Target} target + * @return {?SDK.ServiceWorkerCacheModel} */ static fromTarget(target) { if (!target.hasBrowserCapability()) return null; var instance = - /** @type {?WebInspector.ServiceWorkerCacheModel} */ (target.model(WebInspector.ServiceWorkerCacheModel)); + /** @type {?SDK.ServiceWorkerCacheModel} */ (target.model(SDK.ServiceWorkerCacheModel)); if (!instance) instance = - new WebInspector.ServiceWorkerCacheModel(target, WebInspector.SecurityOriginManager.fromTarget(target)); + new SDK.ServiceWorkerCacheModel(target, SDK.SecurityOriginManager.fromTarget(target)); return instance; } @@ -44,9 +44,9 @@ return; this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); + SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); this._securityOriginManager.addEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); + SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); for (var securityOrigin of this._securityOriginManager.securityOrigins()) this._addOrigin(securityOrigin); @@ -71,11 +71,11 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ deleteCache(cache) { /** - * @this {WebInspector.ServiceWorkerCacheModel} + * @this {SDK.ServiceWorkerCacheModel} */ function callback(error) { if (error) { @@ -89,7 +89,7 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache * @param {string} request * @param {function()} callback */ @@ -99,7 +99,7 @@ */ function myCallback(error) { if (error) { - WebInspector.console.error(WebInspector.UIString( + Common.console.error(Common.UIString( 'ServiceWorkerCacheAgent error deleting cache entry %s in cache: %s', cache.toString(), error)); return; } @@ -109,17 +109,17 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache * @param {number} skipCount * @param {number} pageSize - * @param {function(!Array.<!WebInspector.ServiceWorkerCacheModel.Entry>, boolean)} callback + * @param {function(!Array.<!SDK.ServiceWorkerCacheModel.Entry>, boolean)} callback */ loadCacheData(cache, skipCount, pageSize, callback) { this._requestEntries(cache, skipCount, pageSize, callback); } /** - * @return {!Array.<!WebInspector.ServiceWorkerCacheModel.Cache>} + * @return {!Array.<!SDK.ServiceWorkerCacheModel.Cache>} */ caches() { var caches = new Array(); @@ -137,9 +137,9 @@ this._caches.clear(); if (this._enabled) { this._securityOriginManager.removeEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); + SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); this._securityOriginManager.removeEventListener( - WebInspector.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); + SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); } } @@ -166,8 +166,8 @@ _loadCacheNames(securityOrigin) { /** * @param {?Protocol.Error} error - * @param {!Array.<!WebInspector.ServiceWorkerCacheModel.Cache>} caches - * @this {WebInspector.ServiceWorkerCacheModel} + * @param {!Array.<!SDK.ServiceWorkerCacheModel.Cache>} caches + * @this {SDK.ServiceWorkerCacheModel} */ function callback(error, caches) { if (error) { @@ -185,8 +185,8 @@ */ _updateCacheNames(securityOrigin, cachesJson) { /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache - * @this {WebInspector.ServiceWorkerCacheModel} + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache + * @this {SDK.ServiceWorkerCacheModel} */ function deleteAndSaveOldCaches(cache) { if (cache.securityOrigin === securityOrigin && !updatingCachesIds.has(cache.cacheId)) { @@ -197,13 +197,13 @@ /** @type {!Set<string>} */ var updatingCachesIds = new Set(); - /** @type {!Map<string, !WebInspector.ServiceWorkerCacheModel.Cache>} */ + /** @type {!Map<string, !SDK.ServiceWorkerCacheModel.Cache>} */ var newCaches = new Map(); - /** @type {!Map<string, !WebInspector.ServiceWorkerCacheModel.Cache>} */ + /** @type {!Map<string, !SDK.ServiceWorkerCacheModel.Cache>} */ var oldCaches = new Map(); for (var cacheJson of cachesJson) { - var cache = new WebInspector.ServiceWorkerCacheModel.Cache( + var cache = new SDK.ServiceWorkerCacheModel.Cache( cacheJson.securityOrigin, cacheJson.cacheName, cacheJson.cacheId); updatingCachesIds.add(cache.cacheId); if (this._caches.has(cache.cacheId)) @@ -217,7 +217,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginAdded(event) { var securityOrigin = /** @type {string} */ (event.data); @@ -225,7 +225,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _securityOriginRemoved(event) { var securityOrigin = /** @type {string} */ (event.data); @@ -233,29 +233,29 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ _cacheAdded(cache) { - this.dispatchEventToListeners(WebInspector.ServiceWorkerCacheModel.Events.CacheAdded, cache); + this.dispatchEventToListeners(SDK.ServiceWorkerCacheModel.Events.CacheAdded, cache); } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache */ _cacheRemoved(cache) { - this.dispatchEventToListeners(WebInspector.ServiceWorkerCacheModel.Events.CacheRemoved, cache); + this.dispatchEventToListeners(SDK.ServiceWorkerCacheModel.Events.CacheRemoved, cache); } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache * @param {number} skipCount * @param {number} pageSize - * @param {function(!Array.<!WebInspector.ServiceWorkerCacheModel.Entry>, boolean)} callback + * @param {function(!Array.<!SDK.ServiceWorkerCacheModel.Entry>, boolean)} callback */ _requestEntries(cache, skipCount, pageSize, callback) { /** * @param {?Protocol.Error} error - * @param {!Array.<!WebInspector.ServiceWorkerCacheModel.Entry>} dataEntries + * @param {!Array.<!SDK.ServiceWorkerCacheModel.Entry>} dataEntries * @param {boolean} hasMore */ function innerCallback(error, dataEntries, hasMore) { @@ -265,7 +265,7 @@ } var entries = []; for (var i = 0; i < dataEntries.length; ++i) { - entries.push(new WebInspector.ServiceWorkerCacheModel.Entry(dataEntries[i].request, dataEntries[i].response)); + entries.push(new SDK.ServiceWorkerCacheModel.Entry(dataEntries[i].request, dataEntries[i].response)); } callback(entries, hasMore); } @@ -274,7 +274,7 @@ }; /** @enum {symbol} */ -WebInspector.ServiceWorkerCacheModel.Events = { +SDK.ServiceWorkerCacheModel.Events = { CacheAdded: Symbol('CacheAdded'), CacheRemoved: Symbol('CacheRemoved') }; @@ -282,7 +282,7 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerCacheModel.Entry = class { +SDK.ServiceWorkerCacheModel.Entry = class { /** * @param {string} request * @param {string} response @@ -296,7 +296,7 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerCacheModel.Cache = class { +SDK.ServiceWorkerCacheModel.Cache = class { /** * @param {string} securityOrigin * @param {string} cacheName @@ -309,7 +309,7 @@ } /** - * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache + * @param {!SDK.ServiceWorkerCacheModel.Cache} cache * @return {boolean} */ equals(cache) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js index f8a8dd0..e910c1e5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.js
@@ -31,24 +31,24 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerManager = class extends WebInspector.SDKObject { +SDK.ServiceWorkerManager = class extends SDK.SDKObject { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.SubTargetsManager} subTargetsManager + * @param {!SDK.Target} target + * @param {!SDK.SubTargetsManager} subTargetsManager */ constructor(target, subTargetsManager) { super(target); - target.registerServiceWorkerDispatcher(new WebInspector.ServiceWorkerDispatcher(this)); + target.registerServiceWorkerDispatcher(new SDK.ServiceWorkerDispatcher(this)); this._lastAnonymousTargetId = 0; this._agent = target.serviceWorkerAgent(); - /** @type {!Map.<string, !WebInspector.ServiceWorkerRegistration>} */ + /** @type {!Map.<string, !SDK.ServiceWorkerRegistration>} */ this._registrations = new Map(); this.enable(); - this._forceUpdateSetting = WebInspector.settings.createSetting('serviceWorkerUpdateOnReload', false); + this._forceUpdateSetting = Common.settings.createSetting('serviceWorkerUpdateOnReload', false); if (this._forceUpdateSetting.get()) this._forceUpdateSettingChanged(); this._forceUpdateSetting.addChangeListener(this._forceUpdateSettingChanged, this); - new WebInspector.ServiceWorkerContextNamer(target, this, subTargetsManager); + new SDK.ServiceWorkerContextNamer(target, this, subTargetsManager); } enable() { @@ -67,7 +67,7 @@ } /** - * @return {!Map.<string, !WebInspector.ServiceWorkerRegistration>} + * @return {!Map.<string, !SDK.ServiceWorkerRegistration>} */ registrations() { return this._registrations; @@ -75,7 +75,7 @@ /** * @param {string} versionId - * @return {?WebInspector.ServiceWorkerVersion} + * @return {?SDK.ServiceWorkerVersion} */ findVersion(versionId) { for (var registration of this.registrations().values()) { @@ -95,7 +95,7 @@ return; if (registration._isRedundant()) { this._registrations.delete(registrationId); - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationDeleted, registration); return; } registration._deleting = true; @@ -122,7 +122,7 @@ var registration = this._registrations.get(registrationId); if (!registration) return; - var origin = WebInspector.ParsedURL.extractOrigin(registration.scopeURL); + var origin = Common.ParsedURL.extractOrigin(registration.scopeURL); this._agent.deliverPushMessage(origin, registrationId, data); } @@ -135,7 +135,7 @@ var registration = this._registrations.get(registrationId); if (!registration) return; - var origin = WebInspector.ParsedURL.extractOrigin(registration.scopeURL); + var origin = Common.ParsedURL.extractOrigin(registration.scopeURL); this._agent.dispatchSyncEvent(origin, registrationId, tag, lastChance); } @@ -181,18 +181,18 @@ for (var payload of registrations) { var registration = this._registrations.get(payload.registrationId); if (!registration) { - registration = new WebInspector.ServiceWorkerRegistration(payload); + registration = new SDK.ServiceWorkerRegistration(payload); this._registrations.set(payload.registrationId, registration); - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationUpdated, registration); continue; } registration._update(payload); if (registration._shouldBeRemoved()) { this._registrations.delete(registration.id); - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationDeleted, registration); } else { - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationUpdated, registration); } } } @@ -201,7 +201,7 @@ * @param {!Array.<!Protocol.ServiceWorker.ServiceWorkerVersion>} versions */ _workerVersionUpdated(versions) { - /** @type {!Set.<!WebInspector.ServiceWorkerRegistration>} */ + /** @type {!Set.<!SDK.ServiceWorkerRegistration>} */ var registrations = new Set(); for (var payload of versions) { var registration = this._registrations.get(payload.registrationId); @@ -213,9 +213,9 @@ for (var registration of registrations) { if (registration._shouldBeRemoved()) { this._registrations.delete(registration.id); - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationDeleted, registration); } else { - this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, registration); + this.dispatchEventToListeners(SDK.ServiceWorkerManager.Events.RegistrationUpdated, registration); } } } @@ -229,11 +229,11 @@ return; registration.errors.push(payload); this.dispatchEventToListeners( - WebInspector.ServiceWorkerManager.Events.RegistrationErrorAdded, {registration: registration, error: payload}); + SDK.ServiceWorkerManager.Events.RegistrationErrorAdded, {registration: registration, error: payload}); } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ forceUpdateOnReloadSetting() { return this._forceUpdateSetting; @@ -245,7 +245,7 @@ }; /** @enum {symbol} */ -WebInspector.ServiceWorkerManager.Events = { +SDK.ServiceWorkerManager.Events = { RegistrationUpdated: Symbol('RegistrationUpdated'), RegistrationErrorAdded: Symbol('RegistrationErrorAdded'), RegistrationDeleted: Symbol('RegistrationDeleted') @@ -255,9 +255,9 @@ * @implements {Protocol.ServiceWorkerDispatcher} * @unrestricted */ -WebInspector.ServiceWorkerDispatcher = class { +SDK.ServiceWorkerDispatcher = class { /** - * @param {!WebInspector.ServiceWorkerManager} manager + * @param {!SDK.ServiceWorkerManager} manager */ constructor(manager) { this._manager = manager; @@ -291,9 +291,9 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerVersion = class { +SDK.ServiceWorkerVersion = class { /** - * @param {!WebInspector.ServiceWorkerRegistration} registration + * @param {!SDK.ServiceWorkerRegistration} registration * @param {!Protocol.ServiceWorker.ServiceWorkerVersion} payload */ constructor(registration, payload) { @@ -307,7 +307,7 @@ _update(payload) { this.id = payload.versionId; this.scriptURL = payload.scriptURL; - var parsedURL = new WebInspector.ParsedURL(payload.scriptURL); + var parsedURL = new Common.ParsedURL(payload.scriptURL); this.securityOrigin = parsedURL.securityOrigin(); this.runningStatus = payload.runningStatus; this.status = payload.status; @@ -409,19 +409,19 @@ */ mode() { if (this.isNew() || this.isInstalling()) - return WebInspector.ServiceWorkerVersion.Modes.Installing; + return SDK.ServiceWorkerVersion.Modes.Installing; else if (this.isInstalled()) - return WebInspector.ServiceWorkerVersion.Modes.Waiting; + return SDK.ServiceWorkerVersion.Modes.Waiting; else if (this.isActivating() || this.isActivated()) - return WebInspector.ServiceWorkerVersion.Modes.Active; - return WebInspector.ServiceWorkerVersion.Modes.Redundant; + return SDK.ServiceWorkerVersion.Modes.Active; + return SDK.ServiceWorkerVersion.Modes.Redundant; } }; /** * @enum {string} */ -WebInspector.ServiceWorkerVersion.Modes = { +SDK.ServiceWorkerVersion.Modes = { Installing: 'installing', Waiting: 'waiting', Active: 'active', @@ -431,13 +431,13 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerRegistration = class { +SDK.ServiceWorkerRegistration = class { /** * @param {!Protocol.ServiceWorker.ServiceWorkerRegistration} payload */ constructor(payload) { this._update(payload); - /** @type {!Map.<string, !WebInspector.ServiceWorkerVersion>} */ + /** @type {!Map.<string, !SDK.ServiceWorkerVersion>} */ this.versions = new Map(); this._deleting = false; /** @type {!Array<!Protocol.ServiceWorker.ServiceWorkerErrorMessage>} */ @@ -451,7 +451,7 @@ this._fingerprint = Symbol('fingerprint'); this.id = payload.registrationId; this.scopeURL = payload.scopeURL; - var parsedURL = new WebInspector.ParsedURL(payload.scopeURL); + var parsedURL = new Common.ParsedURL(payload.scopeURL); this.securityOrigin = parsedURL.securityOrigin(); this.isDeleted = payload.isDeleted; this.forceUpdateOnPageLoad = payload.forceUpdateOnPageLoad; @@ -465,10 +465,10 @@ } /** - * @return {!Map<string, !WebInspector.ServiceWorkerVersion>} + * @return {!Map<string, !SDK.ServiceWorkerVersion>} */ versionsByMode() { - /** @type {!Map<string, !WebInspector.ServiceWorkerVersion>} */ + /** @type {!Map<string, !SDK.ServiceWorkerVersion>} */ var result = new Map(); for (var version of this.versions.values()) result.set(version.mode(), version); @@ -477,13 +477,13 @@ /** * @param {!Protocol.ServiceWorker.ServiceWorkerVersion} payload - * @return {!WebInspector.ServiceWorkerVersion} + * @return {!SDK.ServiceWorkerVersion} */ _updateVersion(payload) { this._fingerprint = Symbol('fingerprint'); var version = this.versions.get(payload.versionId); if (!version) { - version = new WebInspector.ServiceWorkerVersion(this, payload); + version = new SDK.ServiceWorkerVersion(this, payload); this.versions.set(payload.versionId, version); return version; } @@ -518,29 +518,29 @@ /** * @unrestricted */ -WebInspector.ServiceWorkerContextNamer = class { +SDK.ServiceWorkerContextNamer = class { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.ServiceWorkerManager} serviceWorkerManager - * @param {!WebInspector.SubTargetsManager} subTargetsManager + * @param {!SDK.Target} target + * @param {!SDK.ServiceWorkerManager} serviceWorkerManager + * @param {!SDK.SubTargetsManager} subTargetsManager */ constructor(target, serviceWorkerManager, subTargetsManager) { this._target = target; this._serviceWorkerManager = serviceWorkerManager; this._subTargetsManager = subTargetsManager; - /** @type {!Map<string, !WebInspector.ServiceWorkerVersion>} */ + /** @type {!Map<string, !SDK.ServiceWorkerVersion>} */ this._versionByTargetId = new Map(); serviceWorkerManager.addEventListener( - WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, this._registrationsUpdated, this); + SDK.ServiceWorkerManager.Events.RegistrationUpdated, this._registrationsUpdated, this); serviceWorkerManager.addEventListener( - WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, this._registrationsUpdated, this); - WebInspector.targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, + SDK.ServiceWorkerManager.Events.RegistrationDeleted, this._registrationsUpdated, this); + SDK.targetManager.addModelListener( + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextCreated, this._executionContextCreated, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _registrationsUpdated(event) { this._versionByTargetId.clear(); @@ -556,10 +556,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _executionContextCreated(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data); var serviceWorkerTargetId = this._serviceWorkerTargetIdForWorker(executionContext.target()); if (!serviceWorkerTargetId) return; @@ -567,7 +567,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {?string} */ _serviceWorkerTargetIdForWorker(target) { @@ -581,7 +581,7 @@ } _updateAllContextLabels() { - for (var target of WebInspector.targetManager.targets()) { + for (var target of SDK.targetManager.targets()) { var serviceWorkerTargetId = this._serviceWorkerTargetIdForWorker(target); if (!serviceWorkerTargetId) continue; @@ -592,8 +592,8 @@ } /** - * @param {!WebInspector.ExecutionContext} context - * @param {?WebInspector.ServiceWorkerVersion} version + * @param {!SDK.ExecutionContext} context + * @param {?SDK.ServiceWorkerVersion} version */ _updateContextLabel(context, version) { var parsedUrl = context.origin.asParsedURL();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js index 826020c..a6a2b28 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
@@ -66,7 +66,7 @@ /** * @unrestricted */ -WebInspector.SourceMapEntry = class { +SDK.SourceMapEntry = class { /** * @param {number} lineNumber * @param {number} columnNumber @@ -88,9 +88,9 @@ /** * @interface */ -WebInspector.SourceMap = function() {}; +SDK.SourceMap = function() {}; -WebInspector.SourceMap.prototype = { +SDK.SourceMap.prototype = { /** * @return {string} */ @@ -108,8 +108,8 @@ /** * @param {string} sourceURL - * @param {!WebInspector.ResourceType} contentType - * @return {!WebInspector.ContentProvider} + * @param {!Common.ResourceType} contentType + * @return {!Common.ContentProvider} */ sourceContentProvider: function(sourceURL, contentType) {}, @@ -122,7 +122,7 @@ /** * @param {number} lineNumber in compiled resource * @param {number} columnNumber in compiled resource - * @return {?WebInspector.SourceMapEntry} + * @return {?SDK.SourceMapEntry} */ findEntry: function(lineNumber, columnNumber) {}, @@ -132,9 +132,9 @@ editable: function() {}, /** - * @param {!Array<!WebInspector.TextRange>} ranges + * @param {!Array<!Common.TextRange>} ranges * @param {!Array<string>} texts - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @return {!Promise<?SDK.SourceMap.EditResult>} */ editCompiled: function(ranges, texts) {}, }; @@ -142,10 +142,10 @@ /** * @unrestricted */ -WebInspector.SourceMap.EditResult = class { +SDK.SourceMap.EditResult = class { /** - * @param {!WebInspector.SourceMap} map - * @param {!Array<!WebInspector.SourceEdit>} compiledEdits + * @param {!SDK.SourceMap} map + * @param {!Array<!Common.SourceEdit>} compiledEdits * @param {!Map<string, string>} newSources */ constructor(map, compiledEdits, newSources) { @@ -158,22 +158,22 @@ /** * @interface */ -WebInspector.SourceMapFactory = function() {}; +SDK.SourceMapFactory = function() {}; -WebInspector.SourceMapFactory.prototype = { +SDK.SourceMapFactory.prototype = { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.SourceMap} sourceMap - * @return {!Promise<?WebInspector.SourceMap>} + * @param {!SDK.Target} target + * @param {!SDK.SourceMap} sourceMap + * @return {!Promise<?SDK.SourceMap>} */ editableSourceMap: function(target, sourceMap) {}, }; /** - * @implements {WebInspector.SourceMap} + * @implements {SDK.SourceMap} * @unrestricted */ -WebInspector.TextSourceMap = class { +SDK.TextSourceMap = class { /** * Implements Source Map V3 model. See https://github.com/google/closure-compiler/wiki/Source-Maps * for format description. @@ -182,19 +182,19 @@ * @param {!SourceMapV3} payload */ constructor(compiledURL, sourceMappingURL, payload) { - if (!WebInspector.TextSourceMap._base64Map) { + if (!SDK.TextSourceMap._base64Map) { const base64Digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - WebInspector.TextSourceMap._base64Map = {}; + SDK.TextSourceMap._base64Map = {}; for (var i = 0; i < base64Digits.length; ++i) - WebInspector.TextSourceMap._base64Map[base64Digits.charAt(i)] = i; + SDK.TextSourceMap._base64Map[base64Digits.charAt(i)] = i; } this._json = payload; this._compiledURL = compiledURL; this._sourceMappingURL = sourceMappingURL; - /** @type {?Array<!WebInspector.SourceMapEntry>} */ + /** @type {?Array<!SDK.SourceMapEntry>} */ this._mappings = null; - /** @type {!Map<string, !WebInspector.TextSourceMap.SourceInfo>} */ + /** @type {!Map<string, !SDK.TextSourceMap.SourceInfo>} */ this._sourceInfos = new Map(); this._eachSection(this._parseSources.bind(this)); } @@ -202,13 +202,13 @@ /** * @param {string} sourceMapURL * @param {string} compiledURL - * @return {!Promise<?WebInspector.TextSourceMap>} - * @this {WebInspector.TextSourceMap} + * @return {!Promise<?SDK.TextSourceMap>} + * @this {SDK.TextSourceMap} */ static load(sourceMapURL, compiledURL) { var callback; var promise = new Promise(fulfill => callback = fulfill); - WebInspector.multitargetNetworkManager.loadResource(sourceMapURL, contentLoaded); + SDK.multitargetNetworkManager.loadResource(sourceMapURL, contentLoaded); return promise; /** @@ -227,10 +227,10 @@ try { var payload = /** @type {!SourceMapV3} */ (JSON.parse(content)); var baseURL = sourceMapURL.startsWith('data:') ? compiledURL : sourceMapURL; - callback(new WebInspector.TextSourceMap(compiledURL, baseURL, payload)); + callback(new SDK.TextSourceMap(compiledURL, baseURL, payload)); } catch (e) { console.error(e); - WebInspector.console.warn('DevTools failed to parse SourceMap: ' + sourceMapURL); + Common.console.warn('DevTools failed to parse SourceMap: ' + sourceMapURL); callback(null); } } @@ -263,14 +263,14 @@ /** * @override * @param {string} sourceURL - * @param {!WebInspector.ResourceType} contentType - * @return {!WebInspector.ContentProvider} + * @param {!Common.ResourceType} contentType + * @return {!Common.ContentProvider} */ sourceContentProvider(sourceURL, contentType) { var info = this._sourceInfos.get(sourceURL); if (info.content) - return WebInspector.StaticContentProvider.fromString(sourceURL, contentType, info.content); - return new WebInspector.CompilerSourceMappingContentProvider(sourceURL, contentType); + return Common.StaticContentProvider.fromString(sourceURL, contentType, info.content); + return new SDK.CompilerSourceMappingContentProvider(sourceURL, contentType); } /** @@ -294,19 +294,19 @@ /** * @override - * @param {!Array<!WebInspector.TextRange>} ranges + * @param {!Array<!Common.TextRange>} ranges * @param {!Array<string>} texts - * @return {!Promise<?WebInspector.SourceMap.EditResult>} + * @return {!Promise<?SDK.SourceMap.EditResult>} */ editCompiled(ranges, texts) { - return Promise.resolve(/** @type {?WebInspector.SourceMap.EditResult} */ (null)); + return Promise.resolve(/** @type {?SDK.SourceMap.EditResult} */ (null)); } /** * @override * @param {number} lineNumber in compiled resource * @param {number} columnNumber in compiled resource - * @return {?WebInspector.SourceMapEntry} + * @return {?SDK.SourceMapEntry} */ findEntry(lineNumber, columnNumber) { var first = 0; @@ -334,7 +334,7 @@ /** * @param {string} sourceURL * @param {number} lineNumber - * @return {?WebInspector.SourceMapEntry} + * @return {?SDK.SourceMapEntry} */ firstSourceLineMapping(sourceURL, lineNumber) { var mappings = this._reversedMappings(sourceURL); @@ -345,7 +345,7 @@ /** * @param {number} lineNumber - * @param {!WebInspector.SourceMapEntry} mapping + * @param {!SDK.SourceMapEntry} mapping * @return {number} */ function lineComparator(lineNumber, mapping) { @@ -354,7 +354,7 @@ } /** - * @return {!Array<!WebInspector.SourceMapEntry>} + * @return {!Array<!SDK.SourceMapEntry>} */ mappings() { if (this._mappings === null) { @@ -362,12 +362,12 @@ this._eachSection(this._parseMap.bind(this)); this._json = null; } - return /** @type {!Array<!WebInspector.SourceMapEntry>} */ (this._mappings); + return /** @type {!Array<!SDK.SourceMapEntry>} */ (this._mappings); } /** * @param {string} sourceURL - * @return {!Array.<!WebInspector.SourceMapEntry>} + * @return {!Array.<!SDK.SourceMapEntry>} */ _reversedMappings(sourceURL) { if (!this._sourceInfos.has(sourceURL)) @@ -380,8 +380,8 @@ return info.reverseMappings; /** - * @param {!WebInspector.SourceMapEntry} a - * @param {!WebInspector.SourceMapEntry} b + * @param {!SDK.SourceMapEntry} a + * @param {!SDK.SourceMapEntry} b * @return {number} */ function sourceMappingComparator(a, b) { @@ -419,14 +419,14 @@ sourceRoot += '/'; for (var i = 0; i < sourceMap.sources.length; ++i) { var href = sourceRoot + sourceMap.sources[i]; - var url = WebInspector.ParsedURL.completeURL(this._sourceMappingURL, href) || href; + var url = Common.ParsedURL.completeURL(this._sourceMappingURL, href) || href; var source = sourceMap.sourcesContent && sourceMap.sourcesContent[i]; if (url === this._compiledURL && source) - url += WebInspector.UIString(' [sm]'); - this._sourceInfos.set(url, new WebInspector.TextSourceMap.SourceInfo(source, null)); + url += Common.UIString(' [sm]'); + this._sourceInfos.set(url, new SDK.TextSourceMap.SourceInfo(source, null)); sourcesList.push(url); } - sourceMap[WebInspector.TextSourceMap._sourcesListSymbol] = sourcesList; + sourceMap[SDK.TextSourceMap._sourcesListSymbol] = sourcesList; } /** @@ -439,9 +439,9 @@ var sourceLineNumber = 0; var sourceColumnNumber = 0; var nameIndex = 0; - var sources = map[WebInspector.TextSourceMap._sourcesListSymbol]; + var sources = map[SDK.TextSourceMap._sourcesListSymbol]; var names = map.names || []; - var stringCharIterator = new WebInspector.TextSourceMap.StringCharIterator(map.mappings); + var stringCharIterator = new SDK.TextSourceMap.StringCharIterator(map.mappings); var sourceURL = sources[sourceIndex]; while (true) { @@ -459,7 +459,7 @@ columnNumber += this._decodeVLQ(stringCharIterator); if (!stringCharIterator.hasNext() || this._isSeparator(stringCharIterator.peek())) { - this._mappings.push(new WebInspector.SourceMapEntry(lineNumber, columnNumber)); + this._mappings.push(new SDK.SourceMapEntry(lineNumber, columnNumber)); continue; } @@ -473,12 +473,12 @@ if (!stringCharIterator.hasNext() || this._isSeparator(stringCharIterator.peek())) { this._mappings.push( - new WebInspector.SourceMapEntry(lineNumber, columnNumber, sourceURL, sourceLineNumber, sourceColumnNumber)); + new SDK.SourceMapEntry(lineNumber, columnNumber, sourceURL, sourceLineNumber, sourceColumnNumber)); continue; } nameIndex += this._decodeVLQ(stringCharIterator); - this._mappings.push(new WebInspector.SourceMapEntry( + this._mappings.push(new SDK.SourceMapEntry( lineNumber, columnNumber, sourceURL, sourceLineNumber, sourceColumnNumber, names[nameIndex])); } } @@ -492,7 +492,7 @@ } /** - * @param {!WebInspector.TextSourceMap.StringCharIterator} stringCharIterator + * @param {!SDK.TextSourceMap.StringCharIterator} stringCharIterator * @return {number} */ _decodeVLQ(stringCharIterator) { @@ -500,10 +500,10 @@ var result = 0; var shift = 0; do { - var digit = WebInspector.TextSourceMap._base64Map[stringCharIterator.next()]; - result += (digit & WebInspector.TextSourceMap._VLQ_BASE_MASK) << shift; - shift += WebInspector.TextSourceMap._VLQ_BASE_SHIFT; - } while (digit & WebInspector.TextSourceMap._VLQ_CONTINUATION_MASK); + var digit = SDK.TextSourceMap._base64Map[stringCharIterator.next()]; + result += (digit & SDK.TextSourceMap._VLQ_BASE_MASK) << shift; + shift += SDK.TextSourceMap._VLQ_BASE_SHIFT; + } while (digit & SDK.TextSourceMap._VLQ_CONTINUATION_MASK); // Fix the sign. var negative = result & 1; @@ -513,13 +513,13 @@ /** * @param {string} url - * @param {!WebInspector.TextRange} textRange - * @return {!WebInspector.TextRange} + * @param {!Common.TextRange} textRange + * @return {!Common.TextRange} */ reverseMapTextRange(url, textRange) { /** * @param {!{lineNumber: number, columnNumber: number}} position - * @param {!WebInspector.SourceMapEntry} mapping + * @param {!SDK.SourceMapEntry} mapping * @return {number} */ function comparator(position, mapping) { @@ -536,20 +536,20 @@ var startMapping = mappings[startIndex]; var endMapping = mappings[endIndex]; - return new WebInspector.TextRange( + return new Common.TextRange( startMapping.lineNumber, startMapping.columnNumber, endMapping.lineNumber, endMapping.columnNumber); } }; -WebInspector.TextSourceMap._VLQ_BASE_SHIFT = 5; -WebInspector.TextSourceMap._VLQ_BASE_MASK = (1 << 5) - 1; -WebInspector.TextSourceMap._VLQ_CONTINUATION_MASK = 1 << 5; +SDK.TextSourceMap._VLQ_BASE_SHIFT = 5; +SDK.TextSourceMap._VLQ_BASE_MASK = (1 << 5) - 1; +SDK.TextSourceMap._VLQ_CONTINUATION_MASK = 1 << 5; /** * @unrestricted */ -WebInspector.TextSourceMap.StringCharIterator = class { +SDK.TextSourceMap.StringCharIterator = class { /** * @param {string} string */ @@ -583,10 +583,10 @@ /** * @unrestricted */ -WebInspector.TextSourceMap.SourceInfo = class { +SDK.TextSourceMap.SourceInfo = class { /** * @param {?string} content - * @param {?Array<!WebInspector.SourceMapEntry>} reverseMappings + * @param {?Array<!SDK.SourceMapEntry>} reverseMappings */ constructor(content, reverseMappings) { this.content = content; @@ -594,4 +594,4 @@ } }; -WebInspector.TextSourceMap._sourcesListSymbol = Symbol('sourcesList'); +SDK.TextSourceMap._sourcesListSymbol = Symbol('sourcesList');
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js index a96ba49e..2c02e63 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js
@@ -4,21 +4,21 @@ /** * @unrestricted */ -WebInspector.SubTargetsManager = class extends WebInspector.SDKModel { +SDK.SubTargetsManager = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.SubTargetsManager, target); - target.registerTargetDispatcher(new WebInspector.SubTargetsDispatcher(this)); + super(SDK.SubTargetsManager, target); + target.registerTargetDispatcher(new SDK.SubTargetsDispatcher(this)); this._lastAnonymousTargetId = 0; this._agent = target.targetAgent(); - /** @type {!Map<string, !WebInspector.Target>} */ + /** @type {!Map<string, !SDK.Target>} */ this._attachedTargets = new Map(); - /** @type {!Map<string, !WebInspector.SubTargetConnection>} */ + /** @type {!Map<string, !SDK.SubTargetConnection>} */ this._connections = new Map(); - /** @type {!Map<string, !WebInspector.PendingTarget>} */ + /** @type {!Map<string, !SDK.PendingTarget>} */ this._pendingTargets = new Map(); this._agent.setAutoAttach(true /* autoAttach */, true /* waitForDebuggerOnStart */); if (Runtime.experiments.isEnabled('autoAttachToCrossProcessSubframes')) @@ -29,17 +29,17 @@ this._agent.setRemoteLocations(defaultLocations); this._agent.setDiscoverTargets(true); } - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.MainFrameNavigated, this._mainFrameNavigated, this); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.SubTargetsManager} + * @param {!SDK.Target} target + * @return {?SDK.SubTargetsManager} */ static fromTarget(target) { - return /** @type {?WebInspector.SubTargetsManager} */ (target.model(WebInspector.SubTargetsManager)); + return /** @type {?SDK.SubTargetsManager} */ (target.model(SDK.SubTargetsManager)); } /** @@ -83,7 +83,7 @@ /** * @param {!Protocol.Target.TargetID} targetId - * @param {function(?WebInspector.TargetInfo)=} callback + * @param {function(?SDK.TargetInfo)=} callback */ getTargetInfo(targetId, callback) { /** @@ -97,7 +97,7 @@ return; } if (targetInfo) - callback(new WebInspector.TargetInfo(targetInfo)); + callback(new SDK.TargetInfo(targetInfo)); else callback(null); } @@ -106,18 +106,18 @@ /** * @param {string} targetId - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ targetForId(targetId) { return this._attachedTargets.get(targetId) || null; } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.TargetInfo} + * @param {!SDK.Target} target + * @return {?SDK.TargetInfo} */ targetInfo(target) { - return target[WebInspector.SubTargetsManager._InfoSymbol] || null; + return target[SDK.SubTargetsManager._InfoSymbol] || null; } /** @@ -126,21 +126,21 @@ */ _capabilitiesForType(type) { if (type === 'worker') - return WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log; + return SDK.Target.Capability.JS | SDK.Target.Capability.Log; if (type === 'service_worker') - return WebInspector.Target.Capability.Log | WebInspector.Target.Capability.Network | - WebInspector.Target.Capability.Target; + return SDK.Target.Capability.Log | SDK.Target.Capability.Network | + SDK.Target.Capability.Target; if (type === 'iframe') - return WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM | - WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log | - WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Target; + return SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | + SDK.Target.Capability.JS | SDK.Target.Capability.Log | + SDK.Target.Capability.Network | SDK.Target.Capability.Target; if (type === 'node') - return WebInspector.Target.Capability.JS; + return SDK.Target.Capability.JS; return 0; } /** - * @param {!WebInspector.TargetInfo} targetInfo + * @param {!SDK.TargetInfo} targetInfo * @param {boolean} waitingForDebugger */ _attachedToTarget(targetInfo, waitingForDebugger) { @@ -151,10 +151,10 @@ var parsedURL = targetInfo.url.asParsedURL(); targetName = parsedURL ? parsedURL.lastPathComponentWithFragment() : '#' + (++this._lastAnonymousTargetId); } - var target = WebInspector.targetManager.createTarget( + var target = SDK.targetManager.createTarget( targetName, this._capabilitiesForType(targetInfo.type), this._createConnection.bind(this, targetInfo.id), this.target()); - target[WebInspector.SubTargetsManager._InfoSymbol] = targetInfo; + target[SDK.SubTargetsManager._InfoSymbol] = targetInfo; this._attachedTargets.set(targetInfo.id, target); // Only pause new worker if debugging SW - we are going through the pause on start checkbox. @@ -170,7 +170,7 @@ pendingTarget = this._pendingTargets.get(targetInfo.id); } pendingTarget.notifyAttached(target); - this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.PendingTargetAttached, pendingTarget); + this.dispatchEventToListeners(SDK.SubTargetsManager.Events.PendingTargetAttached, pendingTarget); } /** @@ -179,7 +179,7 @@ * @return {!InspectorBackendClass.Connection} */ _createConnection(targetId, params) { - var connection = new WebInspector.SubTargetConnection(this._agent, targetId, params); + var connection = new SDK.SubTargetConnection(this._agent, targetId, params); this._connections.set(targetId, connection); return connection; } @@ -193,7 +193,7 @@ var connection = this._connections.get(targetId); connection._onDisconnect.call(null, 'target terminated'); this._connections.delete(targetId); - this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.PendingTargetDetached, this._pendingTargets.get(targetId)); + this.dispatchEventToListeners(SDK.SubTargetsManager.Events.PendingTargetDetached, this._pendingTargets.get(targetId)); } /** @@ -207,15 +207,15 @@ } /** - * @param {!WebInspector.TargetInfo} targetInfo + * @param {!SDK.TargetInfo} targetInfo */ _targetCreated(targetInfo) { var pendingTarget = this._pendingTargets.get(targetInfo.id); if (pendingTarget) return; - pendingTarget = new WebInspector.PendingTarget(targetInfo.id, targetInfo.title, targetInfo.type === 'node', this); + pendingTarget = new SDK.PendingTarget(targetInfo.id, targetInfo.title, targetInfo.type === 'node', this); this._pendingTargets.set(targetInfo.id, pendingTarget); - this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.PendingTargetAdded, pendingTarget); + this.dispatchEventToListeners(SDK.SubTargetsManager.Events.PendingTargetAdded, pendingTarget); } /** @@ -226,18 +226,18 @@ if (!pendingTarget) return; this._pendingTargets.delete(targetId); - this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.PendingTargetRemoved, pendingTarget); + this.dispatchEventToListeners(SDK.SubTargetsManager.Events.PendingTargetRemoved, pendingTarget); } /** - * @return {!Array<!WebInspector.PendingTarget>} + * @return {!Array<!SDK.PendingTarget>} */ pendingTargets() { return this._pendingTargets.valuesArray(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _mainFrameNavigated(event) { if (event.data.target() !== this.target()) @@ -255,22 +255,22 @@ }; /** @enum {symbol} */ -WebInspector.SubTargetsManager.Events = { +SDK.SubTargetsManager.Events = { PendingTargetAdded: Symbol('PendingTargetAdded'), PendingTargetRemoved: Symbol('PendingTargetRemoved'), PendingTargetAttached: Symbol('PendingTargetAttached'), PendingTargetDetached: Symbol('PendingTargetDetached'), }; -WebInspector.SubTargetsManager._InfoSymbol = Symbol('SubTargetInfo'); +SDK.SubTargetsManager._InfoSymbol = Symbol('SubTargetInfo'); /** * @implements {Protocol.TargetDispatcher} * @unrestricted */ -WebInspector.SubTargetsDispatcher = class { +SDK.SubTargetsDispatcher = class { /** - * @param {!WebInspector.SubTargetsManager} manager + * @param {!SDK.SubTargetsManager} manager */ constructor(manager) { this._manager = manager; @@ -281,7 +281,7 @@ * @param {!Protocol.Target.TargetInfo} targetInfo */ targetCreated(targetInfo) { - this._manager._targetCreated(new WebInspector.TargetInfo(targetInfo)); + this._manager._targetCreated(new SDK.TargetInfo(targetInfo)); } /** @@ -298,7 +298,7 @@ * @param {boolean} waitingForDebugger */ attachedToTarget(targetInfo, waitingForDebugger) { - this._manager._attachedToTarget(new WebInspector.TargetInfo(targetInfo), waitingForDebugger); + this._manager._attachedToTarget(new SDK.TargetInfo(targetInfo), waitingForDebugger); } /** @@ -323,7 +323,7 @@ * @implements {InspectorBackendClass.Connection} * @unrestricted */ -WebInspector.SubTargetConnection = class { +SDK.SubTargetConnection = class { /** * @param {!Protocol.TargetAgent} agent * @param {string} targetId @@ -356,7 +356,7 @@ /** * @unrestricted */ -WebInspector.TargetInfo = class { +SDK.TargetInfo = class { /** * @param {!Protocol.Target.TargetInfo} payload */ @@ -366,23 +366,23 @@ this.type = payload.type; this.canActivate = this.type === 'page' || this.type === 'iframe'; if (this.type === 'node') - this.title = WebInspector.UIString('Node: %s', this.url); + this.title = Common.UIString('Node: %s', this.url); else if (this.type === 'page' || this.type === 'iframe') this.title = payload.title; else - this.title = WebInspector.UIString('Worker: %s', this.url); + this.title = Common.UIString('Worker: %s', this.url); } }; /** * @unrestricted */ -WebInspector.PendingTarget = class { +SDK.PendingTarget = class { /** * @param {string} id * @param {string} title * @param {boolean} canConnect - * @param {?WebInspector.SubTargetsManager} manager + * @param {?SDK.SubTargetsManager} manager */ constructor(id, title, canConnect, manager) { this._id = id; @@ -403,7 +403,7 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { if (!this._manager) @@ -445,7 +445,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ notifyAttached(target) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js index bc72bc41..ea019a64 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
@@ -7,13 +7,13 @@ /** * @unrestricted */ -WebInspector.Target = class extends Protocol.TargetBase { +SDK.Target = class extends Protocol.TargetBase { /** - * @param {!WebInspector.TargetManager} targetManager + * @param {!SDK.TargetManager} targetManager * @param {string} name * @param {number} capabilitiesMask * @param {!InspectorBackendClass.Connection.Factory} connectionFactory - * @param {?WebInspector.Target} parentTarget + * @param {?SDK.Target} parentTarget */ constructor(targetManager, name, capabilitiesMask, connectionFactory, parentTarget) { super(connectionFactory); @@ -22,9 +22,9 @@ this._inspectedURL = ''; this._capabilitiesMask = capabilitiesMask; this._parentTarget = parentTarget; - this._id = WebInspector.Target._nextId++; + this._id = SDK.Target._nextId++; - /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ + /** @type {!Map.<!Function, !SDK.SDKModel>} */ this._modelByConstructor = new Map(); } @@ -33,7 +33,7 @@ */ isNodeJS() { // TODO(lushnikov): this is an unreliable way to detect Node.js targets. - return this._capabilitiesMask === WebInspector.Target.Capability.JS || this._isNodeJSForTest; + return this._capabilitiesMask === SDK.Target.Capability.JS || this._isNodeJSForTest; } setIsNodeJSForTest() { @@ -55,7 +55,7 @@ } /** - * @return {!WebInspector.TargetManager} + * @return {!SDK.TargetManager} */ targetManager() { return this._targetManager; @@ -81,46 +81,46 @@ * @return {boolean} */ hasBrowserCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.Browser); + return this.hasAllCapabilities(SDK.Target.Capability.Browser); } /** * @return {boolean} */ hasJSCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.JS); + return this.hasAllCapabilities(SDK.Target.Capability.JS); } /** * @return {boolean} */ hasLogCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.Log); + return this.hasAllCapabilities(SDK.Target.Capability.Log); } /** * @return {boolean} */ hasNetworkCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.Network); + return this.hasAllCapabilities(SDK.Target.Capability.Network); } /** * @return {boolean} */ hasTargetCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.Target); + return this.hasAllCapabilities(SDK.Target.Capability.Target); } /** * @return {boolean} */ hasDOMCapability() { - return this.hasAllCapabilities(WebInspector.Target.Capability.DOM); + return this.hasAllCapabilities(SDK.Target.Capability.DOM); } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ parentTarget() { return this._parentTarget; @@ -137,14 +137,14 @@ /** * @param {!Function} modelClass - * @return {?WebInspector.SDKModel} + * @return {?SDK.SDKModel} */ model(modelClass) { return this._modelByConstructor.get(modelClass) || null; } /** - * @return {!Array<!WebInspector.SDKModel>} + * @return {!Array<!SDK.SDKModel>} */ models() { return this._modelByConstructor.valuesArray(); @@ -166,16 +166,16 @@ this._inspectedURLName = parsedURL ? parsedURL.lastPathComponentWithFragment() : '#' + this._id; if (!this.parentTarget()) InspectorFrontendHost.inspectedURLChanged(inspectedURL || ''); - this._targetManager.dispatchEventToListeners(WebInspector.TargetManager.Events.InspectedURLChanged, this); + this._targetManager.dispatchEventToListeners(SDK.TargetManager.Events.InspectedURLChanged, this); if (!this._name) - this._targetManager.dispatchEventToListeners(WebInspector.TargetManager.Events.NameChanged, this); + this._targetManager.dispatchEventToListeners(SDK.TargetManager.Events.NameChanged, this); } }; /** * @enum {number} */ -WebInspector.Target.Capability = { +SDK.Target.Capability = { Browser: 1, DOM: 2, JS: 4, @@ -184,14 +184,14 @@ Target: 32 }; -WebInspector.Target._nextId = 1; +SDK.Target._nextId = 1; /** * @unrestricted */ -WebInspector.SDKObject = class extends WebInspector.Object { +SDK.SDKObject = class extends Common.Object { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { super(); @@ -199,7 +199,7 @@ } /** - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._target; @@ -209,10 +209,10 @@ /** * @unrestricted */ -WebInspector.SDKModel = class extends WebInspector.SDKObject { +SDK.SDKModel = class extends SDK.SDKObject { /** * @param {!Function} modelClass - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(modelClass, target) { super(target); @@ -237,10 +237,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetDisposed(event) { - var target = /** @type {!WebInspector.Target} */ (event.data); + var target = /** @type {!SDK.Target} */ (event.data); if (target !== this._target) return; this.dispose();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js index 133cabc..f7d7a98 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -7,15 +7,15 @@ /** * @unrestricted */ -WebInspector.TargetManager = class extends WebInspector.Object { +SDK.TargetManager = class extends Common.Object { constructor() { super(); - /** @type {!Array.<!WebInspector.Target>} */ + /** @type {!Array.<!SDK.Target>} */ this._targets = []; - /** @type {!Array.<!WebInspector.TargetManager.Observer>} */ + /** @type {!Array.<!SDK.TargetManager.Observer>} */ this._observers = []; this._observerCapabiliesMaskSymbol = Symbol('observerCapabilitiesMask'); - /** @type {!Map<symbol, !Array<{modelClass: !Function, thisObject: (!Object|undefined), listener: function(!WebInspector.Event)}>>} */ + /** @type {!Map<symbol, !Array<{modelClass: !Function, thisObject: (!Object|undefined), listener: function(!Common.Event)}>>} */ this._modelListeners = new Map(); this._isSuspended = false; } @@ -24,7 +24,7 @@ if (this._isSuspended) return; this._isSuspended = true; - this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendStateChanged); + this.dispatchEventToListeners(SDK.TargetManager.Events.SuspendStateChanged); for (var i = 0; i < this._targets.length; ++i) { for (var model of this._targets[i].models()) @@ -39,7 +39,7 @@ if (!this._isSuspended) throw new Error('Not suspended'); this._isSuspended = false; - this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendStateChanged); + this.dispatchEventToListeners(SDK.TargetManager.Events.SuspendStateChanged); var promises = []; for (var i = 0; i < this._targets.length; ++i) { @@ -69,8 +69,8 @@ } /** - * @param {!WebInspector.TargetManager.Events} eventName - * @param {!WebInspector.Event} event + * @param {!SDK.TargetManager.Events} eventName + * @param {!Common.Event} event */ _redispatchEvent(eventName, event) { this.dispatchEventToListeners(eventName, event.data); @@ -84,7 +84,7 @@ if (!this._targets.length) return; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this._targets[0]); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(this._targets[0]); if (!resourceTreeModel) return; @@ -94,7 +94,7 @@ /** * @param {!Function} modelClass * @param {symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ addModelListener(modelClass, eventType, listener, thisObject) { @@ -111,7 +111,7 @@ /** * @param {!Function} modelClass * @param {symbol} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeModelListener(modelClass, eventType, listener, thisObject) { @@ -135,7 +135,7 @@ } /** - * @param {!WebInspector.TargetManager.Observer} targetObserver + * @param {!SDK.TargetManager.Observer} targetObserver * @param {number=} capabilitiesMask */ observeTargets(targetObserver, capabilitiesMask) { @@ -147,7 +147,7 @@ } /** - * @param {!WebInspector.TargetManager.Observer} targetObserver + * @param {!SDK.TargetManager.Observer} targetObserver */ unobserveTargets(targetObserver) { delete targetObserver[this._observerCapabiliesMaskSymbol]; @@ -158,58 +158,58 @@ * @param {string} name * @param {number} capabilitiesMask * @param {!InspectorBackendClass.Connection.Factory} connectionFactory - * @param {?WebInspector.Target} parentTarget - * @return {!WebInspector.Target} + * @param {?SDK.Target} parentTarget + * @return {!SDK.Target} */ createTarget(name, capabilitiesMask, connectionFactory, parentTarget) { - var target = new WebInspector.Target(this, name, capabilitiesMask, connectionFactory, parentTarget); + var target = new SDK.Target(this, name, capabilitiesMask, connectionFactory, parentTarget); var logAgent = target.hasLogCapability() ? target.logAgent() : null; - /** @type {!WebInspector.ConsoleModel} */ - target.consoleModel = new WebInspector.ConsoleModel(target, logAgent); + /** @type {!SDK.ConsoleModel} */ + target.consoleModel = new SDK.ConsoleModel(target, logAgent); var networkManager = null; var resourceTreeModel = null; if (target.hasNetworkCapability()) - networkManager = new WebInspector.NetworkManager(target); + networkManager = new SDK.NetworkManager(target); if (networkManager && target.hasDOMCapability()) { - resourceTreeModel = new WebInspector.ResourceTreeModel( - target, networkManager, WebInspector.SecurityOriginManager.fromTarget(target)); - new WebInspector.NetworkLog(target, resourceTreeModel, networkManager); + resourceTreeModel = new SDK.ResourceTreeModel( + target, networkManager, SDK.SecurityOriginManager.fromTarget(target)); + new SDK.NetworkLog(target, resourceTreeModel, networkManager); } - /** @type {!WebInspector.RuntimeModel} */ - target.runtimeModel = new WebInspector.RuntimeModel(target); + /** @type {!SDK.RuntimeModel} */ + target.runtimeModel = new SDK.RuntimeModel(target); if (target.hasJSCapability()) - new WebInspector.DebuggerModel(target); + new SDK.DebuggerModel(target); if (resourceTreeModel) { - var domModel = new WebInspector.DOMModel(target); + var domModel = new SDK.DOMModel(target); // TODO(eostroukhov) CSSModel should not depend on RTM - new WebInspector.CSSModel(target, domModel); + new SDK.CSSModel(target, domModel); } - /** @type {?WebInspector.SubTargetsManager} */ - target.subTargetsManager = target.hasTargetCapability() ? new WebInspector.SubTargetsManager(target) : null; - /** @type {!WebInspector.CPUProfilerModel} */ - target.cpuProfilerModel = new WebInspector.CPUProfilerModel(target); - /** @type {!WebInspector.HeapProfilerModel} */ - target.heapProfilerModel = new WebInspector.HeapProfilerModel(target); + /** @type {?SDK.SubTargetsManager} */ + target.subTargetsManager = target.hasTargetCapability() ? new SDK.SubTargetsManager(target) : null; + /** @type {!SDK.CPUProfilerModel} */ + target.cpuProfilerModel = new SDK.CPUProfilerModel(target); + /** @type {!SDK.HeapProfilerModel} */ + target.heapProfilerModel = new SDK.HeapProfilerModel(target); - target.tracingManager = new WebInspector.TracingManager(target); + target.tracingManager = new SDK.TracingManager(target); if (target.subTargetsManager && target.hasBrowserCapability()) - target.serviceWorkerManager = new WebInspector.ServiceWorkerManager(target, target.subTargetsManager); + target.serviceWorkerManager = new SDK.ServiceWorkerManager(target, target.subTargetsManager); this.addTarget(target); return target; } /** - * @param {!WebInspector.Target} target - * @return {!Array<!WebInspector.TargetManager.Observer>} + * @param {!SDK.Target} target + * @return {!Array<!SDK.TargetManager.Observer>} */ _observersForTarget(target) { return this._observers.filter( @@ -217,23 +217,23 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ addTarget(target) { this._targets.push(target); - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (this._targets.length === 1 && resourceTreeModel) { - resourceTreeModel[WebInspector.TargetManager._listenersSymbol] = [ + resourceTreeModel[SDK.TargetManager._listenersSymbol] = [ setupRedispatch.call( - this, WebInspector.ResourceTreeModel.Events.MainFrameNavigated, - WebInspector.TargetManager.Events.MainFrameNavigated), - setupRedispatch.call(this, WebInspector.ResourceTreeModel.Events.Load, WebInspector.TargetManager.Events.Load), + this, SDK.ResourceTreeModel.Events.MainFrameNavigated, + SDK.TargetManager.Events.MainFrameNavigated), + setupRedispatch.call(this, SDK.ResourceTreeModel.Events.Load, SDK.TargetManager.Events.Load), setupRedispatch.call( - this, WebInspector.ResourceTreeModel.Events.PageReloadRequested, - WebInspector.TargetManager.Events.PageReloadRequested), + this, SDK.ResourceTreeModel.Events.PageReloadRequested, + SDK.TargetManager.Events.PageReloadRequested), setupRedispatch.call( - this, WebInspector.ResourceTreeModel.Events.WillReloadPage, - WebInspector.TargetManager.Events.WillReloadPage) + this, SDK.ResourceTreeModel.Events.WillReloadPage, + SDK.TargetManager.Events.WillReloadPage) ]; } var copy = this._observersForTarget(target); @@ -250,10 +250,10 @@ } /** - * @param {!WebInspector.ResourceTreeModel.Events} sourceEvent - * @param {!WebInspector.TargetManager.Events} targetEvent - * @return {!WebInspector.EventTarget.EventDescriptor} - * @this {WebInspector.TargetManager} + * @param {!SDK.ResourceTreeModel.Events} sourceEvent + * @param {!SDK.TargetManager.Events} targetEvent + * @return {!Common.EventTarget.EventDescriptor} + * @this {SDK.TargetManager} */ function setupRedispatch(sourceEvent, targetEvent) { return resourceTreeModel.addEventListener(sourceEvent, this._redispatchEvent.bind(this, targetEvent)); @@ -261,16 +261,16 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ removeTarget(target) { if (!this._targets.includes(target)) return; this._targets.remove(target); - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); - var treeModelListeners = resourceTreeModel && resourceTreeModel[WebInspector.TargetManager._listenersSymbol]; + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); + var treeModelListeners = resourceTreeModel && resourceTreeModel[SDK.TargetManager._listenersSymbol]; if (treeModelListeners) - WebInspector.EventTarget.removeEventListeners(treeModelListeners); + Common.EventTarget.removeEventListeners(treeModelListeners); var copy = this._observersForTarget(target); for (var i = 0; i < copy.length; ++i) @@ -288,7 +288,7 @@ /** * @param {number=} capabilitiesMask - * @return {!Array.<!WebInspector.Target>} + * @return {!Array.<!SDK.Target>} */ targets(capabilitiesMask) { if (!capabilitiesMask) @@ -300,7 +300,7 @@ /** * * @param {number} id - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ targetById(id) { for (var i = 0; i < this._targets.length; ++i) { @@ -311,26 +311,26 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ mainTarget() { return this._targets[0] || null; } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ suspendReload(target) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) resourceTreeModel.suspendReload(); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ resumeReload(target) { - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) setImmediate(resourceTreeModel.resumeReload.bind(resourceTreeModel)); } @@ -344,18 +344,18 @@ } _connectAndCreateMainTarget() { - var capabilities = WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM | - WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log | - WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Target; + var capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.DOM | + SDK.Target.Capability.JS | SDK.Target.Capability.Log | + SDK.Target.Capability.Network | SDK.Target.Capability.Target; if (Runtime.queryParam('isSharedWorker')) { - capabilities = WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.Log | - WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Target; + capabilities = SDK.Target.Capability.Browser | SDK.Target.Capability.Log | + SDK.Target.Capability.Network | SDK.Target.Capability.Target; } else if (Runtime.queryParam('v8only')) { - capabilities = WebInspector.Target.Capability.JS; + capabilities = SDK.Target.Capability.JS; } var target = - this.createTarget(WebInspector.UIString('Main'), capabilities, this._createMainConnection.bind(this), null); + this.createTarget(Common.UIString('Main'), capabilities, this._createMainConnection.bind(this), null); target.runtimeAgent().runIfWaitingForDebugger(); } @@ -366,11 +366,11 @@ _createMainConnection(params) { if (Runtime.queryParam('ws')) { var ws = 'ws://' + Runtime.queryParam('ws'); - this._mainConnection = new WebInspector.WebSocketConnection(ws, this._webSocketConnectionLostCallback, params); + this._mainConnection = new SDK.WebSocketConnection(ws, this._webSocketConnectionLostCallback, params); } else if (InspectorFrontendHost.isHostedMode()) { - this._mainConnection = new WebInspector.StubConnection(params); + this._mainConnection = new SDK.StubConnection(params); } else { - this._mainConnection = new WebInspector.MainConnection(params); + this._mainConnection = new SDK.MainConnection(params); } return this._mainConnection; } @@ -386,7 +386,7 @@ }; /** @enum {symbol} */ -WebInspector.TargetManager.Events = { +SDK.TargetManager.Events = { InspectedURLChanged: Symbol('InspectedURLChanged'), Load: Symbol('Load'), MainFrameNavigated: Symbol('MainFrameNavigated'), @@ -397,26 +397,26 @@ SuspendStateChanged: Symbol('SuspendStateChanged') }; -WebInspector.TargetManager._listenersSymbol = Symbol('WebInspector.TargetManager.Listeners'); +SDK.TargetManager._listenersSymbol = Symbol('SDK.TargetManager.Listeners'); /** * @interface */ -WebInspector.TargetManager.Observer = function() {}; +SDK.TargetManager.Observer = function() {}; -WebInspector.TargetManager.Observer.prototype = { +SDK.TargetManager.Observer.prototype = { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded: function(target) {}, /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved: function(target) {}, }; /** - * @type {!WebInspector.TargetManager} + * @type {!SDK.TargetManager} */ -WebInspector.targetManager = new WebInspector.TargetManager(); +SDK.targetManager = new SDK.TargetManager();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js index efa9c58..15eb987 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TracingManager.js
@@ -6,12 +6,12 @@ /** * @interface */ -WebInspector.TracingManagerClient = function() {}; +SDK.TracingManagerClient = function() {}; -WebInspector.TracingManagerClient.prototype = { +SDK.TracingManagerClient.prototype = { tracingStarted: function() {}, /** - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events */ traceEventsCollected: function(events) {}, tracingComplete: function() {}, @@ -28,22 +28,22 @@ /** * @unrestricted */ -WebInspector.TracingManager = class { +SDK.TracingManager = class { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { this._target = target; - target.registerTracingDispatcher(new WebInspector.TracingDispatcher(this)); + target.registerTracingDispatcher(new SDK.TracingDispatcher(this)); - /** @type {?WebInspector.TracingManagerClient} */ + /** @type {?SDK.TracingManagerClient} */ this._activeClient = null; this._eventBufferSize = 0; this._eventsRetrieved = 0; } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { return this._target; @@ -60,7 +60,7 @@ } /** - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events */ _eventsCollected(events) { this._activeClient.traceEventsCollected(events); @@ -81,7 +81,7 @@ } /** - * @param {!WebInspector.TracingManagerClient} client + * @param {!SDK.TracingManagerClient} client * @param {string} categoryFilter * @param {string} options * @param {function(?string)=} callback @@ -92,7 +92,7 @@ var bufferUsageReportingIntervalMs = 500; this._activeClient = client; this._target.tracingAgent().start( - categoryFilter, options, bufferUsageReportingIntervalMs, WebInspector.TracingManager.TransferMode.ReportEvents, + categoryFilter, options, bufferUsageReportingIntervalMs, SDK.TracingManager.TransferMode.ReportEvents, callback); this._activeClient.tracingStarted(); } @@ -123,9 +123,9 @@ s: string }} */ -WebInspector.TracingManager.EventPayload; +SDK.TracingManager.EventPayload; -WebInspector.TracingManager.TransferMode = { +SDK.TracingManager.TransferMode = { ReportEvents: 'ReportEvents', ReturnAsStream: 'ReturnAsStream' }; @@ -134,9 +134,9 @@ * @implements {Protocol.TracingDispatcher} * @unrestricted */ -WebInspector.TracingDispatcher = class { +SDK.TracingDispatcher = class { /** - * @param {!WebInspector.TracingManager} tracingManager + * @param {!SDK.TracingManager} tracingManager */ constructor(tracingManager) { this._tracingManager = tracingManager; @@ -154,7 +154,7 @@ /** * @override - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} data + * @param {!Array.<!SDK.TracingManager.EventPayload>} data */ dataCollected(data) { this._tracingManager._eventsCollected(data);
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js index 34511821..6961d7f 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js
@@ -7,9 +7,9 @@ /** * @unrestricted */ -WebInspector.TracingModel = class { +SDK.TracingModel = class { /** - * @param {!WebInspector.BackingStorage} backingStorage + * @param {!SDK.BackingStorage} backingStorage */ constructor(backingStorage) { this._backingStorage = backingStorage; @@ -39,7 +39,7 @@ * @return {boolean} */ static isAsyncPhase(phase) { - return WebInspector.TracingModel.isNestableAsyncPhase(phase) || phase === 'S' || phase === 'T' || phase === 'F' || + return SDK.TracingModel.isNestableAsyncPhase(phase) || phase === 'S' || phase === 'T' || phase === 'F' || phase === 'p'; } @@ -52,17 +52,17 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ static isTopLevelEvent(event) { - return event.hasCategory(WebInspector.TracingModel.TopLevelEventCategory) || - event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory) && + return event.hasCategory(SDK.TracingModel.TopLevelEventCategory) || + event.hasCategory(SDK.TracingModel.DevToolsMetadataEventCategory) && event.name === 'Program'; // Older timelines may have this instead of toplevel. } /** - * @param {!WebInspector.TracingManager.EventPayload} payload + * @param {!SDK.TracingManager.EventPayload} payload * @return {string|undefined} */ static _extractId(payload) { @@ -78,8 +78,8 @@ } /** - * @param {!WebInspector.TracingModel} tracingModel - * @return {?WebInspector.TracingModel.Thread} + * @param {!SDK.TracingModel} tracingModel + * @return {?SDK.TracingModel.Thread} * * TODO: Move this to a better place. This is here just for convenience o * re-use between modules. This really belongs to a higher level, since it @@ -105,20 +105,20 @@ tracingModel.devToolsMetadataEvents().filter(e => e.name === 'TracingStartedInBrowser'); if (tracingStartedInBrowser.length === 1) return tracingStartedInBrowser[0].thread; - WebInspector.console.error( + Common.console.error( 'Failed to find browser main thread in trace, some timeline features may be unavailable'); return null; } /** - * @return {!Array.<!WebInspector.TracingModel.Event>} + * @return {!Array.<!SDK.TracingModel.Event>} */ devToolsMetadataEvents() { return this._devToolsMetadataEvents; } /** - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events */ setEventsForTest(events) { this.reset(); @@ -127,7 +127,7 @@ } /** - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events */ addEvents(events) { for (var i = 0; i < events.length; ++i) @@ -146,7 +146,7 @@ } reset() { - /** @type {!Map<(number|string), !WebInspector.TracingModel.Process>} */ + /** @type {!Map<(number|string), !SDK.TracingModel.Process>} */ this._processById = new Map(); this._processByName = new Map(); this._minimumRecordTime = 0; @@ -156,25 +156,25 @@ this._backingStorage.reset(); this._firstWritePending = true; - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this._asyncEvents = []; - /** @type {!Map<string, !WebInspector.TracingModel.AsyncEvent>} */ + /** @type {!Map<string, !SDK.TracingModel.AsyncEvent>} */ this._openAsyncEvents = new Map(); - /** @type {!Map<string, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ + /** @type {!Map<string, !Array<!SDK.TracingModel.AsyncEvent>>} */ this._openNestableAsyncEvents = new Map(); - /** @type {!Map<string, !WebInspector.TracingModel.ProfileEventsGroup>} */ + /** @type {!Map<string, !SDK.TracingModel.ProfileEventsGroup>} */ this._profileGroups = new Map(); /** @type {!Map<string, !Set<string>>} */ this._parsedCategories = new Map(); } /** - * @param {!WebInspector.TracingManager.EventPayload} payload + * @param {!SDK.TracingManager.EventPayload} payload */ _addEvent(payload) { var process = this._processById.get(payload.pid); if (!process) { - process = new WebInspector.TracingModel.Process(this, payload.pid); + process = new SDK.TracingModel.Process(this, payload.pid); this._processById.set(payload.pid, process); } @@ -182,7 +182,7 @@ this._backingStorage.appendString(this._firstWritePending ? '[' : eventsDelimiter); this._firstWritePending = false; var stringPayload = JSON.stringify(payload); - var isAccessible = payload.ph === WebInspector.TracingModel.Phase.SnapshotObject; + var isAccessible = payload.ph === SDK.TracingModel.Phase.SnapshotObject; var backingStorage = null; var keepStringsLessThan = 10000; if (isAccessible && stringPayload.length > keepStringsLessThan) @@ -200,54 +200,54 @@ var event = process._addEvent(payload); if (!event) return; - if (payload.ph === WebInspector.TracingModel.Phase.Sample) { + if (payload.ph === SDK.TracingModel.Phase.Sample) { this._addSampleEvent(event); return; } // Build async event when we've got events from all threads & processes, so we can sort them and process in the // chronological order. However, also add individual async events to the thread flow (above), so we can easily // display them on the same chart as other events, should we choose so. - if (WebInspector.TracingModel.isAsyncPhase(payload.ph)) + if (SDK.TracingModel.isAsyncPhase(payload.ph)) this._asyncEvents.push(event); event._setBackingStorage(backingStorage); - if (event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory)) + if (event.hasCategory(SDK.TracingModel.DevToolsMetadataEventCategory)) this._devToolsMetadataEvents.push(event); - if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) + if (payload.ph !== SDK.TracingModel.Phase.Metadata) return; switch (payload.name) { - case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex: + case SDK.TracingModel.MetadataEvent.ProcessSortIndex: process._setSortIndex(payload.args['sort_index']); break; - case WebInspector.TracingModel.MetadataEvent.ProcessName: + case SDK.TracingModel.MetadataEvent.ProcessName: var processName = payload.args['name']; process._setName(processName); this._processByName.set(processName, process); break; - case WebInspector.TracingModel.MetadataEvent.ThreadSortIndex: + case SDK.TracingModel.MetadataEvent.ThreadSortIndex: process.threadById(payload.tid)._setSortIndex(payload.args['sort_index']); break; - case WebInspector.TracingModel.MetadataEvent.ThreadName: + case SDK.TracingModel.MetadataEvent.ThreadName: process.threadById(payload.tid)._setName(payload.args['name']); break; } } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addSampleEvent(event) { var group = this._profileGroups.get(event.id); if (group) group._addChild(event); else - this._profileGroups.set(event.id, new WebInspector.TracingModel.ProfileEventsGroup(event)); + this._profileGroups.set(event.id, new SDK.TracingModel.ProfileEventsGroup(event)); } /** * @param {string} id - * @return {?WebInspector.TracingModel.ProfileEventsGroup} + * @return {?SDK.TracingModel.ProfileEventsGroup} */ profileGroup(id) { return this._profileGroups.get(id) || null; @@ -268,15 +268,15 @@ } /** - * @return {!Array.<!WebInspector.TracingModel.Process>} + * @return {!Array.<!SDK.TracingModel.Process>} */ sortedProcesses() { - return WebInspector.TracingModel.NamedObject._sort(this._processById.valuesArray()); + return SDK.TracingModel.NamedObject._sort(this._processById.valuesArray()); } /** * @param {string} name - * @return {?WebInspector.TracingModel.Process} + * @return {?SDK.TracingModel.Process} */ processByName(name) { return this._processByName.get(name); @@ -285,7 +285,7 @@ /** * @param {string} processName * @param {string} threadName - * @return {?WebInspector.TracingModel.Thread} + * @return {?SDK.TracingModel.Thread} */ threadByName(processName, threadName) { var process = this.processByName(processName); @@ -293,10 +293,10 @@ } _processPendingAsyncEvents() { - this._asyncEvents.stableSort(WebInspector.TracingModel.Event.compareStartTime); + this._asyncEvents.stableSort(SDK.TracingModel.Event.compareStartTime); for (var i = 0; i < this._asyncEvents.length; ++i) { var event = this._asyncEvents[i]; - if (WebInspector.TracingModel.isNestableAsyncPhase(event.phase)) + if (SDK.TracingModel.isNestableAsyncPhase(event.phase)) this._addNestableAsyncEvent(event); else this._addAsyncEvent(event); @@ -322,10 +322,10 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addNestableAsyncEvent(event) { - var phase = WebInspector.TracingModel.Phase; + var phase = SDK.TracingModel.Phase; var key = event.categoriesString + '.' + event.id; var openEventsStack = this._openNestableAsyncEvents.get(key); @@ -335,7 +335,7 @@ openEventsStack = []; this._openNestableAsyncEvents.set(key, openEventsStack); } - var asyncEvent = new WebInspector.TracingModel.AsyncEvent(event); + var asyncEvent = new SDK.TracingModel.AsyncEvent(event); openEventsStack.push(asyncEvent); event.thread._addAsyncEvent(asyncEvent); break; @@ -359,10 +359,10 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addAsyncEvent(event) { - var phase = WebInspector.TracingModel.Phase; + var phase = SDK.TracingModel.Phase; var key = event.categoriesString + '.' + event.name + '.' + event.id; var asyncEvent = this._openAsyncEvents.get(key); @@ -371,7 +371,7 @@ console.error(`Event ${event.name} has already been started`); return; } - asyncEvent = new WebInspector.TracingModel.AsyncEvent(event); + asyncEvent = new SDK.TracingModel.AsyncEvent(event); this._openAsyncEvents.set(key, asyncEvent); event.thread._addAsyncEvent(asyncEvent); return; @@ -416,7 +416,7 @@ /** * @enum {string} */ -WebInspector.TracingModel.Phase = { +SDK.TracingModel.Phase = { Begin: 'B', End: 'E', Complete: 'X', @@ -439,26 +439,26 @@ DeleteObject: 'D' }; -WebInspector.TracingModel.MetadataEvent = { +SDK.TracingModel.MetadataEvent = { ProcessSortIndex: 'process_sort_index', ProcessName: 'process_name', ThreadSortIndex: 'thread_sort_index', ThreadName: 'thread_name' }; -WebInspector.TracingModel.TopLevelEventCategory = 'toplevel'; -WebInspector.TracingModel.DevToolsMetadataEventCategory = 'disabled-by-default-devtools.timeline'; -WebInspector.TracingModel.DevToolsTimelineEventCategory = 'disabled-by-default-devtools.timeline'; +SDK.TracingModel.TopLevelEventCategory = 'toplevel'; +SDK.TracingModel.DevToolsMetadataEventCategory = 'disabled-by-default-devtools.timeline'; +SDK.TracingModel.DevToolsTimelineEventCategory = 'disabled-by-default-devtools.timeline'; -WebInspector.TracingModel.FrameLifecycleEventCategory = 'cc,devtools'; +SDK.TracingModel.FrameLifecycleEventCategory = 'cc,devtools'; /** * @interface */ -WebInspector.BackingStorage = function() {}; +SDK.BackingStorage = function() {}; -WebInspector.BackingStorage.prototype = { +SDK.BackingStorage.prototype = { /** * @param {string} string */ @@ -478,13 +478,13 @@ /** * @unrestricted */ -WebInspector.TracingModel.Event = class { +SDK.TracingModel.Event = class { /** * @param {string} categories * @param {string} name - * @param {!WebInspector.TracingModel.Phase} phase + * @param {!SDK.TracingModel.Phase} phase * @param {number} startTime - * @param {!WebInspector.TracingModel.Thread} thread + * @param {!SDK.TracingModel.Thread} thread */ constructor(categories, name, phase, startTime, thread) { /** @type {string} */ @@ -493,11 +493,11 @@ this._parsedCategories = thread._model._parsedCategoriesForString(categories); /** @type {string} */ this.name = name; - /** @type {!WebInspector.TracingModel.Phase} */ + /** @type {!SDK.TracingModel.Phase} */ this.phase = phase; /** @type {number} */ this.startTime = startTime; - /** @type {!WebInspector.TracingModel.Thread} */ + /** @type {!SDK.TracingModel.Thread} */ this.thread = thread; /** @type {!Object} */ this.args = {}; @@ -507,13 +507,13 @@ } /** - * @param {!WebInspector.TracingManager.EventPayload} payload - * @param {!WebInspector.TracingModel.Thread} thread - * @return {!WebInspector.TracingModel.Event} + * @param {!SDK.TracingManager.EventPayload} payload + * @param {!SDK.TracingModel.Thread} thread + * @return {!SDK.TracingModel.Event} */ static fromPayload(payload, thread) { - var event = new WebInspector.TracingModel.Event( - payload.cat, payload.name, /** @type {!WebInspector.TracingModel.Phase} */ (payload.ph), payload.ts / 1000, + var event = new SDK.TracingModel.Event( + payload.cat, payload.name, /** @type {!SDK.TracingModel.Phase} */ (payload.ph), payload.ts / 1000, thread); if (payload.args) event.addArgs(payload.args); @@ -521,7 +521,7 @@ console.error('Missing mandatory event argument \'args\' at ' + payload.ts / 1000); if (typeof payload.dur === 'number') event.setEndTime((payload.ts + payload.dur) / 1000); - var id = WebInspector.TracingModel._extractId(payload); + var id = SDK.TracingModel._extractId(payload); if (typeof id !== 'undefined') event.id = id; if (payload.bind_id) @@ -531,8 +531,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} a - * @param {!WebInspector.TracingModel.Event} b + * @param {!SDK.TracingModel.Event} a + * @param {!SDK.TracingModel.Event} b * @return {number} */ static compareStartTime(a, b) { @@ -540,8 +540,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} a - * @param {!WebInspector.TracingModel.Event} b + * @param {!SDK.TracingModel.Event} a + * @param {!SDK.TracingModel.Event} b * @return {number} */ static compareStartAndEndTime(a, b) { @@ -550,8 +550,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} a - * @param {!WebInspector.TracingModel.Event} b + * @param {!SDK.TracingModel.Event} a + * @param {!SDK.TracingModel.Event} b * @return {number} */ static orderedCompareStartTime(a, b) { @@ -594,7 +594,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} endEvent + * @param {!SDK.TracingModel.Event} endEvent */ _complete(endEvent) { if (endEvent.args) @@ -615,25 +615,25 @@ /** * @unrestricted */ -WebInspector.TracingModel.ObjectSnapshot = class extends WebInspector.TracingModel.Event { +SDK.TracingModel.ObjectSnapshot = class extends SDK.TracingModel.Event { /** * @param {string} category * @param {string} name * @param {number} startTime - * @param {!WebInspector.TracingModel.Thread} thread + * @param {!SDK.TracingModel.Thread} thread */ constructor(category, name, startTime, thread) { - super(category, name, WebInspector.TracingModel.Phase.SnapshotObject, startTime, thread); + super(category, name, SDK.TracingModel.Phase.SnapshotObject, startTime, thread); } /** - * @param {!WebInspector.TracingManager.EventPayload} payload - * @param {!WebInspector.TracingModel.Thread} thread - * @return {!WebInspector.TracingModel.ObjectSnapshot} + * @param {!SDK.TracingManager.EventPayload} payload + * @param {!SDK.TracingModel.Thread} thread + * @return {!SDK.TracingModel.ObjectSnapshot} */ static fromPayload(payload, thread) { - var snapshot = new WebInspector.TracingModel.ObjectSnapshot(payload.cat, payload.name, payload.ts / 1000, thread); - var id = WebInspector.TracingModel._extractId(payload); + var snapshot = new SDK.TracingModel.ObjectSnapshot(payload.cat, payload.name, payload.ts / 1000, thread); + var id = SDK.TracingModel._extractId(payload); if (typeof id !== 'undefined') snapshot.id = id; if (!payload.args || !payload.args['snapshot']) { @@ -667,7 +667,7 @@ var payload = JSON.parse(result); callback(payload['args']['snapshot']); } catch (e) { - WebInspector.console.error('Malformed event data in backing storage'); + Common.console.error('Malformed event data in backing storage'); callback(null); } } @@ -698,9 +698,9 @@ /** * @unrestricted */ -WebInspector.TracingModel.AsyncEvent = class extends WebInspector.TracingModel.Event { +SDK.TracingModel.AsyncEvent = class extends SDK.TracingModel.Event { /** - * @param {!WebInspector.TracingModel.Event} startEvent + * @param {!SDK.TracingModel.Event} startEvent */ constructor(startEvent) { super(startEvent.categoriesString, startEvent.name, startEvent.phase, startEvent.startTime, startEvent.thread); @@ -709,12 +709,12 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addStep(event) { this.steps.push(event); - if (event.phase === WebInspector.TracingModel.Phase.AsyncEnd || - event.phase === WebInspector.TracingModel.Phase.NestableAsyncEnd) { + if (event.phase === SDK.TracingModel.Phase.AsyncEnd || + event.phase === SDK.TracingModel.Phase.NestableAsyncEnd) { this.setEndTime(event.startTime); // FIXME: ideally, we shouldn't do this, but this makes the logic of converting // async console events to sync ones much simpler. @@ -726,17 +726,17 @@ /** * @unrestricted */ -WebInspector.TracingModel.ProfileEventsGroup = class { +SDK.TracingModel.ProfileEventsGroup = class { /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ constructor(event) { - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this.children = [event]; } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addChild(event) { this.children.push(event); @@ -746,14 +746,14 @@ /** * @unrestricted */ -WebInspector.TracingModel.NamedObject = class { +SDK.TracingModel.NamedObject = class { /** - * @param {!Array.<!WebInspector.TracingModel.NamedObject>} array + * @param {!Array.<!SDK.TracingModel.NamedObject>} array */ static _sort(array) { /** - * @param {!WebInspector.TracingModel.NamedObject} a - * @param {!WebInspector.TracingModel.NamedObject} b + * @param {!SDK.TracingModel.NamedObject} a + * @param {!SDK.TracingModel.NamedObject} b */ function comparator(a, b) { return a._sortIndex !== b._sortIndex ? a._sortIndex - b._sortIndex : a.name().localeCompare(b.name()); @@ -787,16 +787,16 @@ /** * @unrestricted */ -WebInspector.TracingModel.Process = class extends WebInspector.TracingModel.NamedObject { +SDK.TracingModel.Process = class extends SDK.TracingModel.NamedObject { /** - * @param {!WebInspector.TracingModel} model + * @param {!SDK.TracingModel} model * @param {number} id */ constructor(model, id) { super(); this._setName('Process ' + id); this._id = id; - /** @type {!Map<number, !WebInspector.TracingModel.Thread>} */ + /** @type {!Map<number, !SDK.TracingModel.Thread>} */ this._threads = new Map(); this._threadByName = new Map(); this._model = model; @@ -811,12 +811,12 @@ /** * @param {number} id - * @return {!WebInspector.TracingModel.Thread} + * @return {!SDK.TracingModel.Thread} */ threadById(id) { var thread = this._threads.get(id); if (!thread) { - thread = new WebInspector.TracingModel.Thread(this, id); + thread = new SDK.TracingModel.Thread(this, id); this._threads.set(id, thread); } return thread; @@ -824,7 +824,7 @@ /** * @param {string} name - * @return {?WebInspector.TracingModel.Thread} + * @return {?SDK.TracingModel.Thread} */ threadByName(name) { return this._threadByName.get(name) || null; @@ -832,34 +832,34 @@ /** * @param {string} name - * @param {!WebInspector.TracingModel.Thread} thread + * @param {!SDK.TracingModel.Thread} thread */ _setThreadByName(name, thread) { this._threadByName.set(name, thread); } /** - * @param {!WebInspector.TracingManager.EventPayload} payload - * @return {?WebInspector.TracingModel.Event} event + * @param {!SDK.TracingManager.EventPayload} payload + * @return {?SDK.TracingModel.Event} event */ _addEvent(payload) { return this.threadById(payload.tid)._addEvent(payload); } /** - * @return {!Array.<!WebInspector.TracingModel.Thread>} + * @return {!Array.<!SDK.TracingModel.Thread>} */ sortedThreads() { - return WebInspector.TracingModel.NamedObject._sort(this._threads.valuesArray()); + return SDK.TracingModel.NamedObject._sort(this._threads.valuesArray()); } }; /** * @unrestricted */ -WebInspector.TracingModel.Thread = class extends WebInspector.TracingModel.NamedObject { +SDK.TracingModel.Thread = class extends SDK.TracingModel.NamedObject { /** - * @param {!WebInspector.TracingModel.Process} process + * @param {!SDK.TracingModel.Process} process * @param {number} id */ constructor(process, id) { @@ -873,9 +873,9 @@ } tracingComplete() { - this._asyncEvents.stableSort(WebInspector.TracingModel.Event.compareStartAndEndTime); - this._events.stableSort(WebInspector.TracingModel.Event.compareStartTime); - var phases = WebInspector.TracingModel.Phase; + this._asyncEvents.stableSort(SDK.TracingModel.Event.compareStartAndEndTime); + this._events.stableSort(SDK.TracingModel.Event.compareStartTime); + var phases = SDK.TracingModel.Phase; var stack = []; for (var i = 0; i < this._events.length; ++i) { var e = this._events[i]; @@ -905,14 +905,14 @@ } /** - * @param {!WebInspector.TracingManager.EventPayload} payload - * @return {?WebInspector.TracingModel.Event} event + * @param {!SDK.TracingManager.EventPayload} payload + * @return {?SDK.TracingModel.Event} event */ _addEvent(payload) { - var event = payload.ph === WebInspector.TracingModel.Phase.SnapshotObject ? - WebInspector.TracingModel.ObjectSnapshot.fromPayload(payload, this) : - WebInspector.TracingModel.Event.fromPayload(payload, this); - if (WebInspector.TracingModel.isTopLevelEvent(event)) { + var event = payload.ph === SDK.TracingModel.Phase.SnapshotObject ? + SDK.TracingModel.ObjectSnapshot.fromPayload(payload, this) : + SDK.TracingModel.Event.fromPayload(payload, this); + if (SDK.TracingModel.isTopLevelEvent(event)) { // Discard nested "top-level" events. if (this._lastTopLevelEvent && this._lastTopLevelEvent.endTime > event.startTime) return null; @@ -923,7 +923,7 @@ } /** - * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent + * @param {!SDK.TracingModel.AsyncEvent} asyncEvent */ _addAsyncEvent(asyncEvent) { this._asyncEvents.push(asyncEvent); @@ -946,21 +946,21 @@ } /** - * @return {!WebInspector.TracingModel.Process} + * @return {!SDK.TracingModel.Process} */ process() { return this._process; } /** - * @return {!Array.<!WebInspector.TracingModel.Event>} + * @return {!Array.<!SDK.TracingModel.Event>} */ events() { return this._events; } /** - * @return {!Array.<!WebInspector.TracingModel.AsyncEvent>} + * @return {!Array.<!SDK.TracingModel.AsyncEvent>} */ asyncEvents() { return this._asyncEvents;
diff --git a/third_party/WebKit/Source/devtools/front_end/security/SecurityModel.js b/third_party/WebKit/Source/devtools/front_end/security/SecurityModel.js index 95c8445..a91ca22 100644 --- a/third_party/WebKit/Source/devtools/front_end/security/SecurityModel.js +++ b/third_party/WebKit/Source/devtools/front_end/security/SecurityModel.js
@@ -4,26 +4,26 @@ /** * @unrestricted */ -WebInspector.SecurityModel = class extends WebInspector.SDKModel { +Security.SecurityModel = class extends SDK.SDKModel { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { - super(WebInspector.SecurityModel, target); - this._dispatcher = new WebInspector.SecurityDispatcher(this); + super(Security.SecurityModel, target); + this._dispatcher = new Security.SecurityDispatcher(this); this._securityAgent = target.securityAgent(); target.registerSecurityDispatcher(this._dispatcher); this._securityAgent.enable(); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.SecurityModel} + * @param {!SDK.Target} target + * @return {?Security.SecurityModel} */ static fromTarget(target) { - var model = /** @type {?WebInspector.SecurityModel} */ (target.model(WebInspector.SecurityModel)); + var model = /** @type {?Security.SecurityModel} */ (target.model(Security.SecurityModel)); if (!model) - model = new WebInspector.SecurityModel(target); + model = new Security.SecurityModel(target); return model; } @@ -34,8 +34,8 @@ */ static SecurityStateComparator(a, b) { var securityStateMap; - if (WebInspector.SecurityModel._symbolicToNumericSecurityState) { - securityStateMap = WebInspector.SecurityModel._symbolicToNumericSecurityState; + if (Security.SecurityModel._symbolicToNumericSecurityState) { + securityStateMap = Security.SecurityModel._symbolicToNumericSecurityState; } else { securityStateMap = new Map(); var ordering = [ @@ -47,7 +47,7 @@ ]; for (var i = 0; i < ordering.length; i++) securityStateMap.set(ordering[i], i + 1); - WebInspector.SecurityModel._symbolicToNumericSecurityState = securityStateMap; + Security.SecurityModel._symbolicToNumericSecurityState = securityStateMap; } var aScore = securityStateMap.get(a) || 0; var bScore = securityStateMap.get(b) || 0; @@ -61,7 +61,7 @@ }; /** @enum {symbol} */ -WebInspector.SecurityModel.Events = { +Security.SecurityModel.Events = { SecurityStateChanged: Symbol('SecurityStateChanged') }; @@ -69,7 +69,7 @@ /** * @unrestricted */ -WebInspector.PageSecurityState = class { +Security.PageSecurityState = class { /** * @param {!Protocol.Security.SecurityState} securityState * @param {!Array<!Protocol.Security.SecurityStateExplanation>} explanations @@ -88,7 +88,7 @@ * @implements {Protocol.SecurityDispatcher} * @unrestricted */ -WebInspector.SecurityDispatcher = class { +Security.SecurityDispatcher = class { constructor(model) { this._model = model; } @@ -101,8 +101,8 @@ * @param {boolean=} schemeIsCryptographic */ securityStateChanged(securityState, explanations, insecureContentStatus, schemeIsCryptographic) { - var pageSecurityState = new WebInspector.PageSecurityState( + var pageSecurityState = new Security.PageSecurityState( securityState, explanations || [], insecureContentStatus || null, schemeIsCryptographic || false); - this._model.dispatchEventToListeners(WebInspector.SecurityModel.Events.SecurityStateChanged, pageSecurityState); + this._model.dispatchEventToListeners(Security.SecurityModel.Events.SecurityStateChanged, pageSecurityState); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js index d22e3990..4a9c4221 100644 --- a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
@@ -2,46 +2,46 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.SecurityPanel = class extends WebInspector.PanelWithSidebar { +Security.SecurityPanel = class extends UI.PanelWithSidebar { constructor() { super('security'); - this._mainView = new WebInspector.SecurityMainView(this); + this._mainView = new Security.SecurityMainView(this); - this._sidebarMainViewElement = new WebInspector.SecurityPanelSidebarTreeElement( - WebInspector.UIString('Overview'), this._setVisibleView.bind(this, this._mainView), + this._sidebarMainViewElement = new Security.SecurityPanelSidebarTreeElement( + Common.UIString('Overview'), this._setVisibleView.bind(this, this._mainView), 'security-main-view-sidebar-tree-item', 'lock-icon'); this._sidebarTree = - new WebInspector.SecurityPanelSidebarTree(this._sidebarMainViewElement, this.showOrigin.bind(this)); + new Security.SecurityPanelSidebarTree(this._sidebarMainViewElement, this.showOrigin.bind(this)); this.panelSidebarElement().appendChild(this._sidebarTree.element); - /** @type {!Map<!Protocol.Network.LoaderId, !WebInspector.NetworkRequest>} */ + /** @type {!Map<!Protocol.Network.LoaderId, !SDK.NetworkRequest>} */ this._lastResponseReceivedForLoaderId = new Map(); - /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPanel.OriginState>} */ + /** @type {!Map<!Security.SecurityPanel.Origin, !Security.SecurityPanel.OriginState>} */ this._origins = new Map(); - /** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, number>} */ + /** @type {!Map<!Network.NetworkLogView.MixedContentFilterValues, number>} */ this._filterRequestCounts = new Map(); - /** @type {!Map<!WebInspector.Target, !Array<!WebInspector.EventTarget.EventDescriptor>>}*/ + /** @type {!Map<!SDK.Target, !Array<!Common.EventTarget.EventDescriptor>>}*/ this._eventListeners = new Map(); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Network); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Network); } /** - * @return {!WebInspector.SecurityPanel} + * @return {!Security.SecurityPanel} */ static _instance() { - return /** @type {!WebInspector.SecurityPanel} */ (self.runtime.sharedInstance(WebInspector.SecurityPanel)); + return /** @type {!Security.SecurityPanel} */ (self.runtime.sharedInstance(Security.SecurityPanel)); } /** * @param {string} text - * @param {!WebInspector.SecurityPanel} panel + * @param {!Security.SecurityPanel} panel * @return {!Element} */ static createCertificateViewerButton(text, panel) { @@ -71,7 +71,7 @@ } e.consume(); - WebInspector.multitargetNetworkManager.getCertificate(origin, certificateCallback); + SDK.multitargetNetworkManager.getCertificate(origin, certificateCallback); } return createTextButton(text, showCertificateViewer, 'security-certificate-button'); @@ -103,10 +103,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSecurityStateChanged(event) { - var data = /** @type {!WebInspector.PageSecurityState} */ (event.data); + var data = /** @type {!Security.PageSecurityState} */ (event.data); var securityState = /** @type {!Protocol.Security.SecurityState} */ (data.securityState); var explanations = /** @type {!Array<!Protocol.Security.SecurityStateExplanation>} */ (data.explanations); var insecureContentStatus = /** @type {?Protocol.Security.InsecureContentStatus} */ (data.insecureContentStatus); @@ -119,12 +119,12 @@ this._sidebarMainViewElement.select(); } /** - * @param {!WebInspector.SecurityPanel.Origin} origin + * @param {!Security.SecurityPanel.Origin} origin */ showOrigin(origin) { var originState = this._origins.get(origin); if (!originState.originView) - originState.originView = new WebInspector.SecurityOriginView(this, origin, originState); + originState.originView = new Security.SecurityOriginView(this, origin, originState); this._setVisibleView(originState.originView); } @@ -146,7 +146,7 @@ } /** - * @param {!WebInspector.VBox} view + * @param {!UI.VBox} view */ _setVisibleView(view) { if (this._visibleView === view) @@ -162,19 +162,19 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResponseReceived(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); - if (request.resourceType() === WebInspector.resourceTypes.Document) + var request = /** @type {!SDK.NetworkRequest} */ (event.data); + if (request.resourceType() === Common.resourceTypes.Document) this._lastResponseReceivedForLoaderId.set(request.loaderId, request); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _processRequest(request) { - var origin = WebInspector.ParsedURL.extractOrigin(request.url); + var origin = Common.ParsedURL.extractOrigin(request.url); if (!origin) { // We don't handle resources like data: URIs. Most of them don't affect the lock icon. @@ -218,29 +218,29 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onRequestFinished(event) { - var request = /** @type {!WebInspector.NetworkRequest} */ (event.data); + var request = /** @type {!SDK.NetworkRequest} */ (event.data); this._updateFilterRequestCounts(request); this._processRequest(request); } /** - * @param {!WebInspector.NetworkRequest} request + * @param {!SDK.NetworkRequest} request */ _updateFilterRequestCounts(request) { if (request.mixedContentType === Protocol.Network.RequestMixedContentType.None) return; - /** @type {!WebInspector.NetworkLogView.MixedContentFilterValues} */ - var filterKey = WebInspector.NetworkLogView.MixedContentFilterValues.All; + /** @type {!Network.NetworkLogView.MixedContentFilterValues} */ + var filterKey = Network.NetworkLogView.MixedContentFilterValues.All; if (request.wasBlocked()) - filterKey = WebInspector.NetworkLogView.MixedContentFilterValues.Blocked; + filterKey = Network.NetworkLogView.MixedContentFilterValues.Blocked; else if (request.mixedContentType === Protocol.Network.RequestMixedContentType.Blockable) - filterKey = WebInspector.NetworkLogView.MixedContentFilterValues.BlockOverridden; + filterKey = Network.NetworkLogView.MixedContentFilterValues.BlockOverridden; else if (request.mixedContentType === Protocol.Network.RequestMixedContentType.OptionallyBlockable) - filterKey = WebInspector.NetworkLogView.MixedContentFilterValues.Displayed; + filterKey = Network.NetworkLogView.MixedContentFilterValues.Displayed; if (!this._filterRequestCounts.has(filterKey)) this._filterRequestCounts.set(filterKey, 1); @@ -251,7 +251,7 @@ } /** - * @param {!WebInspector.NetworkLogView.MixedContentFilterValues} filterKey + * @param {!Network.NetworkLogView.MixedContentFilterValues} filterKey * @return {number} */ filterRequestCount(filterKey) { @@ -259,7 +259,7 @@ } showCertificateViewer() { - var securityModel = WebInspector.SecurityModel.fromTarget(this._target); + var securityModel = Security.SecurityModel.fromTarget(this._target); securityModel.showCertificateViewer(); } @@ -269,44 +269,44 @@ * @return {!Protocol.Security.SecurityState} */ _securityStateMin(stateA, stateB) { - return WebInspector.SecurityModel.SecurityStateComparator(stateA, stateB) < 0 ? stateA : stateB; + return Security.SecurityModel.SecurityStateComparator(stateA, stateB) < 0 ? stateA : stateB; } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { if (this._target) return; var listeners = []; - var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); + var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); if (resourceTreeModel) { listeners = listeners.concat([ resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated, this), + SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated, this), resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.InterstitialShown, this._onInterstitialShown, this), + SDK.ResourceTreeModel.Events.InterstitialShown, this._onInterstitialShown, this), resourceTreeModel.addEventListener( - WebInspector.ResourceTreeModel.Events.InterstitialHidden, this._onInterstitialHidden, this), + SDK.ResourceTreeModel.Events.InterstitialHidden, this._onInterstitialHidden, this), ]); } - var networkManager = WebInspector.NetworkManager.fromTarget(target); + var networkManager = SDK.NetworkManager.fromTarget(target); if (networkManager) { listeners = listeners.concat([ networkManager.addEventListener( - WebInspector.NetworkManager.Events.ResponseReceived, this._onResponseReceived, this), + SDK.NetworkManager.Events.ResponseReceived, this._onResponseReceived, this), networkManager.addEventListener( - WebInspector.NetworkManager.Events.RequestFinished, this._onRequestFinished, this), + SDK.NetworkManager.Events.RequestFinished, this._onRequestFinished, this), ]); } - var securityModel = WebInspector.SecurityModel.fromTarget(target); + var securityModel = Security.SecurityModel.fromTarget(target); if (securityModel) { listeners = listeners.concat([securityModel.addEventListener( - WebInspector.SecurityModel.Events.SecurityStateChanged, this._onSecurityStateChanged, this)]); + Security.SecurityModel.Events.SecurityStateChanged, this._onSecurityStateChanged, this)]); } this._target = target; @@ -315,7 +315,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { if (this._target !== target) @@ -323,12 +323,12 @@ delete this._target; - WebInspector.EventTarget.removeEventListeners(this._eventListeners.get(target)); + Common.EventTarget.removeEventListeners(this._eventListeners.get(target)); this._eventListeners.delete(target); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onMainFrameNavigated(event) { var frame = /** type {!Protocol.Page.Frame}*/ (event.data); @@ -344,7 +344,7 @@ this._mainView.refreshExplanations(); if (request) { - var origin = WebInspector.ParsedURL.extractOrigin(request.url); + var origin = Common.ParsedURL.extractOrigin(request.url); this._sidebarTree.setMainOrigin(origin); this._processRequest(request); } @@ -364,25 +364,25 @@ }; /** @typedef {string} */ -WebInspector.SecurityPanel.Origin; +Security.SecurityPanel.Origin; /** * @typedef {Object} * @property {!Protocol.Security.SecurityState} securityState - Current security state of the origin. * @property {?Protocol.Network.SecurityDetails} securityDetails - Security details of the origin, if available. * @property {?Promise<>} certificateDetailsPromise - Certificate details of the origin. - * @property {?WebInspector.SecurityOriginView} originView - Current SecurityOriginView corresponding to origin. + * @property {?Security.SecurityOriginView} originView - Current SecurityOriginView corresponding to origin. */ -WebInspector.SecurityPanel.OriginState; +Security.SecurityPanel.OriginState; /** * @unrestricted */ -WebInspector.SecurityPanelSidebarTree = class extends TreeOutlineInShadow { +Security.SecurityPanelSidebarTree = class extends TreeOutlineInShadow { /** - * @param {!WebInspector.SecurityPanelSidebarTreeElement} mainViewElement - * @param {function(!WebInspector.SecurityPanel.Origin)} showOriginInPanel + * @param {!Security.SecurityPanelSidebarTreeElement} mainViewElement + * @param {function(!Security.SecurityPanel.Origin)} showOriginInPanel */ constructor(mainViewElement, showOriginInPanel) { super(); @@ -393,11 +393,11 @@ this._showOriginInPanel = showOriginInPanel; this._mainOrigin = null; - /** @type {!Map<!WebInspector.SecurityPanelSidebarTree.OriginGroupName, !TreeElement>} */ + /** @type {!Map<!Security.SecurityPanelSidebarTree.OriginGroupName, !TreeElement>} */ this._originGroups = new Map(); - for (var key in WebInspector.SecurityPanelSidebarTree.OriginGroupName) { - var originGroupName = WebInspector.SecurityPanelSidebarTree.OriginGroupName[key]; + for (var key in Security.SecurityPanelSidebarTree.OriginGroupName) { + var originGroupName = Security.SecurityPanelSidebarTree.OriginGroupName[key]; var originGroup = new TreeElement(originGroupName, true); originGroup.selectable = false; originGroup.expand(); @@ -408,13 +408,13 @@ this._clearOriginGroups(); // This message will be removed by clearOrigins() during the first new page load after the panel was opened. - var mainViewReloadMessage = new TreeElement(WebInspector.UIString('Reload to view details')); + var mainViewReloadMessage = new TreeElement(Common.UIString('Reload to view details')); mainViewReloadMessage.selectable = false; mainViewReloadMessage.listItemElement.classList.add('security-main-view-reload-message'); - this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.MainOrigin) + this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.MainOrigin) .appendChild(mainViewReloadMessage); - /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPanelSidebarTreeElement>} */ + /** @type {!Map<!Security.SecurityPanel.Origin, !Security.SecurityPanelSidebarTreeElement>} */ this._elementsByOrigin = new Map(); } @@ -422,8 +422,8 @@ * @param {boolean} hidden */ toggleOriginsList(hidden) { - for (var key in WebInspector.SecurityPanelSidebarTree.OriginGroupName) { - var originGroupName = WebInspector.SecurityPanelSidebarTree.OriginGroupName[key]; + for (var key in Security.SecurityPanelSidebarTree.OriginGroupName) { + var originGroupName = Security.SecurityPanelSidebarTree.OriginGroupName[key]; var group = this._originGroups.get(originGroupName); if (group) group.hidden = hidden; @@ -431,11 +431,11 @@ } /** - * @param {!WebInspector.SecurityPanel.Origin} origin + * @param {!Security.SecurityPanel.Origin} origin * @param {!Protocol.Security.SecurityState} securityState */ addOrigin(origin, securityState) { - var originElement = new WebInspector.SecurityPanelSidebarTreeElement( + var originElement = new Security.SecurityPanelSidebarTreeElement( origin, this._showOriginInPanel.bind(this, origin), 'security-sidebar-tree-item', 'security-property'); originElement.listItemElement.title = origin; this._elementsByOrigin.set(origin, originElement); @@ -443,34 +443,34 @@ } /** - * @param {!WebInspector.SecurityPanel.Origin} origin + * @param {!Security.SecurityPanel.Origin} origin */ setMainOrigin(origin) { this._mainOrigin = origin; } /** - * @param {!WebInspector.SecurityPanel.Origin} origin + * @param {!Security.SecurityPanel.Origin} origin * @param {!Protocol.Security.SecurityState} securityState */ updateOrigin(origin, securityState) { var originElement = - /** @type {!WebInspector.SecurityPanelSidebarTreeElement} */ (this._elementsByOrigin.get(origin)); + /** @type {!Security.SecurityPanelSidebarTreeElement} */ (this._elementsByOrigin.get(origin)); originElement.setSecurityState(securityState); var newParent; if (origin === this._mainOrigin) { - newParent = this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.MainOrigin); + newParent = this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.MainOrigin); } else { switch (securityState) { case Protocol.Security.SecurityState.Secure: - newParent = this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.Secure); + newParent = this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.Secure); break; case Protocol.Security.SecurityState.Unknown: - newParent = this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.Unknown); + newParent = this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.Unknown); break; default: - newParent = this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.NonSecure); + newParent = this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.NonSecure); break; } } @@ -492,7 +492,7 @@ originGroup.removeChildren(); originGroup.hidden = true; } - this._originGroups.get(WebInspector.SecurityPanelSidebarTree.OriginGroupName.MainOrigin).hidden = false; + this._originGroups.get(Security.SecurityPanelSidebarTree.OriginGroupName.MainOrigin).hidden = false; } clearOrigins() { @@ -506,17 +506,17 @@ * Note: The names are used as keys into a map, so they must be distinct from each other. * @enum {string} */ -WebInspector.SecurityPanelSidebarTree.OriginGroupName = { - MainOrigin: WebInspector.UIString('Main Origin'), - NonSecure: WebInspector.UIString('Non-Secure Origins'), - Secure: WebInspector.UIString('Secure Origins'), - Unknown: WebInspector.UIString('Unknown / Canceled') +Security.SecurityPanelSidebarTree.OriginGroupName = { + MainOrigin: Common.UIString('Main Origin'), + NonSecure: Common.UIString('Non-Secure Origins'), + Secure: Common.UIString('Secure Origins'), + Unknown: Common.UIString('Unknown / Canceled') }; /** * @unrestricted */ -WebInspector.SecurityPanelSidebarTreeElement = class extends TreeElement { +Security.SecurityPanelSidebarTreeElement = class extends TreeElement { /** * @param {string} text * @param {function()} selectCallback @@ -535,12 +535,12 @@ } /** - * @param {!WebInspector.SecurityPanelSidebarTreeElement} a - * @param {!WebInspector.SecurityPanelSidebarTreeElement} b + * @param {!Security.SecurityPanelSidebarTreeElement} a + * @param {!Security.SecurityPanelSidebarTreeElement} b * @return {number} */ static SecurityStateComparator(a, b) { - return WebInspector.SecurityModel.SecurityStateComparator(a.securityState(), b.securityState()); + return Security.SecurityModel.SecurityStateComparator(a.securityState(), b.securityState()); } /** @@ -575,9 +575,9 @@ /** * @unrestricted */ -WebInspector.SecurityMainView = class extends WebInspector.VBox { +Security.SecurityMainView = class extends UI.VBox { /** - * @param {!WebInspector.SecurityPanel} panel + * @param {!Security.SecurityPanel} panel */ constructor(panel) { super(true); @@ -598,13 +598,13 @@ // Fill the security summary section. this._summarySection.createChild('div', 'security-summary-section-title').textContent = - WebInspector.UIString('Security Overview'); + Common.UIString('Security Overview'); var lockSpectrum = this._summarySection.createChild('div', 'lock-spectrum'); - lockSpectrum.createChild('div', 'lock-icon lock-icon-secure').title = WebInspector.UIString('Secure'); - lockSpectrum.createChild('div', 'lock-icon lock-icon-neutral').title = WebInspector.UIString('Not Secure'); + lockSpectrum.createChild('div', 'lock-icon lock-icon-secure').title = Common.UIString('Secure'); + lockSpectrum.createChild('div', 'lock-icon lock-icon-neutral').title = Common.UIString('Not Secure'); lockSpectrum.createChild('div', 'lock-icon lock-icon-insecure').title = - WebInspector.UIString('Not Secure (Broken)'); + Common.UIString('Not Secure (Broken)'); this._summarySection.createChild('div', 'triangle-pointer-container') .createChild('div', 'triangle-pointer-wrapper') @@ -629,8 +629,8 @@ text.createChild('div').textContent = explanation.description; if (explanation.hasCertificate) { - text.appendChild(WebInspector.SecurityPanel.createCertificateViewerButton( - WebInspector.UIString('View certificate'), this._panel)); + text.appendChild(Security.SecurityPanel.createCertificateViewerButton( + Common.UIString('View certificate'), this._panel)); } return text; @@ -651,10 +651,10 @@ this._securityState = newSecurityState; this._summarySection.classList.add('security-summary-' + this._securityState); var summaryExplanationStrings = { - 'unknown': WebInspector.UIString('The security of this page is unknown.'), - 'insecure': WebInspector.UIString('This page is not secure (broken HTTPS).'), - 'neutral': WebInspector.UIString('This page is not secure.'), - 'secure': WebInspector.UIString('This page is secure (valid HTTPS).') + 'unknown': Common.UIString('The security of this page is unknown.'), + 'insecure': Common.UIString('This page is not secure (broken HTTPS).'), + 'neutral': Common.UIString('This page is not secure.'), + 'secure': Common.UIString('This page is secure (valid HTTPS).') }; this._summaryText.textContent = summaryExplanationStrings[this._securityState]; @@ -688,8 +688,8 @@ !this._insecureContentStatus.ranContentWithCertErrors)) { this._addExplanation(this._securityExplanationsMain, /** @type {!Protocol.Security.SecurityStateExplanation} */ ({ 'securityState': Protocol.Security.SecurityState.Secure, - 'summary': WebInspector.UIString('Secure Resources'), - 'description': WebInspector.UIString('All resources on this page are served securely.') + 'summary': Common.UIString('Secure Resources'), + 'description': Common.UIString('All resources on this page are served securely.') })); } } @@ -703,33 +703,33 @@ if (this._insecureContentStatus.ranMixedContent) this._addMixedContentExplanation( this._securityExplanationsMain, this._insecureContentStatus.ranInsecureContentStyle, - WebInspector.UIString('Active Mixed Content'), - WebInspector.UIString( + Common.UIString('Active Mixed Content'), + Common.UIString( 'You have recently allowed non-secure content (such as scripts or iframes) to run on this site.'), - WebInspector.NetworkLogView.MixedContentFilterValues.BlockOverridden, + Network.NetworkLogView.MixedContentFilterValues.BlockOverridden, showBlockOverriddenMixedContentInNetworkPanel); if (this._insecureContentStatus.displayedMixedContent) this._addMixedContentExplanation( this._securityExplanationsMain, this._insecureContentStatus.displayedInsecureContentStyle, - WebInspector.UIString('Mixed Content'), WebInspector.UIString('The site includes HTTP resources.'), - WebInspector.NetworkLogView.MixedContentFilterValues.Displayed, showDisplayedMixedContentInNetworkPanel); + Common.UIString('Mixed Content'), Common.UIString('The site includes HTTP resources.'), + Network.NetworkLogView.MixedContentFilterValues.Displayed, showDisplayedMixedContentInNetworkPanel); } - if (this._panel.filterRequestCount(WebInspector.NetworkLogView.MixedContentFilterValues.Blocked) > 0) + if (this._panel.filterRequestCount(Network.NetworkLogView.MixedContentFilterValues.Blocked) > 0) this._addMixedContentExplanation( this._securityExplanationsExtra, Protocol.Security.SecurityState.Info, - WebInspector.UIString('Blocked mixed content'), - WebInspector.UIString('Your page requested non-secure resources that were blocked.'), - WebInspector.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedMixedContentInNetworkPanel); + Common.UIString('Blocked mixed content'), + Common.UIString('Your page requested non-secure resources that were blocked.'), + Network.NetworkLogView.MixedContentFilterValues.Blocked, showBlockedMixedContentInNetworkPanel); /** * @param {!Event} e */ function showDisplayedMixedContentInNetworkPanel(e) { e.consume(); - WebInspector.NetworkPanel.revealAndFilter([{ - filterType: WebInspector.NetworkLogView.FilterType.MixedContent, - filterValue: WebInspector.NetworkLogView.MixedContentFilterValues.Displayed + Network.NetworkPanel.revealAndFilter([{ + filterType: Network.NetworkLogView.FilterType.MixedContent, + filterValue: Network.NetworkLogView.MixedContentFilterValues.Displayed }]); } @@ -738,9 +738,9 @@ */ function showBlockOverriddenMixedContentInNetworkPanel(e) { e.consume(); - WebInspector.NetworkPanel.revealAndFilter([{ - filterType: WebInspector.NetworkLogView.FilterType.MixedContent, - filterValue: WebInspector.NetworkLogView.MixedContentFilterValues.BlockOverridden + Network.NetworkPanel.revealAndFilter([{ + filterType: Network.NetworkLogView.FilterType.MixedContent, + filterValue: Network.NetworkLogView.MixedContentFilterValues.BlockOverridden }]); } @@ -749,9 +749,9 @@ */ function showBlockedMixedContentInNetworkPanel(e) { e.consume(); - WebInspector.NetworkPanel.revealAndFilter([{ - filterType: WebInspector.NetworkLogView.FilterType.MixedContent, - filterValue: WebInspector.NetworkLogView.MixedContentFilterValues.Blocked + Network.NetworkPanel.revealAndFilter([{ + filterType: Network.NetworkLogView.FilterType.MixedContent, + filterValue: Network.NetworkLogView.MixedContentFilterValues.Blocked }]); } } @@ -761,7 +761,7 @@ * @param {!Protocol.Security.SecurityState} securityState * @param {string} summary * @param {string} description - * @param {!WebInspector.NetworkLogView.MixedContentFilterValues} filterKey + * @param {!Network.NetworkLogView.MixedContentFilterValues} filterKey * @param {!Function} networkFilterFn */ _addMixedContentExplanation(parent, securityState, summary, description, filterKey, networkFilterFn) { @@ -778,15 +778,15 @@ // instead of pointing them to the Network panel to get prompted // to refresh. var refreshPrompt = explanation.createChild('div', 'security-mixed-content'); - refreshPrompt.textContent = WebInspector.UIString('Reload the page to record requests for HTTP resources.'); + refreshPrompt.textContent = Common.UIString('Reload the page to record requests for HTTP resources.'); return; } var requestsAnchor = explanation.createChild('div', 'security-mixed-content link'); if (filterRequestCount === 1) { - requestsAnchor.textContent = WebInspector.UIString('View %d request in Network Panel', filterRequestCount); + requestsAnchor.textContent = Common.UIString('View %d request in Network Panel', filterRequestCount); } else { - requestsAnchor.textContent = WebInspector.UIString('View %d requests in Network Panel', filterRequestCount); + requestsAnchor.textContent = Common.UIString('View %d requests in Network Panel', filterRequestCount); } requestsAnchor.href = ''; requestsAnchor.addEventListener('click', networkFilterFn); @@ -803,8 +803,8 @@ this._addExplanation( this._securityExplanationsMain, /** @type {!Protocol.Security.SecurityStateExplanation} */ ({ 'securityState': this._insecureContentStatus.ranInsecureContentStyle, - 'summary': WebInspector.UIString('Active content with certificate errors'), - 'description': WebInspector.UIString( + 'summary': Common.UIString('Active content with certificate errors'), + 'description': Common.UIString( 'You have recently allowed content loaded with certificate errors (such as scripts or iframes) to run on this site.') })); } @@ -812,8 +812,8 @@ if (this._insecureContentStatus.displayedContentWithCertErrors) { this._addExplanation(this._securityExplanationsMain, /** @type {!Protocol.Security.SecurityStateExplanation} */ ({ 'securityState': this._insecureContentStatus.displayedInsecureContentStyle, - 'summary': WebInspector.UIString('Content with certificate errors'), - 'description': WebInspector.UIString( + 'summary': Common.UIString('Content with certificate errors'), + 'description': Common.UIString( 'This site includes resources that were loaded with certificate errors.') })); } @@ -823,11 +823,11 @@ /** * @unrestricted */ -WebInspector.SecurityOriginView = class extends WebInspector.VBox { +Security.SecurityOriginView = class extends UI.VBox { /** - * @param {!WebInspector.SecurityPanel} panel - * @param {!WebInspector.SecurityPanel.Origin} origin - * @param {!WebInspector.SecurityPanel.OriginState} originState + * @param {!Security.SecurityPanel} panel + * @param {!Security.SecurityPanel.Origin} origin + * @param {!Security.SecurityPanel.OriginState} originState */ constructor(panel, origin, originState) { super(); @@ -845,12 +845,12 @@ // TODO(lgarron): Highlight the origin scheme. https://crbug.com/523589 originDisplay.createChild('span', 'origin').textContent = origin; var originNetworkLink = titleSection.createChild('div', 'link'); - originNetworkLink.textContent = WebInspector.UIString('View requests in Network Panel'); + originNetworkLink.textContent = Common.UIString('View requests in Network Panel'); function showOriginRequestsInNetworkPanel() { - var parsedURL = new WebInspector.ParsedURL(origin); - WebInspector.NetworkPanel.revealAndFilter([ - {filterType: WebInspector.NetworkLogView.FilterType.Domain, filterValue: parsedURL.host}, - {filterType: WebInspector.NetworkLogView.FilterType.Scheme, filterValue: parsedURL.scheme} + var parsedURL = new Common.ParsedURL(origin); + Network.NetworkPanel.revealAndFilter([ + {filterType: Network.NetworkLogView.FilterType.Domain, filterValue: parsedURL.host}, + {filterType: Network.NetworkLogView.FilterType.Scheme, filterValue: parsedURL.scheme} ]); } originNetworkLink.addEventListener('click', showOriginRequestsInNetworkPanel, false); @@ -858,9 +858,9 @@ if (originState.securityDetails) { var connectionSection = this.element.createChild('div', 'origin-view-section'); connectionSection.createChild('div', 'origin-view-section-title').textContent = - WebInspector.UIString('Connection'); + Common.UIString('Connection'); - var table = new WebInspector.SecurityDetailsTable(); + var table = new Security.SecurityDetailsTable(); connectionSection.appendChild(table.element()); table.addRow('Protocol', originState.securityDetails.protocol); if (originState.securityDetails.keyExchange) @@ -874,70 +874,70 @@ // Create the certificate section outside the callback, so that it appears in the right place. var certificateSection = this.element.createChild('div', 'origin-view-section'); certificateSection.createChild('div', 'origin-view-section-title').textContent = - WebInspector.UIString('Certificate'); + Common.UIString('Certificate'); if (originState.securityDetails.signedCertificateTimestampList.length) { // Create the Certificate Transparency section outside the callback, so that it appears in the right place. var sctSection = this.element.createChild('div', 'origin-view-section'); sctSection.createChild('div', 'origin-view-section-title').textContent = - WebInspector.UIString('Certificate Transparency'); + Common.UIString('Certificate Transparency'); } var sanDiv = this._createSanDiv(originState.securityDetails.sanList); var validFromString = new Date(1000 * originState.securityDetails.validFrom).toUTCString(); var validUntilString = new Date(1000 * originState.securityDetails.validTo).toUTCString(); - table = new WebInspector.SecurityDetailsTable(); + table = new Security.SecurityDetailsTable(); certificateSection.appendChild(table.element()); - table.addRow(WebInspector.UIString('Subject'), originState.securityDetails.subjectName); - table.addRow(WebInspector.UIString('SAN'), sanDiv); - table.addRow(WebInspector.UIString('Valid From'), validFromString); - table.addRow(WebInspector.UIString('Valid Until'), validUntilString); - table.addRow(WebInspector.UIString('Issuer'), originState.securityDetails.issuer); + table.addRow(Common.UIString('Subject'), originState.securityDetails.subjectName); + table.addRow(Common.UIString('SAN'), sanDiv); + table.addRow(Common.UIString('Valid From'), validFromString); + table.addRow(Common.UIString('Valid Until'), validUntilString); + table.addRow(Common.UIString('Issuer'), originState.securityDetails.issuer); table.addRow( - '', WebInspector.SecurityPanel.createCertificateViewerButton2( - WebInspector.UIString('Open full certificate details'), origin)); + '', Security.SecurityPanel.createCertificateViewerButton2( + Common.UIString('Open full certificate details'), origin)); if (!originState.securityDetails.signedCertificateTimestampList.length) return; // Show summary of SCT(s) of Certificate Transparency. - var sctSummaryTable = new WebInspector.SecurityDetailsTable(); + var sctSummaryTable = new Security.SecurityDetailsTable(); sctSummaryTable.element().classList.add('sct-summary'); sctSection.appendChild(sctSummaryTable.element()); for (var i = 0; i < originState.securityDetails.signedCertificateTimestampList.length; i++) { var sct = originState.securityDetails.signedCertificateTimestampList[i]; sctSummaryTable.addRow( - WebInspector.UIString('SCT'), sct.logDescription + ' (' + sct.origin + ', ' + sct.status + ')'); + Common.UIString('SCT'), sct.logDescription + ' (' + sct.origin + ', ' + sct.status + ')'); } // Show detailed SCT(s) of Certificate Transparency. var sctTableWrapper = sctSection.createChild('div', 'sct-details'); sctTableWrapper.classList.add('hidden'); for (var i = 0; i < originState.securityDetails.signedCertificateTimestampList.length; i++) { - var sctTable = new WebInspector.SecurityDetailsTable(); + var sctTable = new Security.SecurityDetailsTable(); sctTableWrapper.appendChild(sctTable.element()); var sct = originState.securityDetails.signedCertificateTimestampList[i]; - sctTable.addRow(WebInspector.UIString('Log Name'), sct.logDescription); - sctTable.addRow(WebInspector.UIString('Log ID'), sct.logId.replace(/(.{2})/g, '$1 ')); - sctTable.addRow(WebInspector.UIString('Validation Status'), sct.status); - sctTable.addRow(WebInspector.UIString('Source'), sct.origin); - sctTable.addRow(WebInspector.UIString('Issued At'), new Date(sct.timestamp).toUTCString()); - sctTable.addRow(WebInspector.UIString('Hash Algorithm'), sct.hashAlgorithm); - sctTable.addRow(WebInspector.UIString('Signature Algorithm'), sct.signatureAlgorithm); - sctTable.addRow(WebInspector.UIString('Signature Data'), sct.signatureData.replace(/(.{2})/g, '$1 ')); + sctTable.addRow(Common.UIString('Log Name'), sct.logDescription); + sctTable.addRow(Common.UIString('Log ID'), sct.logId.replace(/(.{2})/g, '$1 ')); + sctTable.addRow(Common.UIString('Validation Status'), sct.status); + sctTable.addRow(Common.UIString('Source'), sct.origin); + sctTable.addRow(Common.UIString('Issued At'), new Date(sct.timestamp).toUTCString()); + sctTable.addRow(Common.UIString('Hash Algorithm'), sct.hashAlgorithm); + sctTable.addRow(Common.UIString('Signature Algorithm'), sct.signatureAlgorithm); + sctTable.addRow(Common.UIString('Signature Data'), sct.signatureData.replace(/(.{2})/g, '$1 ')); } // Add link to toggle between displaying of the summary of the SCT(s) and the detailed SCT(s). var toggleSctsDetailsLink = sctSection.createChild('div', 'link'); toggleSctsDetailsLink.classList.add('sct-toggle'); - toggleSctsDetailsLink.textContent = WebInspector.UIString('Show full details'); + toggleSctsDetailsLink.textContent = Common.UIString('Show full details'); function toggleSctDetailsDisplay() { var isDetailsShown = !sctTableWrapper.classList.contains('hidden'); if (isDetailsShown) - toggleSctsDetailsLink.textContent = WebInspector.UIString('Show full details'); + toggleSctsDetailsLink.textContent = Common.UIString('Show full details'); else - toggleSctsDetailsLink.textContent = WebInspector.UIString('Hide full details'); + toggleSctsDetailsLink.textContent = Common.UIString('Hide full details'); sctSummaryTable.element().classList.toggle('hidden'); sctTableWrapper.classList.toggle('hidden'); } @@ -946,19 +946,19 @@ var noteSection = this.element.createChild('div', 'origin-view-section'); // TODO(lgarron): Fix the issue and then remove this section. See comment in SecurityPanel._processRequest(). noteSection.createChild('div').textContent = - WebInspector.UIString('The security details above are from the first inspected response.'); + Common.UIString('The security details above are from the first inspected response.'); } else if (originState.securityState !== Protocol.Security.SecurityState.Unknown) { var notSecureSection = this.element.createChild('div', 'origin-view-section'); notSecureSection.createChild('div', 'origin-view-section-title').textContent = - WebInspector.UIString('Not Secure'); + Common.UIString('Not Secure'); notSecureSection.createChild('div').textContent = - WebInspector.UIString('Your connection to this origin is not secure.'); + Common.UIString('Your connection to this origin is not secure.'); } else { var noInfoSection = this.element.createChild('div', 'origin-view-section'); noInfoSection.createChild('div', 'origin-view-section-title').textContent = - WebInspector.UIString('No Security Information'); + Common.UIString('No Security Information'); noInfoSection.createChild('div').textContent = - WebInspector.UIString('No security details are available for this origin.'); + Common.UIString('No security details are available for this origin.'); } } @@ -969,7 +969,7 @@ _createSanDiv(sanList) { var sanDiv = createElement('div'); if (sanList.length === 0) { - sanDiv.textContent = WebInspector.UIString('(N/A)'); + sanDiv.textContent = Common.UIString('(N/A)'); sanDiv.classList.add('empty-san'); } else { var truncatedNumToShow = 2; @@ -987,10 +987,10 @@ function toggleSANTruncation() { if (sanDiv.classList.contains('truncated-san')) { sanDiv.classList.remove('truncated-san'); - truncatedSANToggle.textContent = WebInspector.UIString('Show less'); + truncatedSANToggle.textContent = Common.UIString('Show less'); } else { sanDiv.classList.add('truncated-san'); - truncatedSANToggle.textContent = WebInspector.UIString('Show more (%d total)', sanList.length); + truncatedSANToggle.textContent = Common.UIString('Show more (%d total)', sanList.length); } } truncatedSANToggle.addEventListener('click', toggleSANTruncation, false); @@ -1016,7 +1016,7 @@ /** * @unrestricted */ -WebInspector.SecurityDetailsTable = class { +Security.SecurityDetailsTable = class { constructor() { this._element = createElement('table'); this._element.classList.add('details-table');
diff --git a/third_party/WebKit/Source/devtools/front_end/security/module.json b/third_party/WebKit/Source/devtools/front_end/security/module.json index 7ac6f3c..30a912dea 100644 --- a/third_party/WebKit/Source/devtools/front_end/security/module.json +++ b/third_party/WebKit/Source/devtools/front_end/security/module.json
@@ -6,7 +6,7 @@ "id": "security", "title": "Security", "order": 80, - "className": "WebInspector.SecurityPanel" + "className": "Security.SecurityPanel" } ], "dependencies": ["network", "platform", "ui", "sdk"],
diff --git a/third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js b/third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js index 0439d4f..4db082eb 100644 --- a/third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js +++ b/third_party/WebKit/Source/devtools/front_end/services/ServiceManager.js
@@ -4,20 +4,20 @@ /** * @unrestricted */ -WebInspector.ServiceManager = class { +Services.ServiceManager = class { /** * @param {string} serviceName - * @return {!Promise<?WebInspector.ServiceManager.Service>} + * @return {!Promise<?Services.ServiceManager.Service>} */ createRemoteService(serviceName) { if (!this._remoteConnection) { var url = Runtime.queryParam('service-backend'); if (!url) { console.error('No endpoint address specified'); - return /** @type {!Promise<?WebInspector.ServiceManager.Service>} */ (Promise.resolve(null)); + return /** @type {!Promise<?Services.ServiceManager.Service>} */ (Promise.resolve(null)); } this._remoteConnection = - new WebInspector.ServiceManager.Connection(new WebInspector.ServiceManager.RemoteServicePort(url)); + new Services.ServiceManager.Connection(new Services.ServiceManager.RemoteServicePort(url)); } return this._remoteConnection._createService(serviceName); } @@ -26,7 +26,7 @@ * @param {string} appName * @param {string} serviceName * @param {boolean} isSharedWorker - * @return {!Promise<?WebInspector.ServiceManager.Service>} + * @return {!Promise<?Services.ServiceManager.Service>} */ createAppService(appName, serviceName, isSharedWorker) { var url = appName + '.js'; @@ -36,7 +36,7 @@ var worker = isSharedWorker ? new SharedWorker(url, appName) : new Worker(url); var connection = - new WebInspector.ServiceManager.Connection(new WebInspector.ServiceManager.WorkerServicePort(worker)); + new Services.ServiceManager.Connection(new Services.ServiceManager.WorkerServicePort(worker)); return connection._createService(serviceName); } }; @@ -44,7 +44,7 @@ /** * @unrestricted */ -WebInspector.ServiceManager.Connection = class { +Services.ServiceManager.Connection = class { /** * @param {!ServicePort} port */ @@ -55,13 +55,13 @@ this._lastId = 1; /** @type {!Map<number, function(?Object)>}*/ this._callbacks = new Map(); - /** @type {!Map<string, !WebInspector.ServiceManager.Service>}*/ + /** @type {!Map<string, !Services.ServiceManager.Service>}*/ this._services = new Map(); } /** * @param {string} serviceName - * @return {!Promise<?WebInspector.ServiceManager.Service>} + * @return {!Promise<?Services.ServiceManager.Service>} */ _createService(serviceName) { return this._sendCommand(serviceName + '.create').then(result => { @@ -69,14 +69,14 @@ console.error('Could not initialize service: ' + serviceName); return null; } - var service = new WebInspector.ServiceManager.Service(this, serviceName, result.id); + var service = new Services.ServiceManager.Service(this, serviceName, result.id); this._services.set(serviceName + ':' + result.id, service); return service; }); } /** - * @param {!WebInspector.ServiceManager.Service} service + * @param {!Services.ServiceManager.Service} service */ _serviceDisposed(service) { this._services.delete(service._serviceName + ':' + service._objectId); @@ -144,9 +144,9 @@ /** * @unrestricted */ -WebInspector.ServiceManager.Service = class { +Services.ServiceManager.Service = class { /** - * @param {!WebInspector.ServiceManager.Connection} connection + * @param {!Services.ServiceManager.Connection} connection * @param {string} serviceName * @param {string} objectId */ @@ -205,7 +205,7 @@ * @implements {ServicePort} * @unrestricted */ -WebInspector.ServiceManager.RemoteServicePort = class { +Services.ServiceManager.RemoteServicePort = class { /** * @param {string} url */ @@ -233,7 +233,7 @@ /** * @param {function(boolean)} fulfill - * @this {WebInspector.ServiceManager.RemoteServicePort} + * @this {Services.ServiceManager.RemoteServicePort} */ function promiseBody(fulfill) { var socket; @@ -247,7 +247,7 @@ } /** - * @this {WebInspector.ServiceManager.RemoteServicePort} + * @this {Services.ServiceManager.RemoteServicePort} */ function onConnect() { this._socket = socket; @@ -256,7 +256,7 @@ /** * @param {!Event} event - * @this {WebInspector.ServiceManager.RemoteServicePort} + * @this {Services.ServiceManager.RemoteServicePort} */ function onMessage(event) { this._messageHandler(event.data); @@ -299,7 +299,7 @@ * @implements {ServicePort} * @unrestricted */ -WebInspector.ServiceManager.WorkerServicePort = class { +Services.ServiceManager.WorkerServicePort = class { /** * @param {!Worker|!SharedWorker} worker */ @@ -320,7 +320,7 @@ /** * @param {!Event} event - * @this {WebInspector.ServiceManager.WorkerServicePort} + * @this {Services.ServiceManager.WorkerServicePort} */ function onMessage(event) { if (event.data === 'workerReady') { @@ -373,4 +373,4 @@ } }; -WebInspector.serviceManager = new WebInspector.ServiceManager(); +Services.serviceManager = new Services.ServiceManager();
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js b/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js index f13db2e..7c5a0618 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js +++ b/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js
@@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.EditFileSystemView = class extends WebInspector.VBox { +Settings.EditFileSystemView = class extends UI.VBox { /** * @param {string} fileSystemPath */ @@ -41,48 +41,48 @@ this._fileSystemPath = fileSystemPath; this._eventListeners = [ - WebInspector.fileSystemMapping.addEventListener( - WebInspector.FileSystemMapping.Events.FileMappingAdded, this._update, this), - WebInspector.fileSystemMapping.addEventListener( - WebInspector.FileSystemMapping.Events.FileMappingRemoved, this._update, this), - WebInspector.isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderAdded, this._update, this), - WebInspector.isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, this._update, this) + Workspace.fileSystemMapping.addEventListener( + Workspace.FileSystemMapping.Events.FileMappingAdded, this._update, this), + Workspace.fileSystemMapping.addEventListener( + Workspace.FileSystemMapping.Events.FileMappingRemoved, this._update, this), + Workspace.isolatedFileSystemManager.addEventListener( + Workspace.IsolatedFileSystemManager.Events.ExcludedFolderAdded, this._update, this), + Workspace.isolatedFileSystemManager.addEventListener( + Workspace.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, this._update, this) ]; - this._mappingsList = new WebInspector.ListWidget(this); + this._mappingsList = new UI.ListWidget(this); this._mappingsList.element.classList.add('file-system-list'); this._mappingsList.registerRequiredCSS('settings/editFileSystemView.css'); var mappingsPlaceholder = createElementWithClass('div', 'file-system-list-empty'); var mappingsHeader = this.contentElement.createChild('div', 'file-system-header'); - mappingsHeader.createChild('div', 'file-system-header-text').textContent = WebInspector.UIString('Mappings'); + mappingsHeader.createChild('div', 'file-system-header-text').textContent = Common.UIString('Mappings'); if (Runtime.experiments.isEnabled('persistence2')) { var div = mappingsPlaceholder.createChild('div'); div.createTextChild( - WebInspector.UIString('Mappings are inferred automatically via the \'Persistence 2.0\' experiment. Please ')); - div.appendChild(WebInspector.linkifyURLAsNode( + Common.UIString('Mappings are inferred automatically via the \'Persistence 2.0\' experiment. Please ')); + div.appendChild(UI.linkifyURLAsNode( 'https://bugs.chromium.org/p/chromium/issues/entry?template=Defect%20report%20from%20user&components=Platform%3EDevTools%3EAuthoring&comment=DevTools%20failed%20to%20link%20network%20resource%20to%20filesystem.%0A%0APlatform%3A%20%3CLinux%2FWin%2FMac%3E%0AChrome%20version%3A%20%3Cyour%20chrome%20version%3E%0A%0AWhat%20are%20the%20details%20of%20your%20project%3F%0A-%20Source%20code%20(if%20any)%3A%20http%3A%2F%2Fgithub.com%2Fexample%2Fexample%0A-%20Build%20System%3A%20gulp%2Fgrunt%2Fwebpack%2Frollup%2F...%0A-%20HTTP%20server%3A%20node%20HTTP%2Fnginx%2Fapache...%0A%0AAssets%20failed%20to%20link%20(or%20incorrectly%20linked)%3A%0A1.%0A2.%0A3.%0A%0AIf%20possible%2C%20please%20attach%20a%20screenshot%20of%20network%20sources%20navigator%20which%20should%0Ashow%20which%20resources%20failed%20to%20map', - WebInspector.UIString('report'), undefined, true)); - div.createTextChild(WebInspector.UIString(' any bugs.')); + Common.UIString('report'), undefined, true)); + div.createTextChild(Common.UIString(' any bugs.')); } else { - mappingsPlaceholder.textContent = WebInspector.UIString('No mappings'); + mappingsPlaceholder.textContent = Common.UIString('No mappings'); mappingsHeader.appendChild( - createTextButton(WebInspector.UIString('Add'), this._addMappingButtonClicked.bind(this), 'add-button')); + createTextButton(Common.UIString('Add'), this._addMappingButtonClicked.bind(this), 'add-button')); } this._mappingsList.setEmptyPlaceholder(mappingsPlaceholder); this._mappingsList.show(this.contentElement); var excludedFoldersHeader = this.contentElement.createChild('div', 'file-system-header'); excludedFoldersHeader.createChild('div', 'file-system-header-text').textContent = - WebInspector.UIString('Excluded folders'); + Common.UIString('Excluded folders'); excludedFoldersHeader.appendChild( - createTextButton(WebInspector.UIString('Add'), this._addExcludedFolderButtonClicked.bind(this), 'add-button')); - this._excludedFoldersList = new WebInspector.ListWidget(this); + createTextButton(Common.UIString('Add'), this._addExcludedFolderButtonClicked.bind(this), 'add-button')); + this._excludedFoldersList = new UI.ListWidget(this); this._excludedFoldersList.element.classList.add('file-system-list'); this._excludedFoldersList.registerRequiredCSS('settings/editFileSystemView.css'); var excludedFoldersPlaceholder = createElementWithClass('div', 'file-system-list-empty'); - excludedFoldersPlaceholder.textContent = WebInspector.UIString('No excluded folders'); + excludedFoldersPlaceholder.textContent = Common.UIString('No excluded folders'); this._excludedFoldersList.setEmptyPlaceholder(excludedFoldersPlaceholder); this._excludedFoldersList.show(this.contentElement); @@ -91,7 +91,7 @@ } dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } _update() { @@ -102,7 +102,7 @@ this._mappings = []; if (Runtime.experiments.isEnabled('persistence2')) return; - var mappings = WebInspector.fileSystemMapping.mappingEntries(this._fileSystemPath); + var mappings = Workspace.fileSystemMapping.mappingEntries(this._fileSystemPath); for (var entry of mappings) { if (entry.configurable) { this._mappingsList.appendItem(entry, true); @@ -118,13 +118,13 @@ this._excludedFoldersList.clear(); this._excludedFolders = []; - for (var folder of WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath) + for (var folder of Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath) .excludedFolders() .values()) { this._excludedFolders.push(folder); this._excludedFoldersList.appendItem(folder, true); } - for (var folder of WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath) + for (var folder of Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath) .nonConfigurableExcludedFolders() .values()) { this._excludedFolders.push(folder); @@ -133,7 +133,7 @@ } _addMappingButtonClicked() { - var entry = new WebInspector.FileSystemMapping.Entry(this._fileSystemPath, '', '', true); + var entry = new Workspace.FileSystemMapping.Entry(this._fileSystemPath, '', '', true); this._mappingsList.addNewItem(0, entry); } @@ -151,10 +151,10 @@ var element = createElementWithClass('div', 'file-system-list-item'); if (!editable) element.classList.add('locked'); - if (item instanceof WebInspector.FileSystemMapping.Entry) { - var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (item); + if (item instanceof Workspace.FileSystemMapping.Entry) { + var entry = /** @type {!Workspace.FileSystemMapping.Entry} */ (item); var urlPrefix = - entry.configurable ? entry.urlPrefix : WebInspector.UIString('%s (via .devtools)', entry.urlPrefix); + entry.configurable ? entry.urlPrefix : Common.UIString('%s (via .devtools)', entry.urlPrefix); var urlPrefixElement = element.createChild('div', 'file-system-value'); urlPrefixElement.textContent = urlPrefix; urlPrefixElement.title = urlPrefix; @@ -163,12 +163,12 @@ pathPrefixElement.textContent = entry.pathPrefix; pathPrefixElement.title = entry.pathPrefix; } else { - var pathPrefix = /** @type {string} */ (editable ? item : WebInspector.UIString('%s (via .devtools)', item)); + var pathPrefix = /** @type {string} */ (editable ? item : Common.UIString('%s (via .devtools)', item)); var pathPrefixElement = element.createChild('div', 'file-system-value'); pathPrefixElement.textContent = pathPrefix; pathPrefixElement.title = pathPrefix; } - element.createChild('div', 'file-system-locked').title = WebInspector.UIString('From .devtools file'); + element.createChild('div', 'file-system-locked').title = Common.UIString('From .devtools file'); return element; } @@ -178,11 +178,11 @@ * @param {number} index */ removeItemRequested(item, index) { - if (item instanceof WebInspector.FileSystemMapping.Entry) { + if (item instanceof Workspace.FileSystemMapping.Entry) { var entry = this._mappings[index]; - WebInspector.fileSystemMapping.removeFileMapping(entry.fileSystemPath, entry.urlPrefix, entry.pathPrefix); + Workspace.fileSystemMapping.removeFileMapping(entry.fileSystemPath, entry.urlPrefix, entry.pathPrefix); } else { - WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath) + Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath) .removeExcludedFolder(this._excludedFolders[index]); } } @@ -190,23 +190,23 @@ /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { this._muteUpdate = true; - if (item instanceof WebInspector.FileSystemMapping.Entry) { - var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (item); + if (item instanceof Workspace.FileSystemMapping.Entry) { + var entry = /** @type {!Workspace.FileSystemMapping.Entry} */ (item); if (!isNew) - WebInspector.fileSystemMapping.removeFileMapping(this._fileSystemPath, entry.urlPrefix, entry.pathPrefix); - WebInspector.fileSystemMapping.addFileMapping( + Workspace.fileSystemMapping.removeFileMapping(this._fileSystemPath, entry.urlPrefix, entry.pathPrefix); + Workspace.fileSystemMapping.addFileMapping( this._fileSystemPath, this._normalizePrefix(editor.control('urlPrefix').value), this._normalizePrefix(editor.control('pathPrefix').value)); } else { if (!isNew) - WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath) + Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath) .removeExcludedFolder(/** @type {string} */ (item)); - WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath) + Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath) .addExcludedFolder(this._normalizePrefix(editor.control('pathPrefix').value)); } this._muteUpdate = false; @@ -216,11 +216,11 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { - if (item instanceof WebInspector.FileSystemMapping.Entry) { - var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (item); + if (item instanceof Workspace.FileSystemMapping.Entry) { + var entry = /** @type {!Workspace.FileSystemMapping.Entry} */ (item); var editor = this._createMappingEditor(); editor.control('urlPrefix').value = entry.urlPrefix; editor.control('pathPrefix').value = entry.pathPrefix; @@ -233,20 +233,20 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createMappingEditor() { if (this._mappingEditor) return this._mappingEditor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._mappingEditor = editor; var content = editor.contentElement(); var titles = content.createChild('div', 'file-system-edit-row'); - titles.createChild('div', 'file-system-value').textContent = WebInspector.UIString('URL prefix'); + titles.createChild('div', 'file-system-value').textContent = Common.UIString('URL prefix'); titles.createChild('div', 'file-system-separator file-system-separator-invisible'); - titles.createChild('div', 'file-system-value').textContent = WebInspector.UIString('Folder path'); + titles.createChild('div', 'file-system-value').textContent = Common.UIString('Folder path'); var fields = content.createChild('div', 'file-system-edit-row'); fields.createChild('div', 'file-system-value') @@ -263,7 +263,7 @@ * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input * @return {boolean} - * @this {WebInspector.EditFileSystemView} + * @this {Settings.EditFileSystemView} */ function urlPrefixValidator(item, index, input) { var prefix = this._normalizePrefix(input.value); @@ -279,7 +279,7 @@ * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input * @return {boolean} - * @this {WebInspector.EditFileSystemView} + * @this {Settings.EditFileSystemView} */ function pathPrefixValidator(item, index, input) { var prefix = this._normalizePrefix(input.value); @@ -292,18 +292,18 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createExcludedFolderEditor() { if (this._excludedFolderEditor) return this._excludedFolderEditor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._excludedFolderEditor = editor; var content = editor.contentElement(); var titles = content.createChild('div', 'file-system-edit-row'); - titles.createChild('div', 'file-system-value').textContent = WebInspector.UIString('Folder path'); + titles.createChild('div', 'file-system-value').textContent = Common.UIString('Folder path'); var fields = content.createChild('div', 'file-system-edit-row'); fields.createChild('div', 'file-system-value') @@ -316,12 +316,12 @@ * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input * @return {boolean} - * @this {WebInspector.EditFileSystemView} + * @this {Settings.EditFileSystemView} */ function pathPrefixValidator(item, index, input) { var prefix = this._normalizePrefix(input.value); var configurableCount = - WebInspector.isolatedFileSystemManager.fileSystem(this._fileSystemPath).excludedFolders().size; + Workspace.isolatedFileSystemManager.fileSystem(this._fileSystemPath).excludedFolders().size; for (var i = 0; i < configurableCount; ++i) { if (i !== index && this._excludedFolders[i] === prefix) return false;
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js b/third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js index 7b80e84..8e3858a 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js +++ b/third_party/WebKit/Source/devtools/front_end/settings/FrameworkBlackboxSettingsTab.js
@@ -4,35 +4,35 @@ * found in the LICENSE file. */ /** - * @implements {WebInspector.ListWidget.Delegate} + * @implements {UI.ListWidget.Delegate} * @unrestricted */ -WebInspector.FrameworkBlackboxSettingsTab = class extends WebInspector.VBox { +Settings.FrameworkBlackboxSettingsTab = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('settings/frameworkBlackboxSettingsTab.css'); - this.contentElement.createChild('div', 'header').textContent = WebInspector.UIString('Framework Blackbox Patterns'); + this.contentElement.createChild('div', 'header').textContent = Common.UIString('Framework Blackbox Patterns'); this.contentElement.createChild('div', 'blackbox-content-scripts') - .appendChild(WebInspector.SettingsUI.createSettingCheckbox( - WebInspector.UIString('Blackbox content scripts'), WebInspector.moduleSetting('skipContentScripts'), true)); + .appendChild(UI.SettingsUI.createSettingCheckbox( + Common.UIString('Blackbox content scripts'), Common.moduleSetting('skipContentScripts'), true)); - this._blackboxLabel = WebInspector.UIString('Blackbox'); - this._disabledLabel = WebInspector.UIString('Disabled'); + this._blackboxLabel = Common.UIString('Blackbox'); + this._disabledLabel = Common.UIString('Disabled'); - this._list = new WebInspector.ListWidget(this); + this._list = new UI.ListWidget(this); this._list.element.classList.add('blackbox-list'); this._list.registerRequiredCSS('settings/frameworkBlackboxSettingsTab.css'); var placeholder = createElementWithClass('div', 'blackbox-list-empty'); - placeholder.textContent = WebInspector.UIString('No blackboxed patterns'); + placeholder.textContent = Common.UIString('No blackboxed patterns'); this._list.setEmptyPlaceholder(placeholder); this._list.show(this.contentElement); var addPatternButton = - createTextButton(WebInspector.UIString('Add pattern...'), this._addButtonClicked.bind(this), 'add-button'); + createTextButton(Common.UIString('Add pattern...'), this._addButtonClicked.bind(this), 'add-button'); this.contentElement.appendChild(addPatternButton); - this._setting = WebInspector.moduleSetting('skipStackFramesPattern'); + this._setting = Common.moduleSetting('skipStackFramesPattern'); this._setting.addChangeListener(this._settingUpdated, this); this.setDefaultFocusedElement(addPatternButton); @@ -91,7 +91,7 @@ /** * @override * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit(item, editor, isNew) { @@ -107,7 +107,7 @@ /** * @override * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit(item) { var editor = this._createEditor(); @@ -117,20 +117,20 @@ } /** - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ _createEditor() { if (this._editor) return this._editor; - var editor = new WebInspector.ListWidget.Editor(); + var editor = new UI.ListWidget.Editor(); this._editor = editor; var content = editor.contentElement(); var titles = content.createChild('div', 'blackbox-edit-row'); - titles.createChild('div', 'blackbox-pattern').textContent = WebInspector.UIString('Pattern'); + titles.createChild('div', 'blackbox-pattern').textContent = Common.UIString('Pattern'); titles.createChild('div', 'blackbox-separator blackbox-separator-invisible'); - titles.createChild('div', 'blackbox-behavior').textContent = WebInspector.UIString('Behavior'); + titles.createChild('div', 'blackbox-behavior').textContent = Common.UIString('Behavior'); var fields = content.createChild('div', 'blackbox-edit-row'); fields.createChild('div', 'blackbox-pattern') @@ -145,7 +145,7 @@ * @param {*} item * @param {number} index * @param {!HTMLInputElement|!HTMLSelectElement} input - * @this {WebInspector.FrameworkBlackboxSettingsTab} + * @this {Settings.FrameworkBlackboxSettingsTab} * @return {boolean} */ function patternValidator(item, index, input) {
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js index 424e320..9ae4eb94 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js +++ b/third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js
@@ -28,10 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ViewLocationResolver} + * @implements {UI.ViewLocationResolver} * @unrestricted */ -WebInspector.SettingsScreen = class extends WebInspector.VBox { +Settings.SettingsScreen = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('settings/settingsScreen.css'); @@ -41,18 +41,18 @@ this.contentElement.classList.add('vbox'); var settingsLabelElement = createElement('div'); - WebInspector.createShadowRootWithCoreStyles(settingsLabelElement, 'settings/settingsScreen.css') + UI.createShadowRootWithCoreStyles(settingsLabelElement, 'settings/settingsScreen.css') .createChild('div', 'settings-window-title') - .textContent = WebInspector.UIString('Settings'); + .textContent = Common.UIString('Settings'); - this._tabbedLocation = WebInspector.viewManager.createTabbedLocation( - () => WebInspector.SettingsScreen._showSettingsScreen(), 'settings-view'); + this._tabbedLocation = UI.viewManager.createTabbedLocation( + () => Settings.SettingsScreen._showSettingsScreen(), 'settings-view'); var tabbedPane = this._tabbedLocation.tabbedPane(); - tabbedPane.leftToolbar().appendToolbarItem(new WebInspector.ToolbarItem(settingsLabelElement)); + tabbedPane.leftToolbar().appendToolbarItem(new UI.ToolbarItem(settingsLabelElement)); tabbedPane.setShrinkableTabs(false); tabbedPane.setVerticalTabLayout(true); - var shortcutsView = new WebInspector.SimpleView(WebInspector.UIString('Shortcuts')); - WebInspector.shortcutsScreen.createShortcutsTabView().show(shortcutsView.element); + var shortcutsView = new UI.SimpleView(Common.UIString('Shortcuts')); + Components.shortcutsScreen.createShortcutsTabView().show(shortcutsView.element); this._tabbedLocation.appendView(shortcutsView); tabbedPane.show(this.contentElement); @@ -66,10 +66,10 @@ */ static _showSettingsScreen(name) { var settingsScreen = - /** @type {!WebInspector.SettingsScreen} */ (self.runtime.sharedInstance(WebInspector.SettingsScreen)); + /** @type {!Settings.SettingsScreen} */ (self.runtime.sharedInstance(Settings.SettingsScreen)); if (settingsScreen.isShowing()) return; - var dialog = new WebInspector.Dialog(); + var dialog = new UI.Dialog(); dialog.addCloseButton(); settingsScreen.show(dialog.element); dialog.show(); @@ -79,7 +79,7 @@ /** * @override * @param {string} locationName - * @return {?WebInspector.ViewLocation} + * @return {?UI.ViewLocation} */ resolveLocation(locationName) { return this._tabbedLocation; @@ -89,7 +89,7 @@ * @param {string} name */ _selectTab(name) { - WebInspector.viewManager.showView(name); + UI.viewManager.showView(name); } /** @@ -106,7 +106,7 @@ /** * @unrestricted */ -WebInspector.SettingsTab = class extends WebInspector.VBox { +Settings.SettingsTab = class extends UI.VBox { /** * @param {string} name * @param {string=} id @@ -160,9 +160,9 @@ /** * @unrestricted */ -WebInspector.GenericSettingsTab = class extends WebInspector.SettingsTab { +Settings.GenericSettingsTab = class extends Settings.SettingsTab { constructor() { - super(WebInspector.UIString('Preferences'), 'preferences-tab-content'); + super(Common.UIString('Preferences'), 'preferences-tab-content'); /** @const */ var explicitSectionOrder = @@ -174,14 +174,14 @@ for (var sectionName of explicitSectionOrder) this._sectionElement(sectionName); self.runtime.extensions('setting').forEach(this._addSetting.bind(this)); - self.runtime.extensions(WebInspector.SettingUI).forEach(this._addSettingUI.bind(this)); + self.runtime.extensions(UI.SettingUI).forEach(this._addSettingUI.bind(this)); this._appendSection().appendChild( - createTextButton(WebInspector.UIString('Restore defaults and reload'), restoreAndReload)); + createTextButton(Common.UIString('Restore defaults and reload'), restoreAndReload)); function restoreAndReload() { - WebInspector.settings.clearAll(); - WebInspector.reload(); + Common.settings.clearAll(); + Components.reload(); } } @@ -202,20 +202,20 @@ * @param {!Runtime.Extension} extension */ _addSetting(extension) { - if (!WebInspector.GenericSettingsTab.isSettingVisible(extension)) + if (!Settings.GenericSettingsTab.isSettingVisible(extension)) return; var descriptor = extension.descriptor(); var sectionName = descriptor['category']; var settingName = descriptor['settingName']; - var setting = WebInspector.moduleSetting(settingName); - var uiTitle = WebInspector.UIString(extension.title()); + var setting = Common.moduleSetting(settingName); + var uiTitle = Common.UIString(extension.title()); var sectionElement = this._sectionElement(sectionName); var settingControl; switch (descriptor['settingType']) { case 'boolean': - settingControl = WebInspector.SettingsUI.createSettingCheckbox(uiTitle, setting); + settingControl = UI.SettingsUI.createSettingCheckbox(uiTitle, setting); break; case 'enum': var descriptorOptions = descriptor['options']; @@ -223,7 +223,7 @@ for (var i = 0; i < options.length; ++i) { // The "raw" flag indicates text is non-i18n-izable. var optionName = descriptorOptions[i]['raw'] ? descriptorOptions[i]['text'] : - WebInspector.UIString(descriptorOptions[i]['text']); + Common.UIString(descriptorOptions[i]['text']); options[i] = [optionName, descriptorOptions[i]['value']]; } settingControl = this._createSelectSetting(uiTitle, options, setting); @@ -246,10 +246,10 @@ /** * @param {!Object} object - * @this {WebInspector.GenericSettingsTab} + * @this {Settings.GenericSettingsTab} */ function appendCustomSetting(object) { - var settingUI = /** @type {!WebInspector.SettingUI} */ (object); + var settingUI = /** @type {!UI.SettingUI} */ (object); var element = settingUI.settingElement(); if (element) this._sectionElement(sectionName).appendChild(element); @@ -263,7 +263,7 @@ _sectionElement(sectionName) { var sectionElement = this._nameToSection.get(sectionName); if (!sectionElement) { - var uiSectionName = sectionName && WebInspector.UIString(sectionName); + var uiSectionName = sectionName && Common.UIString(sectionName); sectionElement = this._appendSection(uiSectionName); this._nameToSection.set(sectionName, sectionElement); } @@ -275,13 +275,13 @@ /** * @unrestricted */ -WebInspector.WorkspaceSettingsTab = class extends WebInspector.SettingsTab { +Settings.WorkspaceSettingsTab = class extends Settings.SettingsTab { constructor() { - super(WebInspector.UIString('Workspace'), 'workspace-tab-content'); - WebInspector.isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this); - WebInspector.isolatedFileSystemManager.addEventListener( - WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this); + super(Common.UIString('Workspace'), 'workspace-tab-content'); + Workspace.isolatedFileSystemManager.addEventListener( + Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this); + Workspace.isolatedFileSystemManager.addEventListener( + Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this); var folderExcludePatternInput = this._createFolderExcludePatternInput(); folderExcludePatternInput.classList.add('folder-exclude-pattern'); @@ -290,15 +290,15 @@ this._fileSystemsListContainer = this.containerElement.createChild('div', ''); this.containerElement.appendChild( - createTextButton(WebInspector.UIString('Add folder\u2026'), this._addFileSystemClicked.bind(this))); + createTextButton(Common.UIString('Add folder\u2026'), this._addFileSystemClicked.bind(this))); /** @type {!Map<string, !Element>} */ this._elementByPath = new Map(); - /** @type {!Map<string, !WebInspector.EditFileSystemView>} */ + /** @type {!Map<string, !Settings.EditFileSystemView>} */ this._mappingViewByPath = new Map(); - var fileSystems = WebInspector.isolatedFileSystemManager.fileSystems(); + var fileSystems = Workspace.isolatedFileSystemManager.fileSystems(); for (var i = 0; i < fileSystems.length; ++i) this._addItem(fileSystems[i]); } @@ -309,12 +309,12 @@ _createFolderExcludePatternInput() { var p = createElement('p'); var labelElement = p.createChild('label'); - labelElement.textContent = WebInspector.UIString('Folder exclude pattern'); + labelElement.textContent = Common.UIString('Folder exclude pattern'); var inputElement = p.createChild('input'); inputElement.type = 'text'; inputElement.style.width = '270px'; - var folderExcludeSetting = WebInspector.isolatedFileSystemManager.workspaceFolderExcludePatternSetting(); - var setValue = WebInspector.bindInput( + var folderExcludeSetting = Workspace.isolatedFileSystemManager.workspaceFolderExcludePatternSetting(); + var setValue = UI.bindInput( inputElement, folderExcludeSetting.set.bind(folderExcludeSetting), regexValidator, false); folderExcludeSetting.addChangeListener(() => setValue.call(null, folderExcludeSetting.get())); setValue(folderExcludeSetting.get()); @@ -335,7 +335,7 @@ } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem */ _addItem(fileSystem) { var element = this._renderFileSystem(fileSystem); @@ -343,19 +343,19 @@ this._fileSystemsListContainer.appendChild(element); - var mappingView = new WebInspector.EditFileSystemView(fileSystem.path()); + var mappingView = new Settings.EditFileSystemView(fileSystem.path()); this._mappingViewByPath.set(fileSystem.path(), mappingView); mappingView.element.classList.add('file-system-mapping-view'); mappingView.show(element); } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem * @return {!Element} */ _renderFileSystem(fileSystem) { var fileSystemPath = fileSystem.path(); - var lastIndexOfSlash = fileSystemPath.lastIndexOf(WebInspector.isWin() ? '\\' : '/'); + var lastIndexOfSlash = fileSystemPath.lastIndexOf(Host.isWin() ? '\\' : '/'); var folderName = fileSystemPath.substr(lastIndexOfSlash + 1); var element = createElementWithClass('div', 'file-system-container'); @@ -366,8 +366,8 @@ path.textContent = fileSystemPath; path.title = fileSystemPath; - var toolbar = new WebInspector.Toolbar(''); - var button = new WebInspector.ToolbarButton(WebInspector.UIString('Remove'), 'largeicon-delete'); + var toolbar = new UI.Toolbar(''); + var button = new UI.ToolbarButton(Common.UIString('Remove'), 'largeicon-delete'); button.addEventListener('click', this._removeFileSystemClicked.bind(this, fileSystem)); toolbar.appendToolbarItem(button); header.appendChild(toolbar.element); @@ -376,23 +376,23 @@ } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem */ _removeFileSystemClicked(fileSystem) { - WebInspector.isolatedFileSystemManager.removeFileSystem(fileSystem); + Workspace.isolatedFileSystemManager.removeFileSystem(fileSystem); } _addFileSystemClicked() { - WebInspector.isolatedFileSystemManager.addFileSystem(); + Workspace.isolatedFileSystemManager.addFileSystem(); } _fileSystemAdded(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); this._addItem(fileSystem); } _fileSystemRemoved(event) { - var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); + var fileSystem = /** @type {!Workspace.IsolatedFileSystem} */ (event.data); var mappingView = this._mappingViewByPath.get(fileSystem.path()); if (mappingView) { @@ -411,9 +411,9 @@ /** * @unrestricted */ -WebInspector.ExperimentsSettingsTab = class extends WebInspector.SettingsTab { +Settings.ExperimentsSettingsTab = class extends Settings.SettingsTab { constructor() { - super(WebInspector.UIString('Experiments'), 'experiments-tab-content'); + super(Common.UIString('Experiments'), 'experiments-tab-content'); var experiments = Runtime.experiments.allConfigurableExperiments(); if (experiments.length) { @@ -430,15 +430,15 @@ _createExperimentsWarningSubsection() { var subsection = createElement('div'); var warning = subsection.createChild('span', 'settings-experiments-warning-subsection-warning'); - warning.textContent = WebInspector.UIString('WARNING:'); + warning.textContent = Common.UIString('WARNING:'); subsection.createTextChild(' '); var message = subsection.createChild('span', 'settings-experiments-warning-subsection-message'); - message.textContent = WebInspector.UIString('These experiments could be dangerous and may require restart.'); + message.textContent = Common.UIString('These experiments could be dangerous and may require restart.'); return subsection; } _createExperimentCheckbox(experiment) { - var label = createCheckboxLabel(WebInspector.UIString(experiment.title), experiment.isEnabled()); + var label = createCheckboxLabel(Common.UIString(experiment.title), experiment.isEnabled()); var input = label.checkboxElement; input.name = experiment.name; function listener() { @@ -454,26 +454,26 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SettingsScreen.ActionDelegate = class { +Settings.SettingsScreen.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { switch (actionId) { case 'settings.show': - WebInspector.SettingsScreen._showSettingsScreen(); + Settings.SettingsScreen._showSettingsScreen(); return true; case 'settings.help': InspectorFrontendHost.openInNewTab('https://developers.google.com/web/tools/chrome-devtools/'); return true; case 'settings.shortcuts': - WebInspector.SettingsScreen._showSettingsScreen(WebInspector.UIString('Shortcuts')); + Settings.SettingsScreen._showSettingsScreen(Common.UIString('Shortcuts')); return true; } return false; @@ -481,22 +481,22 @@ }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.SettingsScreen.Revealer = class { +Settings.SettingsScreen.Revealer = class { /** * @override * @param {!Object} object * @return {!Promise} */ reveal(object) { - console.assert(object instanceof WebInspector.Setting); - var setting = /** @type {!WebInspector.Setting} */ (object); + console.assert(object instanceof Common.Setting); + var setting = /** @type {!Common.Setting} */ (object); var success = false; self.runtime.extensions('setting').forEach(revealModuleSetting); - self.runtime.extensions(WebInspector.SettingUI).forEach(revealSettingUI); + self.runtime.extensions(UI.SettingUI).forEach(revealSettingUI); self.runtime.extensions('view').forEach(revealSettingsView); return success ? Promise.resolve() : Promise.reject(); @@ -505,11 +505,11 @@ * @param {!Runtime.Extension} extension */ function revealModuleSetting(extension) { - if (!WebInspector.GenericSettingsTab.isSettingVisible(extension)) + if (!Settings.GenericSettingsTab.isSettingVisible(extension)) return; if (extension.descriptor()['settingName'] === setting.name) { InspectorFrontendHost.bringToFront(); - WebInspector.SettingsScreen._showSettingsScreen(); + Settings.SettingsScreen._showSettingsScreen(); success = true; } } @@ -521,7 +521,7 @@ var settings = extension.descriptor()['settings']; if (settings && settings.indexOf(setting.name) !== -1) { InspectorFrontendHost.bringToFront(); - WebInspector.SettingsScreen._showSettingsScreen(); + Settings.SettingsScreen._showSettingsScreen(); success = true; } } @@ -536,7 +536,7 @@ var settings = extension.descriptor()['settings']; if (settings && settings.indexOf(setting.name) !== -1) { InspectorFrontendHost.bringToFront(); - WebInspector.SettingsScreen._showSettingsScreen(extension.descriptor()['id']); + Settings.SettingsScreen._showSettingsScreen(extension.descriptor()['id']); success = true; } }
diff --git a/third_party/WebKit/Source/devtools/front_end/settings/module.json b/third_party/WebKit/Source/devtools/front_end/settings/module.json index 6cc26d5d..e4b274c 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/module.json +++ b/third_party/WebKit/Source/devtools/front_end/settings/module.json
@@ -1,11 +1,11 @@ { "extensions": [ { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Settings", "actionId": "settings.show", "title": "Settings", - "className": "WebInspector.SettingsScreen.ActionDelegate", + "className": "Settings.SettingsScreen.ActionDelegate", "bindings": [ { "shortcut": "F1 Shift+?" @@ -13,23 +13,23 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Settings", "actionId": "settings.help", "title": "Help", - "className": "WebInspector.SettingsScreen.ActionDelegate" + "className": "Settings.SettingsScreen.ActionDelegate" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Settings", "actionId": "settings.shortcuts", "title": "Shortcuts", - "className": "WebInspector.SettingsScreen.ActionDelegate" + "className": "Settings.SettingsScreen.ActionDelegate" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.Setting"], - "className": "WebInspector.SettingsScreen.Revealer" + "type": "@Common.Revealer", + "contextTypes": ["Common.Setting"], + "className": "Settings.SettingsScreen.Revealer" }, { "type": "context-menu-item", @@ -55,7 +55,7 @@ "id": "preferences", "title": "Preferences", "order": "0", - "className": "WebInspector.GenericSettingsTab" + "className": "Settings.GenericSettingsTab" }, { "type": "view", @@ -63,7 +63,7 @@ "id": "workspace", "title": "Workspace", "order": "1", - "className": "WebInspector.WorkspaceSettingsTab" + "className": "Settings.WorkspaceSettingsTab" }, { "type": "view", @@ -72,7 +72,7 @@ "title": "Experiments", "order": "2", "experiment": "*", - "className": "WebInspector.ExperimentsSettingsTab" + "className": "Settings.ExperimentsSettingsTab" }, { "type": "view", @@ -80,12 +80,12 @@ "id": "blackbox", "title": "Blackboxing", "order": "3", - "className": "WebInspector.FrameworkBlackboxSettingsTab" + "className": "Settings.FrameworkBlackboxSettingsTab" }, { - "type": "@WebInspector.ViewLocationResolver", + "type": "@UI.ViewLocationResolver", "name": "settings-view", - "className": "WebInspector.SettingsScreen" + "className": "Settings.SettingsScreen" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js index 3e801ed..b3c58509 100644 --- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js +++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
@@ -28,59 +28,59 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ScriptSnippetModel = class extends WebInspector.Object { +Snippets.ScriptSnippetModel = class extends Common.Object { /** - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.Workspace} workspace */ constructor(workspace) { super(); this._workspace = workspace; - /** @type {!Object.<string, !WebInspector.UISourceCode>} */ + /** @type {!Object.<string, !Workspace.UISourceCode>} */ this._uiSourceCodeForSnippetId = {}; - /** @type {!Map.<!WebInspector.UISourceCode, string>} */ + /** @type {!Map.<!Workspace.UISourceCode, string>} */ this._snippetIdForUISourceCode = new Map(); - /** @type {!Map.<!WebInspector.Target, !WebInspector.SnippetScriptMapping>} */ + /** @type {!Map.<!SDK.Target, !Snippets.SnippetScriptMapping>} */ this._mappingForTarget = new Map(); - this._snippetStorage = new WebInspector.SnippetStorage('script', 'Script snippet #'); - this._lastSnippetEvaluationIndexSetting = WebInspector.settings.createSetting('lastSnippetEvaluationIndex', 0); - this._project = new WebInspector.SnippetsProject(workspace, this); + this._snippetStorage = new Snippets.SnippetStorage('script', 'Script snippet #'); + this._lastSnippetEvaluationIndexSetting = Common.settings.createSetting('lastSnippetEvaluationIndex', 0); + this._project = new Snippets.SnippetsProject(workspace, this); this._loadSnippets(); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel) - this._mappingForTarget.set(target, new WebInspector.SnippetScriptMapping(debuggerModel, this)); + this._mappingForTarget.set(target, new Snippets.SnippetScriptMapping(debuggerModel, this)); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - if (WebInspector.DebuggerModel.fromTarget(target)) + if (SDK.DebuggerModel.fromTarget(target)) this._mappingForTarget.remove(target); } /** - * @param {!WebInspector.Target} target - * @return {!WebInspector.SnippetScriptMapping|undefined} + * @param {!SDK.Target} target + * @return {!Snippets.SnippetScriptMapping|undefined} */ snippetScriptMapping(target) { return this._mappingForTarget.get(target); } /** - * @return {!WebInspector.Project} + * @return {!Workspace.Project} */ project() { return this._project; @@ -93,7 +93,7 @@ /** * @param {string} content - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ createScriptSnippet(content) { var snippet = this._snippetStorage.createSnippet(); @@ -102,12 +102,12 @@ } /** - * @param {!WebInspector.Snippet} snippet - * @return {!WebInspector.UISourceCode} + * @param {!Snippets.Snippet} snippet + * @return {!Workspace.UISourceCode} */ _addScriptSnippet(snippet) { - var uiSourceCode = this._project.addSnippet(snippet.name, new WebInspector.SnippetContentProvider(snippet)); - uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); + var uiSourceCode = this._project.addSnippet(snippet.name, new Snippets.SnippetContentProvider(snippet)); + uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); this._snippetIdForUISourceCode.set(uiSourceCode, snippet.id); var breakpointLocations = this._removeBreakpoints(uiSourceCode); this._restoreBreakpoints(uiSourceCode, breakpointLocations); @@ -116,10 +116,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _workingCopyChanged(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); this._scriptSnippetEdited(uiSourceCode); } @@ -174,7 +174,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _scriptSnippetEdited(uiSourceCode) { var breakpointLocations = this._removeBreakpoints(uiSourceCode); @@ -195,8 +195,8 @@ } /** - * @param {!WebInspector.ExecutionContext} executionContext - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!SDK.ExecutionContext} executionContext + * @param {!Workspace.UISourceCode} uiSourceCode */ evaluateScriptSnippet(executionContext, uiSourceCode) { var breakpointLocations = this._removeBreakpoints(uiSourceCode); @@ -212,25 +212,25 @@ uiSourceCode.requestContent().then(compileSnippet.bind(this)); /** - * @this {WebInspector.ScriptSnippetModel} + * @this {Snippets.ScriptSnippetModel} */ function compileSnippet() { var expression = uiSourceCode.workingCopy(); - WebInspector.console.show(); + Common.console.show(); runtimeModel.compileScript(expression, '', true, executionContext.id, compileCallback.bind(this)); } /** * @param {!Protocol.Runtime.ScriptId=} scriptId * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.ScriptSnippetModel} + * @this {Snippets.ScriptSnippetModel} */ function compileCallback(scriptId, exceptionDetails) { var mapping = this._mappingForTarget.get(target); if (mapping.evaluationIndex(uiSourceCode) !== evaluationIndex) return; - var script = /** @type {!WebInspector.Script} */ ( + var script = /** @type {!SDK.Script} */ ( executionContext.debuggerModel.scriptForId(/** @type {string} */ (scriptId || exceptionDetails.scriptId))); mapping._addScript(script, uiSourceCode); if (!scriptId) { @@ -248,7 +248,7 @@ /** * @param {!Protocol.Runtime.ScriptId} scriptId - * @param {!WebInspector.ExecutionContext} executionContext + * @param {!SDK.ExecutionContext} executionContext * @param {?string=} sourceURL */ _runScript(scriptId, executionContext, sourceURL) { @@ -259,10 +259,10 @@ runCallback.bind(this, target)); /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {?Protocol.Runtime.RemoteObject} result * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.ScriptSnippetModel} + * @this {Snippets.ScriptSnippetModel} */ function runCallback(target, result, exceptionDetails) { if (!exceptionDetails) @@ -273,54 +273,54 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {?Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ScriptId} scriptId * @param {?string=} sourceURL */ _printRunScriptResult(target, result, scriptId, sourceURL) { - var consoleMessage = new WebInspector.ConsoleMessage( - target, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Log, '', + var consoleMessage = new SDK.ConsoleMessage( + target, SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Log, '', undefined, sourceURL, undefined, undefined, undefined, [result], undefined, undefined, undefined, scriptId); target.consoleModel.addMessage(consoleMessage); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Runtime.ExceptionDetails} exceptionDetails * @param {?string=} sourceURL */ _printRunOrCompileScriptResultFailure(target, exceptionDetails, sourceURL) { - target.consoleModel.addMessage(WebInspector.ConsoleMessage.fromException( + target.consoleModel.addMessage(SDK.ConsoleMessage.fromException( target, exceptionDetails, undefined, undefined, sourceURL || undefined)); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Array.<!{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLocation: !Workspace.UILocation}>} */ _removeBreakpoints(uiSourceCode) { - var breakpointLocations = WebInspector.breakpointManager.breakpointLocationsForUISourceCode(uiSourceCode); + var breakpointLocations = Bindings.breakpointManager.breakpointLocationsForUISourceCode(uiSourceCode); for (var i = 0; i < breakpointLocations.length; ++i) breakpointLocations[i].breakpoint.remove(); return breakpointLocations; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!Array.<!{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>} breakpointLocations + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLocation: !Workspace.UILocation}>} breakpointLocations */ _restoreBreakpoints(uiSourceCode, breakpointLocations) { for (var i = 0; i < breakpointLocations.length; ++i) { var uiLocation = breakpointLocations[i].uiLocation; var breakpoint = breakpointLocations[i].breakpoint; - WebInspector.breakpointManager.setBreakpoint( + Bindings.breakpointManager.setBreakpoint( uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, breakpoint.condition(), breakpoint.enabled()); } } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _releaseSnippetScript(uiSourceCode) { this._mappingForTarget.valuesArray().forEach(function(mapping) { @@ -333,7 +333,7 @@ * @return {?string} */ _snippetIdForSourceURL(sourceURL) { - var snippetPrefix = WebInspector.ScriptSnippetModel.snippetSourceURLPrefix; + var snippetPrefix = Snippets.ScriptSnippetModel.snippetSourceURLPrefix; if (!sourceURL.startsWith(snippetPrefix)) return null; var splitURL = sourceURL.substring(snippetPrefix.length).split('_'); @@ -342,32 +342,32 @@ } }; -WebInspector.ScriptSnippetModel.snippetSourceURLPrefix = 'snippets:///'; +Snippets.ScriptSnippetModel.snippetSourceURLPrefix = 'snippets:///'; /** - * @implements {WebInspector.DebuggerSourceMapping} + * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ -WebInspector.SnippetScriptMapping = class { +Snippets.SnippetScriptMapping = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.ScriptSnippetModel} scriptSnippetModel + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Snippets.ScriptSnippetModel} scriptSnippetModel */ constructor(debuggerModel, scriptSnippetModel) { this._target = debuggerModel.target(); this._debuggerModel = debuggerModel; this._scriptSnippetModel = scriptSnippetModel; - /** @type {!Object.<string, !WebInspector.UISourceCode>} */ + /** @type {!Object.<string, !Workspace.UISourceCode>} */ this._uiSourceCodeForScriptId = {}; - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.Script>} */ + /** @type {!Map.<!Workspace.UISourceCode, !SDK.Script>} */ this._scriptForUISourceCode = new Map(); - /** @type {!Map.<!WebInspector.UISourceCode, number>} */ + /** @type {!Map.<!Workspace.UISourceCode, number>} */ this._evaluationIndexForUISourceCode = new Map(); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._reset, this); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._reset, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _releaseSnippetScript(uiSourceCode) { var script = this._scriptForUISourceCode.get(uiSourceCode); @@ -381,14 +381,14 @@ /** * @param {number} evaluationIndex - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _setEvaluationIndex(evaluationIndex, uiSourceCode) { this._evaluationIndexForUISourceCode.set(uiSourceCode, evaluationIndex); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {number|undefined} */ evaluationIndex(uiSourceCode) { @@ -396,13 +396,13 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ _evaluationSourceURL(uiSourceCode) { var evaluationSuffix = '_' + this._evaluationIndexForUISourceCode.get(uiSourceCode); var snippetId = this._scriptSnippetModel._snippetIdForUISourceCode.get(uiSourceCode); - return WebInspector.ScriptSnippetModel.snippetSourceURLPrefix + snippetId + evaluationSuffix; + return Snippets.ScriptSnippetModel.snippetSourceURLPrefix + snippetId + evaluationSuffix; } _reset() { @@ -413,11 +413,11 @@ /** * @override - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation); + var debuggerModelLocation = /** @type {!SDK.DebuggerModel.Location} */ (rawLocation); var uiSourceCode = this._uiSourceCodeForScriptId[debuggerModelLocation.scriptId]; if (!uiSourceCode) return null; @@ -427,10 +427,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var script = this._scriptForUISourceCode.get(uiSourceCode); @@ -441,28 +441,28 @@ } /** - * @param {!WebInspector.Script} script - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!SDK.Script} script + * @param {!Workspace.UISourceCode} uiSourceCode */ _addScript(script, uiSourceCode) { console.assert(!this._scriptForUISourceCode.get(uiSourceCode)); - WebInspector.debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); + Bindings.debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; this._scriptForUISourceCode.set(uiSourceCode, script); - WebInspector.debuggerWorkspaceBinding.pushSourceMapping(script, this); + Bindings.debuggerWorkspaceBinding.pushSourceMapping(script, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!Array.<!{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>} breakpointLocations + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Array.<!{breakpoint: !Bindings.BreakpointManager.Breakpoint, uiLocation: !Workspace.UILocation}>} breakpointLocations */ _restoreBreakpoints(uiSourceCode, breakpointLocations) { var script = this._scriptForUISourceCode.get(uiSourceCode); if (!script) return; var rawLocation = - /** @type {!WebInspector.DebuggerModel.Location} */ (this._debuggerModel.createRawLocation(script, 0, 0)); - var scriptUISourceCode = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation).uiSourceCode; + /** @type {!SDK.DebuggerModel.Location} */ (this._debuggerModel.createRawLocation(script, 0, 0)); + var scriptUISourceCode = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation).uiSourceCode; if (scriptUISourceCode) this._scriptSnippetModel._restoreBreakpoints(scriptUISourceCode, breakpointLocations); } @@ -477,7 +477,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -487,12 +487,12 @@ }; /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.SnippetContentProvider = class { +Snippets.SnippetContentProvider = class { /** - * @param {!WebInspector.Snippet} snippet + * @param {!Snippets.Snippet} snippet */ constructor(snippet) { this._snippet = snippet; @@ -508,10 +508,10 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { - return WebInspector.resourceTypes.Snippet; + return Common.resourceTypes.Snippet; } /** @@ -527,15 +527,15 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { /** - * @this {WebInspector.SnippetContentProvider} + * @this {Snippets.SnippetContentProvider} */ function performSearch() { callback( - WebInspector.ContentProvider.performSearchInContent(this._snippet.content, query, caseSensitive, isRegex)); + Common.ContentProvider.performSearchInContent(this._snippet.content, query, caseSensitive, isRegex)); } // searchInContent should call back later. @@ -546,20 +546,20 @@ /** * @unrestricted */ -WebInspector.SnippetsProject = class extends WebInspector.ContentProviderBasedProject { +Snippets.SnippetsProject = class extends Bindings.ContentProviderBasedProject { /** - * @param {!WebInspector.Workspace} workspace - * @param {!WebInspector.ScriptSnippetModel} model + * @param {!Workspace.Workspace} workspace + * @param {!Snippets.ScriptSnippetModel} model */ constructor(workspace, model) { - super(workspace, 'snippets:', WebInspector.projectTypes.Snippets, ''); + super(workspace, 'snippets:', Workspace.projectTypes.Snippets, ''); this._model = model; } /** * @param {string} name - * @param {!WebInspector.ContentProvider} contentProvider - * @return {!WebInspector.UISourceCode} + * @param {!Common.ContentProvider} contentProvider + * @return {!Workspace.UISourceCode} */ addSnippet(name, contentProvider) { return this.addContentProvider(name, contentProvider); @@ -575,7 +575,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newContent * @param {function(?string)} callback */ @@ -607,7 +607,7 @@ * @param {string} url * @param {?string} name * @param {string} content - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ createFile(url, name, content, callback) { callback(this._model.createScriptSnippet(content)); @@ -623,6 +623,6 @@ }; /** - * @type {!WebInspector.ScriptSnippetModel} + * @type {!Snippets.ScriptSnippetModel} */ -WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspector.workspace); +Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspace);
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/SnippetStorage.js b/third_party/WebKit/Source/devtools/front_end/snippets/SnippetStorage.js index 46d57d2..3c8d928 100644 --- a/third_party/WebKit/Source/devtools/front_end/snippets/SnippetStorage.js +++ b/third_party/WebKit/Source/devtools/front_end/snippets/SnippetStorage.js
@@ -31,15 +31,15 @@ /** * @unrestricted */ -WebInspector.SnippetStorage = class extends WebInspector.Object { +Snippets.SnippetStorage = class extends Common.Object { constructor(settingPrefix, namePrefix) { super(); - /** @type {!Map<string,!WebInspector.Snippet>} */ + /** @type {!Map<string,!Snippets.Snippet>} */ this._snippets = new Map(); this._lastSnippetIdentifierSetting = - WebInspector.settings.createSetting(settingPrefix + 'Snippets_lastIdentifier', 0); - this._snippetsSetting = WebInspector.settings.createSetting(settingPrefix + 'Snippets', []); + Common.settings.createSetting(settingPrefix + 'Snippets_lastIdentifier', 0); + this._snippetsSetting = Common.settings.createSetting(settingPrefix + 'Snippets', []); this._namePrefix = namePrefix; this._loadSettings(); @@ -57,7 +57,7 @@ } /** - * @return {!Array<!WebInspector.Snippet>} + * @return {!Array<!Snippets.Snippet>} */ snippets() { return this._snippets.valuesArray(); @@ -65,7 +65,7 @@ /** * @param {string} id - * @return {?WebInspector.Snippet} + * @return {?Snippets.Snippet} */ snippetForId(id) { return this._snippets.get(id); @@ -73,7 +73,7 @@ /** * @param {string} name - * @return {?WebInspector.Snippet} + * @return {?Snippets.Snippet} */ snippetForName(name) { for (var snippet of this._snippets.values()) { @@ -86,11 +86,11 @@ _loadSettings() { var savedSnippets = this._snippetsSetting.get(); for (var i = 0; i < savedSnippets.length; ++i) - this._snippetAdded(WebInspector.Snippet.fromObject(this, savedSnippets[i])); + this._snippetAdded(Snippets.Snippet.fromObject(this, savedSnippets[i])); } /** - * @param {!WebInspector.Snippet} snippet + * @param {!Snippets.Snippet} snippet */ deleteSnippet(snippet) { this._snippets.delete(snippet.id); @@ -98,20 +98,20 @@ } /** - * @return {!WebInspector.Snippet} + * @return {!Snippets.Snippet} */ createSnippet() { var nextId = this._lastSnippetIdentifierSetting.get() + 1; var snippetId = String(nextId); this._lastSnippetIdentifierSetting.set(nextId); - var snippet = new WebInspector.Snippet(this, snippetId); + var snippet = new Snippets.Snippet(this, snippetId); this._snippetAdded(snippet); this._saveSettings(); return snippet; } /** - * @param {!WebInspector.Snippet} snippet + * @param {!Snippets.Snippet} snippet */ _snippetAdded(snippet) { this._snippets.set(snippet.id, snippet); @@ -121,9 +121,9 @@ /** * @unrestricted */ -WebInspector.Snippet = class extends WebInspector.Object { +Snippets.Snippet = class extends Common.Object { /** - * @param {!WebInspector.SnippetStorage} storage + * @param {!Snippets.SnippetStorage} storage * @param {string} id * @param {string=} name * @param {string=} content @@ -137,12 +137,12 @@ } /** - * @param {!WebInspector.SnippetStorage} storage + * @param {!Snippets.SnippetStorage} storage * @param {!Object} serializedSnippet - * @return {!WebInspector.Snippet} + * @return {!Snippets.Snippet} */ static fromObject(storage, serializedSnippet) { - return new WebInspector.Snippet(storage, serializedSnippet.id, serializedSnippet.name, serializedSnippet.content); + return new Snippets.Snippet(storage, serializedSnippet.id, serializedSnippet.name, serializedSnippet.content); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/FontView.js b/third_party/WebKit/Source/devtools/front_end/source_frame/FontView.js index 314ffaf..8d0fd65 100644 --- a/third_party/WebKit/Source/devtools/front_end/source_frame/FontView.js +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/FontView.js
@@ -29,24 +29,24 @@ /** * @unrestricted */ -WebInspector.FontView = class extends WebInspector.SimpleView { +SourceFrame.FontView = class extends UI.SimpleView { /** * @param {string} mimeType - * @param {!WebInspector.ContentProvider} contentProvider + * @param {!Common.ContentProvider} contentProvider */ constructor(mimeType, contentProvider) { - super(WebInspector.UIString('Font')); + super(Common.UIString('Font')); this.registerRequiredCSS('source_frame/fontView.css'); this.element.classList.add('font-view'); this._url = contentProvider.contentURL(); this._mimeType = mimeType; this._contentProvider = contentProvider; - this._mimeTypeLabel = new WebInspector.ToolbarText(mimeType); + this._mimeTypeLabel = new UI.ToolbarText(mimeType); } /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ syncToolbarItems() { return [this._mimeTypeLabel]; @@ -57,7 +57,7 @@ * @param {?string} content */ _onFontContentLoaded(uniqueFontName, content) { - var url = content ? WebInspector.ContentProvider.contentAsDataURL(content, this._mimeType, true) : this._url; + var url = content ? Common.ContentProvider.contentAsDataURL(content, this._mimeType, true) : this._url; this.fontStyleElement.textContent = String.sprintf('@font-face { font-family: "%s"; src: url(%s); }', uniqueFontName, url); } @@ -66,17 +66,17 @@ if (this.fontPreviewElement) return; - var uniqueFontName = 'WebInspectorFontPreview' + (++WebInspector.FontView._fontId); + var uniqueFontName = 'WebInspectorFontPreview' + (++SourceFrame.FontView._fontId); this.fontStyleElement = createElement('style'); this._contentProvider.requestContent().then(this._onFontContentLoaded.bind(this, uniqueFontName)); this.element.appendChild(this.fontStyleElement); var fontPreview = createElement('div'); - for (var i = 0; i < WebInspector.FontView._fontPreviewLines.length; ++i) { + for (var i = 0; i < SourceFrame.FontView._fontPreviewLines.length; ++i) { if (i > 0) fontPreview.createChild('br'); - fontPreview.createTextChild(WebInspector.FontView._fontPreviewLines[i]); + fontPreview.createTextChild(SourceFrame.FontView._fontPreviewLines[i]); } this.fontPreviewElement = fontPreview.cloneNode(true); this.fontPreviewElement.style.setProperty('font-family', uniqueFontName); @@ -88,7 +88,7 @@ this._dummyElement.style.display = 'inline'; this._dummyElement.style.position = 'absolute'; this._dummyElement.style.setProperty('font-family', uniqueFontName); - this._dummyElement.style.setProperty('font-size', WebInspector.FontView._measureFontSize + 'px'); + this._dummyElement.style.setProperty('font-size', SourceFrame.FontView._measureFontSize + 'px'); this.element.appendChild(this.fontPreviewElement); } @@ -146,15 +146,15 @@ var widthRatio = containerWidth / width; var heightRatio = containerHeight / height; - var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize * Math.min(widthRatio, heightRatio)) - 2; + var finalFontSize = Math.floor(SourceFrame.FontView._measureFontSize * Math.min(widthRatio, heightRatio)) - 2; this.fontPreviewElement.style.setProperty('font-size', finalFontSize + 'px', null); } }; -WebInspector.FontView._fontPreviewLines = +SourceFrame.FontView._fontPreviewLines = ['ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ', 'abcdefghijklm', 'nopqrstuvwxyz', '1234567890']; -WebInspector.FontView._fontId = 0; +SourceFrame.FontView._fontId = 0; -WebInspector.FontView._measureFontSize = 50; +SourceFrame.FontView._measureFontSize = 50;
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js b/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js index 3de1c10..6750e988 100644 --- a/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/ImageView.js
@@ -29,31 +29,31 @@ /** * @unrestricted */ -WebInspector.ImageView = class extends WebInspector.SimpleView { +SourceFrame.ImageView = class extends UI.SimpleView { /** * @param {string} mimeType - * @param {!WebInspector.ContentProvider} contentProvider + * @param {!Common.ContentProvider} contentProvider */ constructor(mimeType, contentProvider) { - super(WebInspector.UIString('Image')); + super(Common.UIString('Image')); this.registerRequiredCSS('source_frame/imageView.css'); this.element.classList.add('image-view'); this._url = contentProvider.contentURL(); - this._parsedURL = new WebInspector.ParsedURL(this._url); + this._parsedURL = new Common.ParsedURL(this._url); this._mimeType = mimeType; this._contentProvider = contentProvider; - this._sizeLabel = new WebInspector.ToolbarText(); - this._dimensionsLabel = new WebInspector.ToolbarText(); - this._mimeTypeLabel = new WebInspector.ToolbarText(mimeType); + this._sizeLabel = new UI.ToolbarText(); + this._dimensionsLabel = new UI.ToolbarText(); + this._mimeTypeLabel = new UI.ToolbarText(mimeType); } /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ syncToolbarItems() { return [ - this._sizeLabel, new WebInspector.ToolbarSeparator(), this._dimensionsLabel, new WebInspector.ToolbarSeparator(), + this._sizeLabel, new UI.ToolbarSeparator(), this._dimensionsLabel, new UI.ToolbarSeparator(), this._mimeTypeLabel ]; } @@ -77,16 +77,16 @@ /** * @param {?string} content - * @this {WebInspector.ImageView} + * @this {SourceFrame.ImageView} */ function onContentAvailable(content) { - var imageSrc = WebInspector.ContentProvider.contentAsDataURL(content, this._mimeType, true); + var imageSrc = Common.ContentProvider.contentAsDataURL(content, this._mimeType, true); if (imageSrc === null) imageSrc = this._url; imagePreviewElement.src = imageSrc; this._sizeLabel.setText(Number.bytesToString(this._base64ToSize(content))); this._dimensionsLabel.setText( - WebInspector.UIString('%d × %d', imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight)); + Common.UIString('%d × %d', imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight)); } this._imagePreviewElement = imagePreviewElement; } @@ -107,14 +107,14 @@ } _contextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (!this._parsedURL.isDataURL()) - contextMenu.appendItem(WebInspector.UIString.capitalize('Copy ^image URL'), this._copyImageURL.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Copy ^image URL'), this._copyImageURL.bind(this)); if (this._imagePreviewElement.src) contextMenu.appendItem( - WebInspector.UIString.capitalize('Copy ^image as Data URI'), this._copyImageAsDataURL.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Open ^image in ^new ^tab'), this._openInNewTab.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Save\u2026'), this._saveImage.bind(this)); + Common.UIString.capitalize('Copy ^image as Data URI'), this._copyImageAsDataURL.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Open ^image in ^new ^tab'), this._openInNewTab.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Save\u2026'), this._saveImage.bind(this)); contextMenu.show(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/ResourceSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/ResourceSourceFrame.js index 0cf2e6a6..c4c1174f 100644 --- a/third_party/WebKit/Source/devtools/front_end/source_frame/ResourceSourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/ResourceSourceFrame.js
@@ -30,9 +30,9 @@ /** * @unrestricted */ -WebInspector.ResourceSourceFrame = class extends WebInspector.SourceFrame { +SourceFrame.ResourceSourceFrame = class extends SourceFrame.SourceFrame { /** - * @param {!WebInspector.ContentProvider} resource + * @param {!Common.ContentProvider} resource */ constructor(resource) { super(resource.contentURL(), resource.requestContent.bind(resource)); @@ -40,15 +40,15 @@ } /** - * @param {!WebInspector.ContentProvider} resource + * @param {!Common.ContentProvider} resource * @param {string} highlighterType - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ static createSearchableView(resource, highlighterType) { - var sourceFrame = new WebInspector.ResourceSourceFrame(resource); + var sourceFrame = new SourceFrame.ResourceSourceFrame(resource); sourceFrame.setHighlighterType(highlighterType); - var searchableView = new WebInspector.SearchableView(sourceFrame); - searchableView.setPlaceholder(WebInspector.UIString('Find')); + var searchableView = new UI.SearchableView(sourceFrame); + searchableView.setPlaceholder(Common.UIString('Find')); sourceFrame.show(searchableView.element); sourceFrame.setSearchableView(searchableView); return searchableView; @@ -60,7 +60,7 @@ /** * @override - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {number} lineNumber * @param {number} columnNumber * @return {!Promise}
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js index 7f5db78..1774b085 100644 --- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
@@ -28,42 +28,42 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Searchable} - * @implements {WebInspector.Replaceable} - * @implements {WebInspector.SourcesTextEditorDelegate} + * @implements {UI.Searchable} + * @implements {UI.Replaceable} + * @implements {SourceFrame.SourcesTextEditorDelegate} * @unrestricted */ -WebInspector.SourceFrame = class extends WebInspector.SimpleView { +SourceFrame.SourceFrame = class extends UI.SimpleView { /** * @param {string} url * @param {function(): !Promise<?string>} lazyContent */ constructor(url, lazyContent) { - super(WebInspector.UIString('Source')); + super(Common.UIString('Source')); this._url = url; this._lazyContent = lazyContent; - this._textEditor = new WebInspector.SourcesTextEditor(this); + this._textEditor = new SourceFrame.SourcesTextEditor(this); this._currentSearchResultIndex = -1; this._searchResults = []; this._textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.EditorFocused, this._resetCurrentSearchResultIndex, this); + SourceFrame.SourcesTextEditor.Events.EditorFocused, this._resetCurrentSearchResultIndex, this); this._textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.SelectionChanged, this._updateSourcePosition, this); + SourceFrame.SourcesTextEditor.Events.SelectionChanged, this._updateSourcePosition, this); this._textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.TextChanged, + SourceFrame.SourcesTextEditor.Events.TextChanged, event => this.onTextChanged(event.data.oldRange, event.data.newRange)); this._shortcuts = {}; this.element.addEventListener('keydown', this._handleKeyDown.bind(this), false); - this._sourcePosition = new WebInspector.ToolbarText(); + this._sourcePosition = new UI.ToolbarText(); /** - * @type {?WebInspector.SearchableView} + * @type {?UI.SearchableView} */ this._searchableView = null; this._editable = false; @@ -113,7 +113,7 @@ /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ syncToolbarItems() { return [this._sourcePosition]; @@ -186,14 +186,14 @@ } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ selection() { return this.textEditor.selection(); } /** - * @param {!WebInspector.TextRange} textRange + * @param {!Common.TextRange} textRange */ setSelection(textRange) { this._selectionToSet = textRange; @@ -218,8 +218,8 @@ } /** - * @param {!WebInspector.TextRange} oldRange - * @param {!WebInspector.TextRange} newRange + * @param {!Common.TextRange} oldRange + * @param {!Common.TextRange} newRange */ onTextChanged(oldRange, newRange) { if (this._searchConfig && this._searchableView) @@ -287,14 +287,14 @@ } /** - * @param {?WebInspector.SearchableView} view + * @param {?UI.SearchableView} view */ setSearchableView(view) { this._searchableView = view; } /** - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean} jumpBackwards */ @@ -321,7 +321,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -389,7 +389,7 @@ */ _searchResultIndexForCurrentSelection() { return this._searchResults.lowerBound( - this._textEditor.selection().collapseToEnd(), WebInspector.TextRange.comparator); + this._textEditor.selection().collapseToEnd(), Common.TextRange.comparator); } /** @@ -440,7 +440,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceSelectionWith(searchConfig, replacement) { @@ -465,7 +465,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceAllWith(searchConfig, replacement) { @@ -487,7 +487,7 @@ return; // Calculate the position of the end of the last range to be edited. - var currentRangeIndex = ranges.lowerBound(this._textEditor.selection(), WebInspector.TextRange.comparator); + var currentRangeIndex = ranges.lowerBound(this._textEditor.selection(), Common.TextRange.comparator); var lastRangeIndex = mod(currentRangeIndex - 1, ranges.length); var lastRange = ranges[lastRangeIndex]; var replacementLineEndings = replacement.computeLineEndings(); @@ -500,7 +500,7 @@ this._textEditor.editRange(range, text); this._textEditor.revealPosition(lastLineNumber, lastColumnNumber); - this._textEditor.setSelection(WebInspector.TextRange.createFromLocation(lastLineNumber, lastColumnNumber)); + this._textEditor.setSelection(Common.TextRange.createFromLocation(lastLineNumber, lastColumnNumber)); } _collectRegexMatches(regexObject) { @@ -513,7 +513,7 @@ if (match) { var matchEndIndex = match.index + Math.max(match[0].length, 1); if (match[0].length) - ranges.push(new WebInspector.TextRange(i, offset + match.index, i, offset + matchEndIndex)); + ranges.push(new Common.TextRange(i, offset + match.index, i, offset + matchEndIndex)); offset += matchEndIndex; line = line.substring(matchEndIndex); } @@ -550,27 +550,27 @@ if (!selections.length) return; if (selections.length > 1) { - this._sourcePosition.setText(WebInspector.UIString('%d selection regions', selections.length)); + this._sourcePosition.setText(Common.UIString('%d selection regions', selections.length)); return; } var textRange = selections[0]; if (textRange.isEmpty()) { this._sourcePosition.setText( - WebInspector.UIString('Line %d, Column %d', textRange.endLine + 1, textRange.endColumn + 1)); + Common.UIString('Line %d, Column %d', textRange.endLine + 1, textRange.endColumn + 1)); return; } textRange = textRange.normalize(); var selectedText = this._textEditor.text(textRange); if (textRange.startLine === textRange.endLine) - this._sourcePosition.setText(WebInspector.UIString('%d characters selected', selectedText.length)); + this._sourcePosition.setText(Common.UIString('%d characters selected', selectedText.length)); else - this._sourcePosition.setText(WebInspector.UIString( + this._sourcePosition.setText(Common.UIString( '%d lines, %d characters selected', textRange.endLine - textRange.startLine + 1, selectedText.length)); } _handleKeyDown(e) { - var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); + var shortcutKey = UI.KeyboardShortcut.makeKeyFromEvent(e); var handler = this._shortcuts[shortcutKey]; if (handler && handler()) e.consume(true);
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js index 4ad58f1..7057ba6 100644 --- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
@@ -4,15 +4,15 @@ /** * @unrestricted */ -WebInspector.SourcesTextEditor = class extends WebInspector.CodeMirrorTextEditor { +SourceFrame.SourcesTextEditor = class extends TextEditor.CodeMirrorTextEditor { /** - * @param {!WebInspector.SourcesTextEditorDelegate} delegate + * @param {!SourceFrame.SourcesTextEditorDelegate} delegate */ constructor(delegate) { super({ lineNumbers: true, lineWrapping: false, - bracketMatchingSetting: WebInspector.moduleSetting('textEditorBracketMatching'), + bracketMatchingSetting: Common.moduleSetting('textEditorBracketMatching'), }); this.codeMirror().addKeyMap({'Enter': 'smartNewlineAndIndent', 'Esc': 'sourcesDismiss'}); @@ -28,8 +28,8 @@ this.codeMirror().on('beforeSelectionChange', this._fireBeforeSelectionChanged.bind(this)); this.element.addEventListener('contextmenu', this._contextMenu.bind(this), false); - this.codeMirror().addKeyMap(WebInspector.SourcesTextEditor._BlockIndentController); - this._tokenHighlighter = new WebInspector.SourcesTextEditor.TokenHighlighter(this, this.codeMirror()); + this.codeMirror().addKeyMap(SourceFrame.SourcesTextEditor._BlockIndentController); + this._tokenHighlighter = new SourceFrame.SourcesTextEditor.TokenHighlighter(this, this.codeMirror()); /** @type {!Array<string>} */ this._gutters = ['CodeMirror-linenumbers']; @@ -39,7 +39,7 @@ this.codeMirror().setOption('smartIndent', false); /** - * @this {WebInspector.SourcesTextEditor} + * @this {SourceFrame.SourcesTextEditor} */ function updateAnticipateJumpFlag(value) { this._isHandlingMouseDownEvent = value; @@ -47,9 +47,9 @@ this.element.addEventListener('mousedown', updateAnticipateJumpFlag.bind(this, true), true); this.element.addEventListener('mousedown', updateAnticipateJumpFlag.bind(this, false), false); - WebInspector.moduleSetting('textEditorIndent').addChangeListener(this._onUpdateEditorIndentation, this); - WebInspector.moduleSetting('textEditorAutoDetectIndent').addChangeListener(this._onUpdateEditorIndentation, this); - WebInspector.moduleSetting('showWhitespacesInEditor').addChangeListener(this._updateWhitespace, this); + Common.moduleSetting('textEditorIndent').addChangeListener(this._onUpdateEditorIndentation, this); + Common.moduleSetting('textEditorAutoDetectIndent').addChangeListener(this._onUpdateEditorIndentation, this); + Common.moduleSetting('showWhitespacesInEditor').addChangeListener(this._updateWhitespace, this); this._onUpdateEditorIndentation(); this._setupWhitespaceHighlight(); @@ -65,14 +65,14 @@ var indents = {}; for (var lineNumber = 0; lineNumber < lines.length; ++lineNumber) { var text = lines[lineNumber]; - if (text.length === 0 || !WebInspector.TextUtils.isSpaceChar(text[0])) + if (text.length === 0 || !Common.TextUtils.isSpaceChar(text[0])) continue; if (tabRegex.test(text)) { ++tabLines; continue; } var i = 0; - while (i < text.length && WebInspector.TextUtils.isSpaceChar(text[i])) + while (i < text.length && Common.TextUtils.isSpaceChar(text[i])) ++i; if (i % 2 !== 0) continue; @@ -90,7 +90,7 @@ minimumIndent = indent; } if (minimumIndent === Infinity) - return WebInspector.moduleSetting('textEditorIndent').get(); + return Common.moduleSetting('textEditorIndent').get(); return ' '.repeat(minimumIndent); } @@ -112,19 +112,19 @@ /** * @param {!RegExp} regex - * @param {?WebInspector.TextRange} range + * @param {?Common.TextRange} range */ highlightSearchResults(regex, range) { /** - * @this {WebInspector.CodeMirrorTextEditor} + * @this {TextEditor.CodeMirrorTextEditor} */ function innerHighlightRegex() { if (range) { this.scrollLineIntoView(range.startLine); - if (range.endColumn > WebInspector.CodeMirrorTextEditor.maxHighlightLength) + if (range.endColumn > TextEditor.CodeMirrorTextEditor.maxHighlightLength) this.setSelection(range); else - this.setSelection(WebInspector.TextRange.createFromLocation(range.startLine, range.startColumn)); + this.setSelection(Common.TextRange.createFromLocation(range.startLine, range.startColumn)); } this._tokenHighlighter.highlightSearchResults(regex, range); } @@ -152,13 +152,13 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} cssClass * @return {!Object} */ highlightRange(range, cssClass) { cssClass = 'CodeMirror-persist-highlight ' + cssClass; - var pos = WebInspector.CodeMirrorUtils.toPos(range); + var pos = TextEditor.CodeMirrorUtils.toPos(range); ++pos.end.ch; return this.codeMirror().markText( pos.start, pos.end, {className: cssClass, startStyle: cssClass + '-start', endStyle: cssClass + '-end'}); @@ -301,11 +301,11 @@ _gutterClick(instance, lineNumber, gutter, event) { this.dispatchEventToListeners( - WebInspector.SourcesTextEditor.Events.GutterClick, {lineNumber: lineNumber, event: event}); + SourceFrame.SourcesTextEditor.Events.GutterClick, {lineNumber: lineNumber, event: event}); } _contextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); event.consume(true); // Consume event now to prevent document from handling the async menu var target = event.target.enclosingNodeOrSelfWithClass('CodeMirror-gutter-elt'); var promise; @@ -319,7 +319,7 @@ promise.then(showAsync.bind(this)); /** - * @this {WebInspector.SourcesTextEditor} + * @this {SourceFrame.SourcesTextEditor} */ function showAsync() { contextMenu.appendApplicableItems(this); @@ -329,25 +329,25 @@ /** * @override - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} text * @param {string=} origin - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ editRange(range, text, origin) { var newRange = super.editRange(range, text, origin); this.dispatchEventToListeners( - WebInspector.SourcesTextEditor.Events.TextChanged, {oldRange: range, newRange: newRange}); + SourceFrame.SourcesTextEditor.Events.TextChanged, {oldRange: range, newRange: newRange}); - if (WebInspector.moduleSetting('textEditorAutoDetectIndent').get()) + if (Common.moduleSetting('textEditorAutoDetectIndent').get()) this._onUpdateEditorIndentation(); return newRange; } _onUpdateEditorIndentation() { - this._setEditorIndentation(WebInspector.CodeMirrorUtils.pullLines( - this.codeMirror(), WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing)); + this._setEditorIndentation(TextEditor.CodeMirrorUtils.pullLines( + this.codeMirror(), SourceFrame.SourcesTextEditor.LinesToScanForIndentationGuessing)); } /** @@ -355,11 +355,11 @@ */ _setEditorIndentation(lines) { var extraKeys = {}; - var indent = WebInspector.moduleSetting('textEditorIndent').get(); - if (WebInspector.moduleSetting('textEditorAutoDetectIndent').get()) - indent = WebInspector.SourcesTextEditor._guessIndentationLevel(lines); + var indent = Common.moduleSetting('textEditorIndent').get(); + if (Common.moduleSetting('textEditorAutoDetectIndent').get()) + indent = SourceFrame.SourcesTextEditor._guessIndentationLevel(lines); - if (indent === WebInspector.TextUtils.Indent.TabCharacter) { + if (indent === Common.TextUtils.Indent.TabCharacter) { this.codeMirror().setOption('indentWithTabs', true); this.codeMirror().setOption('indentUnit', 4); } else { @@ -392,7 +392,7 @@ if (!position) continue; var line = this.line(position.lineNumber); - if (line.length === position.columnNumber && WebInspector.TextUtils.lineIndent(line).length === line.length) + if (line.length === position.columnNumber && Common.TextUtils.lineIndent(line).length === line.length) this.codeMirror().replaceRange( '', new CodeMirror.Pos(position.lineNumber, 0), new CodeMirror.Pos(position.lineNumber, position.columnNumber)); @@ -418,7 +418,7 @@ for (var changeIndex = 0; changeIndex < changes.length; ++changeIndex) { var changeObject = changes[changeIndex]; - var edit = WebInspector.CodeMirrorUtils.changeObjectToEditOperation(changeObject); + var edit = TextEditor.CodeMirrorUtils.changeObjectToEditOperation(changeObject); if (currentEdit && edit.oldRange.equal(currentEdit.newRange)) { currentEdit.newRange = edit.newRange; } else { @@ -428,7 +428,7 @@ } for (var i = 0; i < edits.length; ++i) - this.dispatchEventToListeners(WebInspector.SourcesTextEditor.Events.TextChanged, edits[i]); + this.dispatchEventToListeners(SourceFrame.SourcesTextEditor.Events.TextChanged, edits[i]); } _cursorActivity() { @@ -438,30 +438,30 @@ var start = this.codeMirror().getCursor('anchor'); var end = this.codeMirror().getCursor('head'); this.dispatchEventToListeners( - WebInspector.SourcesTextEditor.Events.SelectionChanged, WebInspector.CodeMirrorUtils.toRange(start, end)); + SourceFrame.SourcesTextEditor.Events.SelectionChanged, TextEditor.CodeMirrorUtils.toRange(start, end)); } /** - * @param {?WebInspector.TextRange} from - * @param {?WebInspector.TextRange} to + * @param {?Common.TextRange} from + * @param {?Common.TextRange} to */ _reportJump(from, to) { if (from && to && from.equal(to)) return; - this.dispatchEventToListeners(WebInspector.SourcesTextEditor.Events.JumpHappened, {from: from, to: to}); + this.dispatchEventToListeners(SourceFrame.SourcesTextEditor.Events.JumpHappened, {from: from, to: to}); } _scroll() { var topmostLineNumber = this.codeMirror().lineAtHeight(this.codeMirror().getScrollInfo().top, 'local'); - this.dispatchEventToListeners(WebInspector.SourcesTextEditor.Events.ScrollChanged, topmostLineNumber); + this.dispatchEventToListeners(SourceFrame.SourcesTextEditor.Events.ScrollChanged, topmostLineNumber); } _focus() { - this.dispatchEventToListeners(WebInspector.SourcesTextEditor.Events.EditorFocused); + this.dispatchEventToListeners(SourceFrame.SourcesTextEditor.Events.EditorFocused); } _blur() { - this.dispatchEventToListeners(WebInspector.SourcesTextEditor.Events.EditorBlurred); + this.dispatchEventToListeners(SourceFrame.SourcesTextEditor.Events.EditorBlurred); } /** @@ -476,7 +476,7 @@ var primarySelection = selection.ranges[0]; this._reportJump( - this.selection(), WebInspector.CodeMirrorUtils.toRange(primarySelection.anchor, primarySelection.head)); + this.selection(), TextEditor.CodeMirrorUtils.toRange(primarySelection.anchor, primarySelection.head)); } /** @@ -484,10 +484,10 @@ */ dispose() { super.dispose(); - WebInspector.moduleSetting('textEditorIndent').removeChangeListener(this._onUpdateEditorIndentation, this); - WebInspector.moduleSetting('textEditorAutoDetectIndent') + Common.moduleSetting('textEditorIndent').removeChangeListener(this._onUpdateEditorIndentation, this); + Common.moduleSetting('textEditorAutoDetectIndent') .removeChangeListener(this._onUpdateEditorIndentation, this); - WebInspector.moduleSetting('showWhitespacesInEditor').removeChangeListener(this._updateWhitespace, this); + Common.moduleSetting('showWhitespacesInEditor').removeChangeListener(this._updateWhitespace, this); } /** @@ -497,7 +497,7 @@ setText(text) { this._muteTextChangedEvent = true; this._setEditorIndentation( - text.split('\n').slice(0, WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing)); + text.split('\n').slice(0, SourceFrame.SourcesTextEditor.LinesToScanForIndentationGuessing)); super.setText(text); delete this._muteTextChangedEvent; } @@ -524,7 +524,7 @@ */ _applyWhitespaceMimetype(mimeType) { this._setupWhitespaceHighlight(); - var whitespaceMode = WebInspector.moduleSetting('showWhitespacesInEditor').get(); + var whitespaceMode = Common.moduleSetting('showWhitespacesInEditor').get(); this.element.classList.toggle('show-whitespaces', whitespaceMode === 'all'); if (whitespaceMode === 'all') @@ -551,7 +551,7 @@ function nextToken(stream) { if (stream.peek() === ' ') { var spaces = 0; - while (spaces < WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan && + while (spaces < SourceFrame.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan && stream.peek() === ' ') { ++spaces; stream.next(); @@ -600,14 +600,14 @@ _setupWhitespaceHighlight() { var doc = this.element.ownerDocument; - if (doc._codeMirrorWhitespaceStyleInjected || !WebInspector.moduleSetting('showWhitespacesInEditor').get()) + if (doc._codeMirrorWhitespaceStyleInjected || !Common.moduleSetting('showWhitespacesInEditor').get()) return; doc._codeMirrorWhitespaceStyleInjected = true; const classBase = '.show-whitespaces .CodeMirror .cm-whitespace-'; const spaceChar = '·'; var spaceChars = ''; var rules = ''; - for (var i = 1; i <= WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan; ++i) { + for (var i = 1; i <= SourceFrame.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan; ++i) { spaceChars += spaceChar; var rule = classBase + i + '::before { content: \'' + spaceChars + '\';}\n'; rules += rule; @@ -619,10 +619,10 @@ }; /** @typedef {{lineNumber: number, event: !Event}} */ -WebInspector.SourcesTextEditor.GutterClickEventData; +SourceFrame.SourcesTextEditor.GutterClickEventData; /** @enum {symbol} */ -WebInspector.SourcesTextEditor.Events = { +SourceFrame.SourcesTextEditor.Events = { GutterClick: Symbol('GutterClick'), TextChanged: Symbol('TextChanged'), SelectionChanged: Symbol('SelectionChanged'), @@ -635,17 +635,17 @@ /** * @interface */ -WebInspector.SourcesTextEditorDelegate = function() {}; -WebInspector.SourcesTextEditorDelegate.prototype = { +SourceFrame.SourcesTextEditorDelegate = function() {}; +SourceFrame.SourcesTextEditorDelegate.prototype = { /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {number} lineNumber * @return {!Promise} */ populateLineGutterContextMenu: function(contextMenu, lineNumber) {}, /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {number} lineNumber * @param {number} columnNumber * @return {!Promise} @@ -665,7 +665,7 @@ var selection = selections[i]; var cur = CodeMirror.cmpPos(selection.head, selection.anchor) < 0 ? selection.head : selection.anchor; var line = codeMirror.getLine(cur.line); - var indent = WebInspector.TextUtils.lineIndent(line); + var indent = Common.TextUtils.lineIndent(line); replacements.push('\n' + indent.substring(0, Math.min(cur.ch, indent.length))); } codeMirror.replaceSelections(replacements); @@ -682,7 +682,7 @@ return CodeMirror.commands.dismiss(codemirror); }; -WebInspector.SourcesTextEditor._BlockIndentController = { +SourceFrame.SourcesTextEditor._BlockIndentController = { name: 'blockIndentKeymap', /** @@ -696,7 +696,7 @@ var selection = selections[i]; var start = CodeMirror.cmpPos(selection.head, selection.anchor) < 0 ? selection.head : selection.anchor; var line = codeMirror.getLine(start.line); - var indent = WebInspector.TextUtils.lineIndent(line); + var indent = Common.TextUtils.lineIndent(line); var indentToInsert = '\n' + indent + codeMirror._codeMirrorTextEditor.indent(); var isCollapsedBlock = false; if (selection.head.ch === 0) @@ -740,7 +740,7 @@ for (var i = 0; i < selections.length; ++i) { var selection = selections[i]; var line = codeMirror.getLine(selection.head.line); - if (line !== WebInspector.TextUtils.lineIndent(line)) + if (line !== Common.TextUtils.lineIndent(line)) return CodeMirror.Pass; replacements.push('}'); } @@ -755,7 +755,7 @@ return; updatedSelections.push({head: selection.head, anchor: new CodeMirror.Pos(selection.head.line, 0)}); var line = codeMirror.getLine(matchingBracket.to.line); - var indent = WebInspector.TextUtils.lineIndent(line); + var indent = Common.TextUtils.lineIndent(line); replacements.push(indent + '}'); } codeMirror.setSelections(updatedSelections); @@ -767,9 +767,9 @@ /** * @unrestricted */ -WebInspector.SourcesTextEditor.TokenHighlighter = class { +SourceFrame.SourcesTextEditor.TokenHighlighter = class { /** - * @param {!WebInspector.SourcesTextEditor} textEditor + * @param {!SourceFrame.SourcesTextEditor} textEditor * @param {!CodeMirror} codeMirror */ constructor(textEditor, codeMirror) { @@ -779,7 +779,7 @@ /** * @param {!RegExp} regex - * @param {?WebInspector.TextRange} range + * @param {?Common.TextRange} range */ highlightSearchResults(regex, range) { var oldRegex = this._highlightRegex; @@ -805,7 +805,7 @@ this._setHighlighter(this._searchHighlighter.bind(this, this._highlightRegex), selectionStart); } if (this._highlightRange) { - var pos = WebInspector.CodeMirrorUtils.toPos(this._highlightRange); + var pos = TextEditor.CodeMirrorUtils.toPos(this._highlightRange); this._searchResultMarker = this._codeMirror.markText(pos.start, pos.end, {className: 'cm-column-with-selection'}); } } @@ -848,9 +848,9 @@ */ _isWord(selectedText, lineNumber, startColumn, endColumn) { var line = this._codeMirror.getLine(lineNumber); - var leftBound = startColumn === 0 || !WebInspector.TextUtils.isWordChar(line.charAt(startColumn - 1)); - var rightBound = endColumn === line.length || !WebInspector.TextUtils.isWordChar(line.charAt(endColumn)); - return leftBound && rightBound && WebInspector.TextUtils.isWord(selectedText); + var leftBound = startColumn === 0 || !Common.TextUtils.isWordChar(line.charAt(startColumn - 1)); + var rightBound = endColumn === line.length || !Common.TextUtils.isWordChar(line.charAt(endColumn)); + return leftBound && rightBound && Common.TextUtils.isWord(selectedText); } _removeHighlight() { @@ -899,12 +899,12 @@ */ _tokenHighlighter(token, selectionStart, stream) { var tokenFirstChar = token.charAt(0); - if (stream.match(token) && (stream.eol() || !WebInspector.TextUtils.isWordChar(stream.peek()))) + if (stream.match(token) && (stream.eol() || !Common.TextUtils.isWordChar(stream.peek()))) return stream.column() === selectionStart.ch ? 'token-highlight column-with-selection' : 'token-highlight'; var eatenChar; do { eatenChar = stream.next(); - } while (eatenChar && (WebInspector.TextUtils.isWordChar(eatenChar) || stream.peek() !== tokenFirstChar)); + } while (eatenChar && (Common.TextUtils.isWordChar(eatenChar) || stream.peek() !== tokenFirstChar)); } /** @@ -918,5 +918,5 @@ } }; -WebInspector.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; -WebInspector.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16; +SourceFrame.SourcesTextEditor.LinesToScanForIndentationGuessing = 1000; +SourceFrame.SourcesTextEditor.MaximumNumberOfWhitespacesPerSingleSpan = 16;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js index 0120fff..36cb16c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/AddSourceMapURLDialog.js
@@ -4,21 +4,21 @@ /** * @unrestricted */ -WebInspector.AddSourceMapURLDialog = class extends WebInspector.HBox { +Sources.AddSourceMapURLDialog = class extends UI.HBox { /** * @param {function(string)} callback */ constructor(callback) { super(true); this.registerRequiredCSS('ui_lazy/dialog.css'); - this.contentElement.createChild('label').textContent = WebInspector.UIString('Source map URL: '); + this.contentElement.createChild('label').textContent = Common.UIString('Source map URL: '); this._input = this.contentElement.createChild('input'); this._input.setAttribute('type', 'text'); this._input.addEventListener('keydown', this._onKeyDown.bind(this), false); var addButton = this.contentElement.createChild('button'); - addButton.textContent = WebInspector.UIString('Add'); + addButton.textContent = Common.UIString('Add'); addButton.addEventListener('click', this._apply.bind(this), false); this.setDefaultFocusedElement(this._input); @@ -30,8 +30,8 @@ * @param {function(string)} callback */ static show(callback) { - var dialog = new WebInspector.Dialog(); - var addSourceMapURLDialog = new WebInspector.AddSourceMapURLDialog(done); + var dialog = new UI.Dialog(); + var addSourceMapURLDialog = new Sources.AddSourceMapURLDialog(done); addSourceMapURLDialog.show(dialog.element); dialog.setWrapsContent(true); dialog.show(); @@ -53,7 +53,7 @@ * @param {!Event} event */ _onKeyDown(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { + if (event.keyCode === UI.KeyboardShortcut.Keys.Enter.code) { event.preventDefault(); this._apply(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js b/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js index fb7705a4..5f2aa13 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/AdvancedSearchView.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.AdvancedSearchView = class extends WebInspector.VBox { +Sources.AdvancedSearchView = class extends UI.VBox { constructor() { super(true); this.setMinimumSize(0, 40); @@ -21,9 +21,9 @@ this._searchResultsElement = this.contentElement.createChild('div'); this._searchResultsElement.className = 'search-results'; - this._search = WebInspector.HistoryInput.create(); + this._search = UI.HistoryInput.create(); this._searchPanelElement.appendChild(this._search); - this._search.placeholder = WebInspector.UIString('Search all sources (use "file:" to filter by path)\u200e'); + this._search.placeholder = Common.UIString('Search all sources (use "file:" to filter by path)\u200e'); this._search.setAttribute('type', 'text'); this._search.classList.add('search-config-search'); this._search.setAttribute('results', '0'); @@ -34,13 +34,13 @@ this._searchInputClearElement.hidden = true; this._searchInputClearElement.addEventListener('click', this._onSearchInputClear.bind(this), false); - this._ignoreCaseLabel = createCheckboxLabel(WebInspector.UIString('Ignore case')); + this._ignoreCaseLabel = createCheckboxLabel(Common.UIString('Ignore case')); this._ignoreCaseLabel.classList.add('search-config-label'); this._searchPanelElement.appendChild(this._ignoreCaseLabel); this._ignoreCaseCheckbox = this._ignoreCaseLabel.checkboxElement; this._ignoreCaseCheckbox.classList.add('search-config-checkbox'); - this._regexLabel = createCheckboxLabel(WebInspector.UIString('Regular expression')); + this._regexLabel = createCheckboxLabel(Common.UIString('Regular expression')); this._regexLabel.classList.add('search-config-label'); this._searchPanelElement.appendChild(this._regexLabel); this._regexCheckbox = this._regexLabel.checkboxElement; @@ -51,11 +51,11 @@ this._searchProgressPlaceholderElement = this._searchToolbarElement.createChild('div', 'flex-centered'); this._searchResultsMessageElement = this._searchToolbarElement.createChild('div', 'search-message'); - this._advancedSearchConfig = WebInspector.settings.createLocalSetting( - 'advancedSearchConfig', new WebInspector.SearchConfig('', true, false).toPlainObject()); + this._advancedSearchConfig = Common.settings.createLocalSetting( + 'advancedSearchConfig', new Workspace.SearchConfig('', true, false).toPlainObject()); this._load(); - /** @type {!WebInspector.SearchScope} */ - this._searchScope = new WebInspector.SourcesSearchScope(); + /** @type {!Sources.SearchScope} */ + this._searchScope = new Sources.SourcesSearchScope(); } /** @@ -63,18 +63,18 @@ * @param {string=} filePath */ static openSearch(query, filePath) { - WebInspector.viewManager.showView('sources.search'); + UI.viewManager.showView('sources.search'); var searchView = - /** @type {!WebInspector.AdvancedSearchView} */ (self.runtime.sharedInstance(WebInspector.AdvancedSearchView)); + /** @type {!Sources.AdvancedSearchView} */ (self.runtime.sharedInstance(Sources.AdvancedSearchView)); var fileMask = filePath ? ' file:' + filePath : ''; searchView._toggle(query + fileMask); } /** - * @return {!WebInspector.SearchConfig} + * @return {!Workspace.SearchConfig} */ _buildSearchConfig() { - return new WebInspector.SearchConfig( + return new Workspace.SearchConfig( this._search.value, this._ignoreCaseCheckbox.checked, this._regexCheckbox.checked); } @@ -122,11 +122,11 @@ this._isIndexing = true; if (this._progressIndicator) this._progressIndicator.done(); - this._progressIndicator = new WebInspector.ProgressIndicator(); - this._searchMessageElement.textContent = WebInspector.UIString('Indexing\u2026'); + this._progressIndicator = new UI.ProgressIndicator(); + this._searchMessageElement.textContent = Common.UIString('Indexing\u2026'); this._progressIndicator.show(this._searchProgressPlaceholderElement); this._searchScope.performIndexing( - new WebInspector.ProgressProxy(this._progressIndicator, this._onIndexingFinished.bind(this))); + new Common.ProgressProxy(this._progressIndicator, this._onIndexingFinished.bind(this))); } _onSearchInputClear() { @@ -137,7 +137,7 @@ /** * @param {number} searchId - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Sources.FileBasedSearchResult} searchResult */ _onSearchResult(searchId, searchResult) { if (searchId !== this._searchId || !this._progressIndicator) @@ -170,7 +170,7 @@ } /** - * @param {!WebInspector.SearchConfig} searchConfig + * @param {!Workspace.SearchConfig} searchConfig */ _startSearch(searchConfig) { this._resetSearch(); @@ -181,13 +181,13 @@ } /** - * @param {!WebInspector.SearchConfig} searchConfig + * @param {!Workspace.SearchConfig} searchConfig */ _innerStartSearch(searchConfig) { this._searchConfig = searchConfig; if (this._progressIndicator) this._progressIndicator.done(); - this._progressIndicator = new WebInspector.ProgressIndicator(); + this._progressIndicator = new UI.ProgressIndicator(); this._searchStarted(this._progressIndicator); this._searchScope.performSearch( searchConfig, this._progressIndicator, this._onSearchResult.bind(this, this._searchId), @@ -212,18 +212,18 @@ } /** - * @param {!WebInspector.ProgressIndicator} progressIndicator + * @param {!UI.ProgressIndicator} progressIndicator */ _searchStarted(progressIndicator) { this._resetResults(); this._resetCounters(); - this._searchMessageElement.textContent = WebInspector.UIString('Searching\u2026'); + this._searchMessageElement.textContent = Common.UIString('Searching\u2026'); progressIndicator.show(this._searchProgressPlaceholderElement); this._updateSearchResultsMessage(); if (!this._searchingView) - this._searchingView = new WebInspector.EmptyWidget(WebInspector.UIString('Searching\u2026')); + this._searchingView = new UI.EmptyWidget(Common.UIString('Searching\u2026')); this._searchingView.show(this._searchResultsElement); } @@ -231,12 +231,12 @@ * @param {boolean} finished */ _indexingFinished(finished) { - this._searchMessageElement.textContent = finished ? '' : WebInspector.UIString('Indexing interrupted.'); + this._searchMessageElement.textContent = finished ? '' : Common.UIString('Indexing interrupted.'); } _updateSearchResultsMessage() { if (this._searchMatchesCount && this._searchResultsCount) - this._searchResultsMessageElement.textContent = WebInspector.UIString( + this._searchResultsMessageElement.textContent = Common.UIString( 'Found %d matches in %d files.', this._searchMatchesCount, this._nonEmptySearchResultsCount); else this._searchResultsMessageElement.textContent = ''; @@ -260,13 +260,13 @@ this._resetResults(); if (!this._notFoundView) - this._notFoundView = new WebInspector.EmptyWidget(WebInspector.UIString('No matches found.')); + this._notFoundView = new UI.EmptyWidget(Common.UIString('No matches found.')); this._notFoundView.show(this._searchResultsElement); - this._searchResultsMessageElement.textContent = WebInspector.UIString('No matches found.'); + this._searchResultsMessageElement.textContent = Common.UIString('No matches found.'); } /** - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Sources.FileBasedSearchResult} searchResult */ _addSearchResult(searchResult) { this._searchMatchesCount += searchResult.searchMatches.length; @@ -281,7 +281,7 @@ */ _searchFinished(finished) { this._searchMessageElement.textContent = - finished ? WebInspector.UIString('Search finished.') : WebInspector.UIString('Search interrupted.'); + finished ? Common.UIString('Search finished.') : Common.UIString('Search interrupted.'); } /** @@ -304,7 +304,7 @@ */ _onKeyDown(event) { switch (event.keyCode) { - case WebInspector.KeyboardShortcut.Keys.Enter.code: + case UI.KeyboardShortcut.Keys.Enter.code: this._onAction(); break; } @@ -322,7 +322,7 @@ } _load() { - var searchConfig = WebInspector.SearchConfig.fromPlainObject(this._advancedSearchConfig.get()); + var searchConfig = Workspace.SearchConfig.fromPlainObject(this._advancedSearchConfig.get()); this._search.value = searchConfig.query(); this._ignoreCaseCheckbox.checked = searchConfig.ignoreCase(); this._regexCheckbox.checked = searchConfig.isRegex(); @@ -344,9 +344,9 @@ /** * @unrestricted */ -WebInspector.SearchResultsPane = class { +Sources.SearchResultsPane = class { /** - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.ProjectSearchConfig} searchConfig */ constructor(searchConfig) { this._searchConfig = searchConfig; @@ -354,27 +354,27 @@ } /** - * @return {!WebInspector.ProjectSearchConfig} + * @return {!Workspace.ProjectSearchConfig} */ get searchConfig() { return this._searchConfig; } /** - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Sources.FileBasedSearchResult} searchResult */ addSearchResult(searchResult) { } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.AdvancedSearchView.ActionDelegate = class { +Sources.AdvancedSearchView.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ @@ -384,20 +384,20 @@ } _showSearch() { - var selection = WebInspector.inspectorView.element.getDeepSelection(); + var selection = UI.inspectorView.element.getDeepSelection(); var queryCandidate = ''; if (selection.rangeCount) queryCandidate = selection.toString().replace(/\r?\n.*/, ''); - WebInspector.AdvancedSearchView.openSearch(queryCandidate); + Sources.AdvancedSearchView.openSearch(queryCandidate); } }; /** * @unrestricted */ -WebInspector.FileBasedSearchResult = class { +Sources.FileBasedSearchResult = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {!Array.<!Object>} searchMatches */ constructor(uiSourceCode, searchMatches) { @@ -409,27 +409,27 @@ /** * @interface */ -WebInspector.SearchScope = function() {}; +Sources.SearchScope = function() {}; -WebInspector.SearchScope.prototype = { +Sources.SearchScope.prototype = { /** - * @param {!WebInspector.SearchConfig} searchConfig - * @param {!WebInspector.Progress} progress - * @param {function(!WebInspector.FileBasedSearchResult)} searchResultCallback + * @param {!Workspace.SearchConfig} searchConfig + * @param {!Common.Progress} progress + * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback * @param {function(boolean)} searchFinishedCallback */ performSearch: function(searchConfig, progress, searchResultCallback, searchFinishedCallback) {}, /** - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ performIndexing: function(progress) {}, stopSearch: function() {}, /** - * @param {!WebInspector.ProjectSearchConfig} searchConfig - * @return {!WebInspector.SearchResultsPane} + * @param {!Workspace.ProjectSearchConfig} searchConfig + * @return {!Sources.SearchResultsPane} */ createSearchResultsPane: function(searchConfig) {} };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js index 243535073d..217a8ec 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js
@@ -31,25 +31,25 @@ /** * @unrestricted */ -WebInspector.CSSSourceFrame = class extends WebInspector.UISourceCodeFrame { +Sources.CSSSourceFrame = class extends Sources.UISourceCodeFrame { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ constructor(uiSourceCode) { super(uiSourceCode); this._registerShortcuts(); - this._swatchPopoverHelper = new WebInspector.SwatchPopoverHelper(); + this._swatchPopoverHelper = new UI.SwatchPopoverHelper(); this._muteSwatchProcessing = false; this.configureAutocomplete( {suggestionsCallback: this._cssSuggestions.bind(this), isWordChar: this._isWordChar.bind(this)}); - this.textEditor.addEventListener(WebInspector.SourcesTextEditor.Events.ScrollChanged, () => { + this.textEditor.addEventListener(SourceFrame.SourcesTextEditor.Events.ScrollChanged, () => { if (this._swatchPopoverHelper.isShowing()) this._swatchPopoverHelper.hide(true); }); } _registerShortcuts() { - var shortcutKeys = WebInspector.ShortcutsScreen.SourcesPanelShortcuts; + var shortcutKeys = Components.ShortcutsScreen.SourcesPanelShortcuts; for (var i = 0; i < shortcutKeys.IncreaseCSSUnitByOne.length; ++i) this.addShortcut(shortcutKeys.IncreaseCSSUnitByOne[i].key, this._handleUnitModification.bind(this, 1)); for (var i = 0; i < shortcutKeys.DecreaseCSSUnitByOne.length; ++i) @@ -90,7 +90,7 @@ return false; var cssUnitRange = - new WebInspector.TextRange(selection.startLine, token.startColumn, selection.startLine, token.endColumn); + new Common.TextRange(selection.startLine, token.startColumn, selection.startLine, token.endColumn); var cssUnitText = this.textEditor.text(cssUnitRange); var newUnitText = this._modifyUnit(cssUnitText, change); if (!newUnitText) @@ -111,16 +111,16 @@ var swatchPositions = []; var regexes = [ - WebInspector.CSSMetadata.VariableRegex, WebInspector.CSSMetadata.URLRegex, - WebInspector.Geometry.CubicBezier.Regex, WebInspector.Color.Regex + SDK.CSSMetadata.VariableRegex, SDK.CSSMetadata.URLRegex, + Common.Geometry.CubicBezier.Regex, Common.Color.Regex ]; var handlers = new Map(); - handlers.set(WebInspector.Color.Regex, this._createColorSwatch.bind(this)); - handlers.set(WebInspector.Geometry.CubicBezier.Regex, this._createBezierSwatch.bind(this)); + handlers.set(Common.Color.Regex, this._createColorSwatch.bind(this)); + handlers.set(Common.Geometry.CubicBezier.Regex, this._createBezierSwatch.bind(this)); for (var lineNumber = startLine; lineNumber <= endLine; lineNumber++) { - var line = this.textEditor.line(lineNumber).substring(0, WebInspector.CSSSourceFrame.maxSwatchProcessingLength); - var results = WebInspector.TextUtils.splitStringByRegexes(line, regexes); + var line = this.textEditor.line(lineNumber).substring(0, Sources.CSSSourceFrame.maxSwatchProcessingLength); + var results = Common.TextUtils.splitStringByRegexes(line, regexes); for (var i = 0; i < results.length; i++) { var result = results[i]; if (result.regexIndex === -1 || !handlers.has(regexes[result.regexIndex])) @@ -135,40 +135,40 @@ if (!swatch) continue; swatches.push(swatch); - swatchPositions.push(WebInspector.TextRange.createFromLocation(lineNumber, result.position)); + swatchPositions.push(Common.TextRange.createFromLocation(lineNumber, result.position)); } } this.textEditor.operation(putSwatchesInline.bind(this)); /** - * @this {WebInspector.CSSSourceFrame} + * @this {Sources.CSSSourceFrame} */ function putSwatchesInline() { - var clearRange = new WebInspector.TextRange(startLine, 0, endLine, this.textEditor.line(endLine).length); - this.textEditor.bookmarks(clearRange, WebInspector.CSSSourceFrame.SwatchBookmark) + var clearRange = new Common.TextRange(startLine, 0, endLine, this.textEditor.line(endLine).length); + this.textEditor.bookmarks(clearRange, Sources.CSSSourceFrame.SwatchBookmark) .forEach(marker => marker.clear()); for (var i = 0; i < swatches.length; i++) { var swatch = swatches[i]; var swatchPosition = swatchPositions[i]; var bookmark = this.textEditor.addBookmark( - swatchPosition.startLine, swatchPosition.startColumn, swatch, WebInspector.CSSSourceFrame.SwatchBookmark); - swatch[WebInspector.CSSSourceFrame.SwatchBookmark] = bookmark; + swatchPosition.startLine, swatchPosition.startColumn, swatch, Sources.CSSSourceFrame.SwatchBookmark); + swatch[Sources.CSSSourceFrame.SwatchBookmark] = bookmark; } } } /** * @param {string} text - * @return {?WebInspector.ColorSwatch} + * @return {?UI.ColorSwatch} */ _createColorSwatch(text) { - var color = WebInspector.Color.parse(text); + var color = Common.Color.parse(text); if (!color) return null; - var swatch = WebInspector.ColorSwatch.create(); + var swatch = UI.ColorSwatch.create(); swatch.setColor(color); - swatch.iconElement().title = WebInspector.UIString('Open color picker.'); + swatch.iconElement().title = Common.UIString('Open color picker.'); swatch.iconElement().addEventListener('click', this._swatchIconClicked.bind(this, swatch), false); swatch.hideText(true); return swatch; @@ -176,14 +176,14 @@ /** * @param {string} text - * @return {?WebInspector.BezierSwatch} + * @return {?UI.BezierSwatch} */ _createBezierSwatch(text) { - if (!WebInspector.Geometry.CubicBezier.parse(text)) + if (!Common.Geometry.CubicBezier.parse(text)) return null; - var swatch = WebInspector.BezierSwatch.create(); + var swatch = UI.BezierSwatch.create(); swatch.setBezierText(text); - swatch.iconElement().title = WebInspector.UIString('Open cubic bezier editor.'); + swatch.iconElement().title = Common.UIString('Open cubic bezier editor.'); swatch.iconElement().addEventListener('click', this._swatchIconClicked.bind(this, swatch), false); swatch.hideText(true); return swatch; @@ -197,44 +197,44 @@ event.consume(true); this._hadSwatchChange = false; this._muteSwatchProcessing = true; - var swatchPosition = swatch[WebInspector.CSSSourceFrame.SwatchBookmark].position(); + var swatchPosition = swatch[Sources.CSSSourceFrame.SwatchBookmark].position(); this.textEditor.setSelection(swatchPosition); this._editedSwatchTextRange = swatchPosition.clone(); this._editedSwatchTextRange.endColumn += swatch.textContent.length; this._currentSwatch = swatch; - if (swatch instanceof WebInspector.ColorSwatch) + if (swatch instanceof UI.ColorSwatch) this._showSpectrum(swatch); - else if (swatch instanceof WebInspector.BezierSwatch) + else if (swatch instanceof UI.BezierSwatch) this._showBezierEditor(swatch); } /** - * @param {!WebInspector.ColorSwatch} swatch + * @param {!UI.ColorSwatch} swatch */ _showSpectrum(swatch) { if (!this._spectrum) { - this._spectrum = new WebInspector.Spectrum(); - this._spectrum.addEventListener(WebInspector.Spectrum.Events.SizeChanged, this._spectrumResized, this); - this._spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, this._spectrumChanged, this); + this._spectrum = new Components.Spectrum(); + this._spectrum.addEventListener(Components.Spectrum.Events.SizeChanged, this._spectrumResized, this); + this._spectrum.addEventListener(Components.Spectrum.Events.ColorChanged, this._spectrumChanged, this); } this._spectrum.setColor(swatch.color(), swatch.format()); this._swatchPopoverHelper.show(this._spectrum, swatch.iconElement(), this._swatchPopoverHidden.bind(this)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _spectrumResized(event) { this._swatchPopoverHelper.reposition(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _spectrumChanged(event) { var colorString = /** @type {string} */ (event.data); - var color = WebInspector.Color.parse(colorString); + var color = Common.Color.parse(colorString); if (!color) return; this._currentSwatch.setColor(color); @@ -242,23 +242,23 @@ } /** - * @param {!WebInspector.BezierSwatch} swatch + * @param {!UI.BezierSwatch} swatch */ _showBezierEditor(swatch) { if (!this._bezierEditor) { - this._bezierEditor = new WebInspector.BezierEditor(); - this._bezierEditor.addEventListener(WebInspector.BezierEditor.Events.BezierChanged, this._bezierChanged, this); + this._bezierEditor = new UI.BezierEditor(); + this._bezierEditor.addEventListener(UI.BezierEditor.Events.BezierChanged, this._bezierChanged, this); } - var cubicBezier = WebInspector.Geometry.CubicBezier.parse(swatch.bezierText()); + var cubicBezier = Common.Geometry.CubicBezier.parse(swatch.bezierText()); if (!cubicBezier) cubicBezier = - /** @type {!WebInspector.Geometry.CubicBezier} */ (WebInspector.Geometry.CubicBezier.parse('linear')); + /** @type {!Common.Geometry.CubicBezier} */ (Common.Geometry.CubicBezier.parse('linear')); this._bezierEditor.setBezier(cubicBezier); this._swatchPopoverHelper.show(this._bezierEditor, swatch.iconElement(), this._swatchPopoverHidden.bind(this)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _bezierChanged(event) { var bezierString = /** @type {string} */ (event.data); @@ -295,8 +295,8 @@ /** * @override - * @param {!WebInspector.TextRange} oldRange - * @param {!WebInspector.TextRange} newRange + * @param {!Common.TextRange} oldRange + * @param {!Common.TextRange} newRange */ onTextChanged(oldRange, newRange) { super.onTextChanged(oldRange, newRange); @@ -309,13 +309,13 @@ * @return {boolean} */ _isWordChar(char) { - return WebInspector.TextUtils.isWordChar(char) || char === '.' || char === '-' || char === '$'; + return Common.TextUtils.isWordChar(char) || char === '.' || char === '-' || char === '$'; } /** - * @param {!WebInspector.TextRange} prefixRange - * @param {!WebInspector.TextRange} substituteRange - * @return {?Promise.<!WebInspector.SuggestBox.Suggestions>} + * @param {!Common.TextRange} prefixRange + * @param {!Common.TextRange} substituteRange + * @return {?Promise.<!UI.SuggestBox.Suggestions>} */ _cssSuggestions(prefixRange, substituteRange) { var prefix = this._textEditor.text(prefixRange); @@ -328,7 +328,7 @@ var line = this._textEditor.line(prefixRange.startLine); var tokenContent = line.substring(propertyToken.startColumn, propertyToken.endColumn); - var propertyValues = WebInspector.cssMetadata().propertyValues(tokenContent); + var propertyValues = SDK.cssMetadata().propertyValues(tokenContent); return Promise.resolve(propertyValues.filter(value => value.startsWith(prefix)).map(value => ({title: value}))); } @@ -365,6 +365,6 @@ }; /** @type {number} */ -WebInspector.CSSSourceFrame.maxSwatchProcessingLength = 300; +Sources.CSSSourceFrame.maxSwatchProcessingLength = 300; /** @type {symbol} */ -WebInspector.CSSSourceFrame.SwatchBookmark = Symbol('swatch'); +Sources.CSSSourceFrame.SwatchBookmark = Symbol('swatch');
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js index 7eb7293b..fe46c36 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -23,22 +23,22 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContextFlavorListener} + * @implements {UI.ContextFlavorListener} * @unrestricted */ -WebInspector.CallStackSidebarPane = class extends WebInspector.SimpleView { +Sources.CallStackSidebarPane = class extends UI.SimpleView { constructor() { - super(WebInspector.UIString('Call Stack')); + super(Common.UIString('Call Stack')); this.element.addEventListener('keydown', this._keyDown.bind(this), true); this.element.tabIndex = 0; - this.callFrameList = new WebInspector.UIList(); + this.callFrameList = new Sources.UIList(); this.callFrameList.show(this.element); - this._linkifier = new WebInspector.Linkifier(); - WebInspector.moduleSetting('enableAsyncStackTraces').addChangeListener(this._asyncStackTracesStateChanged, this); - WebInspector.moduleSetting('skipStackFramesPattern').addChangeListener(this._update, this); - /** @type {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} */ + this._linkifier = new Components.Linkifier(); + Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this._asyncStackTracesStateChanged, this); + Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._update, this); + /** @type {!Array<!Sources.CallStackSidebarPane.CallFrame>} */ this.callFrames = []; - this._locationPool = new WebInspector.LiveLocationPool(); + this._locationPool = new Bindings.LiveLocationPool(); this._update(); } @@ -51,7 +51,7 @@ } _update() { - var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails); + var details = UI.context.flavor(SDK.DebuggerPausedDetails); this.callFrameList.detach(); this.callFrameList.clear(); @@ -66,8 +66,8 @@ if (!details) { var infoElement = this.element.createChild('div', 'gray-info-message'); - infoElement.textContent = WebInspector.UIString('Not Paused'); - WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame, null); + infoElement.textContent = Common.UIString('Not Paused'); + UI.context.setFlavor(SDK.DebuggerModel.CallFrame, null); return; } this._debuggerModel = details.debuggerModel; @@ -82,13 +82,13 @@ if (asyncStackTrace.description === 'async function') { var lastPreviousFrame = peviousStackTrace[peviousStackTrace.length - 1]; var topFrame = asyncStackTrace.callFrames[0]; - var lastPreviousFrameName = WebInspector.beautifyFunctionName(lastPreviousFrame.functionName); - var topFrameName = WebInspector.beautifyFunctionName(topFrame.functionName); + var lastPreviousFrameName = UI.beautifyFunctionName(lastPreviousFrame.functionName); + var topFrameName = UI.beautifyFunctionName(topFrame.functionName); title = topFrameName + ' awaits ' + lastPreviousFrameName; } else { - title = WebInspector.asyncStackTraceLabel(asyncStackTrace.description); + title = UI.asyncStackTraceLabel(asyncStackTrace.description); } - var asyncCallFrame = new WebInspector.UIList.Item(title, '', true); + var asyncCallFrame = new Sources.UIList.Item(title, '', true); asyncCallFrame.setHoverable(false); asyncCallFrame.element.addEventListener( 'contextmenu', this._asyncCallFrameContextMenu.bind(this, this.callFrames.length), true); @@ -103,13 +103,13 @@ if (this._hiddenCallFrames) { var element = createElementWithClass('div', 'hidden-callframes-message'); if (this._hiddenCallFrames === 1) - element.textContent = WebInspector.UIString('1 stack frame is hidden (black-boxed).'); + element.textContent = Common.UIString('1 stack frame is hidden (black-boxed).'); else element.textContent = - WebInspector.UIString('%d stack frames are hidden (black-boxed).', this._hiddenCallFrames); + Common.UIString('%d stack frames are hidden (black-boxed).', this._hiddenCallFrames); element.createTextChild(' '); var showAllLink = element.createChild('span', 'link'); - showAllLink.textContent = WebInspector.UIString('Show'); + showAllLink.textContent = Common.UIString('Show'); showAllLink.addEventListener('click', this._revealHiddenCallFrames.bind(this), false); this.element.insertBefore(element, this.element.firstChild); this._hiddenCallFramesMessageElement = element; @@ -119,14 +119,14 @@ } /** - * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames - * @return {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} + * @param {!Array.<!SDK.DebuggerModel.CallFrame>} callFrames + * @return {!Array<!Sources.CallStackSidebarPane.CallFrame>} */ _callFramesFromDebugger(callFrames) { var callFrameItems = []; for (var i = 0, n = callFrames.length; i < n; ++i) { var callFrame = callFrames[i]; - var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame( + var callFrameItem = new Sources.CallStackSidebarPane.CallFrame( callFrame.functionName, callFrame.location(), this._linkifier, callFrame, this._locationPool); callFrameItem.element.addEventListener('click', this._callFrameSelected.bind(this, callFrameItem), false); callFrameItems.push(callFrameItem); @@ -136,16 +136,16 @@ /** * @param {!Array<!Protocol.Runtime.CallFrame>} callFrames - * @param {!WebInspector.UIList.Item} asyncCallFrameItem - * @return {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} + * @param {!Sources.UIList.Item} asyncCallFrameItem + * @return {!Array<!Sources.CallStackSidebarPane.CallFrame>} */ _callFramesFromRuntime(callFrames, asyncCallFrameItem) { var callFrameItems = []; for (var i = 0, n = callFrames.length; i < n; ++i) { var callFrame = callFrames[i]; - var location = new WebInspector.DebuggerModel.Location( + var location = new SDK.DebuggerModel.Location( this._debuggerModel, callFrame.scriptId, callFrame.lineNumber, callFrame.columnNumber); - var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame( + var callFrameItem = new Sources.CallStackSidebarPane.CallFrame( callFrame.functionName, location, this._linkifier, null, this._locationPool, asyncCallFrameItem); callFrameItem.element.addEventListener('click', this._asyncCallFrameClicked.bind(this, callFrameItem), false); callFrameItems.push(callFrameItem); @@ -154,8 +154,8 @@ } /** - * @param {!Array.<!WebInspector.CallStackSidebarPane.CallFrame>} callFrames - * @param {!WebInspector.UIList.Item=} asyncCallFrameItem + * @param {!Array.<!Sources.CallStackSidebarPane.CallFrame>} callFrames + * @param {!Sources.UIList.Item=} asyncCallFrameItem */ _appendSidebarCallFrames(callFrames, asyncCallFrameItem) { if (asyncCallFrameItem) @@ -167,7 +167,7 @@ callFrameItem.element.addEventListener('contextmenu', this._callFrameContextMenu.bind(this, callFrameItem), true); this.callFrames.push(callFrameItem); - if (WebInspector.blackboxManager.isBlackboxedRawLocation(callFrameItem._location)) { + if (Bindings.blackboxManager.isBlackboxedRawLocation(callFrameItem._location)) { callFrameItem.setHidden(true); callFrameItem.setDimmed(true); ++this._hiddenCallFrames; @@ -204,19 +204,19 @@ } /** - * @param {!WebInspector.CallStackSidebarPane.CallFrame} callFrame + * @param {!Sources.CallStackSidebarPane.CallFrame} callFrame * @param {!Event} event */ _callFrameContextMenu(callFrame, event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); var debuggerCallFrame = callFrame._debuggerCallFrame; if (debuggerCallFrame) contextMenu.appendItem( - WebInspector.UIString.capitalize('Restart ^frame'), debuggerCallFrame.restart.bind(debuggerCallFrame)); + Common.UIString.capitalize('Restart ^frame'), debuggerCallFrame.restart.bind(debuggerCallFrame)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Copy ^stack ^trace'), this._copyStackTrace.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Copy ^stack ^trace'), this._copyStackTrace.bind(this)); - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame._location); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame._location); this.appendBlackboxURLContextMenuItems(contextMenu, uiLocation.uiSourceCode); contextMenu.show(); @@ -237,44 +237,44 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!UI.ContextMenu} contextMenu + * @param {!Workspace.UISourceCode} uiSourceCode */ appendBlackboxURLContextMenuItems(contextMenu, uiSourceCode) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (binding) uiSourceCode = binding.network; - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) return; - var canBlackbox = WebInspector.blackboxManager.canBlackboxUISourceCode(uiSourceCode); - var isBlackboxed = WebInspector.blackboxManager.isBlackboxedUISourceCode(uiSourceCode); - var isContentScript = uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts; + var canBlackbox = Bindings.blackboxManager.canBlackboxUISourceCode(uiSourceCode); + var isBlackboxed = Bindings.blackboxManager.isBlackboxedUISourceCode(uiSourceCode); + var isContentScript = uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts; - var manager = WebInspector.blackboxManager; + var manager = Bindings.blackboxManager; if (canBlackbox) { if (isBlackboxed) contextMenu.appendItem( - WebInspector.UIString.capitalize('Stop ^blackboxing'), + Common.UIString.capitalize('Stop ^blackboxing'), manager.unblackboxUISourceCode.bind(manager, uiSourceCode)); else contextMenu.appendItem( - WebInspector.UIString.capitalize('Blackbox ^script'), + Common.UIString.capitalize('Blackbox ^script'), manager.blackboxUISourceCode.bind(manager, uiSourceCode)); } if (isContentScript) { if (isBlackboxed) contextMenu.appendItem( - WebInspector.UIString.capitalize('Stop blackboxing ^all ^content ^scripts'), + Common.UIString.capitalize('Stop blackboxing ^all ^content ^scripts'), manager.blackboxContentScripts.bind(manager)); else contextMenu.appendItem( - WebInspector.UIString.capitalize('Blackbox ^all ^content ^scripts'), + Common.UIString.capitalize('Blackbox ^all ^content ^scripts'), manager.unblackboxContentScripts.bind(manager)); } } _asyncStackTracesStateChanged() { - var enabled = WebInspector.moduleSetting('enableAsyncStackTraces').get(); + var enabled = Common.moduleSetting('enableAsyncStackTraces').get(); if (!enabled && this.callFrames) this._removeAsyncCallFrames(); } @@ -352,15 +352,15 @@ } /** - * @param {!WebInspector.CallStackSidebarPane.CallFrame} callFrameItem + * @param {!Sources.CallStackSidebarPane.CallFrame} callFrameItem */ _asyncCallFrameClicked(callFrameItem) { - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrameItem._location); - WebInspector.Revealer.reveal(uiLocation); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrameItem._location); + Common.Revealer.reveal(uiLocation); } /** - * @param {!WebInspector.CallStackSidebarPane.CallFrame} selectedCallFrame + * @param {!Sources.CallStackSidebarPane.CallFrame} selectedCallFrame */ _callFrameSelected(selectedCallFrame) { selectedCallFrame.element.scrollIntoViewIfNeeded(); @@ -373,14 +373,14 @@ this._revealHiddenCallFrames(); } - var oldCallFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); + var oldCallFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); if (oldCallFrame === callFrame) { - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location()); - WebInspector.Revealer.reveal(uiLocation); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location()); + Common.Revealer.reveal(uiLocation); return; } - WebInspector.context.setFlavor(WebInspector.DebuggerModel.CallFrame, callFrame); + UI.context.setFlavor(SDK.DebuggerModel.CallFrame, callFrame); callFrame.debuggerModel.setSelectedCallFrame(callFrame); } @@ -400,13 +400,13 @@ } /** - * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate + * @param {function(!Array.<!UI.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate */ registerShortcuts(registerShortcutDelegate) { registerShortcutDelegate( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this)); + Components.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this)); registerShortcutDelegate( - WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame, + Components.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame, this._selectPreviousCallFrameOnStack.bind(this)); } @@ -422,25 +422,25 @@ /** * @unrestricted */ -WebInspector.CallStackSidebarPane.CallFrame = class extends WebInspector.UIList.Item { +Sources.CallStackSidebarPane.CallFrame = class extends Sources.UIList.Item { /** * @param {string} functionName - * @param {!WebInspector.DebuggerModel.Location} location - * @param {!WebInspector.Linkifier} linkifier - * @param {?WebInspector.DebuggerModel.CallFrame} debuggerCallFrame - * @param {!WebInspector.LiveLocationPool} locationPool - * @param {!WebInspector.UIList.Item=} asyncCallFrame + * @param {!SDK.DebuggerModel.Location} location + * @param {!Components.Linkifier} linkifier + * @param {?SDK.DebuggerModel.CallFrame} debuggerCallFrame + * @param {!Bindings.LiveLocationPool} locationPool + * @param {!Sources.UIList.Item=} asyncCallFrame */ constructor(functionName, location, linkifier, debuggerCallFrame, locationPool, asyncCallFrame) { - super(WebInspector.beautifyFunctionName(functionName), ''); + super(UI.beautifyFunctionName(functionName), ''); this._location = location; this._debuggerCallFrame = debuggerCallFrame; this._asyncCallFrame = asyncCallFrame; - WebInspector.debuggerWorkspaceBinding.createCallFrameLiveLocation(location, this._update.bind(this), locationPool); + Bindings.debuggerWorkspaceBinding.createCallFrameLiveLocation(location, this._update.bind(this), locationPool); } /** - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!Bindings.LiveLocation} liveLocation */ _update(liveLocation) { var uiLocation = liveLocation.uiLocation();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js b/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js index cb18dbb..424115f 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/DebuggerPausedMessage.js
@@ -4,10 +4,10 @@ /** * @unrestricted */ -WebInspector.DebuggerPausedMessage = class { +Sources.DebuggerPausedMessage = class { constructor() { this._element = createElementWithClass('div', 'paused-message flex-none'); - var root = WebInspector.createShadowRootWithCoreStyles(this._element, 'sources/debuggerPausedMessage.css'); + var root = UI.createShadowRootWithCoreStyles(this._element, 'sources/debuggerPausedMessage.css'); this._contentElement = root.createChild('div', 'paused-status'); } @@ -19,9 +19,9 @@ } /** - * @param {?WebInspector.DebuggerPausedDetails} details - * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding - * @param {!WebInspector.BreakpointManager} breakpointManager + * @param {?SDK.DebuggerPausedDetails} details + * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding + * @param {!Bindings.BreakpointManager} breakpointManager */ render(details, debuggerWorkspaceBinding, breakpointManager) { var status = this._contentElement; @@ -31,43 +31,43 @@ return; var messageWrapper; - if (details.reason === WebInspector.DebuggerModel.BreakReason.DOM) { - messageWrapper = WebInspector.DOMBreakpointsSidebarPane.createBreakpointHitMessage(details); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.EventListener) { + if (details.reason === SDK.DebuggerModel.BreakReason.DOM) { + messageWrapper = Components.DOMBreakpointsSidebarPane.createBreakpointHitMessage(details); + } else if (details.reason === SDK.DebuggerModel.BreakReason.EventListener) { var eventName = details.auxData['eventName']; - var eventNameForUI = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName, details.auxData); - messageWrapper = buildWrapper(WebInspector.UIString('Paused on event listener'), eventNameForUI); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.XHR) { - messageWrapper = buildWrapper(WebInspector.UIString('Paused on XMLHttpRequest'), details.auxData['url'] || ''); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.Exception) { + var eventNameForUI = Sources.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName, details.auxData); + messageWrapper = buildWrapper(Common.UIString('Paused on event listener'), eventNameForUI); + } else if (details.reason === SDK.DebuggerModel.BreakReason.XHR) { + messageWrapper = buildWrapper(Common.UIString('Paused on XMLHttpRequest'), details.auxData['url'] || ''); + } else if (details.reason === SDK.DebuggerModel.BreakReason.Exception) { var description = details.auxData['description'] || details.auxData['value'] || ''; var descriptionFirstLine = description.split('\n', 1)[0]; - messageWrapper = buildWrapper(WebInspector.UIString('Paused on exception'), descriptionFirstLine, description); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.PromiseRejection) { + messageWrapper = buildWrapper(Common.UIString('Paused on exception'), descriptionFirstLine, description); + } else if (details.reason === SDK.DebuggerModel.BreakReason.PromiseRejection) { var description = details.auxData['description'] || details.auxData['value'] || ''; var descriptionFirstLine = description.split('\n', 1)[0]; messageWrapper = - buildWrapper(WebInspector.UIString('Paused on promise rejection'), descriptionFirstLine, description); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.Assert) { - messageWrapper = buildWrapper(WebInspector.UIString('Paused on assertion')); - } else if (details.reason === WebInspector.DebuggerModel.BreakReason.DebugCommand) { - messageWrapper = buildWrapper(WebInspector.UIString('Paused on debugged function')); + buildWrapper(Common.UIString('Paused on promise rejection'), descriptionFirstLine, description); + } else if (details.reason === SDK.DebuggerModel.BreakReason.Assert) { + messageWrapper = buildWrapper(Common.UIString('Paused on assertion')); + } else if (details.reason === SDK.DebuggerModel.BreakReason.DebugCommand) { + messageWrapper = buildWrapper(Common.UIString('Paused on debugged function')); } else if (details.callFrames.length) { var uiLocation = debuggerWorkspaceBinding.rawLocationToUILocation(details.callFrames[0].location()); var breakpoint = uiLocation ? breakpointManager.findBreakpoint( uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber) : null; var defaultText = - breakpoint ? WebInspector.UIString('Paused on breakpoint') : WebInspector.UIString('Debugger paused'); + breakpoint ? Common.UIString('Paused on breakpoint') : Common.UIString('Debugger paused'); messageWrapper = buildWrapper(defaultText); } else { console.warn( 'ScriptsPanel paused, but callFrames.length is zero.'); // TODO remove this once we understand this case better } - var errorLike = details.reason === WebInspector.DebuggerModel.BreakReason.Exception || - details.reason === WebInspector.DebuggerModel.BreakReason.PromiseRejection || - details.reason === WebInspector.DebuggerModel.BreakReason.Assert; + var errorLike = details.reason === SDK.DebuggerModel.BreakReason.Exception || + details.reason === SDK.DebuggerModel.BreakReason.PromiseRejection || + details.reason === SDK.DebuggerModel.BreakReason.Assert; status.classList.toggle('error-reason', errorLike); if (messageWrapper) status.appendChild(messageWrapper); @@ -81,7 +81,7 @@ function buildWrapper(mainText, subText, title) { var messageWrapper = createElement('span'); var mainElement = messageWrapper.createChild('div', 'status-main'); - mainElement.appendChild(WebInspector.Icon.create('smallicon-info', 'status-icon')); + mainElement.appendChild(UI.Icon.create('smallicon-info', 'status-icon')); mainElement.appendChild(createTextNode(mainText)); if (subText) { var subElement = messageWrapper.createChild('div', 'status-sub monospace');
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/EditingLocationHistoryManager.js b/third_party/WebKit/Source/devtools/front_end/sources/EditingLocationHistoryManager.js index 4058147..6676279a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/EditingLocationHistoryManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/EditingLocationHistoryManager.js
@@ -31,28 +31,28 @@ /** * @unrestricted */ -WebInspector.EditingLocationHistoryManager = class { +Sources.EditingLocationHistoryManager = class { /** - * @param {!WebInspector.SourcesView} sourcesView - * @param {function():?WebInspector.SourceFrame} currentSourceFrameCallback + * @param {!Sources.SourcesView} sourcesView + * @param {function():?SourceFrame.SourceFrame} currentSourceFrameCallback */ constructor(sourcesView, currentSourceFrameCallback) { this._sourcesView = sourcesView; this._historyManager = - new WebInspector.SimpleHistoryManager(WebInspector.EditingLocationHistoryManager.HistoryDepth); + new Sources.SimpleHistoryManager(Sources.EditingLocationHistoryManager.HistoryDepth); this._currentSourceFrameCallback = currentSourceFrameCallback; } /** - * @param {!WebInspector.UISourceCodeFrame} sourceFrame + * @param {!Sources.UISourceCodeFrame} sourceFrame */ trackSourceFrameCursorJumps(sourceFrame) { sourceFrame.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.JumpHappened, this._onJumpHappened.bind(this)); + SourceFrame.SourcesTextEditor.Events.JumpHappened, this._onJumpHappened.bind(this)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onJumpHappened(event) { if (event.data.from) @@ -84,7 +84,7 @@ } /** - * @param {!WebInspector.TextRange} selection + * @param {!Common.TextRange} selection */ _updateActiveState(selection) { var active = this._historyManager.active(); @@ -93,23 +93,23 @@ var sourceFrame = this._currentSourceFrameCallback(); if (!sourceFrame) return; - var entry = new WebInspector.EditingLocationHistoryEntry(this._sourcesView, this, sourceFrame, selection); + var entry = new Sources.EditingLocationHistoryEntry(this._sourcesView, this, sourceFrame, selection); active.merge(entry); } /** - * @param {!WebInspector.TextRange} selection + * @param {!Common.TextRange} selection */ _pushActiveState(selection) { var sourceFrame = this._currentSourceFrameCallback(); if (!sourceFrame) return; - var entry = new WebInspector.EditingLocationHistoryEntry(this._sourcesView, this, sourceFrame, selection); + var entry = new Sources.EditingLocationHistoryEntry(this._sourcesView, this, sourceFrame, selection); this._historyManager.push(entry); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ removeHistoryForSourceCode(uiSourceCode) { function filterOut(entry) { @@ -120,18 +120,18 @@ } }; -WebInspector.EditingLocationHistoryManager.HistoryDepth = 20; +Sources.EditingLocationHistoryManager.HistoryDepth = 20; /** - * @implements {WebInspector.HistoryEntry} + * @implements {Sources.HistoryEntry} * @unrestricted */ -WebInspector.EditingLocationHistoryEntry = class { +Sources.EditingLocationHistoryEntry = class { /** - * @param {!WebInspector.SourcesView} sourcesView - * @param {!WebInspector.EditingLocationHistoryManager} editingLocationManager - * @param {!WebInspector.SourceFrame} sourceFrame - * @param {!WebInspector.TextRange} selection + * @param {!Sources.SourcesView} sourcesView + * @param {!Sources.EditingLocationHistoryManager} editingLocationManager + * @param {!SourceFrame.SourceFrame} sourceFrame + * @param {!Common.TextRange} selection */ constructor(sourcesView, editingLocationManager, sourceFrame, selection) { this._sourcesView = sourcesView; @@ -145,7 +145,7 @@ } /** - * @param {!WebInspector.HistoryEntry} entry + * @param {!Sources.HistoryEntry} entry */ merge(entry) { if (this._projectId !== entry._projectId || this._url !== entry._url) @@ -154,7 +154,7 @@ } /** - * @param {!WebInspector.TextRange} selection + * @param {!Common.TextRange} selection * @return {!{lineNumber: number, columnNumber: number}} */ _positionFromSelection(selection) { @@ -167,7 +167,7 @@ */ valid() { var position = this._positionHandle.resolve(); - var uiSourceCode = WebInspector.workspace.uiSourceCode(this._projectId, this._url); + var uiSourceCode = Workspace.workspace.uiSourceCode(this._projectId, this._url); return !!(position && uiSourceCode); } @@ -176,7 +176,7 @@ */ reveal() { var position = this._positionHandle.resolve(); - var uiSourceCode = WebInspector.workspace.uiSourceCode(this._projectId, this._url); + var uiSourceCode = Workspace.workspace.uiSourceCode(this._projectId, this._url); if (!position || !uiSourceCode) return;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js index e0a8b83..d26f9993 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/EventListenerBreakpointsSidebarPane.js
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.EventListenerBreakpointsSidebarPane = class extends WebInspector.VBox { +Sources.EventListenerBreakpointsSidebarPane = class extends UI.VBox { constructor() { super(); this.registerRequiredCSS('components/breakpointsList.css'); - this._eventListenerBreakpointsSetting = WebInspector.settings.createLocalSetting('eventListenerBreakpoints', []); + this._eventListenerBreakpointsSetting = Common.settings.createLocalSetting('eventListenerBreakpoints', []); this._categoriesTreeOutline = new TreeOutlineInShadow(); this._categoriesTreeOutline.element.tabIndex = 0; @@ -21,27 +21,27 @@ this._categoryItems = []; // FIXME: uncomment following once inspector stops being drop targer in major ports. // Otherwise, inspector page reacts on drop event and tries to load the event data. - // this._createCategory(WebInspector.UIString("Drag"), ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]); + // this._createCategory(Common.UIString("Drag"), ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]); this._createCategory( - WebInspector.UIString('Animation'), ['requestAnimationFrame', 'cancelAnimationFrame', 'animationFrameFired'], + Common.UIString('Animation'), ['requestAnimationFrame', 'cancelAnimationFrame', 'animationFrameFired'], true); this._createCategory( - WebInspector.UIString('Clipboard'), ['copy', 'cut', 'paste', 'beforecopy', 'beforecut', 'beforepaste']); + Common.UIString('Clipboard'), ['copy', 'cut', 'paste', 'beforecopy', 'beforecut', 'beforepaste']); this._createCategory( - WebInspector.UIString('Control'), + Common.UIString('Control'), ['resize', 'scroll', 'zoom', 'focus', 'blur', 'select', 'change', 'submit', 'reset']); - this._createCategory(WebInspector.UIString('Device'), ['deviceorientation', 'devicemotion']); - this._createCategory(WebInspector.UIString('DOM Mutation'), [ + this._createCategory(Common.UIString('Device'), ['deviceorientation', 'devicemotion']); + this._createCategory(Common.UIString('DOM Mutation'), [ 'DOMActivate', 'DOMFocusIn', 'DOMFocusOut', 'DOMAttrModified', 'DOMCharacterDataModified', 'DOMNodeInserted', 'DOMNodeInsertedIntoDocument', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument', 'DOMSubtreeModified', 'DOMContentLoaded' ]); - this._createCategory(WebInspector.UIString('Drag / drop'), ['dragenter', 'dragover', 'dragleave', 'drop']); - this._createCategory(WebInspector.UIString('Keyboard'), ['keydown', 'keyup', 'keypress', 'input']); + this._createCategory(Common.UIString('Drag / drop'), ['dragenter', 'dragover', 'dragleave', 'drop']); + this._createCategory(Common.UIString('Keyboard'), ['keydown', 'keyup', 'keypress', 'input']); this._createCategory( - WebInspector.UIString('Load'), ['load', 'beforeunload', 'unload', 'abort', 'error', 'hashchange', 'popstate']); + Common.UIString('Load'), ['load', 'beforeunload', 'unload', 'abort', 'error', 'hashchange', 'popstate']); this._createCategory( - WebInspector.UIString('Media'), + Common.UIString('Media'), [ 'play', 'pause', 'playing', 'canplay', 'canplaythrough', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'durationchange', 'volumechange', @@ -49,31 +49,31 @@ 'stalled', 'loadedmetadata', 'loadeddata', 'waiting' ], false, ['audio', 'video']); - this._createCategory(WebInspector.UIString('Mouse'), [ + this._createCategory(Common.UIString('Mouse'), [ 'auxclick', 'click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mousemove', 'mouseout', 'mouseenter', 'mouseleave', 'mousewheel', 'wheel', 'contextmenu' ]); - this._createCategory(WebInspector.UIString('Parse'), ['setInnerHTML'], true); - this._createCategory(WebInspector.UIString('Pointer'), [ + this._createCategory(Common.UIString('Parse'), ['setInnerHTML'], true); + this._createCategory(Common.UIString('Pointer'), [ 'pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointerdown', 'pointerup', 'pointermove', 'pointercancel', 'gotpointercapture', 'lostpointercapture' ]); - this._createCategory(WebInspector.UIString('Script'), ['scriptFirstStatement', 'scriptBlockedByCSP'], true); - this._createCategory(WebInspector.UIString('Timer'), ['setTimer', 'clearTimer', 'timerFired'], true); - this._createCategory(WebInspector.UIString('Touch'), ['touchstart', 'touchmove', 'touchend', 'touchcancel']); - this._createCategory(WebInspector.UIString('WebGL'), ['webglErrorFired', 'webglWarningFired'], true); - this._createCategory(WebInspector.UIString('Window'), ['close'], true); + this._createCategory(Common.UIString('Script'), ['scriptFirstStatement', 'scriptBlockedByCSP'], true); + this._createCategory(Common.UIString('Timer'), ['setTimer', 'clearTimer', 'timerFired'], true); + this._createCategory(Common.UIString('Touch'), ['touchstart', 'touchmove', 'touchend', 'touchcancel']); + this._createCategory(Common.UIString('WebGL'), ['webglErrorFired', 'webglWarningFired'], true); + this._createCategory(Common.UIString('Window'), ['close'], true); this._createCategory( - WebInspector.UIString('XHR'), + Common.UIString('XHR'), ['readystatechange', 'load', 'loadstart', 'loadend', 'abort', 'error', 'progress', 'timeout'], false, ['XMLHttpRequest', 'XMLHttpRequestUpload']); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.DOM); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._update, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._update, this); - WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._update, this); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.DOM); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._update, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._update, this); + UI.context.addFlavorChangeListener(SDK.Target, this._update, this); } /** @@ -82,19 +82,19 @@ * @return {string} */ static eventNameForUI(eventName, auxData) { - if (!WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI) { - WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI = { - 'instrumentation:setTimer': WebInspector.UIString('Set Timer'), - 'instrumentation:clearTimer': WebInspector.UIString('Clear Timer'), - 'instrumentation:timerFired': WebInspector.UIString('Timer Fired'), - 'instrumentation:scriptFirstStatement': WebInspector.UIString('Script First Statement'), - 'instrumentation:scriptBlockedByCSP': WebInspector.UIString('Script Blocked by Content Security Policy'), - 'instrumentation:requestAnimationFrame': WebInspector.UIString('Request Animation Frame'), - 'instrumentation:cancelAnimationFrame': WebInspector.UIString('Cancel Animation Frame'), - 'instrumentation:animationFrameFired': WebInspector.UIString('Animation Frame Fired'), - 'instrumentation:webglErrorFired': WebInspector.UIString('WebGL Error Fired'), - 'instrumentation:webglWarningFired': WebInspector.UIString('WebGL Warning Fired'), - 'instrumentation:setInnerHTML': WebInspector.UIString('Set innerHTML'), + if (!Sources.EventListenerBreakpointsSidebarPane._eventNamesForUI) { + Sources.EventListenerBreakpointsSidebarPane._eventNamesForUI = { + 'instrumentation:setTimer': Common.UIString('Set Timer'), + 'instrumentation:clearTimer': Common.UIString('Clear Timer'), + 'instrumentation:timerFired': Common.UIString('Timer Fired'), + 'instrumentation:scriptFirstStatement': Common.UIString('Script First Statement'), + 'instrumentation:scriptBlockedByCSP': Common.UIString('Script Blocked by Content Security Policy'), + 'instrumentation:requestAnimationFrame': Common.UIString('Request Animation Frame'), + 'instrumentation:cancelAnimationFrame': Common.UIString('Cancel Animation Frame'), + 'instrumentation:animationFrameFired': Common.UIString('Animation Frame Fired'), + 'instrumentation:webglErrorFired': Common.UIString('WebGL Error Fired'), + 'instrumentation:webglWarningFired': Common.UIString('WebGL Warning Fired'), + 'instrumentation:setInnerHTML': Common.UIString('Set innerHTML'), }; } if (auxData) { @@ -102,19 +102,19 @@ var errorName = auxData['webglErrorName']; // If there is a hex code of the error, display only this. errorName = errorName.replace(/^.*(0x[0-9a-f]+).*$/i, '$1'); - return WebInspector.UIString('WebGL Error Fired (%s)', errorName); + return Common.UIString('WebGL Error Fired (%s)', errorName); } if (eventName === 'instrumentation:scriptBlockedByCSP' && auxData['directiveText']) - return WebInspector.UIString( + return Common.UIString( 'Script blocked due to Content Security Policy directive: %s', auxData['directiveText']); } - return WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI[eventName] || + return Sources.EventListenerBreakpointsSidebarPane._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(':') + 1); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._restoreBreakpoints(target); @@ -122,7 +122,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } @@ -145,16 +145,16 @@ categoryItem.checkbox.addEventListener('click', this._categoryCheckboxClicked.bind(this, categoryItem), true); categoryItem.targetNames = - this._stringArrayToLowerCase(targetNames || [WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny]); + this._stringArrayToLowerCase(targetNames || [Sources.EventListenerBreakpointsSidebarPane.eventTargetAny]); categoryItem.children = {}; var category = - (isInstrumentationEvent ? WebInspector.EventListenerBreakpointsSidebarPane.categoryInstrumentation : - WebInspector.EventListenerBreakpointsSidebarPane.categoryListener); + (isInstrumentationEvent ? Sources.EventListenerBreakpointsSidebarPane.categoryInstrumentation : + Sources.EventListenerBreakpointsSidebarPane.categoryListener); for (var i = 0; i < eventNames.length; ++i) { var eventName = category + eventNames[i]; var breakpointItem = {}; - var title = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName); + var title = Sources.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName); labelNode = createCheckboxLabel(title); labelNode.classList.add('source-code'); @@ -176,11 +176,11 @@ } _update() { - var target = WebInspector.context.flavor(WebInspector.Target); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var target = UI.context.flavor(SDK.Target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); var details = debuggerModel ? debuggerModel.debuggerPausedDetails() : null; - if (!details || details.reason !== WebInspector.DebuggerModel.BreakReason.EventListener) { + if (!details || details.reason !== SDK.DebuggerModel.BreakReason.EventListener) { if (this._highlightedElement) { this._highlightedElement.classList.remove('breakpoint-hit'); delete this._highlightedElement; @@ -192,10 +192,10 @@ var breakpointItem = this._findBreakpointItem(eventName, targetName); if (!breakpointItem || !breakpointItem.checkbox.checked) breakpointItem = - this._findBreakpointItem(eventName, WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny); + this._findBreakpointItem(eventName, Sources.EventListenerBreakpointsSidebarPane.eventTargetAny); if (!breakpointItem) return; - WebInspector.viewManager.showView('sources.eventListenerBreakpoints'); + UI.viewManager.showView('sources.eventListenerBreakpoints'); breakpointItem.parent.element.expand(); breakpointItem.element.listItemElement.classList.add('breakpoint-hit'); this._highlightedElement = breakpointItem.element.listItemElement; @@ -241,10 +241,10 @@ /** * @param {string} eventName * @param {?Array.<string>=} eventTargetNames - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _setBreakpoint(eventName, eventTargetNames, target) { - eventTargetNames = eventTargetNames || [WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny]; + eventTargetNames = eventTargetNames || [Sources.EventListenerBreakpointsSidebarPane.eventTargetAny]; for (var i = 0; i < eventTargetNames.length; ++i) { var eventTargetName = eventTargetNames[i]; var breakpointItem = this._findBreakpointItem(eventName, eventTargetName); @@ -260,10 +260,10 @@ /** * @param {string} eventName * @param {?Array.<string>=} eventTargetNames - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _removeBreakpoint(eventName, eventTargetNames, target) { - eventTargetNames = eventTargetNames || [WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny]; + eventTargetNames = eventTargetNames || [Sources.EventListenerBreakpointsSidebarPane.eventTargetAny]; for (var i = 0; i < eventTargetNames.length; ++i) { var eventTargetName = eventTargetNames[i]; var breakpointItem = this._findBreakpointItem(eventName, eventTargetName); @@ -280,21 +280,21 @@ * @param {string} eventName * @param {string} eventTargetName * @param {boolean} enable - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _updateBreakpointOnTarget(eventName, eventTargetName, enable, target) { - var targets = target ? [target] : WebInspector.targetManager.targets(WebInspector.Target.Capability.DOM); + var targets = target ? [target] : SDK.targetManager.targets(SDK.Target.Capability.DOM); for (target of targets) { - if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categoryListener)) { + if (eventName.startsWith(Sources.EventListenerBreakpointsSidebarPane.categoryListener)) { var protocolEventName = - eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categoryListener.length); + eventName.substring(Sources.EventListenerBreakpointsSidebarPane.categoryListener.length); if (enable) target.domdebuggerAgent().setEventListenerBreakpoint(protocolEventName, eventTargetName); else target.domdebuggerAgent().removeEventListenerBreakpoint(protocolEventName, eventTargetName); - } else if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categoryInstrumentation)) { + } else if (eventName.startsWith(Sources.EventListenerBreakpointsSidebarPane.categoryInstrumentation)) { var protocolEventName = - eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categoryInstrumentation.length); + eventName.substring(Sources.EventListenerBreakpointsSidebarPane.categoryInstrumentation.length); if (enable) target.domdebuggerAgent().setInstrumentationBreakpoint(protocolEventName); else @@ -329,7 +329,7 @@ * @return {?Object} */ _findBreakpointItem(eventName, targetName) { - targetName = (targetName || WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny).toLowerCase(); + targetName = (targetName || Sources.EventListenerBreakpointsSidebarPane.eventTargetAny).toLowerCase(); for (var i = 0; i < this._categoryItems.length; ++i) { var categoryItem = this._categoryItems[i]; if (categoryItem.targetNames.indexOf(targetName) === -1) @@ -355,7 +355,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _restoreBreakpoints(target) { var breakpoints = this._eventListenerBreakpointsSetting.get(); @@ -367,6 +367,6 @@ } }; -WebInspector.EventListenerBreakpointsSidebarPane.categoryListener = 'listener:'; -WebInspector.EventListenerBreakpointsSidebarPane.categoryInstrumentation = 'instrumentation:'; -WebInspector.EventListenerBreakpointsSidebarPane.eventTargetAny = '*'; +Sources.EventListenerBreakpointsSidebarPane.categoryListener = 'listener:'; +Sources.EventListenerBreakpointsSidebarPane.categoryInstrumentation = 'instrumentation:'; +Sources.EventListenerBreakpointsSidebarPane.eventTargetAny = '*';
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FileBasedSearchResultsPane.js b/third_party/WebKit/Source/devtools/front_end/sources/FileBasedSearchResultsPane.js index 7bb17ca..aaba72d 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/FileBasedSearchResultsPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/FileBasedSearchResultsPane.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.FileBasedSearchResultsPane = class extends WebInspector.SearchResultsPane { +Sources.FileBasedSearchResultsPane = class extends Sources.SearchResultsPane { /** - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.ProjectSearchConfig} searchConfig */ constructor(searchConfig) { super(searchConfig); @@ -21,7 +21,7 @@ /** * @override - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Sources.FileBasedSearchResult} searchResult */ addSearchResult(searchResult) { this._searchResults.push(searchResult); @@ -32,28 +32,28 @@ } /** - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Sources.FileBasedSearchResult} searchResult */ _addFileTreeElement(searchResult) { - var fileTreeElement = new WebInspector.FileBasedSearchResultsPane.FileTreeElement(this._searchConfig, searchResult); + var fileTreeElement = new Sources.FileBasedSearchResultsPane.FileTreeElement(this._searchConfig, searchResult); this._treeOutline.appendChild(fileTreeElement); // Expand until at least a certain number of matches is expanded. - if (this._matchesExpandedCount < WebInspector.FileBasedSearchResultsPane.matchesExpandedByDefaultCount) + if (this._matchesExpandedCount < Sources.FileBasedSearchResultsPane.matchesExpandedByDefaultCount) fileTreeElement.expand(); this._matchesExpandedCount += searchResult.searchMatches.length; } }; -WebInspector.FileBasedSearchResultsPane.matchesExpandedByDefaultCount = 20; -WebInspector.FileBasedSearchResultsPane.fileMatchesShownAtOnce = 20; +Sources.FileBasedSearchResultsPane.matchesExpandedByDefaultCount = 20; +Sources.FileBasedSearchResultsPane.fileMatchesShownAtOnce = 20; /** * @unrestricted */ -WebInspector.FileBasedSearchResultsPane.FileTreeElement = class extends TreeElement { +Sources.FileBasedSearchResultsPane.FileTreeElement = class extends TreeElement { /** - * @param {!WebInspector.ProjectSearchConfig} searchConfig - * @param {!WebInspector.FileBasedSearchResult} searchResult + * @param {!Workspace.ProjectSearchConfig} searchConfig + * @param {!Sources.FileBasedSearchResult} searchResult */ constructor(searchConfig, searchResult) { super('', true); @@ -78,7 +78,7 @@ _updateMatchesUI() { this.removeChildren(); var toIndex = Math.min( - this._searchResult.searchMatches.length, WebInspector.FileBasedSearchResultsPane.fileMatchesShownAtOnce); + this._searchResult.searchMatches.length, Sources.FileBasedSearchResultsPane.fileMatchesShownAtOnce); if (toIndex < this._searchResult.searchMatches.length) { this._appendSearchMatches(0, toIndex - 1); this._appendShowMoreMatchesElement(toIndex - 1); @@ -107,9 +107,9 @@ var searchMatchesCount = this._searchResult.searchMatches.length; if (searchMatchesCount === 1) - matchesCountSpan.textContent = WebInspector.UIString('(%d match)', searchMatchesCount); + matchesCountSpan.textContent = Common.UIString('(%d match)', searchMatchesCount); else - matchesCountSpan.textContent = WebInspector.UIString('(%d matches)', searchMatchesCount); + matchesCountSpan.textContent = Common.UIString('(%d matches)', searchMatchesCount); this.listItemElement.appendChild(matchesCountSpan); if (this.expanded) @@ -161,7 +161,7 @@ */ _appendShowMoreMatchesElement(startMatchIndex) { var matchesLeftCount = this._searchResult.searchMatches.length - startMatchIndex; - var showMoreMatchesText = WebInspector.UIString('Show all matches (%d more).', matchesLeftCount); + var showMoreMatchesText = Common.UIString('Show all matches (%d more).', matchesLeftCount); this._showMoreMatchesTreeElement = new TreeElement(showMoreMatchesText); this.appendChild(this._showMoreMatchesTreeElement); this._showMoreMatchesTreeElement.listItemElement.classList.add('show-more-matches'); @@ -169,38 +169,38 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber * @return {!Element} */ _createAnchor(uiSourceCode, lineNumber, columnNumber) { - return WebInspector.Linkifier.linkifyUsingRevealer(uiSourceCode.uiLocation(lineNumber, columnNumber), ''); + return Components.Linkifier.linkifyUsingRevealer(uiSourceCode.uiLocation(lineNumber, columnNumber), ''); } /** * @param {string} lineContent - * @param {!Array.<!WebInspector.SourceRange>} matchRanges + * @param {!Array.<!Common.SourceRange>} matchRanges */ _createContentSpan(lineContent, matchRanges) { var contentSpan = createElement('span'); contentSpan.className = 'search-match-content'; contentSpan.textContent = lineContent; - WebInspector.highlightRangesWithStyleClass(contentSpan, matchRanges, 'highlighted-match'); + UI.highlightRangesWithStyleClass(contentSpan, matchRanges, 'highlighted-match'); return contentSpan; } /** * @param {string} lineContent * @param {!RegExp} regex - * @return {!Array.<!WebInspector.SourceRange>} + * @return {!Array.<!Common.SourceRange>} */ _regexMatchRanges(lineContent, regex) { regex.lastIndex = 0; var match; var matchRanges = []; while ((regex.lastIndex < lineContent.length) && (match = regex.exec(lineContent))) - matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length)); + matchRanges.push(new Common.SourceRange(match.index, match[0].length)); return matchRanges; }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js b/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js index 5ea54505..845d6d2 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.FilePathScoreFunction = class { +Sources.FilePathScoreFunction = class { /** * @param {string} query */
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js index d13f062..2e073f5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
@@ -7,38 +7,38 @@ /** * @unrestricted */ -WebInspector.FilteredUISourceCodeListDelegate = class extends WebInspector.FilteredListWidget.Delegate { +Sources.FilteredUISourceCodeListDelegate = class extends UI.FilteredListWidget.Delegate { /** - * @param {!Map.<!WebInspector.UISourceCode, number>=} defaultScores + * @param {!Map.<!Workspace.UISourceCode, number>=} defaultScores * @param {!Array<string>=} history */ constructor(defaultScores, history) { super(history || []); this._defaultScores = defaultScores; - this._scorer = new WebInspector.FilePathScoreFunction(''); - WebInspector.workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + this._scorer = new Sources.FilePathScoreFunction(''); + Workspace.workspace.addEventListener( + Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _projectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); this.populate(project); this.refresh(); } /** * @protected - * @param {!WebInspector.Project=} skipProject + * @param {!Workspace.Project=} skipProject */ populate(skipProject) { - /** @type {!Array.<!WebInspector.UISourceCode>} */ + /** @type {!Array.<!Workspace.UISourceCode>} */ this._uiSourceCodes = []; - var projects = WebInspector.workspace.projects().filter(this.filterProject.bind(this)); + var projects = Workspace.workspace.projects().filter(this.filterProject.bind(this)); for (var i = 0; i < projects.length; ++i) { if (skipProject && projects[i] === skipProject) continue; @@ -48,16 +48,16 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ _filterUISourceCode(uiSourceCode) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); return !binding || binding.network === uiSourceCode; } /** - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode * @param {number=} lineNumber * @param {number=} columnNumber */ @@ -66,7 +66,7 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ filterProject(project) { @@ -105,7 +105,7 @@ if (this._query !== query) { this._query = query; - this._scorer = new WebInspector.FilePathScoreFunction(query); + this._scorer = new Sources.FilePathScoreFunction(query); } var url = uiSourceCode.url(); @@ -124,7 +124,7 @@ var uiSourceCode = this._uiSourceCodes[itemIndex]; var fullDisplayName = uiSourceCode.fullDisplayName(); var indexes = []; - var score = new WebInspector.FilePathScoreFunction(query).score(fullDisplayName, indexes); + var score = new Sources.FilePathScoreFunction(query).score(fullDisplayName, indexes); var fileNameIndex = fullDisplayName.lastIndexOf('/'); titleElement.textContent = uiSourceCode.displayName() + (this._queryLineNumberAndColumnNumber || ''); @@ -137,9 +137,9 @@ if (indexes[0] > fileNameIndex) { for (var i = 0; i < ranges.length; ++i) ranges[i].offset -= fileNameIndex + 1; - WebInspector.highlightRangesWithStyleClass(titleElement, ranges, 'highlight'); + UI.highlightRangesWithStyleClass(titleElement, ranges, 'highlight'); } else { - WebInspector.highlightRangesWithStyleClass(subtitleElement, ranges, 'highlight'); + UI.highlightRangesWithStyleClass(subtitleElement, ranges, 'highlight'); } } @@ -194,10 +194,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (!this._filterUISourceCode(uiSourceCode) || !this.filterProject(uiSourceCode.project())) return; this._uiSourceCodes.push(uiSourceCode); @@ -208,9 +208,9 @@ * @override */ dispose() { - WebInspector.workspace.removeEventListener( - WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); - WebInspector.workspace.removeEventListener( - WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + Workspace.workspace.removeEventListener( + Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); + Workspace.workspace.removeEventListener( + Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/InplaceFormatterEditorAction.js b/third_party/WebKit/Source/devtools/front_end/sources/InplaceFormatterEditorAction.js index bb98b011..6d2c45b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/InplaceFormatterEditorAction.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/InplaceFormatterEditorAction.js
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.SourcesView.EditorAction} + * @implements {Sources.SourcesView.EditorAction} * @unrestricted */ -WebInspector.InplaceFormatterEditorAction = class { +Sources.InplaceFormatterEditorAction = class { /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorSelected(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._updateButton(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorClosed(event) { var wasSelected = /** @type {boolean} */ (event.data.wasSelected); @@ -24,7 +24,7 @@ } /** - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode */ _updateButton(uiSourceCode) { this._button.element.classList.toggle('hidden', !this._isFormattable(uiSourceCode)); @@ -32,18 +32,18 @@ /** * @override - * @param {!WebInspector.SourcesView} sourcesView - * @return {!WebInspector.ToolbarButton} + * @param {!Sources.SourcesView} sourcesView + * @return {!UI.ToolbarButton} */ button(sourcesView) { if (this._button) return this._button; this._sourcesView = sourcesView; - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClosed, this._editorClosed.bind(this)); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorClosed, this._editorClosed.bind(this)); - this._button = new WebInspector.ToolbarButton(WebInspector.UIString('Format'), 'largeicon-pretty-print'); + this._button = new UI.ToolbarButton(Common.UIString('Format'), 'largeicon-pretty-print'); this._button.addEventListener('click', this._formatSourceInPlace, this); this._updateButton(sourcesView.currentUISourceCode()); @@ -51,18 +51,18 @@ } /** - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode * @return {boolean} */ _isFormattable(uiSourceCode) { if (!uiSourceCode) return false; - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) return true; - if (WebInspector.persistence.binding(uiSourceCode)) + if (Persistence.persistence.binding(uiSourceCode)) return true; return uiSourceCode.contentType().isStyleSheet() || - uiSourceCode.project().type() === WebInspector.projectTypes.Snippets; + uiSourceCode.project().type() === Workspace.projectTypes.Snippets; } _formatSourceInPlace() { @@ -76,19 +76,19 @@ uiSourceCode.requestContent().then(contentLoaded.bind(this)); /** - * @this {WebInspector.InplaceFormatterEditorAction} + * @this {Sources.InplaceFormatterEditorAction} * @param {?string} content */ function contentLoaded(content) { - var highlighterType = WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode); - WebInspector.Formatter.format( + var highlighterType = Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode); + Sources.Formatter.format( uiSourceCode.contentType(), highlighterType, content || '', innerCallback.bind(this)); } /** - * @this {WebInspector.InplaceFormatterEditorAction} + * @this {Sources.InplaceFormatterEditorAction} * @param {string} formattedContent - * @param {!WebInspector.FormatterSourceMapping} formatterMapping + * @param {!Sources.FormatterSourceMapping} formatterMapping */ function innerCallback(formattedContent, formatterMapping) { if (uiSourceCode.workingCopy() === formattedContent)
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js index 51d5121b..69e066cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ContextFlavorListener} + * @implements {UI.ContextFlavorListener} * @unrestricted */ -WebInspector.JavaScriptBreakpointsSidebarPane = class extends WebInspector.VBox { +Sources.JavaScriptBreakpointsSidebarPane = class extends UI.VBox { constructor() { super(); this.registerRequiredCSS('components/breakpointsList.css'); - this._breakpointManager = WebInspector.breakpointManager; + this._breakpointManager = Bindings.breakpointManager; this._listElement = createElementWithClass('ol', 'breakpoint-list'); this.emptyElement = this.element.createChild('div', 'gray-info-message'); - this.emptyElement.textContent = WebInspector.UIString('No Breakpoints'); + this.emptyElement.textContent = Common.UIString('No Breakpoints'); this._items = new Map(); @@ -24,49 +24,49 @@ this._addBreakpoint(breakpointLocations[i].breakpoint, breakpointLocations[i].uiLocation); this._breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); + Bindings.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); this._breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); + Bindings.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); this.emptyElement.addEventListener('contextmenu', this._emptyElementContextMenu.bind(this), true); this._breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); + Bindings.BreakpointManager.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); this._breakpointsActiveStateChanged(); this._update(); } _emptyElementContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); this._appendBreakpointActiveItem(contextMenu); contextMenu.show(); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendBreakpointActiveItem(contextMenu) { var breakpointActive = this._breakpointManager.breakpointsActive(); - var breakpointActiveTitle = breakpointActive ? WebInspector.UIString.capitalize('Deactivate ^breakpoints') : - WebInspector.UIString.capitalize('Activate ^breakpoints'); + var breakpointActiveTitle = breakpointActive ? Common.UIString.capitalize('Deactivate ^breakpoints') : + Common.UIString.capitalize('Activate ^breakpoints'); contextMenu.appendItem( breakpointActiveTitle, this._breakpointManager.setBreakpointsActive.bind(this._breakpointManager, !breakpointActive)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _breakpointAdded(event) { this._breakpointRemoved(event); - var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint); - var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation); + var breakpoint = /** @type {!Bindings.BreakpointManager.Breakpoint} */ (event.data.breakpoint); + var uiLocation = /** @type {!Workspace.UILocation} */ (event.data.uiLocation); this._addBreakpoint(breakpoint, uiLocation); } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint - * @param {!WebInspector.UILocation} uiLocation + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint + * @param {!Workspace.UILocation} uiLocation */ _addBreakpoint(breakpoint, uiLocation) { var element = createElementWithClass('li', 'cursor-pointer'); @@ -81,12 +81,12 @@ /** * @param {?string} content - * @this {WebInspector.JavaScriptBreakpointsSidebarPane} + * @this {Sources.JavaScriptBreakpointsSidebarPane} */ function didRequestContent(content) { var lineNumber = uiLocation.lineNumber; var columnNumber = uiLocation.columnNumber; - var text = new WebInspector.Text(content || ''); + var text = new Common.Text(content || ''); if (lineNumber < text.lineCount()) { var lineText = text.lineAt(lineNumber); var maxSnippetLength = 200; @@ -112,7 +112,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber */ @@ -120,10 +120,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _breakpointRemoved(event) { - var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint); + var breakpoint = /** @type {!Bindings.BreakpointManager.Breakpoint} */ (event.data.breakpoint); var breakpointItem = this._items.get(breakpoint); if (!breakpointItem) return; @@ -140,9 +140,9 @@ } _update() { - var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails); + var details = UI.context.flavor(SDK.DebuggerPausedDetails); var uiLocation = details && details.callFrames.length ? - WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(details.callFrames[0].location()) : + Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(details.callFrames[0].location()) : null; var breakpoint = uiLocation ? this._breakpointManager.findBreakpoint( @@ -159,7 +159,7 @@ breakpointItem.element.classList.add('breakpoint-hit'); this._highlightedBreakpointItem = breakpointItem; - WebInspector.viewManager.showView('sources.jsBreakpoints'); + UI.viewManager.showView('sources.jsBreakpoints'); } _breakpointsActiveStateChanged() { @@ -167,14 +167,14 @@ } /** - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation */ _breakpointClicked(uiLocation) { - WebInspector.Revealer.reveal(uiLocation); + Common.Revealer.reveal(uiLocation); } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint * @param {!Event} event */ _breakpointCheckboxClicked(breakpoint, event) { @@ -184,15 +184,15 @@ } /** - * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint * @param {!Event} event */ _breakpointContextMenu(breakpoint, event) { var breakpoints = this._items.valuesArray(); - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString.capitalize('Remove ^breakpoint'), breakpoint.remove.bind(breakpoint)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString.capitalize('Remove ^breakpoint'), breakpoint.remove.bind(breakpoint)); if (breakpoints.length > 1) { - var removeAllTitle = WebInspector.UIString.capitalize('Remove ^all ^breakpoints'); + var removeAllTitle = Common.UIString.capitalize('Remove ^all ^breakpoints'); contextMenu.appendItem( removeAllTitle, this._breakpointManager.removeAllBreakpoints.bind(this._breakpointManager)); } @@ -210,8 +210,8 @@ } if (breakpoints.length > 1) { var enableBreakpointCount = enabledBreakpointCount(breakpoints); - var enableTitle = WebInspector.UIString.capitalize('Enable ^all ^breakpoints'); - var disableTitle = WebInspector.UIString.capitalize('Disable ^all ^breakpoints'); + var enableTitle = Common.UIString.capitalize('Enable ^all ^breakpoints'); + var disableTitle = Common.UIString.capitalize('Disable ^all ^breakpoints'); contextMenu.appendSeparator();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js index 07c15e4..ba9f6fd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.JavaScriptCompiler = class { +Sources.JavaScriptCompiler = class { /** - * @param {!WebInspector.JavaScriptSourceFrame} sourceFrame + * @param {!Sources.JavaScriptSourceFrame} sourceFrame */ constructor(sourceFrame) { this._sourceFrame = sourceFrame; @@ -20,21 +20,21 @@ } if (this._timeout) clearTimeout(this._timeout); - this._timeout = setTimeout(this._compile.bind(this), WebInspector.JavaScriptCompiler.CompileDelay); + this._timeout = setTimeout(this._compile.bind(this), Sources.JavaScriptCompiler.CompileDelay); } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ _findTarget() { - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); var sourceCode = this._sourceFrame.uiSourceCode(); for (var i = 0; i < targets.length; ++i) { - var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(sourceCode, targets[i]); + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode, targets[i]); if (scriptFile) return targets[i]; } - return WebInspector.targetManager.mainTarget(); + return SDK.targetManager.mainTarget(); } _compile() { @@ -42,7 +42,7 @@ if (!target) return; var runtimeModel = target.runtimeModel; - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (!currentExecutionContext) return; @@ -51,10 +51,10 @@ runtimeModel.compileScript(code, '', false, currentExecutionContext.id, compileCallback.bind(this, target)); /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {!Protocol.Runtime.ScriptId=} scriptId * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.JavaScriptCompiler} + * @this {Sources.JavaScriptCompiler} */ function compileCallback(target, scriptId, exceptionDetails) { this._compiling = false; @@ -65,9 +65,9 @@ } if (!exceptionDetails) return; - var text = WebInspector.ConsoleMessage.simpleTextFromException(exceptionDetails); + var text = SDK.ConsoleMessage.simpleTextFromException(exceptionDetails); this._sourceFrame.uiSourceCode().addLineMessage( - WebInspector.UISourceCode.Message.Level.Error, text, exceptionDetails.lineNumber, + Workspace.UISourceCode.Message.Level.Error, text, exceptionDetails.lineNumber, exceptionDetails.columnNumber); this._compilationFinishedForTest(); } @@ -77,4 +77,4 @@ } }; -WebInspector.JavaScriptCompiler.CompileDelay = 1000; +Sources.JavaScriptCompiler.CompileDelay = 1000;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptOutlineDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptOutlineDialog.js index 8f7a93f..7f6eb8b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptOutlineDialog.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptOutlineDialog.js
@@ -7,9 +7,9 @@ /** * @unrestricted */ -WebInspector.JavaScriptOutlineDialog = class extends WebInspector.FilteredListWidget.Delegate { +Sources.JavaScriptOutlineDialog = class extends UI.FilteredListWidget.Delegate { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(number, number)} selectItemCallback */ constructor(uiSourceCode, selectItemCallback) { @@ -17,18 +17,18 @@ this._functionItems = []; this._selectItemCallback = selectItemCallback; - WebInspector.formatterWorkerPool.runChunkedTask( + Common.formatterWorkerPool.runChunkedTask( 'javaScriptOutline', {content: uiSourceCode.workingCopy()}, this._didBuildOutlineChunk.bind(this)); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(number, number)} selectItemCallback */ static show(uiSourceCode, selectItemCallback) { - WebInspector.JavaScriptOutlineDialog._instanceForTests = - new WebInspector.JavaScriptOutlineDialog(uiSourceCode, selectItemCallback); - new WebInspector.FilteredListWidget(WebInspector.JavaScriptOutlineDialog._instanceForTests).showAsDialog(); + Sources.JavaScriptOutlineDialog._instanceForTests = + new Sources.JavaScriptOutlineDialog(uiSourceCode, selectItemCallback); + new UI.FilteredListWidget(Sources.JavaScriptOutlineDialog._instanceForTests).showAsDialog(); } /** @@ -40,7 +40,7 @@ this.refresh(); return; } - var data = /** @type {!WebInspector.JavaScriptOutlineDialog.MessageEventData} */ (event.data); + var data = /** @type {!Sources.JavaScriptOutlineDialog.MessageEventData} */ (event.data); var chunk = data.chunk; for (var i = 0; i < chunk.length; ++i) this._functionItems.push(chunk[i]); @@ -121,4 +121,4 @@ /** * @typedef {{isLastChunk: boolean, chunk: !Array.<!{selectorText: string, lineNumber: number, columnNumber: number}>}} */ -WebInspector.JavaScriptOutlineDialog.MessageEventData; +Sources.JavaScriptOutlineDialog.MessageEventData;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js index 46310859..2d978c8 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -31,19 +31,19 @@ /** * @unrestricted */ -WebInspector.JavaScriptSourceFrame = class extends WebInspector.UISourceCodeFrame { +Sources.JavaScriptSourceFrame = class extends Sources.UISourceCodeFrame { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ constructor(uiSourceCode) { super(uiSourceCode); - this._scriptsPanel = WebInspector.SourcesPanel.instance(); - this._breakpointManager = WebInspector.breakpointManager; - if (uiSourceCode.project().type() === WebInspector.projectTypes.Debugger) + this._scriptsPanel = Sources.SourcesPanel.instance(); + this._breakpointManager = Bindings.breakpointManager; + if (uiSourceCode.project().type() === Workspace.projectTypes.Debugger) this.element.classList.add('source-frame-debugger-script'); - this._popoverHelper = new WebInspector.ObjectPopoverHelper( + this._popoverHelper = new Components.ObjectPopoverHelper( this._scriptsPanel.element, this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), this._onHidePopover.bind(this), true); this._popoverHelper.setTimeout(250, 250); @@ -51,37 +51,37 @@ this.textEditor.element.addEventListener('keydown', this._onKeyDown.bind(this), true); this.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.GutterClick, this._handleGutterClick.bind(this), this); + SourceFrame.SourcesTextEditor.Events.GutterClick, this._handleGutterClick.bind(this), this); this._breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); + Bindings.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); this._breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); + Bindings.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); this.uiSourceCode().addEventListener( - WebInspector.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this); + Workspace.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this); this.uiSourceCode().addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); this.uiSourceCode().addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); this.uiSourceCode().addEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._showBlackboxInfobarIfNeeded, this); + Workspace.UISourceCode.Events.TitleChanged, this._showBlackboxInfobarIfNeeded, this); - /** @type {!Map.<!WebInspector.Target, !WebInspector.ResourceScriptFile>}*/ + /** @type {!Map.<!SDK.Target, !Bindings.ResourceScriptFile>}*/ this._scriptFileForTarget = new Map(); - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); for (var i = 0; i < targets.length; ++i) { - var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSourceCode, targets[i]); + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCode, targets[i]); if (scriptFile) this._updateScriptFile(targets[i]); } if (this._scriptFileForTarget.size || uiSourceCode.extension() === 'js' || - uiSourceCode.project().type() === WebInspector.projectTypes.Snippets) - this._compiler = new WebInspector.JavaScriptCompiler(this); + uiSourceCode.project().type() === Workspace.projectTypes.Snippets) + this._compiler = new Sources.JavaScriptCompiler(this); - WebInspector.moduleSetting('skipStackFramesPattern').addChangeListener(this._showBlackboxInfobarIfNeeded, this); - WebInspector.moduleSetting('skipContentScripts').addChangeListener(this._showBlackboxInfobarIfNeeded, this); + Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._showBlackboxInfobarIfNeeded, this); + Common.moduleSetting('skipContentScripts').addChangeListener(this._showBlackboxInfobarIfNeeded, this); this._showBlackboxInfobarIfNeeded(); /** @type {!Map.<number, !Element>} */ this._valueWidgets = new Map(); @@ -89,24 +89,24 @@ /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ syncToolbarItems() { var result = super.syncToolbarItems(); - var originURL = WebInspector.CompilerScriptMapping.uiSourceCodeOrigin(this.uiSourceCode()); + var originURL = Bindings.CompilerScriptMapping.uiSourceCodeOrigin(this.uiSourceCode()); if (originURL) { var parsedURL = originURL.asParsedURL(); if (parsedURL) result.push( - new WebInspector.ToolbarText(WebInspector.UIString('(source mapped from %s)', parsedURL.displayName))); + new UI.ToolbarText(Common.UIString('(source mapped from %s)', parsedURL.displayName))); } - if (this.uiSourceCode().project().type() === WebInspector.projectTypes.Snippets) { - result.push(new WebInspector.ToolbarSeparator(true)); - var runSnippet = WebInspector.Toolbar.createActionButtonForId('debugger.run-snippet'); - runSnippet.setText(WebInspector.isMac() ? - WebInspector.UIString('\u2318+Enter') : - WebInspector.UIString('Ctrl+Enter')); + if (this.uiSourceCode().project().type() === Workspace.projectTypes.Snippets) { + result.push(new UI.ToolbarSeparator(true)); + var runSnippet = UI.Toolbar.createActionButtonForId('debugger.run-snippet'); + runSnippet.setText(Host.isMac() ? + Common.UIString('\u2318+Enter') : + Common.UIString('Ctrl+Enter')); result.push(runSnippet); } @@ -124,27 +124,27 @@ if (this._divergedInfobar) this._divergedInfobar.dispose(); - var infobar = new WebInspector.Infobar( - WebInspector.Infobar.Type.Warning, WebInspector.UIString('Workspace mapping mismatch')); + var infobar = new UI.Infobar( + UI.Infobar.Type.Warning, Common.UIString('Workspace mapping mismatch')); this._divergedInfobar = infobar; var fileURL = this.uiSourceCode().url(); - infobar.createDetailsRowMessage(WebInspector.UIString('The content of this file on the file system:\u00a0')) - .appendChild(WebInspector.linkifyURLAsNode(fileURL, fileURL, 'source-frame-infobar-details-url', true)); + infobar.createDetailsRowMessage(Common.UIString('The content of this file on the file system:\u00a0')) + .appendChild(UI.linkifyURLAsNode(fileURL, fileURL, 'source-frame-infobar-details-url', true)); var scriptURL = this.uiSourceCode().url(); - infobar.createDetailsRowMessage(WebInspector.UIString('does not match the loaded script:\u00a0')) - .appendChild(WebInspector.linkifyURLAsNode(scriptURL, scriptURL, 'source-frame-infobar-details-url', true)); + infobar.createDetailsRowMessage(Common.UIString('does not match the loaded script:\u00a0')) + .appendChild(UI.linkifyURLAsNode(scriptURL, scriptURL, 'source-frame-infobar-details-url', true)); infobar.createDetailsRowMessage(); - infobar.createDetailsRowMessage(WebInspector.UIString('Possible solutions are:')); + infobar.createDetailsRowMessage(Common.UIString('Possible solutions are:')); - if (WebInspector.moduleSetting('cacheDisabled').get()) - infobar.createDetailsRowMessage(' - ').createTextChild(WebInspector.UIString('Reload inspected page')); + if (Common.moduleSetting('cacheDisabled').get()) + infobar.createDetailsRowMessage(' - ').createTextChild(Common.UIString('Reload inspected page')); else - infobar.createDetailsRowMessage(' - ').createTextChild(WebInspector.UIString( + infobar.createDetailsRowMessage(' - ').createTextChild(Common.UIString( 'Check "Disable cache" in settings and reload inspected page (recommended setup for authoring and debugging)')); - infobar.createDetailsRowMessage(' - ').createTextChild(WebInspector.UIString( + infobar.createDetailsRowMessage(' - ').createTextChild(Common.UIString( 'Check that your file and script are both loaded from the correct source and their contents match')); this._updateInfobars(); @@ -162,9 +162,9 @@ if (!uiSourceCode.contentType().hasScripts()) return; var projectType = uiSourceCode.project().type(); - if (projectType === WebInspector.projectTypes.Snippets) + if (projectType === Workspace.projectTypes.Snippets) return; - if (!WebInspector.blackboxManager.isBlackboxedUISourceCode(uiSourceCode)) { + if (!Bindings.blackboxManager.isBlackboxedUISourceCode(uiSourceCode)) { this._hideBlackboxInfobar(); return; } @@ -172,29 +172,29 @@ if (this._blackboxInfobar) this._blackboxInfobar.dispose(); - var infobar = new WebInspector.Infobar( - WebInspector.Infobar.Type.Warning, WebInspector.UIString('This script is blackboxed in debugger')); + var infobar = new UI.Infobar( + UI.Infobar.Type.Warning, Common.UIString('This script is blackboxed in debugger')); this._blackboxInfobar = infobar; infobar.createDetailsRowMessage( - WebInspector.UIString('Debugger will skip stepping through this script, and will not stop on exceptions')); + Common.UIString('Debugger will skip stepping through this script, and will not stop on exceptions')); var scriptFile = this._scriptFileForTarget.size ? this._scriptFileForTarget.valuesArray()[0] : null; if (scriptFile && scriptFile.hasSourceMapURL()) - infobar.createDetailsRowMessage(WebInspector.UIString('Source map found, but ignored for blackboxed file.')); + infobar.createDetailsRowMessage(Common.UIString('Source map found, but ignored for blackboxed file.')); infobar.createDetailsRowMessage(); - infobar.createDetailsRowMessage(WebInspector.UIString('Possible ways to cancel this behavior are:')); + infobar.createDetailsRowMessage(Common.UIString('Possible ways to cancel this behavior are:')); infobar.createDetailsRowMessage(' - ').createTextChild( - WebInspector.UIString('Go to "%s" tab in settings', WebInspector.UIString('Blackboxing'))); + Common.UIString('Go to "%s" tab in settings', Common.UIString('Blackboxing'))); var unblackboxLink = infobar.createDetailsRowMessage(' - ').createChild('span', 'link'); - unblackboxLink.textContent = WebInspector.UIString('Unblackbox this script'); + unblackboxLink.textContent = Common.UIString('Unblackbox this script'); unblackboxLink.addEventListener('click', unblackbox, false); function unblackbox() { - WebInspector.blackboxManager.unblackboxUISourceCode(uiSourceCode); - if (projectType === WebInspector.projectTypes.ContentScripts) - WebInspector.blackboxManager.unblackboxContentScripts(); + Bindings.blackboxManager.unblackboxUISourceCode(uiSourceCode); + if (projectType === Workspace.projectTypes.ContentScripts) + Bindings.blackboxManager.unblackboxContentScripts(); } this._updateInfobars(); @@ -250,35 +250,35 @@ */ populateLineGutterContextMenu(contextMenu, lineNumber) { /** - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function populate(resolve, reject) { - var uiLocation = new WebInspector.UILocation(this.uiSourceCode(), lineNumber, 0); + var uiLocation = new Workspace.UILocation(this.uiSourceCode(), lineNumber, 0); this._scriptsPanel.appendUILocationItems(contextMenu, uiLocation); var breakpoints = this._breakpointManager.findBreakpoints(this.uiSourceCode(), lineNumber); if (!breakpoints.length) { // This row doesn't have a breakpoint: We want to show Add Breakpoint and Add and Edit Breakpoint. contextMenu.appendItem( - WebInspector.UIString('Add breakpoint'), this._createNewBreakpoint.bind(this, lineNumber, '', true)); + Common.UIString('Add breakpoint'), this._createNewBreakpoint.bind(this, lineNumber, '', true)); contextMenu.appendItem( - WebInspector.UIString('Add conditional breakpoint…'), this._editBreakpointCondition.bind(this, lineNumber)); + Common.UIString('Add conditional breakpoint…'), this._editBreakpointCondition.bind(this, lineNumber)); contextMenu.appendItem( - WebInspector.UIString('Never pause here'), + Common.UIString('Never pause here'), this._createNewBreakpoint.bind(this, lineNumber, 'false', true)); } else { var breakpoint = breakpoints[0]; // This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable. - contextMenu.appendItem(WebInspector.UIString('Remove breakpoint'), breakpoint.remove.bind(breakpoint)); + contextMenu.appendItem(Common.UIString('Remove breakpoint'), breakpoint.remove.bind(breakpoint)); contextMenu.appendItem( - WebInspector.UIString('Edit breakpoint…'), + Common.UIString('Edit breakpoint…'), this._editBreakpointCondition.bind(this, lineNumber, breakpoint)); if (breakpoint.enabled()) contextMenu.appendItem( - WebInspector.UIString('Disable breakpoint'), breakpoint.setEnabled.bind(breakpoint, false)); + Common.UIString('Disable breakpoint'), breakpoint.setEnabled.bind(breakpoint, false)); else contextMenu.appendItem( - WebInspector.UIString('Enable breakpoint'), breakpoint.setEnabled.bind(breakpoint, true)); + Common.UIString('Enable breakpoint'), breakpoint.setEnabled.bind(breakpoint, true)); } resolve(); } @@ -291,14 +291,14 @@ */ populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber) { /** - * @param {!WebInspector.ResourceScriptFile} scriptFile + * @param {!Bindings.ResourceScriptFile} scriptFile */ function addSourceMapURL(scriptFile) { - WebInspector.AddSourceMapURLDialog.show(addSourceMapURLDialogCallback.bind(null, scriptFile)); + Sources.AddSourceMapURLDialog.show(addSourceMapURLDialogCallback.bind(null, scriptFile)); } /** - * @param {!WebInspector.ResourceScriptFile} scriptFile + * @param {!Bindings.ResourceScriptFile} scriptFile * @param {string} url */ function addSourceMapURLDialogCallback(scriptFile, url) { @@ -308,15 +308,15 @@ } /** - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function populateSourceMapMembers() { - if (this.uiSourceCode().project().type() === WebInspector.projectTypes.Network && - WebInspector.moduleSetting('jsSourceMapsEnabled').get() && - !WebInspector.blackboxManager.isBlackboxedUISourceCode(this.uiSourceCode())) { + if (this.uiSourceCode().project().type() === Workspace.projectTypes.Network && + Common.moduleSetting('jsSourceMapsEnabled').get() && + !Bindings.blackboxManager.isBlackboxedUISourceCode(this.uiSourceCode())) { if (this._scriptFileForTarget.size) { var scriptFile = this._scriptFileForTarget.valuesArray()[0]; - var addSourceMapURLLabel = WebInspector.UIString.capitalize('Add ^source ^map\u2026'); + var addSourceMapURLLabel = Common.UIString.capitalize('Add ^source ^map\u2026'); contextMenu.appendItem(addSourceMapURLLabel, addSourceMapURL.bind(null, scriptFile)); contextMenu.appendSeparator(); } @@ -376,7 +376,7 @@ } _updateDivergedInfobar() { - if (this.uiSourceCode().project().type() !== WebInspector.projectTypes.FileSystem) { + if (this.uiSourceCode().project().type() !== Workspace.projectTypes.FileSystem) { this._hideDivergedInfobar(); return; } @@ -396,7 +396,7 @@ } _supportsEnabledBreakpointsWhileEditing() { - return this.uiSourceCode().project().type() === WebInspector.projectTypes.Snippets; + return this.uiSourceCode().project().type() === Workspace.projectTypes.Snippets; } _restoreBreakpointsIfConsistentScripts() { @@ -449,8 +449,8 @@ } _getPopoverAnchor(element, event) { - var target = WebInspector.context.flavor(WebInspector.Target); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var target = UI.context.flavor(SDK.Target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel || !debuggerModel.isPaused()) return; @@ -498,8 +498,8 @@ } _resolveObjectForPopover(anchorBox, showCallback, objectGroupName) { - var target = WebInspector.context.flavor(WebInspector.Target); - var selectedCallFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); + var target = UI.context.flavor(SDK.Target); + var selectedCallFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); if (!selectedCallFrame) { this._popoverHelper.hidePopover(); return; @@ -519,14 +519,14 @@ } } var evaluationText = line.substring(startHighlight, endHighlight + 1); - WebInspector.SourceMapNamesResolver + Sources.SourceMapNamesResolver .resolveExpression( selectedCallFrame, evaluationText, this.uiSourceCode(), lineNumber, startHighlight, endHighlight) .then(onResolve.bind(this)); /** * @param {?string=} text - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function onResolve(text) { selectedCallFrame.evaluate( @@ -536,11 +536,11 @@ /** * @param {?Protocol.Runtime.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function showObjectPopover(result, exceptionDetails) { - var target = WebInspector.context.flavor(WebInspector.Target); - var potentiallyUpdatedCallFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); + var target = UI.context.flavor(SDK.Target); + var potentiallyUpdatedCallFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); if (selectedCallFrame !== potentiallyUpdatedCallFrame || !result) { this._popoverHelper.hidePopover(); return; @@ -549,7 +549,7 @@ showCallback(target.runtimeModel.createRemoteObject(result), !!exceptionDetails, this._popoverAnchorBox); // Popover may have been removed by showCallback(). if (this._popoverAnchorBox) { - var highlightRange = new WebInspector.TextRange(lineNumber, startHighlight, lineNumber, endHighlight); + var highlightRange = new Common.TextRange(lineNumber, startHighlight, lineNumber, endHighlight); this._popoverAnchorBox._highlightDescriptor = this.textEditor.highlightRange(highlightRange, 'source-frame-eval-expression'); } @@ -596,14 +596,14 @@ /** * @param {number} lineNumber - * @param {!WebInspector.BreakpointManager.Breakpoint=} breakpoint + * @param {!Bindings.BreakpointManager.Breakpoint=} breakpoint */ _editBreakpointCondition(lineNumber, breakpoint) { this._conditionElement = this._createConditionElement(lineNumber); this.textEditor.addDecoration(this._conditionElement, lineNumber); /** - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function finishEditing(committed, element, newText) { this.textEditor.removeDecoration(this._conditionElement, lineNumber); @@ -618,8 +618,8 @@ this._createNewBreakpoint(lineNumber, newText, true); } - var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false)); - WebInspector.InplaceEditor.startEditing(this._conditionEditorElement, config); + var config = new UI.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false)); + UI.InplaceEditor.startEditing(this._conditionEditorElement, config); this._conditionEditorElement.value = breakpoint ? breakpoint.condition() : ''; this._conditionEditorElement.select(); } @@ -630,7 +630,7 @@ var labelElement = conditionElement.createChild('label', 'source-frame-breakpoint-message'); labelElement.htmlFor = 'source-frame-breakpoint-condition'; labelElement.createTextChild( - WebInspector.UIString('The breakpoint on line %d will stop only if this expression is true:', lineNumber + 1)); + Common.UIString('The breakpoint on line %d will stop only if this expression is true:', lineNumber + 1)); var editorElement = conditionElement.createChild('input', 'monospace'); editorElement.id = 'source-frame-breakpoint-condition'; @@ -641,7 +641,7 @@ } /** - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation */ setExecutionLocation(uiLocation) { this._executionLocation = uiLocation; @@ -656,19 +656,19 @@ } _generateValuesInSource() { - if (!WebInspector.moduleSetting('inlineVariableValues').get()) + if (!Common.moduleSetting('inlineVariableValues').get()) return; - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (!executionContext) return; - var callFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); + var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); if (!callFrame) return; var localScope = callFrame.localScope(); var functionLocation = callFrame.functionLocation(); if (localScope && functionLocation) - WebInspector.SourceMapNamesResolver.resolveScopeInObject(localScope) + Sources.SourceMapNamesResolver.resolveScopeInObject(localScope) .getAllProperties(false, this._prepareScopeVariables.bind(this, callFrame)); if (this._clearValueWidgetsTimer) { @@ -678,9 +678,9 @@ } /** - * @param {!WebInspector.DebuggerModel.CallFrame} callFrame - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {!SDK.DebuggerModel.CallFrame} callFrame + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties */ _prepareScopeVariables(callFrame, properties, internalProperties) { if (!properties || !properties.length || properties.length > 500) { @@ -688,9 +688,9 @@ return; } - var functionUILocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation( - /** @type {!WebInspector.DebuggerModel.Location} */ (callFrame.functionLocation())); - var executionUILocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location()); + var functionUILocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation( + /** @type {!SDK.DebuggerModel.Location} */ (callFrame.functionLocation())); + var executionUILocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrame.location()); if (functionUILocation.uiSourceCode !== this.uiSourceCode() || executionUILocation.uiSourceCode !== this.uiSourceCode()) { this._clearValueWidgets(); @@ -718,7 +718,7 @@ /** @type {!Map.<number, !Set<string>>} */ var namesPerLine = new Map(); var skipObjectProperty = false; - var tokenizer = new WebInspector.CodeMirrorUtils.TokenizerFactory().createTokenizer('text/javascript'); + var tokenizer = new TextEditor.CodeMirrorUtils.TokenizerFactory().createTokenizer('text/javascript'); tokenizer(this.textEditor.line(fromLine).substring(fromColumn), processToken.bind(this, fromLine)); for (var i = fromLine + 1; i < toLine; ++i) tokenizer(this.textEditor.line(i), processToken.bind(this, i)); @@ -729,7 +729,7 @@ * @param {?string} tokenType * @param {number} column * @param {number} newColumn - * @this {WebInspector.JavaScriptSourceFrame} + * @this {Sources.JavaScriptSourceFrame} */ function processToken(lineNumber, tokenValue, tokenType, column, newColumn) { if (!skipObjectProperty && tokenType && this._isIdentifier(tokenType) && valuesMap.get(tokenValue)) { @@ -746,13 +746,13 @@ } /** - * @param {!Map.<string,!WebInspector.RemoteObject>} valuesMap + * @param {!Map.<string,!SDK.RemoteObject>} valuesMap * @param {!Map.<number, !Set<string>>} namesPerLine * @param {number} fromLine * @param {number} toLine */ _renderDecorations(valuesMap, namesPerLine, fromLine, toLine) { - var formatter = new WebInspector.RemoteObjectPreviewFormatter(); + var formatter = new Components.RemoteObjectPreviewFormatter(); for (var i = fromLine; i < toLine; ++i) { var names = namesPerLine.get(i); var oldWidget = this._valueWidgets.get(i); @@ -789,7 +789,7 @@ if (value.preview && propertyCount + entryCount < 10) formatter.appendObjectPreview(nameValuePair, value.preview); else - nameValuePair.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(value, false)); + nameValuePair.appendChild(Components.ObjectPropertiesSection.createValueElement(value, false)); ++renderedNameCount; } @@ -802,7 +802,7 @@ if (newText !== oldText) { widgetChanged = true; // value has changed, update it. - WebInspector.runCSSAnimationOnce( + UI.runCSSAnimationOnce( /** @type {!Element} */ (widget.__nameToToken.get(name)), 'source-frame-value-update-highlight'); } } @@ -849,20 +849,20 @@ } _breakpointAdded(event) { - var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation); + var uiLocation = /** @type {!Workspace.UILocation} */ (event.data.uiLocation); if (uiLocation.uiSourceCode !== this.uiSourceCode()) return; if (this._shouldIgnoreExternalBreakpointEvents()) return; - var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint); + var breakpoint = /** @type {!Bindings.BreakpointManager.Breakpoint} */ (event.data.breakpoint); if (this.loaded) this._addBreakpointDecoration( uiLocation.lineNumber, uiLocation.columnNumber, breakpoint.condition(), breakpoint.enabled(), false); } _breakpointRemoved(event) { - var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation); + var uiLocation = /** @type {!Workspace.UILocation} */ (event.data.uiLocation); if (uiLocation.uiSourceCode !== this.uiSourceCode()) return; if (this._shouldIgnoreExternalBreakpointEvents()) @@ -874,10 +874,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSourceMappingChanged(event) { - var data = /** @type {{target: !WebInspector.Target}} */ (event.data); + var data = /** @type {{target: !SDK.Target}} */ (event.data); this._updateScriptFile(data.target); this._updateLinesWithoutMappingHighlight(); } @@ -885,7 +885,7 @@ _updateLinesWithoutMappingHighlight() { var linesCount = this.textEditor.linesCount; for (var i = 0; i < linesCount; ++i) { - var lineHasMapping = WebInspector.debuggerWorkspaceBinding.uiLineHasMapping(this.uiSourceCode(), i); + var lineHasMapping = Bindings.debuggerWorkspaceBinding.uiLineHasMapping(this.uiSourceCode(), i); if (!lineHasMapping) this._hasLineWithoutMapping = true; if (this._hasLineWithoutMapping) @@ -894,16 +894,16 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _updateScriptFile(target) { var oldScriptFile = this._scriptFileForTarget.get(target); - var newScriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(this.uiSourceCode(), target); + var newScriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this.uiSourceCode(), target); this._scriptFileForTarget.remove(target); if (oldScriptFile) { - oldScriptFile.removeEventListener(WebInspector.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); + oldScriptFile.removeEventListener(Bindings.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); oldScriptFile.removeEventListener( - WebInspector.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeFromVM, this); + Bindings.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeFromVM, this); if (this._muted && !this.uiSourceCode().isDirty()) this._restoreBreakpointsIfConsistentScripts(); } @@ -913,21 +913,21 @@ this._updateDivergedInfobar(); if (newScriptFile) { - newScriptFile.addEventListener(WebInspector.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); + newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); newScriptFile.addEventListener( - WebInspector.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeFromVM, this); + Bindings.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeFromVM, this); if (this.loaded) newScriptFile.checkMapping(); if (newScriptFile.hasSourceMapURL()) { - var sourceMapInfobar = WebInspector.Infobar.create( - WebInspector.Infobar.Type.Info, WebInspector.UIString('Source Map detected.'), - WebInspector.settings.createSetting('sourceMapInfobarDisabled', false)); + var sourceMapInfobar = UI.Infobar.create( + UI.Infobar.Type.Info, Common.UIString('Source Map detected.'), + Common.settings.createSetting('sourceMapInfobarDisabled', false)); if (sourceMapInfobar) { - sourceMapInfobar.createDetailsRowMessage(WebInspector.UIString( + sourceMapInfobar.createDetailsRowMessage(Common.UIString( 'Associated files should be added to the file tree. You can debug these resolved source files as regular JavaScript files.')); - sourceMapInfobar.createDetailsRowMessage(WebInspector.UIString( + sourceMapInfobar.createDetailsRowMessage(Common.UIString( 'Associated files are available via file tree or %s.', - WebInspector.shortcutRegistry.shortcutTitleForAction('sources.go-to-source'))); + UI.shortcutRegistry.shortcutTitleForAction('sources.go-to-source'))); this.attachInfobars([sourceMapInfobar]); } } @@ -971,35 +971,35 @@ if (!minified) return; - this._prettyPrintInfobar = WebInspector.Infobar.create( - WebInspector.Infobar.Type.Info, WebInspector.UIString('Pretty-print this minified file?'), - WebInspector.settings.createSetting('prettyPrintInfobarDisabled', false)); + this._prettyPrintInfobar = UI.Infobar.create( + UI.Infobar.Type.Info, Common.UIString('Pretty-print this minified file?'), + Common.settings.createSetting('prettyPrintInfobarDisabled', false)); if (!this._prettyPrintInfobar) return; this._prettyPrintInfobar.setCloseCallback(() => delete this._prettyPrintInfobar); - var toolbar = new WebInspector.Toolbar(''); - var button = new WebInspector.ToolbarButton('', 'largeicon-pretty-print'); + var toolbar = new UI.Toolbar(''); + var button = new UI.ToolbarButton('', 'largeicon-pretty-print'); toolbar.appendToolbarItem(button); toolbar.element.style.display = 'inline-block'; toolbar.element.style.verticalAlign = 'middle'; toolbar.element.style.marginBottom = '3px'; toolbar.element.style.pointerEvents = 'none'; var element = this._prettyPrintInfobar.createDetailsRowMessage(); - element.appendChild(WebInspector.formatLocalized( + element.appendChild(UI.formatLocalized( 'You can click the %s button on the bottom status bar, and continue debugging with the new formatted source.', [toolbar.element])); this.attachInfobars([this._prettyPrintInfobar]); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _handleGutterClick(event) { if (this._muted) return; - var eventData = /** @type {!WebInspector.SourcesTextEditor.GutterClickEventData} */ (event.data); + var eventData = /** @type {!SourceFrame.SourcesTextEditor.GutterClickEventData} */ (event.data); var lineNumber = eventData.lineNumber; var eventObject = eventData.event; @@ -1036,26 +1036,26 @@ .then(setBreakpoint.bind(this)); /** - * @this {!WebInspector.JavaScriptSourceFrame} + * @this {!Sources.JavaScriptSourceFrame} * @param {number} lineNumber - * @return {!Promise<?Array<!WebInspector.UILocation>>} + * @return {!Promise<?Array<!Workspace.UILocation>>} */ function findPossibleBreakpoints(lineNumber) { const maxLengthToCheck = 1024; if (lineNumber >= this._textEditor.linesCount) - return Promise.resolve(/** @type {?Array<!WebInspector.UILocation>} */([])); + return Promise.resolve(/** @type {?Array<!Workspace.UILocation>} */([])); if (this._textEditor.line(lineNumber).length >= maxLengthToCheck) - return Promise.resolve(/** @type {?Array<!WebInspector.UILocation>} */([])); - return this._breakpointManager.possibleBreakpoints(this.uiSourceCode(), new WebInspector.TextRange(lineNumber, 0, lineNumber + 1, 0)) + return Promise.resolve(/** @type {?Array<!Workspace.UILocation>} */([])); + return this._breakpointManager.possibleBreakpoints(this.uiSourceCode(), new Common.TextRange(lineNumber, 0, lineNumber + 1, 0)) .then(locations => locations.length ? locations : null); } /** - * @this {!WebInspector.JavaScriptSourceFrame} + * @this {!Sources.JavaScriptSourceFrame} * @param {number} currentLineNumber * @param {number} linesToCheck - * @param {?Array<!WebInspector.UILocation>} locations - * @return {!Promise<?Array<!WebInspector.UILocation>>} + * @param {?Array<!Workspace.UILocation>} locations + * @return {!Promise<?Array<!Workspace.UILocation>>} */ function checkNextLineIfNeeded(currentLineNumber, linesToCheck, locations) { if (locations || linesToCheck <= 0) @@ -1065,15 +1065,15 @@ } /** - * @this {!WebInspector.JavaScriptSourceFrame} - * @param {?Array<!WebInspector.UILocation>} locations + * @this {!Sources.JavaScriptSourceFrame} + * @param {?Array<!Workspace.UILocation>} locations */ function setBreakpoint(locations) { if (!locations || !locations.length) this._setBreakpoint(lineNumber, 0, condition, enabled); else this._setBreakpoint(locations[0].lineNumber, locations[0].columnNumber, condition, enabled); - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ScriptsBreakpointSet); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ScriptsBreakpointSet); } } @@ -1094,7 +1094,7 @@ * @param {boolean} enabled */ _setBreakpoint(lineNumber, columnNumber, condition, enabled) { - if (!WebInspector.debuggerWorkspaceBinding.uiLineHasMapping(this.uiSourceCode(), lineNumber)) + if (!Bindings.debuggerWorkspaceBinding.uiLineHasMapping(this.uiSourceCode(), lineNumber)) return; this._breakpointManager.setBreakpoint(this.uiSourceCode(), lineNumber, columnNumber, condition, enabled); @@ -1115,19 +1115,19 @@ */ dispose() { this._breakpointManager.removeEventListener( - WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); + Bindings.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this); this._breakpointManager.removeEventListener( - WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); + Bindings.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this); this.uiSourceCode().removeEventListener( - WebInspector.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this); + Workspace.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this); this.uiSourceCode().removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this); this.uiSourceCode().removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this); this.uiSourceCode().removeEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._showBlackboxInfobarIfNeeded, this); - WebInspector.moduleSetting('skipStackFramesPattern').removeChangeListener(this._showBlackboxInfobarIfNeeded, this); - WebInspector.moduleSetting('skipContentScripts').removeChangeListener(this._showBlackboxInfobarIfNeeded, this); + Workspace.UISourceCode.Events.TitleChanged, this._showBlackboxInfobarIfNeeded, this); + Common.moduleSetting('skipStackFramesPattern').removeChangeListener(this._showBlackboxInfobarIfNeeded, this); + Common.moduleSetting('skipContentScripts').removeChangeListener(this._showBlackboxInfobarIfNeeded, this); super.dispose(); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js index f2337df7..c030bb57 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
@@ -26,59 +26,59 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.NavigatorView = class extends WebInspector.VBox { +Sources.NavigatorView = class extends UI.VBox { constructor() { super(); this.registerRequiredCSS('sources/navigatorView.css'); this._scriptsTree = new TreeOutlineInShadow(); this._scriptsTree.registerRequiredCSS('sources/navigatorTree.css'); - this._scriptsTree.setComparator(WebInspector.NavigatorView._treeElementsCompare); + this._scriptsTree.setComparator(Sources.NavigatorView._treeElementsCompare); this.element.appendChild(this._scriptsTree.element); this.setDefaultFocusedElement(this._scriptsTree.element); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.NavigatorUISourceCodeTreeNode>} */ + /** @type {!Map.<!Workspace.UISourceCode, !Sources.NavigatorUISourceCodeTreeNode>} */ this._uiSourceCodeNodes = new Map(); - /** @type {!Map.<string, !WebInspector.NavigatorFolderTreeNode>} */ + /** @type {!Map.<string, !Sources.NavigatorFolderTreeNode>} */ this._subfolderNodes = new Map(); - this._rootNode = new WebInspector.NavigatorRootTreeNode(this); + this._rootNode = new Sources.NavigatorRootTreeNode(this); this._rootNode.populate(); - /** @type {!Map.<!WebInspector.ResourceTreeFrame, !WebInspector.NavigatorGroupTreeNode>} */ + /** @type {!Map.<!SDK.ResourceTreeFrame, !Sources.NavigatorGroupTreeNode>} */ this._frameNodes = new Map(); this.element.addEventListener('contextmenu', this.handleContextMenu.bind(this), false); - this._navigatorGroupByFolderSetting = WebInspector.moduleSetting('navigatorGroupByFolder'); + this._navigatorGroupByFolderSetting = Common.moduleSetting('navigatorGroupByFolder'); this._navigatorGroupByFolderSetting.addChangeListener(this._groupingChanged.bind(this)); this._initGrouping(); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this); - WebInspector.targetManager.addModelListener( - WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); + SDK.targetManager.addModelListener( + SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this); if (Runtime.experiments.isEnabled('persistence2')) { - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingCreated, this._onBindingChanged, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingRemoved, this._onBindingChanged, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingCreated, this._onBindingChanged, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingRemoved, this._onBindingChanged, this); } else { - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingCreated, this._onBindingCreated, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingRemoved, this._onBindingRemoved, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingCreated, this._onBindingCreated, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingRemoved, this._onBindingRemoved, this); } - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.NameChanged, this._targetNameChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.NameChanged, this._targetNameChanged, this); - WebInspector.targetManager.observeTargets(this); - this._resetWorkspace(WebInspector.workspace); + SDK.targetManager.observeTargets(this); + this._resetWorkspace(Workspace.workspace); this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); } @@ -89,9 +89,9 @@ if (treeElement._boostOrder) return 0; - if (!WebInspector.NavigatorView._typeOrders) { + if (!Sources.NavigatorView._typeOrders) { var weights = {}; - var types = WebInspector.NavigatorView.Types; + var types = Sources.NavigatorView.Types; weights[types.Root] = 1; weights[types.Category] = 1; weights[types.Domain] = 10; @@ -102,10 +102,10 @@ weights[types.Frame] = 70; weights[types.Worker] = 90; weights[types.FileSystem] = 100; - WebInspector.NavigatorView._typeOrders = weights; + Sources.NavigatorView._typeOrders = weights; } - var order = WebInspector.NavigatorView._typeOrders[treeElement._nodeType]; + var order = Sources.NavigatorView._typeOrders[treeElement._nodeType]; if (treeElement._uiSourceCode) { var contentType = treeElement._uiSourceCode.contentType(); if (contentType.isDocument()) @@ -122,30 +122,30 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ static appendAddFolderItem(contextMenu) { function addFolder() { - WebInspector.isolatedFileSystemManager.addFileSystem(); + Workspace.isolatedFileSystemManager.addFileSystem(); } - var addFolderLabel = WebInspector.UIString('Add folder to workspace'); + var addFolderLabel = Common.UIString('Add folder to workspace'); contextMenu.appendItem(addFolderLabel, addFolder); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {string=} path */ static appendSearchItem(contextMenu, path) { function searchPath() { - WebInspector.AdvancedSearchView.openSearch('', path.trim()); + Sources.AdvancedSearchView.openSearch('', path.trim()); } - var searchLabel = WebInspector.UIString('Search in folder'); + var searchLabel = Common.UIString('Search in folder'); if (!path || !path.trim()) { path = '*'; - searchLabel = WebInspector.UIString('Search in all files'); + searchLabel = Common.UIString('Search in all files'); } contextMenu.appendItem(searchLabel, searchPath); } @@ -156,8 +156,8 @@ * @return {number} */ static _treeElementsCompare(treeElement1, treeElement2) { - var typeWeight1 = WebInspector.NavigatorView._treeElementOrder(treeElement1); - var typeWeight2 = WebInspector.NavigatorView._treeElementOrder(treeElement2); + var typeWeight1 = Sources.NavigatorView._treeElementOrder(treeElement1); + var typeWeight2 = Sources.NavigatorView._treeElementOrder(treeElement2); var result; if (typeWeight1 > typeWeight2) @@ -168,26 +168,26 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingCreated(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); this._removeUISourceCode(binding.network); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingRemoved(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); this._addUISourceCode(binding.network); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingChanged(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); // Update UISourceCode titles. var networkNode = this._uiSourceCodeNodes.get(binding.network); @@ -198,7 +198,7 @@ fileSystemNode.updateTitle(); // Update folder titles. - var pathTokens = WebInspector.FileSystemWorkspaceBinding.relativePath(binding.fileSystem); + var pathTokens = Bindings.FileSystemWorkspaceBinding.relativePath(binding.fileSystem); var folderPath = ''; for (var i = 0; i < pathTokens.length - 1; ++i) { folderPath += pathTokens[i]; @@ -224,19 +224,19 @@ } /** - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.Workspace} workspace */ _resetWorkspace(workspace) { this._workspace = workspace; - this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); + this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); this._workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); + Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); this._workspace.addEventListener( - WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved.bind(this), this); + Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved.bind(this), this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { @@ -244,78 +244,78 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {?WebInspector.ResourceTreeFrame} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {?SDK.ResourceTreeFrame} */ _uiSourceCodeFrame(uiSourceCode) { - var frame = WebInspector.NetworkProject.frameForProject(uiSourceCode.project()); + var frame = Bindings.NetworkProject.frameForProject(uiSourceCode.project()); if (!frame) { - var target = WebInspector.NetworkProject.targetForProject(uiSourceCode.project()); - var resourceTreeModel = target && WebInspector.ResourceTreeModel.fromTarget(target); + var target = Bindings.NetworkProject.targetForProject(uiSourceCode.project()); + var resourceTreeModel = target && SDK.ResourceTreeModel.fromTarget(target); frame = resourceTreeModel && resourceTreeModel.mainFrame; } return frame; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _addUISourceCode(uiSourceCode) { if (!this.accept(uiSourceCode)) return; - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (!Runtime.experiments.isEnabled('persistence2') && binding && binding.network === uiSourceCode) return; var isFromSourceMap = uiSourceCode.contentType().isFromSourceMap(); var path; - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) - path = WebInspector.FileSystemWorkspaceBinding.relativePath(uiSourceCode).slice(0, -1); + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) + path = Bindings.FileSystemWorkspaceBinding.relativePath(uiSourceCode).slice(0, -1); else - path = WebInspector.ParsedURL.extractPath(uiSourceCode.url()).split('/').slice(1, -1); + path = Common.ParsedURL.extractPath(uiSourceCode.url()).split('/').slice(1, -1); var project = uiSourceCode.project(); - var target = WebInspector.NetworkProject.targetForUISourceCode(uiSourceCode); + var target = Bindings.NetworkProject.targetForUISourceCode(uiSourceCode); var frame = this._uiSourceCodeFrame(uiSourceCode); var folderNode = this._folderNode(uiSourceCode, project, target, frame, uiSourceCode.origin(), path, isFromSourceMap); - var uiSourceCodeNode = new WebInspector.NavigatorUISourceCodeTreeNode(this, uiSourceCode); + var uiSourceCodeNode = new Sources.NavigatorUISourceCodeTreeNode(this, uiSourceCode); this._uiSourceCodeNodes.set(uiSourceCode, uiSourceCodeNode); folderNode.appendChild(uiSourceCodeNode); this.uiSourceCodeAdded(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ uiSourceCodeAdded(uiSourceCode) { } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._addUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._removeUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _projectRemoved(event) { - var project = /** @type {!WebInspector.Project} */ (event.data); + var project = /** @type {!Workspace.Project} */ (event.data); - var frame = WebInspector.NetworkProject.frameForProject(project); + var frame = Bindings.NetworkProject.frameForProject(project); if (frame) this._discardFrame(frame); @@ -325,32 +325,32 @@ } /** - * @param {!WebInspector.Project} project - * @param {?WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!Workspace.Project} project + * @param {?SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} projectOrigin * @param {string} path * @return {string} */ _folderNodeId(project, target, frame, projectOrigin, path) { var targetId = target ? target.id() : ''; - var projectId = project.type() === WebInspector.projectTypes.FileSystem ? project.id() : ''; + var projectId = project.type() === Workspace.projectTypes.FileSystem ? project.id() : ''; var frameId = this._groupByFrame && frame ? frame.id : ''; return targetId + ':' + projectId + ':' + frameId + ':' + projectOrigin + ':' + path; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.Project} project - * @param {?WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Workspace.Project} project + * @param {?SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} projectOrigin * @param {!Array<string>} path * @param {boolean} fromSourceMap - * @return {!WebInspector.NavigatorTreeNode} + * @return {!Sources.NavigatorTreeNode} */ _folderNode(uiSourceCode, project, target, frame, projectOrigin, path, fromSourceMap) { - if (project.type() === WebInspector.projectTypes.Snippets) + if (project.type() === Workspace.projectTypes.Snippets) return this._rootNode; if (target && !this._groupByFolder && !fromSourceMap) @@ -367,8 +367,8 @@ return this._domainNode(uiSourceCode, project, target, frame, projectOrigin); var fileSystemNode = this._rootNode.child(project.id()); if (!fileSystemNode) { - fileSystemNode = new WebInspector.NavigatorGroupTreeNode( - this, project, project.id(), WebInspector.NavigatorView.Types.FileSystem, project.displayName()); + fileSystemNode = new Sources.NavigatorGroupTreeNode( + this, project, project.id(), Sources.NavigatorView.Types.FileSystem, project.displayName()); this._rootNode.appendChild(fileSystemNode); } return fileSystemNode; @@ -376,25 +376,25 @@ var parentNode = this._folderNode(uiSourceCode, project, target, frame, projectOrigin, path.slice(0, -1), fromSourceMap); - var type = fromSourceMap ? WebInspector.NavigatorView.Types.SourceMapFolder : - WebInspector.NavigatorView.Types.NetworkFolder; - if (project.type() === WebInspector.projectTypes.FileSystem) - type = WebInspector.NavigatorView.Types.FileSystemFolder; + var type = fromSourceMap ? Sources.NavigatorView.Types.SourceMapFolder : + Sources.NavigatorView.Types.NetworkFolder; + if (project.type() === Workspace.projectTypes.FileSystem) + type = Sources.NavigatorView.Types.FileSystemFolder; var name = path[path.length - 1]; - folderNode = new WebInspector.NavigatorFolderTreeNode(this, project, folderId, type, folderPath, name); + folderNode = new Sources.NavigatorFolderTreeNode(this, project, folderId, type, folderPath, name); this._subfolderNodes.set(folderId, folderNode); parentNode.appendChild(folderNode); return folderNode; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.Project} project - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Workspace.Project} project + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame * @param {string} projectOrigin - * @return {!WebInspector.NavigatorTreeNode} + * @return {!Sources.NavigatorTreeNode} */ _domainNode(uiSourceCode, project, target, frame, projectOrigin) { var frameNode = this._frameNode(project, target, frame); @@ -404,20 +404,20 @@ if (domainNode) return domainNode; - domainNode = new WebInspector.NavigatorGroupTreeNode( - this, project, projectOrigin, WebInspector.NavigatorView.Types.Domain, + domainNode = new Sources.NavigatorGroupTreeNode( + this, project, projectOrigin, Sources.NavigatorView.Types.Domain, this._computeProjectDisplayName(target, projectOrigin)); - if (frame && projectOrigin === WebInspector.ParsedURL.extractOrigin(frame.url)) + if (frame && projectOrigin === Common.ParsedURL.extractOrigin(frame.url)) domainNode.treeNode()._boostOrder = true; frameNode.appendChild(domainNode); return domainNode; } /** - * @param {!WebInspector.Project} project - * @param {!WebInspector.Target} target - * @param {?WebInspector.ResourceTreeFrame} frame - * @return {!WebInspector.NavigatorTreeNode} + * @param {!Workspace.Project} project + * @param {!SDK.Target} target + * @param {?SDK.ResourceTreeFrame} frame + * @return {!Sources.NavigatorTreeNode} */ _frameNode(project, target, frame) { if (!this._groupByFrame || !frame) @@ -427,8 +427,8 @@ if (frameNode) return frameNode; - frameNode = new WebInspector.NavigatorGroupTreeNode( - this, project, target.id() + ':' + frame.id, WebInspector.NavigatorView.Types.Frame, frame.displayName()); + frameNode = new Sources.NavigatorGroupTreeNode( + this, project, target.id() + ':' + frame.id, Sources.NavigatorView.Types.Frame, frame.displayName()); frameNode.setHoverCallback(hoverCallback); this._frameNodes.set(frame, frameNode); this._frameNode(project, target, frame.parentFrame).appendChild(frameNode); @@ -440,31 +440,31 @@ */ function hoverCallback(hovered) { if (hovered) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (domModel) domModel.highlightFrame(frame.id); } else { - WebInspector.DOMModel.hideDOMNodeHighlight(); + SDK.DOMModel.hideDOMNodeHighlight(); } } return frameNode; } /** - * @param {!WebInspector.Project} project - * @param {!WebInspector.Target} target - * @return {!WebInspector.NavigatorTreeNode} + * @param {!Workspace.Project} project + * @param {!SDK.Target} target + * @return {!Sources.NavigatorTreeNode} */ _targetNode(project, target) { - if (target === WebInspector.targetManager.mainTarget()) + if (target === SDK.targetManager.mainTarget()) return this._rootNode; var targetNode = this._rootNode.child('target:' + target.id()); if (!targetNode) { - targetNode = new WebInspector.NavigatorGroupTreeNode( + targetNode = new Sources.NavigatorGroupTreeNode( this, project, 'target:' + target.id(), - !target.hasBrowserCapability() ? WebInspector.NavigatorView.Types.Worker : - WebInspector.NavigatorView.Types.NetworkFolder, + !target.hasBrowserCapability() ? Sources.NavigatorView.Types.Worker : + Sources.NavigatorView.Types.NetworkFolder, target.name()); this._rootNode.appendChild(targetNode); } @@ -472,7 +472,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @param {string} projectOrigin * @return {string} */ @@ -483,16 +483,16 @@ } if (!projectOrigin) - return WebInspector.UIString('(no domain)'); + return Common.UIString('(no domain)'); - var parsedURL = new WebInspector.ParsedURL(projectOrigin); + var parsedURL = new Common.ParsedURL(projectOrigin); var prettyURL = parsedURL.isValid ? parsedURL.host + (parsedURL.port ? (':' + parsedURL.port) : '') : ''; return (prettyURL || projectOrigin); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean=} select */ revealUISourceCode(uiSourceCode, select) { @@ -506,22 +506,22 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean} focusSource */ _sourceSelected(uiSourceCode, focusSource) { this._lastSelectedUISourceCode = uiSourceCode; - WebInspector.Revealer.reveal(uiSourceCode, !focusSource); + Common.Revealer.reveal(uiSourceCode, !focusSource); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ sourceDeleted(uiSourceCode) { } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeUISourceCode(uiSourceCode) { var node = this._uiSourceCodeNodes.get(uiSourceCode); @@ -529,7 +529,7 @@ return; var project = uiSourceCode.project(); - var target = WebInspector.NetworkProject.targetForUISourceCode(uiSourceCode); + var target = Bindings.NetworkProject.targetForUISourceCode(uiSourceCode); var frame = this._uiSourceCodeFrame(uiSourceCode); var parentNode = node.parent; @@ -541,10 +541,10 @@ parentNode = node.parent; if (!parentNode || !node.isEmpty()) break; - if (!(node instanceof WebInspector.NavigatorGroupTreeNode || - node instanceof WebInspector.NavigatorFolderTreeNode)) + if (!(node instanceof Sources.NavigatorGroupTreeNode || + node instanceof Sources.NavigatorFolderTreeNode)) break; - if (node._type === WebInspector.NavigatorView.Types.Frame) + if (node._type === Sources.NavigatorView.Types.Frame) break; var folderId = this._folderNodeId(project, target, frame, uiSourceCode.origin(), node._folderPath); @@ -573,61 +573,61 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {string} path - * @param {!WebInspector.UISourceCode=} uiSourceCode + * @param {!Workspace.UISourceCode=} uiSourceCode */ _handleContextMenuCreate(project, path, uiSourceCode) { this.create(project, path, uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleContextMenuRename(uiSourceCode) { this.rename(uiSourceCode, false); } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {string} path */ _handleContextMenuExclude(project, path) { - var shouldExclude = window.confirm(WebInspector.UIString('Are you sure you want to exclude this folder?')); + var shouldExclude = window.confirm(Common.UIString('Are you sure you want to exclude this folder?')); if (shouldExclude) { - WebInspector.startBatchUpdate(); - project.excludeFolder(WebInspector.FileSystemWorkspaceBinding.completeURL(project, path)); - WebInspector.endBatchUpdate(); + UI.startBatchUpdate(); + project.excludeFolder(Bindings.FileSystemWorkspaceBinding.completeURL(project, path)); + UI.endBatchUpdate(); } } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleContextMenuDelete(uiSourceCode) { - var shouldDelete = window.confirm(WebInspector.UIString('Are you sure you want to delete this file?')); + var shouldDelete = window.confirm(Common.UIString('Are you sure you want to delete this file?')); if (shouldDelete) uiSourceCode.project().deleteFile(uiSourceCode.url()); } /** * @param {!Event} event - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ handleFileContextMenu(event, uiSourceCode) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(uiSourceCode); contextMenu.appendSeparator(); var project = uiSourceCode.project(); - if (project.type() === WebInspector.projectTypes.FileSystem) { + if (project.type() === Workspace.projectTypes.FileSystem) { var parentURL = uiSourceCode.parentURL(); contextMenu.appendItem( - WebInspector.UIString('Rename\u2026'), this._handleContextMenuRename.bind(this, uiSourceCode)); + Common.UIString('Rename\u2026'), this._handleContextMenuRename.bind(this, uiSourceCode)); contextMenu.appendItem( - WebInspector.UIString('Make a copy\u2026'), + Common.UIString('Make a copy\u2026'), this._handleContextMenuCreate.bind(this, project, parentURL, uiSourceCode)); - contextMenu.appendItem(WebInspector.UIString('Delete'), this._handleContextMenuDelete.bind(this, uiSourceCode)); + contextMenu.appendItem(Common.UIString('Delete'), this._handleContextMenuDelete.bind(this, uiSourceCode)); contextMenu.appendSeparator(); } @@ -636,40 +636,40 @@ /** * @param {!Event} event - * @param {!WebInspector.NavigatorFolderTreeNode} node + * @param {!Sources.NavigatorFolderTreeNode} node */ handleFolderContextMenu(event, node) { var path = node._folderPath; var project = node._project; - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); - WebInspector.NavigatorView.appendSearchItem(contextMenu, path); + Sources.NavigatorView.appendSearchItem(contextMenu, path); contextMenu.appendSeparator(); - if (project.type() !== WebInspector.projectTypes.FileSystem) + if (project.type() !== Workspace.projectTypes.FileSystem) return; - contextMenu.appendItem(WebInspector.UIString('New file'), this._handleContextMenuCreate.bind(this, project, path)); + contextMenu.appendItem(Common.UIString('New file'), this._handleContextMenuCreate.bind(this, project, path)); contextMenu.appendItem( - WebInspector.UIString('Exclude folder'), this._handleContextMenuExclude.bind(this, project, path)); + Common.UIString('Exclude folder'), this._handleContextMenuExclude.bind(this, project, path)); function removeFolder() { - var shouldRemove = window.confirm(WebInspector.UIString('Are you sure you want to remove this folder?')); + var shouldRemove = window.confirm(Common.UIString('Are you sure you want to remove this folder?')); if (shouldRemove) project.remove(); } contextMenu.appendSeparator(); - WebInspector.NavigatorView.appendAddFolderItem(contextMenu); - if (node instanceof WebInspector.NavigatorGroupTreeNode) - contextMenu.appendItem(WebInspector.UIString('Remove folder from workspace'), removeFolder); + Sources.NavigatorView.appendAddFolderItem(contextMenu); + if (node instanceof Sources.NavigatorGroupTreeNode) + contextMenu.appendItem(Common.UIString('Remove folder from workspace'), removeFolder); contextMenu.show(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean} deleteIfCanceled */ rename(uiSourceCode, deleteIfCanceled) { @@ -678,7 +678,7 @@ node.rename(callback.bind(this)); /** - * @this {WebInspector.NavigatorView} + * @this {Sources.NavigatorView} * @param {boolean} committed */ function callback(committed) { @@ -693,16 +693,16 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {string} path - * @param {!WebInspector.UISourceCode=} uiSourceCodeToCopy + * @param {!Workspace.UISourceCode=} uiSourceCodeToCopy */ create(project, path, uiSourceCodeToCopy) { var filePath; var uiSourceCode; /** - * @this {WebInspector.NavigatorView} + * @this {Sources.NavigatorView} * @param {?string} content */ function contentLoaded(content) { @@ -715,7 +715,7 @@ createFile.call(this); /** - * @this {WebInspector.NavigatorView} + * @this {Sources.NavigatorView} * @param {string=} content */ function createFile(content) { @@ -723,8 +723,8 @@ } /** - * @this {WebInspector.NavigatorView} - * @param {?WebInspector.UISourceCode} uiSourceCode + * @this {Sources.NavigatorView} + * @param {?Workspace.UISourceCode} uiSourceCode */ function fileCreated(uiSourceCode) { if (!uiSourceCode) @@ -753,10 +753,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _frameNavigated(event) { - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); var node = this._frameNodes.get(frame); if (!node) return; @@ -767,15 +767,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _frameDetached(event) { - var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); + var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); this._discardFrame(frame); } /** - * @param {!WebInspector.ResourceTreeFrame} frame + * @param {!SDK.ResourceTreeFrame} frame */ _discardFrame(frame) { var node = this._frameNodes.get(frame); @@ -791,14 +791,14 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { var targetNode = this._rootNode.child('target:' + target.id()); @@ -807,17 +807,17 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetNameChanged(event) { - var target = /** @type {!WebInspector.Target} */ (event.data); + var target = /** @type {!SDK.Target} */ (event.data); var targetNode = this._rootNode.child('target:' + target.id()); if (targetNode) targetNode.setTitle(target.name()); } }; -WebInspector.NavigatorView.Types = { +Sources.NavigatorView.Types = { Category: 'category', Domain: 'domain', File: 'file', @@ -834,9 +834,9 @@ /** * @unrestricted */ -WebInspector.NavigatorFolderTreeElement = class extends TreeElement { +Sources.NavigatorFolderTreeElement = class extends TreeElement { /** - * @param {!WebInspector.NavigatorView} navigatorView + * @param {!Sources.NavigatorView} navigatorView * @param {string} type * @param {string} title * @param {function(boolean)=} hoverCallback @@ -871,7 +871,7 @@ } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ setNode(node) { this._node = node; @@ -918,15 +918,15 @@ /** * @unrestricted */ -WebInspector.NavigatorSourceTreeElement = class extends TreeElement { +Sources.NavigatorSourceTreeElement = class extends TreeElement { /** - * @param {!WebInspector.NavigatorView} navigatorView - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Sources.NavigatorView} navigatorView + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} title */ constructor(navigatorView, uiSourceCode, title) { super('', false); - this._nodeType = WebInspector.NavigatorView.Types.File; + this._nodeType = Sources.NavigatorView.Types.File; this.title = title; this.listItemElement.classList.add( 'navigator-' + uiSourceCode.contentType().name() + '-tree-item', 'navigator-file-tree-item'); @@ -938,7 +938,7 @@ } /** - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ get uiSourceCode() { return this._uiSourceCode; @@ -960,7 +960,7 @@ this._uiSourceCode.requestContent().then(callback.bind(this)); /** * @param {?string} content - * @this {WebInspector.NavigatorSourceTreeElement} + * @this {Sources.NavigatorSourceTreeElement} */ function callback(content) { this._warmedUpContent = content; @@ -971,7 +971,7 @@ if (!this._uiSourceCode.canRename()) return false; var isSelected = this === this.treeOutline.selectedTreeElement; - return isSelected && this.treeOutline.element.hasFocus() && !WebInspector.isBeingEdited(this.treeOutline.element); + return isSelected && this.treeOutline.element.hasFocus() && !UI.isBeingEdited(this.treeOutline.element); } /** @@ -985,7 +985,7 @@ setTimeout(rename.bind(this), 300); /** - * @this {WebInspector.NavigatorSourceTreeElement} + * @this {Sources.NavigatorSourceTreeElement} */ function rename() { if (this._shouldRenameOnMouseDown()) @@ -1055,7 +1055,7 @@ /** * @unrestricted */ -WebInspector.NavigatorTreeNode = class { +Sources.NavigatorTreeNode = class { /** * @param {string} id * @param {string} type @@ -1063,7 +1063,7 @@ constructor(id, type) { this.id = id; this._type = type; - /** @type {!Map.<string, !WebInspector.NavigatorTreeNode>} */ + /** @type {!Map.<string, !Sources.NavigatorTreeNode>} */ this._children = new Map(); } @@ -1117,7 +1117,7 @@ } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ didAddChild(node) { if (this.isPopulated()) @@ -1125,7 +1125,7 @@ } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ willRemoveChild(node) { if (this.isPopulated()) @@ -1147,7 +1147,7 @@ } /** - * @return {!Array.<!WebInspector.NavigatorTreeNode>} + * @return {!Array.<!Sources.NavigatorTreeNode>} */ children() { return this._children.valuesArray(); @@ -1155,14 +1155,14 @@ /** * @param {string} id - * @return {?WebInspector.NavigatorTreeNode} + * @return {?Sources.NavigatorTreeNode} */ child(id) { return this._children.get(id) || null; } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ appendChild(node) { this._children.set(node.id, node); @@ -1171,7 +1171,7 @@ } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ removeChild(node) { this.willRemoveChild(node); @@ -1188,12 +1188,12 @@ /** * @unrestricted */ -WebInspector.NavigatorRootTreeNode = class extends WebInspector.NavigatorTreeNode { +Sources.NavigatorRootTreeNode = class extends Sources.NavigatorTreeNode { /** - * @param {!WebInspector.NavigatorView} navigatorView + * @param {!Sources.NavigatorView} navigatorView */ constructor(navigatorView) { - super('', WebInspector.NavigatorView.Types.Root); + super('', Sources.NavigatorView.Types.Root); this._navigatorView = navigatorView; } @@ -1217,13 +1217,13 @@ /** * @unrestricted */ -WebInspector.NavigatorUISourceCodeTreeNode = class extends WebInspector.NavigatorTreeNode { +Sources.NavigatorUISourceCodeTreeNode = class extends Sources.NavigatorTreeNode { /** - * @param {!WebInspector.NavigatorView} navigatorView - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Sources.NavigatorView} navigatorView + * @param {!Workspace.UISourceCode} uiSourceCode */ constructor(navigatorView, uiSourceCode) { - super(uiSourceCode.project().id() + ':' + uiSourceCode.url(), WebInspector.NavigatorView.Types.File); + super(uiSourceCode.project().id() + ':' + uiSourceCode.url(), Sources.NavigatorView.Types.File); this._navigatorView = navigatorView; this._uiSourceCode = uiSourceCode; this._treeElement = null; @@ -1231,7 +1231,7 @@ } /** - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ uiSourceCode() { return this._uiSourceCode; @@ -1245,14 +1245,14 @@ if (this._treeElement) return this._treeElement; - this._treeElement = new WebInspector.NavigatorSourceTreeElement(this._navigatorView, this._uiSourceCode, ''); + this._treeElement = new Sources.NavigatorSourceTreeElement(this._navigatorView, this._uiSourceCode, ''); this.updateTitle(); var updateTitleBound = this.updateTitle.bind(this, undefined); this._eventListeners = [ - this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged, updateTitleBound), - this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, updateTitleBound), - this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, updateTitleBound) + this._uiSourceCode.addEventListener(Workspace.UISourceCode.Events.TitleChanged, updateTitleBound), + this._uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyChanged, updateTitleBound), + this._uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted, updateTitleBound) ]; return this._treeElement; } @@ -1266,15 +1266,15 @@ var titleText = this._uiSourceCode.displayName(); if (!ignoreIsDirty && - (this._uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommittedChanges(this._uiSourceCode))) + (this._uiSourceCode.isDirty() || Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode))) titleText = '*' + titleText; - var binding = WebInspector.persistence.binding(this._uiSourceCode); + var binding = Persistence.persistence.binding(this._uiSourceCode); if (binding && Runtime.experiments.isEnabled('persistence2')) { var titleElement = createElement('span'); titleElement.textContent = titleText; - var icon = WebInspector.Icon.create('smallicon-checkmark', 'mapped-file-checkmark'); - icon.title = WebInspector.PersistenceUtils.tooltipForUISourceCode(this._uiSourceCode); + var icon = UI.Icon.create('smallicon-checkmark', 'mapped-file-checkmark'); + icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(this._uiSourceCode); titleElement.appendChild(icon); this._treeElement.title = titleElement; } else { @@ -1283,7 +1283,7 @@ var tooltip = this._uiSourceCode.url(); if (this._uiSourceCode.contentType().isFromSourceMap()) - tooltip = WebInspector.UIString('%s (from source map)', this._uiSourceCode.displayName()); + tooltip = Common.UIString('%s (from source map)', this._uiSourceCode.displayName()); this._treeElement.tooltip = tooltip; } @@ -1299,7 +1299,7 @@ * @override */ dispose() { - WebInspector.EventTarget.removeEventListeners(this._eventListeners); + Common.EventTarget.removeEventListeners(this._eventListeners); } /** @@ -1322,13 +1322,13 @@ // Tree outline should be marked as edited as well as the tree element to prevent search from starting. var treeOutlineElement = this._treeElement.treeOutline.element; - WebInspector.markBeingEdited(treeOutlineElement, true); + UI.markBeingEdited(treeOutlineElement, true); /** * @param {!Element} element * @param {string} newTitle * @param {string} oldTitle - * @this {WebInspector.NavigatorUISourceCodeTreeNode} + * @this {Sources.NavigatorUISourceCodeTreeNode} */ function commitHandler(element, newTitle, oldTitle) { if (newTitle !== oldTitle) { @@ -1341,11 +1341,11 @@ /** * @param {boolean} success - * @this {WebInspector.NavigatorUISourceCodeTreeNode} + * @this {Sources.NavigatorUISourceCodeTreeNode} */ function renameCallback(success) { if (!success) { - WebInspector.markBeingEdited(treeOutlineElement, false); + UI.markBeingEdited(treeOutlineElement, false); this.updateTitle(); this.rename(callback); return; @@ -1355,10 +1355,10 @@ /** * @param {boolean} committed - * @this {WebInspector.NavigatorUISourceCodeTreeNode} + * @this {Sources.NavigatorUISourceCodeTreeNode} */ function afterEditing(committed) { - WebInspector.markBeingEdited(treeOutlineElement, false); + UI.markBeingEdited(treeOutlineElement, false); this.updateTitle(); this._treeElement.treeOutline.focus(); if (callback) @@ -1367,17 +1367,17 @@ this.updateTitle(true); this._treeElement.startEditingTitle( - new WebInspector.InplaceEditor.Config(commitHandler.bind(this), afterEditing.bind(this, false))); + new UI.InplaceEditor.Config(commitHandler.bind(this), afterEditing.bind(this, false))); } }; /** * @unrestricted */ -WebInspector.NavigatorFolderTreeNode = class extends WebInspector.NavigatorTreeNode { +Sources.NavigatorFolderTreeNode = class extends Sources.NavigatorTreeNode { /** - * @param {!WebInspector.NavigatorView} navigatorView - * @param {?WebInspector.Project} project + * @param {!Sources.NavigatorView} navigatorView + * @param {?Workspace.Project} project * @param {string} id * @param {string} type * @param {string} folderPath @@ -1404,12 +1404,12 @@ } updateTitle() { - if (!this._treeElement || this._project.type() !== WebInspector.projectTypes.FileSystem) + if (!this._treeElement || this._project.type() !== Workspace.projectTypes.FileSystem) return; var absoluteFileSystemPath = - WebInspector.FileSystemWorkspaceBinding.fileSystemPath(this._project.id()) + '/' + this._folderPath; + Bindings.FileSystemWorkspaceBinding.fileSystemPath(this._project.id()) + '/' + this._folderPath; var hasMappedFiles = Runtime.experiments.isEnabled('persistence2') ? - WebInspector.persistence.filePathHasBindings(absoluteFileSystemPath) : + Persistence.persistence.filePathHasBindings(absoluteFileSystemPath) : true; this._treeElement.listItemElement.classList.toggle('has-mapped-files', hasMappedFiles); } @@ -1418,13 +1418,13 @@ * @return {!TreeElement} */ _createTreeElement(title, node) { - if (this._project.type() !== WebInspector.projectTypes.FileSystem) { + if (this._project.type() !== Workspace.projectTypes.FileSystem) { try { title = decodeURI(title); } catch (e) { } } - var treeElement = new WebInspector.NavigatorFolderTreeElement(this._navigatorView, this._type, title); + var treeElement = new Sources.NavigatorFolderTreeElement(this._navigatorView, this._type, title); treeElement.setNode(node); return treeElement; } @@ -1443,18 +1443,18 @@ for (var i = 0; i < children.length; ++i) { var child = children[i]; this.didAddChild(child); - if (child instanceof WebInspector.NavigatorFolderTreeNode) + if (child instanceof Sources.NavigatorFolderTreeNode) child._addChildrenRecursive(); } } _shouldMerge(node) { - return this._type !== WebInspector.NavigatorView.Types.Domain && - node instanceof WebInspector.NavigatorFolderTreeNode; + return this._type !== Sources.NavigatorView.Types.Domain && + node instanceof Sources.NavigatorFolderTreeNode; } /** - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node * @override */ didAddChild(node) { @@ -1526,7 +1526,7 @@ /** * @override - * @param {!WebInspector.NavigatorTreeNode} node + * @param {!Sources.NavigatorTreeNode} node */ willRemoveChild(node) { if (node._isMerged || !this.isPopulated()) @@ -1538,10 +1538,10 @@ /** * @unrestricted */ -WebInspector.NavigatorGroupTreeNode = class extends WebInspector.NavigatorTreeNode { +Sources.NavigatorGroupTreeNode = class extends Sources.NavigatorTreeNode { /** - * @param {!WebInspector.NavigatorView} navigatorView - * @param {!WebInspector.Project} project + * @param {!Sources.NavigatorView} navigatorView + * @param {!Workspace.Project} project * @param {string} id * @param {string} type * @param {string} title @@ -1569,7 +1569,7 @@ if (this._treeElement) return this._treeElement; this._treeElement = - new WebInspector.NavigatorFolderTreeElement(this._navigatorView, this._type, this._title, this._hoverCallback); + new Sources.NavigatorFolderTreeElement(this._navigatorView, this._type, this._title, this._hoverCallback); this._treeElement.setNode(this); return this._treeElement; } @@ -1582,15 +1582,15 @@ } updateTitle() { - if (!this._treeElement || this._project.type() !== WebInspector.projectTypes.FileSystem) + if (!this._treeElement || this._project.type() !== Workspace.projectTypes.FileSystem) return; if (!Runtime.experiments.isEnabled('persistence2')) { this._treeElement.listItemElement.classList.add('has-mapped-files'); return; } - var fileSystemPath = WebInspector.FileSystemWorkspaceBinding.fileSystemPath(this._project.id()); + var fileSystemPath = Bindings.FileSystemWorkspaceBinding.fileSystemPath(this._project.id()); var wasActive = this._treeElement.listItemElement.classList.contains('has-mapped-files'); - var isActive = WebInspector.persistence.filePathHasBindings(fileSystemPath); + var isActive = Persistence.persistence.filePathHasBindings(fileSystemPath); if (wasActive === isActive) return; this._treeElement.listItemElement.classList.toggle('has-mapped-files', isActive);
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js index b62cbe5f..db31f97 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ObjectEventListenersSidebarPane.js
@@ -2,24 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ToolbarItem.ItemsProvider} + * @implements {UI.ToolbarItem.ItemsProvider} * @unrestricted */ -WebInspector.ObjectEventListenersSidebarPane = class extends WebInspector.VBox { +Sources.ObjectEventListenersSidebarPane = class extends UI.VBox { constructor() { super(); this.element.classList.add('event-listeners-sidebar-pane'); - this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this._refreshButton.addEventListener('click', this._refreshClick.bind(this)); this._refreshButton.setEnabled(false); - this._eventListenersView = new WebInspector.EventListenersView(this.element, this.update.bind(this)); + this._eventListenersView = new Components.EventListenersView(this.element, this.update.bind(this)); } /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ toolbarItems() { return [this._refreshButton]; @@ -28,10 +28,10 @@ update() { if (this._lastRequestedContext) { this._lastRequestedContext.target().runtimeAgent().releaseObjectGroup( - WebInspector.ObjectEventListenersSidebarPane._objectGroupName); + Sources.ObjectEventListenersSidebarPane._objectGroupName); delete this._lastRequestedContext; } - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (!executionContext) { this._eventListenersView.reset(); this._eventListenersView.addEmptyHolderIfNeeded(); @@ -47,7 +47,7 @@ */ wasShown() { super.wasShown(); - WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this.update, this); + UI.context.addFlavorChangeListener(SDK.ExecutionContext, this.update, this); this._refreshButton.setEnabled(true); this.update(); } @@ -57,13 +57,13 @@ */ willHide() { super.willHide(); - WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionContext, this.update, this); + UI.context.removeFlavorChangeListener(SDK.ExecutionContext, this.update, this); this._refreshButton.setEnabled(false); } /** - * @param {!WebInspector.ExecutionContext} executionContext - * @return {!Promise<!WebInspector.RemoteObject>} object + * @param {!SDK.ExecutionContext} executionContext + * @return {!Promise<!SDK.RemoteObject>} object */ _windowObjectInContext(executionContext) { return new Promise(windowObjectInContext); @@ -73,10 +73,10 @@ */ function windowObjectInContext(fulfill, reject) { executionContext.evaluate( - 'self', WebInspector.ObjectEventListenersSidebarPane._objectGroupName, false, true, false, false, false, + 'self', Sources.ObjectEventListenersSidebarPane._objectGroupName, false, true, false, false, false, mycallback); /** - * @param {?WebInspector.RemoteObject} object + * @param {?SDK.RemoteObject} object */ function mycallback(object) { if (object) @@ -88,7 +88,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _refreshClick(event) { event.consume(); @@ -96,4 +96,4 @@ } }; -WebInspector.ObjectEventListenersSidebarPane._objectGroupName = 'object-event-listeners-sidebar-pane'; +Sources.ObjectEventListenersSidebarPane._objectGroupName = 'object-event-listeners-sidebar-pane';
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js index b8a98ad..c58aa39 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js
@@ -7,10 +7,10 @@ /** * @unrestricted */ -WebInspector.OpenResourceDialog = class extends WebInspector.FilteredUISourceCodeListDelegate { +Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListDelegate { /** - * @param {!WebInspector.SourcesView} sourcesView - * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores + * @param {!Sources.SourcesView} sourcesView + * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores * @param {!Array<string>} history */ constructor(sourcesView, defaultScores, history) { @@ -20,23 +20,23 @@ } /** - * @param {!WebInspector.SourcesView} sourcesView + * @param {!Sources.SourcesView} sourcesView * @param {string} query - * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores + * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores * @param {!Array<string>} history */ static show(sourcesView, query, defaultScores, history) { - WebInspector.OpenResourceDialog._instanceForTest = - new WebInspector.OpenResourceDialog(sourcesView, defaultScores, history); + Sources.OpenResourceDialog._instanceForTest = + new Sources.OpenResourceDialog(sourcesView, defaultScores, history); var filteredItemSelectionDialog = - new WebInspector.FilteredListWidget(WebInspector.OpenResourceDialog._instanceForTest); + new UI.FilteredListWidget(Sources.OpenResourceDialog._instanceForTest); filteredItemSelectionDialog.showAsDialog(); filteredItemSelectionDialog.setQuery(query); } /** * @override - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode * @param {number=} lineNumber * @param {number=} columnNumber */ @@ -59,11 +59,11 @@ /** * @override - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ filterProject(project) { - return !WebInspector.Project.isServiceProject(project); + return !Workspace.Project.isServiceProject(project); } /** @@ -79,10 +79,10 @@ /** * @unrestricted */ -WebInspector.SelectUISourceCodeForProjectTypesDialog = class extends WebInspector.FilteredUISourceCodeListDelegate { +Sources.SelectUISourceCodeForProjectTypesDialog = class extends Sources.FilteredUISourceCodeListDelegate { /** * @param {!Array.<string>} types - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ constructor(types, callback) { super(); @@ -94,18 +94,18 @@ /** * @param {string} name * @param {!Array.<string>} types - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ static show(name, types, callback) { var filteredItemSelectionDialog = - new WebInspector.FilteredListWidget(new WebInspector.SelectUISourceCodeForProjectTypesDialog(types, callback)); + new UI.FilteredListWidget(new Sources.SelectUISourceCodeForProjectTypesDialog(types, callback)); filteredItemSelectionDialog.showAsDialog(); filteredItemSelectionDialog.setQuery(name); } /** * @override - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode * @param {number=} lineNumber * @param {number=} columnNumber */ @@ -115,7 +115,7 @@ /** * @override - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ filterProject(project) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/RevisionHistoryView.js b/third_party/WebKit/Source/devtools/front_end/sources/RevisionHistoryView.js index 5776d62d..a8bdbea4 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/RevisionHistoryView.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/RevisionHistoryView.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.RevisionHistoryView = class extends WebInspector.VBox { +Sources.RevisionHistoryView = class extends UI.VBox { constructor() { super(); this._uiSourceCodeItems = new Map(); @@ -42,34 +42,34 @@ this.element.appendChild(this._treeOutline.element); /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @this {WebInspector.RevisionHistoryView} + * @param {!Workspace.UISourceCode} uiSourceCode + * @this {Sources.RevisionHistoryView} */ function populateRevisions(uiSourceCode) { if (uiSourceCode.history.length) this._createUISourceCodeItem(uiSourceCode); } - WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this)); - WebInspector.workspace.addEventListener( - WebInspector.Workspace.Events.WorkingCopyCommittedByUser, this._revisionAdded, this); - WebInspector.workspace.addEventListener( - WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + Workspace.workspace.uiSourceCodes().forEach(populateRevisions.bind(this)); + Workspace.workspace.addEventListener( + Workspace.Workspace.Events.WorkingCopyCommittedByUser, this._revisionAdded, this); + Workspace.workspace.addEventListener( + Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); + Workspace.workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ static showHistory(uiSourceCode) { - WebInspector.viewManager.showView('sources.history'); - var historyView = /** @type {!WebInspector.RevisionHistoryView} */ ( - self.runtime.sharedInstance(WebInspector.RevisionHistoryView)); + UI.viewManager.showView('sources.history'); + var historyView = /** @type {!Sources.RevisionHistoryView} */ ( + self.runtime.sharedInstance(Sources.RevisionHistoryView)); historyView._revealUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _createUISourceCodeItem(uiSourceCode) { var uiSourceCodeItem = new TreeElement(uiSourceCode.displayName(), true); @@ -92,7 +92,7 @@ for (var i = revisionCount - 1; i >= 0; --i) { var revision = uiSourceCode.history[i]; var historyItem = - new WebInspector.RevisionHistoryTreeElement(revision, uiSourceCode.history[i - 1], i !== revisionCount - 1); + new Sources.RevisionHistoryTreeElement(revision, uiSourceCode.history[i - 1], i !== revisionCount - 1); uiSourceCodeItem.appendChild(historyItem); } @@ -102,31 +102,31 @@ var revertToOriginal = linkItem.listItemElement.createChild('span', 'revision-history-link revision-history-link-row'); - revertToOriginal.textContent = WebInspector.UIString('apply original content'); + revertToOriginal.textContent = Common.UIString('apply original content'); revertToOriginal.addEventListener('click', this._revertToOriginal.bind(this, uiSourceCode)); var clearHistoryElement = uiSourceCodeItem.listItemElement.createChild('span', 'revision-history-link'); - clearHistoryElement.textContent = WebInspector.UIString('revert'); + clearHistoryElement.textContent = Common.UIString('revert'); clearHistoryElement.addEventListener('click', this._clearHistory.bind(this, uiSourceCode)); return uiSourceCodeItem; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _revertToOriginal(uiSourceCode) { uiSourceCode.revertToOriginal(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _clearHistory(uiSourceCode) { uiSourceCode.revertAndClearHistory(this._removeUISourceCode.bind(this)); } _revisionAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode); var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode); if (!uiSourceCodeItem) { uiSourceCodeItem = this._createUISourceCodeItem(uiSourceCode); @@ -134,7 +134,7 @@ } var historyLength = uiSourceCode.history.length; - var historyItem = new WebInspector.RevisionHistoryTreeElement( + var historyItem = new Sources.RevisionHistoryTreeElement( uiSourceCode.history[historyLength - 1], uiSourceCode.history[historyLength - 2], false); if (uiSourceCodeItem.firstChild()) uiSourceCodeItem.firstChild().allowRevert(); @@ -142,7 +142,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _revealUISourceCode(uiSourceCode) { var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode); @@ -153,12 +153,12 @@ } _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._removeUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeUISourceCode(uiSourceCode) { var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode); @@ -178,10 +178,10 @@ /** * @unrestricted */ -WebInspector.RevisionHistoryTreeElement = class extends TreeElement { +Sources.RevisionHistoryTreeElement = class extends TreeElement { /** - * @param {!WebInspector.Revision} revision - * @param {!WebInspector.Revision} baseRevision + * @param {!Workspace.Revision} revision + * @param {!Workspace.Revision} baseRevision * @param {boolean} allowRevert */ constructor(revision, baseRevision, allowRevert) { @@ -193,7 +193,7 @@ this._revertElement = createElement('span'); this._revertElement.className = 'revision-history-link'; - this._revertElement.textContent = WebInspector.UIString('apply revision content'); + this._revertElement.textContent = Common.UIString('apply revision content'); this._revertElement.addEventListener('click', event => { this._revision.revertToThis(); }, false); @@ -226,12 +226,12 @@ /** * @param {?string} baseContent * @param {?string} newContent - * @this {WebInspector.RevisionHistoryTreeElement} + * @this {Sources.RevisionHistoryTreeElement} */ function diff(baseContent, newContent) { var baseLines = baseContent.split('\n'); var newLines = newContent.split('\n'); - var opcodes = WebInspector.Diff.lineDiff(baseLines, newLines); + var opcodes = Diff.Diff.lineDiff(baseLines, newLines); var lastWasSeparator = false; var baseLineNumber = 0; @@ -239,18 +239,18 @@ for (var idx = 0; idx < opcodes.length; idx++) { var code = opcodes[idx][0]; var rowCount = opcodes[idx][1].length; - if (code === WebInspector.Diff.Operation.Equal) { + if (code === Diff.Diff.Operation.Equal) { baseLineNumber += rowCount; newLineNumber += rowCount; if (!lastWasSeparator) this._createLine(null, null, ' \u2026', 'separator'); lastWasSeparator = true; - } else if (code === WebInspector.Diff.Operation.Delete) { + } else if (code === Diff.Diff.Operation.Delete) { lastWasSeparator = false; for (var i = 0; i < rowCount; ++i) this._createLine(baseLineNumber + i, null, baseLines[baseLineNumber + i], 'removed'); baseLineNumber += rowCount; - } else if (code === WebInspector.Diff.Operation.Insert) { + } else if (code === Diff.Diff.Operation.Insert) { lastWasSeparator = false; for (var i = 0; i < rowCount; ++i) this._createLine(null, newLineNumber + i, newLines[newLineNumber + i], 'added');
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js index d9edaa9..d6f96cab 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
@@ -24,14 +24,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContextFlavorListener} + * @implements {UI.ContextFlavorListener} * @unrestricted */ -WebInspector.ScopeChainSidebarPane = class extends WebInspector.VBox { +Sources.ScopeChainSidebarPane = class extends UI.VBox { constructor() { super(); - this._expandController = new WebInspector.ObjectPropertiesSectionExpandController(); - this._linkifier = new WebInspector.Linkifier(); + this._expandController = new Components.ObjectPropertiesSectionExpandController(); + this._linkifier = new Components.Linkifier(); this._update(); } @@ -44,17 +44,17 @@ } _update() { - var callFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); - var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails); + var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); + var details = UI.context.flavor(SDK.DebuggerPausedDetails); this._linkifier.reset(); - WebInspector.SourceMapNamesResolver.resolveThisObject(callFrame).then( + Sources.SourceMapNamesResolver.resolveThisObject(callFrame).then( this._innerUpdate.bind(this, details, callFrame)); } /** - * @param {?WebInspector.DebuggerPausedDetails} details - * @param {?WebInspector.DebuggerModel.CallFrame} callFrame - * @param {?WebInspector.RemoteObject} thisObject + * @param {?SDK.DebuggerPausedDetails} details + * @param {?SDK.DebuggerModel.CallFrame} callFrame + * @param {?SDK.RemoteObject} thisObject */ _innerUpdate(details, callFrame, thisObject) { this.element.removeChildren(); @@ -62,7 +62,7 @@ if (!details || !callFrame) { var infoElement = createElement('div'); infoElement.className = 'gray-info-message'; - infoElement.textContent = WebInspector.UIString('Not Paused'); + infoElement.textContent = Common.UIString('Not Paused'); this.element.appendChild(infoElement); return; } @@ -78,45 +78,45 @@ switch (scope.type()) { case Protocol.Debugger.ScopeType.Local: foundLocalScope = true; - title = WebInspector.UIString('Local'); - emptyPlaceholder = WebInspector.UIString('No Variables'); + title = Common.UIString('Local'); + emptyPlaceholder = Common.UIString('No Variables'); if (thisObject) - extraProperties.push(new WebInspector.RemoteObjectProperty('this', thisObject)); + extraProperties.push(new SDK.RemoteObjectProperty('this', thisObject)); if (i === 0) { var exception = details.exception(); if (exception) - extraProperties.push(new WebInspector.RemoteObjectProperty( - WebInspector.UIString.capitalize('Exception'), exception, undefined, undefined, undefined, undefined, + extraProperties.push(new SDK.RemoteObjectProperty( + Common.UIString.capitalize('Exception'), exception, undefined, undefined, undefined, undefined, undefined, true)); var returnValue = callFrame.returnValue(); if (returnValue) - extraProperties.push(new WebInspector.RemoteObjectProperty( - WebInspector.UIString.capitalize('Return ^value'), returnValue, undefined, undefined, undefined, + extraProperties.push(new SDK.RemoteObjectProperty( + Common.UIString.capitalize('Return ^value'), returnValue, undefined, undefined, undefined, undefined, undefined, true)); } break; case Protocol.Debugger.ScopeType.Closure: var scopeName = scope.name(); if (scopeName) - title = WebInspector.UIString('Closure (%s)', WebInspector.beautifyFunctionName(scopeName)); + title = Common.UIString('Closure (%s)', UI.beautifyFunctionName(scopeName)); else - title = WebInspector.UIString('Closure'); - emptyPlaceholder = WebInspector.UIString('No Variables'); + title = Common.UIString('Closure'); + emptyPlaceholder = Common.UIString('No Variables'); break; case Protocol.Debugger.ScopeType.Catch: - title = WebInspector.UIString('Catch'); + title = Common.UIString('Catch'); break; case Protocol.Debugger.ScopeType.Block: - title = WebInspector.UIString('Block'); + title = Common.UIString('Block'); break; case Protocol.Debugger.ScopeType.Script: - title = WebInspector.UIString('Script'); + title = Common.UIString('Script'); break; case Protocol.Debugger.ScopeType.With: - title = WebInspector.UIString('With Block'); + title = Common.UIString('With Block'); break; case Protocol.Debugger.ScopeType.Global: - title = WebInspector.UIString('Global'); + title = Common.UIString('Global'); break; } @@ -128,8 +128,8 @@ titleElement.createChild('div', 'scope-chain-sidebar-pane-section-subtitle').textContent = subtitle; titleElement.createChild('div', 'scope-chain-sidebar-pane-section-title').textContent = title; - var section = new WebInspector.ObjectPropertiesSection( - WebInspector.SourceMapNamesResolver.resolveScopeInObject(scope), titleElement, this._linkifier, + var section = new Components.ObjectPropertiesSection( + Sources.SourceMapNamesResolver.resolveScopeInObject(scope), titleElement, this._linkifier, emptyPlaceholder, true, extraProperties); this._expandController.watchSection(title + (subtitle ? ':' + subtitle : ''), section); @@ -148,4 +148,4 @@ } }; -WebInspector.ScopeChainSidebarPane._pathSymbol = Symbol('path'); +Sources.ScopeChainSidebarPane._pathSymbol = Symbol('path');
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js index fa7361b..11a8eed 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatter.js
@@ -30,19 +30,19 @@ /** * @interface */ -WebInspector.Formatter = function() {}; +Sources.Formatter = function() {}; /** - * @param {!WebInspector.ResourceType} contentType + * @param {!Common.ResourceType} contentType * @param {string} mimeType * @param {string} content - * @param {function(string, !WebInspector.FormatterSourceMapping)} callback + * @param {function(string, !Sources.FormatterSourceMapping)} callback */ -WebInspector.Formatter.format = function(contentType, mimeType, content, callback) { +Sources.Formatter.format = function(contentType, mimeType, content, callback) { if (contentType.isDocumentOrScriptOrStyleSheet()) - new WebInspector.ScriptFormatter(mimeType, content, callback); + new Sources.ScriptFormatter(mimeType, content, callback); else - new WebInspector.IdentityFormatter(mimeType, content, callback); + new Sources.ScriptIdentityFormatter(mimeType, content, callback); }; /** @@ -51,7 +51,7 @@ * @param {number} columnNumber * @return {number} */ -WebInspector.Formatter.locationToPosition = function(lineEndings, lineNumber, columnNumber) { +Sources.Formatter.locationToPosition = function(lineEndings, lineNumber, columnNumber) { var position = lineNumber ? lineEndings[lineNumber - 1] + 1 : 0; return position + columnNumber; }; @@ -61,7 +61,7 @@ * @param {number} position * @return {!Array.<number>} */ -WebInspector.Formatter.positionToLocation = function(lineEndings, position) { +Sources.Formatter.positionToLocation = function(lineEndings, position) { var lineNumber = lineEndings.upperBound(position - 1); if (!lineNumber) var columnNumber = position; @@ -71,14 +71,14 @@ }; /** - * @implements {WebInspector.Formatter} + * @implements {Sources.Formatter} * @unrestricted */ -WebInspector.ScriptFormatter = class { +Sources.ScriptFormatter = class { /** * @param {string} mimeType * @param {string} content - * @param {function(string, !WebInspector.FormatterSourceMapping)} callback + * @param {function(string, !Sources.FormatterSourceMapping)} callback */ constructor(mimeType, content, callback) { content = content.replace(/\r\n?|[\n\u2028\u2029]/g, '\n').replace(/^\uFEFF/, ''); @@ -88,9 +88,9 @@ var parameters = { mimeType: mimeType, content: content, - indentString: WebInspector.moduleSetting('textEditorIndent').get() + indentString: Common.moduleSetting('textEditorIndent').get() }; - WebInspector.formatterWorkerPool.runTask('format', parameters).then(this._didFormatContent.bind(this)); + Common.formatterWorkerPool.runTask('format', parameters).then(this._didFormatContent.bind(this)); } /** @@ -103,38 +103,38 @@ formattedContent = event.data.content; mapping = event.data['mapping']; } - var sourceMapping = new WebInspector.FormatterSourceMappingImpl( + var sourceMapping = new Sources.FormatterSourceMappingImpl( this._originalContent.computeLineEndings(), formattedContent.computeLineEndings(), mapping); this._callback(formattedContent, sourceMapping); } }; /** - * @implements {WebInspector.Formatter} + * @implements {Sources.Formatter} * @unrestricted */ -WebInspector.IdentityFormatter = class { +Sources.ScriptIdentityFormatter = class { /** * @param {string} mimeType * @param {string} content - * @param {function(string, !WebInspector.FormatterSourceMapping)} callback + * @param {function(string, !Sources.FormatterSourceMapping)} callback */ constructor(mimeType, content, callback) { - callback(content, new WebInspector.IdentityFormatterSourceMapping()); + callback(content, new Sources.IdentityFormatterSourceMapping()); } }; /** * @typedef {{original: !Array.<number>, formatted: !Array.<number>}} */ -WebInspector.FormatterMappingPayload; +Sources.FormatterMappingPayload; /** * @interface */ -WebInspector.FormatterSourceMapping = function() {}; +Sources.FormatterSourceMapping = function() {}; -WebInspector.FormatterSourceMapping.prototype = { +Sources.FormatterSourceMapping.prototype = { /** * @param {number} lineNumber * @param {number=} columnNumber @@ -151,10 +151,10 @@ }; /** - * @implements {WebInspector.FormatterSourceMapping} + * @implements {Sources.FormatterSourceMapping} * @unrestricted */ -WebInspector.IdentityFormatterSourceMapping = class { +Sources.IdentityFormatterSourceMapping = class { /** * @override * @param {number} lineNumber @@ -177,14 +177,14 @@ }; /** - * @implements {WebInspector.FormatterSourceMapping} + * @implements {Sources.FormatterSourceMapping} * @unrestricted */ -WebInspector.FormatterSourceMappingImpl = class { +Sources.FormatterSourceMappingImpl = class { /** * @param {!Array.<number>} originalLineEndings * @param {!Array.<number>} formattedLineEndings - * @param {!WebInspector.FormatterMappingPayload} mapping + * @param {!Sources.FormatterMappingPayload} mapping */ constructor(originalLineEndings, formattedLineEndings, mapping) { this._originalLineEndings = originalLineEndings; @@ -200,10 +200,10 @@ */ originalToFormatted(lineNumber, columnNumber) { var originalPosition = - WebInspector.Formatter.locationToPosition(this._originalLineEndings, lineNumber, columnNumber || 0); + Sources.Formatter.locationToPosition(this._originalLineEndings, lineNumber, columnNumber || 0); var formattedPosition = this._convertPosition(this._mapping.original, this._mapping.formatted, originalPosition || 0); - return WebInspector.Formatter.positionToLocation(this._formattedLineEndings, formattedPosition); + return Sources.Formatter.positionToLocation(this._formattedLineEndings, formattedPosition); } /** @@ -214,9 +214,9 @@ */ formattedToOriginal(lineNumber, columnNumber) { var formattedPosition = - WebInspector.Formatter.locationToPosition(this._formattedLineEndings, lineNumber, columnNumber || 0); + Sources.Formatter.locationToPosition(this._formattedLineEndings, lineNumber, columnNumber || 0); var originalPosition = this._convertPosition(this._mapping.formatted, this._mapping.original, formattedPosition); - return WebInspector.Formatter.positionToLocation(this._originalLineEndings, originalPosition || 0); + return Sources.Formatter.positionToLocation(this._originalLineEndings, originalPosition || 0); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js index 6640007d..d297db3 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.DebuggerSourceMapping} + * @implements {Bindings.DebuggerSourceMapping} * @unrestricted */ -WebInspector.FormatterScriptMapping = class { +Sources.FormatterScriptMapping = class { /** - * @param {!WebInspector.DebuggerModel} debuggerModel - * @param {!WebInspector.ScriptFormatterEditorAction} editorAction + * @param {!SDK.DebuggerModel} debuggerModel + * @param {!Sources.ScriptFormatterEditorAction} editorAction */ constructor(debuggerModel, editorAction) { this._debuggerModel = debuggerModel; @@ -17,11 +17,11 @@ /** * @override - * @param {!WebInspector.DebuggerModel.Location} rawLocation - * @return {?WebInspector.UILocation} + * @param {!SDK.DebuggerModel.Location} rawLocation + * @return {?Workspace.UILocation} */ rawLocationToUILocation(rawLocation) { - var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation); + var debuggerModelLocation = /** @type {!SDK.DebuggerModel.Location} */ (rawLocation); var script = debuggerModelLocation.script(); if (!script) return null; @@ -41,10 +41,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.DebuggerModel.Location} + * @return {?SDK.DebuggerModel.Location} */ uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { var formatData = this._editorAction._formatData.get(uiSourceCode); @@ -68,7 +68,7 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @return {boolean} */ @@ -80,12 +80,12 @@ /** * @unrestricted */ -WebInspector.FormatterScriptMapping.FormatData = class { +Sources.FormatterScriptMapping.FormatData = class { /** * @param {string} projectId * @param {string} path - * @param {!WebInspector.FormatterSourceMapping} mapping - * @param {!Array.<!WebInspector.Script>} scripts + * @param {!Sources.FormatterSourceMapping} mapping + * @param {!Array.<!SDK.Script>} scripts */ constructor(projectId, path, mapping, scripts) { this.projectId = projectId; @@ -96,62 +96,62 @@ }; /** - * @implements {WebInspector.SourcesView.EditorAction} - * @implements {WebInspector.TargetManager.Observer} + * @implements {Sources.SourcesView.EditorAction} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ScriptFormatterEditorAction = class { +Sources.ScriptFormatterEditorAction = class { constructor() { this._projectId = 'formatter:'; - this._project = new WebInspector.ContentProviderBasedProject( - WebInspector.workspace, this._projectId, WebInspector.projectTypes.Formatter, 'formatter'); + this._project = new Bindings.ContentProviderBasedProject( + Workspace.workspace, this._projectId, Workspace.projectTypes.Formatter, 'formatter'); - /** @type {!Map.<!WebInspector.Script, !WebInspector.UISourceCode>} */ + /** @type {!Map.<!SDK.Script, !Workspace.UISourceCode>} */ this._uiSourceCodes = new Map(); /** @type {!Map.<string, string>} */ this._formattedPaths = new Map(); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.FormatterScriptMapping.FormatData>} */ + /** @type {!Map.<!Workspace.UISourceCode, !Sources.FormatterScriptMapping.FormatData>} */ this._formatData = new Map(); /** @type {!Set.<string>} */ this._pathsToFormatOnLoad = new Set(); - /** @type {!Map.<!WebInspector.Target, !WebInspector.FormatterScriptMapping>} */ + /** @type {!Map.<!SDK.Target, !Sources.FormatterScriptMapping>} */ this._scriptMappingByTarget = new Map(); - this._workspace = WebInspector.workspace; - WebInspector.targetManager.observeTargets(this); + this._workspace = Workspace.workspace; + SDK.targetManager.observeTargets(this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return; - this._scriptMappingByTarget.set(target, new WebInspector.FormatterScriptMapping(debuggerModel, this)); - debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); + this._scriptMappingByTarget.set(target, new Sources.FormatterScriptMapping(debuggerModel, this)); + debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return; this._scriptMappingByTarget.remove(target); this._cleanForTarget(target); - debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); + debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorSelected(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._updateButton(uiSourceCode); var path = uiSourceCode.project().id() + ':' + uiSourceCode.url(); @@ -161,10 +161,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorClosed(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode); var wasSelected = /** @type {boolean} */ (event.data.wasSelected); if (wasSelected) @@ -173,7 +173,7 @@ } /** - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode */ _updateButton(uiSourceCode) { this._button.element.classList.toggle('hidden', !this._isFormatableScript(uiSourceCode)); @@ -181,18 +181,18 @@ /** * @override - * @param {!WebInspector.SourcesView} sourcesView - * @return {!WebInspector.ToolbarButton} + * @param {!Sources.SourcesView} sourcesView + * @return {!UI.ToolbarButton} */ button(sourcesView) { if (this._button) return this._button; this._sourcesView = sourcesView; - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClosed, this._editorClosed.bind(this)); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorClosed, this._editorClosed.bind(this)); - this._button = new WebInspector.ToolbarButton(WebInspector.UIString('Pretty print'), 'largeicon-pretty-print'); + this._button = new UI.ToolbarButton(Common.UIString('Pretty print'), 'largeicon-pretty-print'); this._button.addEventListener('click', this._toggleFormatScriptSource, this); this._updateButton(sourcesView.currentUISourceCode()); @@ -200,16 +200,16 @@ } /** - * @param {?WebInspector.UISourceCode} uiSourceCode + * @param {?Workspace.UISourceCode} uiSourceCode * @return {boolean} */ _isFormatableScript(uiSourceCode) { if (!uiSourceCode) return false; - if (WebInspector.persistence.binding(uiSourceCode)) + if (Persistence.persistence.binding(uiSourceCode)) return false; var supportedProjectTypes = [ - WebInspector.projectTypes.Network, WebInspector.projectTypes.Debugger, WebInspector.projectTypes.ContentScripts + Workspace.projectTypes.Network, Workspace.projectTypes.Debugger, Workspace.projectTypes.ContentScripts ]; if (supportedProjectTypes.indexOf(uiSourceCode.project().type()) === -1) return false; @@ -223,9 +223,9 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.UISourceCode} formattedUISourceCode - * @param {!WebInspector.FormatterSourceMapping} mapping + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} formattedUISourceCode + * @param {!Sources.FormatterSourceMapping} mapping * @private */ _showIfNeeded(uiSourceCode, formattedUISourceCode, mapping) { @@ -242,7 +242,7 @@ } /** - * @param {!WebInspector.UISourceCode} formattedUISourceCode + * @param {!Workspace.UISourceCode} formattedUISourceCode */ _discardFormattedUISourceCodeScript(formattedUISourceCode) { var formatData = this._formatData.get(formattedUISourceCode); @@ -255,18 +255,18 @@ this._pathsToFormatOnLoad.delete(path); for (var i = 0; i < formatData.scripts.length; ++i) { this._uiSourceCodes.remove(formatData.scripts[i]); - WebInspector.debuggerWorkspaceBinding.popSourceMapping(formatData.scripts[i]); + Bindings.debuggerWorkspaceBinding.popSourceMapping(formatData.scripts[i]); } this._project.removeFile(formattedUISourceCode.url()); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _cleanForTarget(target) { var uiSourceCodes = this._formatData.keysArray(); for (var i = 0; i < uiSourceCodes.length; ++i) { - WebInspector.debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCodes[i], null); + Bindings.debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCodes[i], null); var formatData = this._formatData.get(uiSourceCodes[i]); var scripts = []; for (var j = 0; j < formatData.scripts.length; ++j) { @@ -287,35 +287,35 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerReset(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); this._cleanForTarget(debuggerModel.target()); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Array.<!WebInspector.Script>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Array.<!SDK.Script>} */ _scriptsForUISourceCode(uiSourceCode) { /** - * @param {!WebInspector.Script} script + * @param {!SDK.Script} script * @return {boolean} */ function isInlineScript(script) { return script.isInlineScript() && !script.hasSourceURL; } - if (uiSourceCode.contentType() === WebInspector.resourceTypes.Document) { + if (uiSourceCode.contentType() === Common.resourceTypes.Document) { var scripts = []; - var debuggerModels = WebInspector.DebuggerModel.instances(); + var debuggerModels = SDK.DebuggerModel.instances(); for (var i = 0; i < debuggerModels.length; ++i) scripts.pushAll(debuggerModels[i].scriptsForSourceURL(uiSourceCode.url())); return scripts.filter(isInlineScript); } if (uiSourceCode.contentType().isScript()) { - var rawLocations = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0); + var rawLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0); return rawLocations.map(function(rawLocation) { return rawLocation.script(); }); @@ -324,7 +324,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _formatUISourceCodeScript(uiSourceCode) { var formattedPath = this._formattedPaths.get(uiSourceCode.project().id() + ':' + uiSourceCode.url()); @@ -334,35 +334,35 @@ var formatData = formattedUISourceCode ? this._formatData.get(formattedUISourceCode) : null; if (formatData) this._showIfNeeded( - uiSourceCode, /** @type {!WebInspector.UISourceCode} */ (formattedUISourceCode), formatData.mapping); + uiSourceCode, /** @type {!Workspace.UISourceCode} */ (formattedUISourceCode), formatData.mapping); return; } uiSourceCode.requestContent().then(contentLoaded.bind(this)); /** - * @this {WebInspector.ScriptFormatterEditorAction} + * @this {Sources.ScriptFormatterEditorAction} * @param {?string} content */ function contentLoaded(content) { - var highlighterType = WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode); - WebInspector.Formatter.format( + var highlighterType = Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode); + Sources.Formatter.format( uiSourceCode.contentType(), highlighterType, content || '', innerCallback.bind(this)); } /** - * @this {WebInspector.ScriptFormatterEditorAction} + * @this {Sources.ScriptFormatterEditorAction} * @param {string} formattedContent - * @param {!WebInspector.FormatterSourceMapping} formatterMapping + * @param {!Sources.FormatterSourceMapping} formatterMapping */ function innerCallback(formattedContent, formatterMapping) { var scripts = this._scriptsForUISourceCode(uiSourceCode); var formattedURL = uiSourceCode.url() + ':formatted'; var contentProvider = - WebInspector.StaticContentProvider.fromString(formattedURL, uiSourceCode.contentType(), formattedContent); + Common.StaticContentProvider.fromString(formattedURL, uiSourceCode.contentType(), formattedContent); var formattedUISourceCode = this._project.addContentProvider(formattedURL, contentProvider); var formattedPath = formattedUISourceCode.url(); - var formatData = new WebInspector.FormatterScriptMapping.FormatData( + var formatData = new Sources.FormatterScriptMapping.FormatData( uiSourceCode.project().id(), uiSourceCode.url(), formatterMapping, scripts); this._formatData.set(formattedUISourceCode, formatData); var path = uiSourceCode.project().id() + ':' + uiSourceCode.url(); @@ -371,15 +371,15 @@ for (var i = 0; i < scripts.length; ++i) { this._uiSourceCodes.set(scripts[i], formattedUISourceCode); var scriptMapping = - /** @type {!WebInspector.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(scripts[i].target())); - WebInspector.debuggerWorkspaceBinding.pushSourceMapping(scripts[i], scriptMapping); + /** @type {!Sources.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(scripts[i].target())); + Bindings.debuggerWorkspaceBinding.pushSourceMapping(scripts[i], scriptMapping); } - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); for (var i = 0; i < targets.length; ++i) { var scriptMapping = - /** @type {!WebInspector.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(targets[i])); - WebInspector.debuggerWorkspaceBinding.setSourceMapping(targets[i], formattedUISourceCode, scriptMapping); + /** @type {!Sources.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(targets[i])); + Bindings.debuggerWorkspaceBinding.setSourceMapping(targets[i], formattedUISourceCode, scriptMapping); } this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMapping); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SimpleHistoryManager.js b/third_party/WebKit/Source/devtools/front_end/sources/SimpleHistoryManager.js index 3d7379c..5801ebd 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SimpleHistoryManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SimpleHistoryManager.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.HistoryEntry = function() {}; +Sources.HistoryEntry = function() {}; -WebInspector.HistoryEntry.prototype = { +Sources.HistoryEntry.prototype = { /** * @return {boolean} */ @@ -44,7 +44,7 @@ /** * @unrestricted */ -WebInspector.SimpleHistoryManager = class { +Sources.SimpleHistoryManager = class { /** * @param {number} historyDepth */ @@ -71,7 +71,7 @@ } /** - * @param {function(!WebInspector.HistoryEntry):boolean} filterOutCallback + * @param {function(!Sources.HistoryEntry):boolean} filterOutCallback */ filterOut(filterOutCallback) { if (this.readOnly()) @@ -96,14 +96,14 @@ } /** - * @return {?WebInspector.HistoryEntry} + * @return {?Sources.HistoryEntry} */ active() { return this.empty() ? null : this._entries[this._activeEntryIndex]; } /** - * @param {!WebInspector.HistoryEntry} entry + * @param {!Sources.HistoryEntry} entry */ push(entry) { if (this.readOnly())
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js index f052090..0a4aca4 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js
@@ -4,17 +4,17 @@ /** * @unrestricted */ -WebInspector.SourceCodeDiff = class { +Sources.SourceCodeDiff = class { /** * @param {!Promise<?string>} diffBaseline - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!TextEditor.CodeMirrorTextEditor} textEditor */ constructor(diffBaseline, textEditor) { this._textEditor = textEditor; this._decorations = []; - this._textEditor.installGutter(WebInspector.SourceCodeDiff.DiffGutterType, true); + this._textEditor.installGutter(Sources.SourceCodeDiff.DiffGutterType, true); this._diffBaseline = diffBaseline; - /** @type {!Array<!WebInspector.TextEditorPositionHandle>}*/ + /** @type {!Array<!TextEditor.TextEditorPositionHandle>}*/ this._animatedLines = []; } @@ -22,7 +22,7 @@ if (this._updateTimeout) clearTimeout(this._updateTimeout); this._updateTimeout = - setTimeout(this.updateDiffMarkersImmediately.bind(this), WebInspector.SourceCodeDiff.UpdateTimeout); + setTimeout(this.updateDiffMarkersImmediately.bind(this), Sources.SourceCodeDiff.UpdateTimeout); } updateDiffMarkersImmediately() { @@ -44,7 +44,7 @@ var changedLines = []; for (var i = 0; i < diff.length; ++i) { var diffEntry = diff[i]; - if (diffEntry.type === WebInspector.SourceCodeDiff.GutterDecorationType.Delete) + if (diffEntry.type === Sources.SourceCodeDiff.GutterDecorationType.Delete) continue; for (var lineNumber = diffEntry.from; lineNumber < diffEntry.to; ++lineNumber) { var position = this._textEditor.textEditorPositionHandle(lineNumber, 0); @@ -58,7 +58,7 @@ } /** - * @param {!Array<!WebInspector.TextEditorPositionHandle>} newLines + * @param {!Array<!TextEditor.TextEditorPositionHandle>} newLines */ _updateHighlightedLines(newLines) { if (this._animationTimeout) @@ -67,7 +67,7 @@ this._textEditor.operation(operation.bind(this)); /** - * @this {WebInspector.SourceCodeDiff} + * @this {Sources.SourceCodeDiff} */ function operation() { toggleLines.call(this, false); @@ -77,7 +77,7 @@ /** * @param {boolean} value - * @this {WebInspector.SourceCodeDiff} + * @this {Sources.SourceCodeDiff} */ function toggleLines(value) { for (var i = 0; i < this._animatedLines.length; ++i) { @@ -89,8 +89,8 @@ } /** - * @param {!Array<!WebInspector.SourceCodeDiff.GutterDecoration>} removed - * @param {!Array<!WebInspector.SourceCodeDiff.GutterDecoration>} added + * @param {!Array<!Sources.SourceCodeDiff.GutterDecoration>} removed + * @param {!Array<!Sources.SourceCodeDiff.GutterDecoration>} added */ _updateDecorations(removed, added) { this._textEditor.operation(operation); @@ -106,10 +106,10 @@ /** * @param {string} baseline * @param {string} current - * @return {!Array<!{type: !WebInspector.SourceCodeDiff.GutterDecorationType, from: number, to: number}>} + * @return {!Array<!{type: !Sources.SourceCodeDiff.GutterDecorationType, from: number, to: number}>} */ _computeDiff(baseline, current) { - var diff = WebInspector.Diff.lineDiff(baseline.split('\n'), current.split('\n')); + var diff = Diff.Diff.lineDiff(baseline.split('\n'), current.split('\n')); var result = []; var hasAdded = false; var hasRemoved = false; @@ -118,7 +118,7 @@ var isInsideBlock = false; for (var i = 0; i < diff.length; ++i) { var token = diff[i]; - if (token[0] === WebInspector.Diff.Operation.Equal) { + if (token[0] === Diff.Diff.Operation.Equal) { if (isInsideBlock) flush(); currentLineNumber += token[1].length; @@ -130,7 +130,7 @@ blockStartLineNumber = currentLineNumber; } - if (token[0] === WebInspector.Diff.Operation.Delete) { + if (token[0] === Diff.Diff.Operation.Delete) { hasRemoved = true; } else { currentLineNumber += token[1].length; @@ -140,22 +140,22 @@ if (isInsideBlock) flush(); if (result.length > 1 && result[0].from === 0 && result[1].from === 0) { - var merged = {type: WebInspector.SourceCodeDiff.GutterDecorationType.Modify, from: 0, to: result[1].to}; + var merged = {type: Sources.SourceCodeDiff.GutterDecorationType.Modify, from: 0, to: result[1].to}; result.splice(0, 2, merged); } return result; function flush() { - var type = WebInspector.SourceCodeDiff.GutterDecorationType.Insert; + var type = Sources.SourceCodeDiff.GutterDecorationType.Insert; var from = blockStartLineNumber; var to = currentLineNumber; if (hasAdded && hasRemoved) { - type = WebInspector.SourceCodeDiff.GutterDecorationType.Modify; + type = Sources.SourceCodeDiff.GutterDecorationType.Modify; } else if (!hasAdded && hasRemoved && from === 0 && to === 0) { - type = WebInspector.SourceCodeDiff.GutterDecorationType.Modify; + type = Sources.SourceCodeDiff.GutterDecorationType.Modify; to = 1; } else if (!hasAdded && hasRemoved) { - type = WebInspector.SourceCodeDiff.GutterDecorationType.Delete; + type = Sources.SourceCodeDiff.GutterDecorationType.Delete; from -= 1; } result.push({type: type, from: from, to: to}); @@ -178,7 +178,7 @@ var diff = this._computeDiff(baseline, current); - /** @type {!Map<number, !WebInspector.SourceCodeDiff.GutterDecoration>} */ + /** @type {!Map<number, !Sources.SourceCodeDiff.GutterDecoration>} */ var oldDecorations = new Map(); for (var i = 0; i < this._decorations.length; ++i) { var decoration = this._decorations[i]; @@ -188,7 +188,7 @@ oldDecorations.set(lineNumber, decoration); } - /** @type {!Map<number, !{lineNumber: number, type: !WebInspector.SourceCodeDiff.GutterDecorationType}>} */ + /** @type {!Map<number, !{lineNumber: number, type: !Sources.SourceCodeDiff.GutterDecorationType}>} */ var newDecorations = new Map(); for (var i = 0; i < diff.length; ++i) { var diffEntry = diff[i]; @@ -198,7 +198,7 @@ var decorationDiff = oldDecorations.diff(newDecorations, (e1, e2) => e1.type === e2.type); var addedDecorations = decorationDiff.added.map( - entry => new WebInspector.SourceCodeDiff.GutterDecoration(this._textEditor, entry.lineNumber, entry.type)); + entry => new Sources.SourceCodeDiff.GutterDecoration(this._textEditor, entry.lineNumber, entry.type)); this._decorations = decorationDiff.equal.concat(addedDecorations); this._updateDecorations(decorationDiff.removed, addedDecorations); @@ -206,20 +206,20 @@ } /** - * @param {!Map<number, !{lineNumber: number, type: !WebInspector.SourceCodeDiff.GutterDecorationType}>} decorations + * @param {!Map<number, !{lineNumber: number, type: !Sources.SourceCodeDiff.GutterDecorationType}>} decorations */ _decorationsSetForTest(decorations) { } }; /** @type {number} */ -WebInspector.SourceCodeDiff.UpdateTimeout = 200; +Sources.SourceCodeDiff.UpdateTimeout = 200; /** @type {string} */ -WebInspector.SourceCodeDiff.DiffGutterType = 'CodeMirror-gutter-diff'; +Sources.SourceCodeDiff.DiffGutterType = 'CodeMirror-gutter-diff'; /** @enum {symbol} */ -WebInspector.SourceCodeDiff.GutterDecorationType = { +Sources.SourceCodeDiff.GutterDecorationType = { Insert: Symbol('Insert'), Delete: Symbol('Delete'), Modify: Symbol('Modify'), @@ -228,21 +228,21 @@ /** * @unrestricted */ -WebInspector.SourceCodeDiff.GutterDecoration = class { +Sources.SourceCodeDiff.GutterDecoration = class { /** - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!TextEditor.CodeMirrorTextEditor} textEditor * @param {number} lineNumber - * @param {!WebInspector.SourceCodeDiff.GutterDecorationType} type + * @param {!Sources.SourceCodeDiff.GutterDecorationType} type */ constructor(textEditor, lineNumber, type) { this._textEditor = textEditor; this._position = this._textEditor.textEditorPositionHandle(lineNumber, 0); this._className = ''; - if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Insert) + if (type === Sources.SourceCodeDiff.GutterDecorationType.Insert) this._className = 'diff-entry-insert'; - else if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Delete) + else if (type === Sources.SourceCodeDiff.GutterDecorationType.Delete) this._className = 'diff-entry-delete'; - else if (type === WebInspector.SourceCodeDiff.GutterDecorationType.Modify) + else if (type === Sources.SourceCodeDiff.GutterDecorationType.Modify) this._className = 'diff-entry-modify'; this.type = type; } @@ -263,7 +263,7 @@ return; var element = createElementWithClass('div', 'diff-marker'); element.textContent = '\u00A0'; - this._textEditor.setGutterDecoration(location.lineNumber, WebInspector.SourceCodeDiff.DiffGutterType, element); + this._textEditor.setGutterDecoration(location.lineNumber, Sources.SourceCodeDiff.DiffGutterType, element); this._textEditor.toggleLineClass(location.lineNumber, this._className, true); } @@ -271,7 +271,7 @@ var location = this._position.resolve(); if (!location) return; - this._textEditor.setGutterDecoration(location.lineNumber, WebInspector.SourceCodeDiff.DiffGutterType, null); + this._textEditor.setGutterDecoration(location.lineNumber, Sources.SourceCodeDiff.DiffGutterType, null); this._textEditor.toggleLineClass(location.lineNumber, this._className, false); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js index a98c629..d659300e 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -1,15 +1,15 @@ // Copyright 2016 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. -WebInspector.SourceMapNamesResolver = {}; +Sources.SourceMapNamesResolver = {}; -WebInspector.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); -WebInspector.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifiers'); +Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); +Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifiers'); /** * @unrestricted */ -WebInspector.SourceMapNamesResolver.Identifier = class { +Sources.SourceMapNamesResolver.Identifier = class { /** * @param {string} name * @param {number} lineNumber @@ -23,49 +23,49 @@ }; /** - * @param {!WebInspector.DebuggerModel.Scope} scope - * @return {!Promise<!Array<!WebInspector.SourceMapNamesResolver.Identifier>>} + * @param {!SDK.DebuggerModel.Scope} scope + * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>} */ -WebInspector.SourceMapNamesResolver._scopeIdentifiers = function(scope) { +Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) { var startLocation = scope.startLocation(); var endLocation = scope.endLocation(); if (scope.type() === Protocol.Debugger.ScopeType.Global || !startLocation || !endLocation || !startLocation.script().sourceMapURL || (startLocation.script() !== endLocation.script())) - return Promise.resolve(/** @type {!Array<!WebInspector.SourceMapNamesResolver.Identifier>}*/ ([])); + return Promise.resolve(/** @type {!Array<!Sources.SourceMapNamesResolver.Identifier>}*/ ([])); var script = startLocation.script(); return script.requestContent().then(onContent); /** * @param {?string} content - * @return {!Promise<!Array<!WebInspector.SourceMapNamesResolver.Identifier>>} + * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>} */ function onContent(content) { if (!content) - return Promise.resolve(/** @type {!Array<!WebInspector.SourceMapNamesResolver.Identifier>}*/ ([])); + return Promise.resolve(/** @type {!Array<!Sources.SourceMapNamesResolver.Identifier>}*/ ([])); - var text = new WebInspector.Text(content); - var scopeRange = new WebInspector.TextRange( + var text = new Common.Text(content); + var scopeRange = new Common.TextRange( startLocation.lineNumber, startLocation.columnNumber, endLocation.lineNumber, endLocation.columnNumber); var scopeText = text.extract(scopeRange); var scopeStart = text.toSourceRange(scopeRange).offset; var prefix = 'function fui'; - return WebInspector.formatterWorkerPool.runTask('javaScriptIdentifiers', {content: prefix + scopeText}) + return Common.formatterWorkerPool.runTask('javaScriptIdentifiers', {content: prefix + scopeText}) .then(onIdentifiers.bind(null, text, scopeStart, prefix)); } /** - * @param {!WebInspector.Text} text + * @param {!Common.Text} text * @param {number} scopeStart * @param {string} prefix * @param {?MessageEvent} event - * @return {!Array<!WebInspector.SourceMapNamesResolver.Identifier>} + * @return {!Array<!Sources.SourceMapNamesResolver.Identifier>} */ function onIdentifiers(text, scopeStart, prefix, event) { var identifiers = event ? /** @type {!Array<!{name: string, offset: number}>} */ (event.data) : []; var result = []; - var cursor = new WebInspector.TextCursor(text.lineEndings()); + var cursor = new Common.TextCursor(text.lineEndings()); var promises = []; for (var i = 0; i < identifiers.length; ++i) { var id = identifiers[i]; @@ -74,34 +74,34 @@ var start = scopeStart + id.offset - prefix.length; cursor.resetTo(start); result.push( - new WebInspector.SourceMapNamesResolver.Identifier(id.name, cursor.lineNumber(), cursor.columnNumber())); + new Sources.SourceMapNamesResolver.Identifier(id.name, cursor.lineNumber(), cursor.columnNumber())); } return result; } }; /** - * @param {!WebInspector.DebuggerModel.Scope} scope + * @param {!SDK.DebuggerModel.Scope} scope * @return {!Promise.<!Map<string, string>>} */ -WebInspector.SourceMapNamesResolver._resolveScope = function(scope) { - var identifiersPromise = scope[WebInspector.SourceMapNamesResolver._cachedIdentifiersSymbol]; +Sources.SourceMapNamesResolver._resolveScope = function(scope) { + var identifiersPromise = scope[Sources.SourceMapNamesResolver._cachedIdentifiersSymbol]; if (identifiersPromise) return identifiersPromise; var script = scope.callFrame().script; - var sourceMap = WebInspector.debuggerWorkspaceBinding.sourceMapForScript(script); + var sourceMap = Bindings.debuggerWorkspaceBinding.sourceMapForScript(script); if (!sourceMap) return Promise.resolve(new Map()); - /** @type {!Map<string, !WebInspector.Text>} */ + /** @type {!Map<string, !Common.Text>} */ var textCache = new Map(); - identifiersPromise = WebInspector.SourceMapNamesResolver._scopeIdentifiers(scope).then(onIdentifiers); - scope[WebInspector.SourceMapNamesResolver._cachedIdentifiersSymbol] = identifiersPromise; + identifiersPromise = Sources.SourceMapNamesResolver._scopeIdentifiers(scope).then(onIdentifiers); + scope[Sources.SourceMapNamesResolver._cachedIdentifiersSymbol] = identifiersPromise; return identifiersPromise; /** - * @param {!Array<!WebInspector.SourceMapNamesResolver.Identifier>} identifiers + * @param {!Array<!Sources.SourceMapNamesResolver.Identifier>} identifiers * @return {!Promise<!Map<string, string>>} */ function onIdentifiers(identifiers) { @@ -124,13 +124,13 @@ promises.push(promise); } return Promise.all(promises) - .then(() => WebInspector.SourceMapNamesResolver._scopeResolvedForTest()) + .then(() => Sources.SourceMapNamesResolver._scopeResolvedForTest()) .then(() => namesMapping); } /** * @param {!Map<string, string>} namesMapping - * @param {!WebInspector.SourceMapNamesResolver.Identifier} id + * @param {!Sources.SourceMapNamesResolver.Identifier} id * @param {?string} sourceName */ function onSourceNameResolved(namesMapping, id, sourceName) { @@ -140,7 +140,7 @@ } /** - * @param {!WebInspector.SourceMapNamesResolver.Identifier} id + * @param {!Sources.SourceMapNamesResolver.Identifier} id * @return {!Promise<?string>} */ function resolveSourceName(id) { @@ -150,10 +150,10 @@ !startEntry.sourceLineNumber || !startEntry.sourceColumnNumber || !endEntry.sourceLineNumber || !endEntry.sourceColumnNumber) return Promise.resolve(/** @type {?string} */ (null)); - var sourceTextRange = new WebInspector.TextRange( + var sourceTextRange = new Common.TextRange( startEntry.sourceLineNumber, startEntry.sourceColumnNumber, endEntry.sourceLineNumber, endEntry.sourceColumnNumber); - var uiSourceCode = WebInspector.networkMapping.uiSourceCodeForScriptURL(startEntry.sourceURL, script); + var uiSourceCode = Bindings.networkMapping.uiSourceCodeForScriptURL(startEntry.sourceURL, script); if (!uiSourceCode) return Promise.resolve(/** @type {?string} */ (null)); @@ -161,7 +161,7 @@ } /** - * @param {!WebInspector.TextRange} sourceTextRange + * @param {!Common.TextRange} sourceTextRange * @param {?string} content * @return {?string} */ @@ -170,7 +170,7 @@ return null; var text = textCache.get(content); if (!text) { - text = new WebInspector.Text(content); + text = new Common.Text(content); textCache.set(content, text); } var originalIdentifier = text.extract(sourceTextRange).trim(); @@ -178,21 +178,21 @@ } }; -WebInspector.SourceMapNamesResolver._scopeResolvedForTest = function() {}; +Sources.SourceMapNamesResolver._scopeResolvedForTest = function() {}; /** - * @param {!WebInspector.DebuggerModel.CallFrame} callFrame + * @param {!SDK.DebuggerModel.CallFrame} callFrame * @return {!Promise.<!Map<string, string>>} */ -WebInspector.SourceMapNamesResolver._allVariablesInCallFrame = function(callFrame) { - var cached = callFrame[WebInspector.SourceMapNamesResolver._cachedMapSymbol]; +Sources.SourceMapNamesResolver._allVariablesInCallFrame = function(callFrame) { + var cached = callFrame[Sources.SourceMapNamesResolver._cachedMapSymbol]; if (cached) return Promise.resolve(cached); var promises = []; var scopeChain = callFrame.scopeChain(); for (var i = 0; i < scopeChain.length; ++i) - promises.push(WebInspector.SourceMapNamesResolver._resolveScope(scopeChain[i])); + promises.push(Sources.SourceMapNamesResolver._resolveScope(scopeChain[i])); return Promise.all(promises).then(mergeVariables); @@ -209,26 +209,26 @@ reverseMapping.set(originalName, compiledName); } } - callFrame[WebInspector.SourceMapNamesResolver._cachedMapSymbol] = reverseMapping; + callFrame[Sources.SourceMapNamesResolver._cachedMapSymbol] = reverseMapping; return reverseMapping; } }; /** - * @param {!WebInspector.DebuggerModel.CallFrame} callFrame + * @param {!SDK.DebuggerModel.CallFrame} callFrame * @param {string} originalText - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} startColumnNumber * @param {number} endColumnNumber * @return {!Promise<string>} */ -WebInspector.SourceMapNamesResolver.resolveExpression = function( +Sources.SourceMapNamesResolver.resolveExpression = function( callFrame, originalText, uiSourceCode, lineNumber, startColumnNumber, endColumnNumber) { if (!Runtime.experiments.isEnabled('resolveVariableNames') || !uiSourceCode.contentType().isFromSourceMap()) return Promise.resolve(''); - return WebInspector.SourceMapNamesResolver._allVariablesInCallFrame(callFrame).then(findCompiledName); + return Sources.SourceMapNamesResolver._allVariablesInCallFrame(callFrame).then(findCompiledName); /** * @param {!Map<string, string>} reverseMapping @@ -238,23 +238,23 @@ if (reverseMapping.has(originalText)) return Promise.resolve(reverseMapping.get(originalText) || ''); - return WebInspector.SourceMapNamesResolver._resolveExpression( + return Sources.SourceMapNamesResolver._resolveExpression( callFrame, uiSourceCode, lineNumber, startColumnNumber, endColumnNumber); } }; /** - * @param {!WebInspector.DebuggerModel.CallFrame} callFrame - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!SDK.DebuggerModel.CallFrame} callFrame + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} startColumnNumber * @param {number} endColumnNumber * @return {!Promise<string>} */ -WebInspector.SourceMapNamesResolver._resolveExpression = function( +Sources.SourceMapNamesResolver._resolveExpression = function( callFrame, uiSourceCode, lineNumber, startColumnNumber, endColumnNumber) { var target = callFrame.target(); - var rawLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocation( + var rawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation( target, uiSourceCode, lineNumber, startColumnNumber); if (!rawLocation) return Promise.resolve(''); @@ -262,7 +262,7 @@ var script = rawLocation.script(); if (!script) return Promise.resolve(''); - var sourceMap = WebInspector.debuggerWorkspaceBinding.sourceMapForScript(script); + var sourceMap = Bindings.debuggerWorkspaceBinding.sourceMapForScript(script); if (!sourceMap) return Promise.resolve(''); @@ -276,13 +276,13 @@ if (!content) return Promise.resolve(''); - var text = new WebInspector.Text(content); + var text = new Common.Text(content); var textRange = sourceMap.reverseMapTextRange( - uiSourceCode.url(), new WebInspector.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber)); + uiSourceCode.url(), new Common.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber)); var originalText = text.extract(textRange); if (!originalText) return Promise.resolve(''); - return WebInspector.formatterWorkerPool.runTask('evaluatableJavaScriptSubstring', {content: originalText}) + return Common.formatterWorkerPool.runTask('evaluatableJavaScriptSubstring', {content: originalText}) .then(onResult); } @@ -296,20 +296,20 @@ }; /** - * @param {?WebInspector.DebuggerModel.CallFrame} callFrame - * @return {!Promise<?WebInspector.RemoteObject>} + * @param {?SDK.DebuggerModel.CallFrame} callFrame + * @return {!Promise<?SDK.RemoteObject>} */ -WebInspector.SourceMapNamesResolver.resolveThisObject = function(callFrame) { +Sources.SourceMapNamesResolver.resolveThisObject = function(callFrame) { if (!callFrame) - return Promise.resolve(/** @type {?WebInspector.RemoteObject} */ (null)); + return Promise.resolve(/** @type {?SDK.RemoteObject} */ (null)); if (!Runtime.experiments.isEnabled('resolveVariableNames') || !callFrame.scopeChain().length) return Promise.resolve(callFrame.thisObject()); - return WebInspector.SourceMapNamesResolver._resolveScope(callFrame.scopeChain()[0]).then(onScopeResolved); + return Sources.SourceMapNamesResolver._resolveScope(callFrame.scopeChain()[0]).then(onScopeResolved); /** * @param {!Map<string, string>} namesMapping - * @return {!Promise<?WebInspector.RemoteObject>} + * @return {!Promise<?SDK.RemoteObject>} */ function onScopeResolved(namesMapping) { var thisMappings = namesMapping.inverse().get('this'); @@ -324,7 +324,7 @@ } /** - * @param {function(!WebInspector.RemoteObject)} callback + * @param {function(!SDK.RemoteObject)} callback * @param {?Protocol.Runtime.RemoteObject} evaluateResult */ function onEvaluated(callback, evaluateResult) { @@ -335,10 +335,10 @@ }; /** - * @param {!WebInspector.DebuggerModel.Scope} scope - * @return {!WebInspector.RemoteObject} + * @param {!SDK.DebuggerModel.Scope} scope + * @return {!SDK.RemoteObject} */ -WebInspector.SourceMapNamesResolver.resolveScopeInObject = function(scope) { +Sources.SourceMapNamesResolver.resolveScopeInObject = function(scope) { if (!Runtime.experiments.isEnabled('resolveVariableNames')) return scope.object(); @@ -349,15 +349,15 @@ !startLocation.script().sourceMapURL || startLocation.script() !== endLocation.script()) return scope.object(); - return new WebInspector.SourceMapNamesResolver.RemoteObject(scope); + return new Sources.SourceMapNamesResolver.RemoteObject(scope); }; /** * @unrestricted */ -WebInspector.SourceMapNamesResolver.RemoteObject = class extends WebInspector.RemoteObject { +Sources.SourceMapNamesResolver.RemoteObject = class extends SDK.RemoteObject { /** - * @param {!WebInspector.DebuggerModel.Scope} scope + * @param {!SDK.DebuggerModel.Scope} scope */ constructor(scope) { super(); @@ -415,7 +415,7 @@ /** * @override - * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback */ getOwnProperties(callback) { this._object.getOwnProperties(callback); @@ -424,22 +424,22 @@ /** * @override * @param {boolean} accessorPropertiesOnly - * @param {function(?Array<!WebInspector.RemoteObjectProperty>, ?Array<!WebInspector.RemoteObjectProperty>)} callback + * @param {function(?Array<!SDK.RemoteObjectProperty>, ?Array<!SDK.RemoteObjectProperty>)} callback */ getAllProperties(accessorPropertiesOnly, callback) { /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties - * @this {WebInspector.SourceMapNamesResolver.RemoteObject} + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties + * @this {Sources.SourceMapNamesResolver.RemoteObject} */ function wrappedCallback(properties, internalProperties) { - WebInspector.SourceMapNamesResolver._resolveScope(this._scope) + Sources.SourceMapNamesResolver._resolveScope(this._scope) .then(resolveNames.bind(null, properties, internalProperties)); } /** - * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties - * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties + * @param {?Array.<!SDK.RemoteObjectProperty>} properties + * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties * @param {!Map<string, string>} namesMapping */ function resolveNames(properties, internalProperties, namesMapping) { @@ -448,7 +448,7 @@ for (var i = 0; i < properties.length; ++i) { var property = properties[i]; var name = namesMapping.get(property.name) || properties[i].name; - newProperties.push(new WebInspector.RemoteObjectProperty( + newProperties.push(new SDK.RemoteObjectProperty( name, property.value, property.enumerable, property.writable, property.isOwn, property.wasThrown, property.symbol, property.synthetic)); } @@ -467,11 +467,11 @@ * @param {function(string=)} callback */ setPropertyValue(argumentName, value, callback) { - WebInspector.SourceMapNamesResolver._resolveScope(this._scope).then(resolveName.bind(this)); + Sources.SourceMapNamesResolver._resolveScope(this._scope).then(resolveName.bind(this)); /** * @param {!Map<string, string>} namesMapping - * @this {WebInspector.SourceMapNamesResolver.RemoteObject} + * @this {Sources.SourceMapNamesResolver.RemoteObject} */ function resolveName(namesMapping) { var name; @@ -493,7 +493,7 @@ /** * @override - * @return {!Promise<?Array<!WebInspector.EventListener>>} + * @return {!Promise<?Array<!SDK.EventListener>>} */ eventListeners() { return this._object.eventListeners(); @@ -512,7 +512,7 @@ * @override * @param {function(this:Object, ...)} functionDeclaration * @param {!Array<!Protocol.Runtime.CallArgument>=} args - * @param {function(?WebInspector.RemoteObject, boolean=)=} callback + * @param {function(?SDK.RemoteObject, boolean=)=} callback */ callFunction(functionDeclaration, args, callback) { this._object.callFunction(functionDeclaration, args, callback); @@ -530,7 +530,7 @@ /** * @override - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._object.target(); @@ -538,7 +538,7 @@ /** * @override - * @return {?WebInspector.DebuggerModel} + * @return {?SDK.DebuggerModel} */ debuggerModel() { return this._object.debuggerModel();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js index 1cb4d6e1..8b1cf10 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
@@ -29,30 +29,30 @@ /** * @unrestricted */ -WebInspector.SourcesNavigatorView = class extends WebInspector.NavigatorView { +Sources.SourcesNavigatorView = class extends Sources.NavigatorView { constructor() { super(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { if (!super.accept(uiSourceCode)) return false; - return uiSourceCode.project().type() !== WebInspector.projectTypes.ContentScripts && - uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets; + return uiSourceCode.project().type() !== Workspace.projectTypes.ContentScripts && + uiSourceCode.project().type() !== Workspace.projectTypes.Snippets; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _inspectedURLChanged(event) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (event.data !== mainTarget) return; var inspectedURL = mainTarget && mainTarget.inspectedURL(); @@ -67,10 +67,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ uiSourceCodeAdded(uiSourceCode) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); var inspectedURL = mainTarget && mainTarget.inspectedURL(); if (!inspectedURL) return; @@ -83,8 +83,8 @@ * @param {!Event} event */ handleContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); - WebInspector.NavigatorView.appendAddFolderItem(contextMenu); + var contextMenu = new UI.ContextMenu(event); + Sources.NavigatorView.appendAddFolderItem(contextMenu); contextMenu.show(); } }; @@ -92,27 +92,27 @@ /** * @unrestricted */ -WebInspector.NetworkNavigatorView = class extends WebInspector.NavigatorView { +Sources.NetworkNavigatorView = class extends Sources.NavigatorView { constructor() { super(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.Network; + return uiSourceCode.project().type() === Workspace.projectTypes.Network; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _inspectedURLChanged(event) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (event.data !== mainTarget) return; var inspectedURL = mainTarget && mainTarget.inspectedURL(); @@ -127,10 +127,10 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ uiSourceCodeAdded(uiSourceCode) { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); var inspectedURL = mainTarget && mainTarget.inspectedURL(); if (!inspectedURL) return; @@ -142,25 +142,25 @@ /** * @unrestricted */ -WebInspector.FilesNavigatorView = class extends WebInspector.NavigatorView { +Sources.FilesNavigatorView = class extends Sources.NavigatorView { constructor() { super(); - var toolbar = new WebInspector.Toolbar('navigator-toolbar'); - var title = WebInspector.UIString('Add folder to workspace'); - var addButton = new WebInspector.ToolbarButton(title, 'largeicon-add', title); + var toolbar = new UI.Toolbar('navigator-toolbar'); + var title = Common.UIString('Add folder to workspace'); + var addButton = new UI.ToolbarButton(title, 'largeicon-add', title); addButton.addEventListener('click', () => - WebInspector.isolatedFileSystemManager.addFileSystem()); + Workspace.isolatedFileSystemManager.addFileSystem()); toolbar.appendToolbarItem(addButton); this.element.insertBefore(toolbar.element, this.element.firstChild); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem; + return uiSourceCode.project().type() === Workspace.projectTypes.FileSystem; } /** @@ -168,8 +168,8 @@ * @param {!Event} event */ handleContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); - WebInspector.NavigatorView.appendAddFolderItem(contextMenu); + var contextMenu = new UI.ContextMenu(event); + Sources.NavigatorView.appendAddFolderItem(contextMenu); contextMenu.show(); } }; @@ -177,29 +177,29 @@ /** * @unrestricted */ -WebInspector.ContentScriptsNavigatorView = class extends WebInspector.NavigatorView { +Sources.ContentScriptsNavigatorView = class extends Sources.NavigatorView { constructor() { super(); } /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts; + return uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts; } }; /** * @unrestricted */ -WebInspector.SnippetsNavigatorView = class extends WebInspector.NavigatorView { +Sources.SnippetsNavigatorView = class extends Sources.NavigatorView { constructor() { super(); - var toolbar = new WebInspector.Toolbar('navigator-toolbar'); - var newButton = new WebInspector.ToolbarButton('', 'largeicon-add', WebInspector.UIString('New Snippet')); + var toolbar = new UI.Toolbar('navigator-toolbar'); + var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('New Snippet')); newButton.addEventListener('click', this._handleCreateSnippet.bind(this)); toolbar.appendToolbarItem(newButton); this.element.insertBefore(toolbar.element, this.element.firstChild); @@ -207,11 +207,11 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ accept(uiSourceCode) { - return uiSourceCode.project().type() === WebInspector.projectTypes.Snippets; + return uiSourceCode.project().type() === Workspace.projectTypes.Snippets; } /** @@ -219,58 +219,58 @@ * @param {!Event} event */ handleContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('New'), this._handleCreateSnippet.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('New'), this._handleCreateSnippet.bind(this)); contextMenu.show(); } /** * @override * @param {!Event} event - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ handleFileContextMenu(event, uiSourceCode) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString('Run'), this._handleEvaluateSnippet.bind(this, uiSourceCode)); - contextMenu.appendItem(WebInspector.UIString('Rename'), this.rename.bind(this, uiSourceCode)); - contextMenu.appendItem(WebInspector.UIString('Remove'), this._handleRemoveSnippet.bind(this, uiSourceCode)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString('Run'), this._handleEvaluateSnippet.bind(this, uiSourceCode)); + contextMenu.appendItem(Common.UIString('Rename'), this.rename.bind(this, uiSourceCode)); + contextMenu.appendItem(Common.UIString('Remove'), this._handleRemoveSnippet.bind(this, uiSourceCode)); contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('New'), this._handleCreateSnippet.bind(this)); + contextMenu.appendItem(Common.UIString('New'), this._handleCreateSnippet.bind(this)); contextMenu.appendSeparator(); - contextMenu.appendItem(WebInspector.UIString('Save as...'), this._handleSaveAs.bind(this, uiSourceCode)); + contextMenu.appendItem(Common.UIString('Save as...'), this._handleSaveAs.bind(this, uiSourceCode)); contextMenu.show(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleEvaluateSnippet(uiSourceCode) { - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); - if (uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets || !executionContext) + var executionContext = UI.context.flavor(SDK.ExecutionContext); + if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets || !executionContext) return; - WebInspector.scriptSnippetModel.evaluateScriptSnippet(executionContext, uiSourceCode); + Snippets.scriptSnippetModel.evaluateScriptSnippet(executionContext, uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleSaveAs(uiSourceCode) { - if (uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets) + if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets) return; uiSourceCode.saveAs(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleRemoveSnippet(uiSourceCode) { - if (uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets) + if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets) return; uiSourceCode.remove(); } _handleCreateSnippet() { - this.create(WebInspector.scriptSnippetModel.project(), ''); + this.create(Snippets.scriptSnippetModel.project(), ''); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js index 67b17a8..003dffd 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -24,64 +24,64 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContextMenu.Provider} - * @implements {WebInspector.TargetManager.Observer} - * @implements {WebInspector.ViewLocationResolver} + * @implements {UI.ContextMenu.Provider} + * @implements {SDK.TargetManager.Observer} + * @implements {UI.ViewLocationResolver} * @unrestricted */ -WebInspector.SourcesPanel = class extends WebInspector.Panel { +Sources.SourcesPanel = class extends UI.Panel { constructor() { super('sources'); - WebInspector.SourcesPanel._instance = this; + Sources.SourcesPanel._instance = this; this.registerRequiredCSS('sources/sourcesPanel.css'); - new WebInspector.DropTarget( - this.element, [WebInspector.DropTarget.Types.Files], WebInspector.UIString('Drop workspace folder here'), + new UI.DropTarget( + this.element, [UI.DropTarget.Types.Files], Common.UIString('Drop workspace folder here'), this._handleDrop.bind(this)); - this._workspace = WebInspector.workspace; - this._networkMapping = WebInspector.networkMapping; + this._workspace = Workspace.workspace; + this._networkMapping = Bindings.networkMapping; this._togglePauseAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('debugger.toggle-pause')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-pause')); this._stepOverAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('debugger.step-over')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-over')); this._stepIntoAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('debugger.step-into')); - this._stepOutAction = /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('debugger.step-out')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-into')); + this._stepOutAction = /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-out')); this._toggleBreakpointsActiveAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('debugger.toggle-breakpoints-active')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-breakpoints-active')); this._debugToolbar = this._createDebugToolbar(); this._debugToolbarDrawer = this._createDebugToolbarDrawer(); - this._debuggerPausedMessage = new WebInspector.DebuggerPausedMessage(); + this._debuggerPausedMessage = new Sources.DebuggerPausedMessage(); const initialDebugSidebarWidth = 225; this._splitWidget = - new WebInspector.SplitWidget(true, true, 'sourcesPanelSplitViewState', initialDebugSidebarWidth); + new UI.SplitWidget(true, true, 'sourcesPanelSplitViewState', initialDebugSidebarWidth); this._splitWidget.enableShowModeSaving(); this._splitWidget.show(this.element); // Create scripts navigator const initialNavigatorWidth = 225; this.editorView = - new WebInspector.SplitWidget(true, false, 'sourcesPanelNavigatorSplitViewState', initialNavigatorWidth); + new UI.SplitWidget(true, false, 'sourcesPanelNavigatorSplitViewState', initialNavigatorWidth); this.editorView.enableShowModeSaving(); this.editorView.element.tabIndex = 0; this._splitWidget.setMainWidget(this.editorView); // Create navigator tabbed pane with toolbar. this._navigatorTabbedLocation = - WebInspector.viewManager.createTabbedLocation(this._revealNavigatorSidebar.bind(this), 'navigator-view', true); + UI.viewManager.createTabbedLocation(this._revealNavigatorSidebar.bind(this), 'navigator-view', true); var tabbedPane = this._navigatorTabbedLocation.tabbedPane(); tabbedPane.setMinimumSize(100, 25); tabbedPane.element.classList.add('navigator-tabbed-pane'); - var navigatorMenuButton = new WebInspector.ToolbarMenuButton(this._populateNavigatorMenu.bind(this), true); - navigatorMenuButton.setTitle(WebInspector.UIString('More options')); + var navigatorMenuButton = new UI.ToolbarMenuButton(this._populateNavigatorMenu.bind(this), true); + navigatorMenuButton.setTitle(Common.UIString('More options')); tabbedPane.rightToolbar().appendToolbarItem(navigatorMenuButton); this.editorView.setSidebarWidget(tabbedPane); - this._sourcesView = new WebInspector.SourcesView(); - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); + this._sourcesView = new Sources.SourcesView(); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); this._toggleNavigatorSidebarButton = this.editorView.createShowHideSidebarButton('navigator'); @@ -89,62 +89,62 @@ this.editorView.setMainWidget(this._sourcesView); this._threadsSidebarPane = null; - this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view('sources.watch')); + this._watchSidebarPane = /** @type {!UI.View} */ (UI.viewManager.view('sources.watch')); // TODO: Force installing listeners from the model, not the UI. - self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); - this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSidebarPane); + self.runtime.sharedInstance(Sources.XHRBreakpointsSidebarPane); + this._callstackPane = self.runtime.sharedInstance(Sources.CallStackSidebarPane); this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this)); - WebInspector.moduleSetting('sidebarPosition').addChangeListener(this._updateSidebarPosition.bind(this)); + Common.moduleSetting('sidebarPosition').addChangeListener(this._updateSidebarPosition.bind(this)); this._updateSidebarPosition(); this._updateDebuggerButtonsAndStatus(); this._pauseOnExceptionEnabledChanged(); - WebInspector.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._pauseOnExceptionEnabledChanged, this); + Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._pauseOnExceptionEnabledChanged, this); - this._liveLocationPool = new WebInspector.LiveLocationPool(); + this._liveLocationPool = new Bindings.LiveLocationPool(); - this._setTarget(WebInspector.context.flavor(WebInspector.Target)); - WebInspector.breakpointManager.addEventListener( - WebInspector.BreakpointManager.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); - WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._onCurrentTargetChanged, this); - WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.CallFrame, this._callFrameChanged, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, + this._setTarget(UI.context.flavor(SDK.Target)); + Bindings.breakpointManager.addEventListener( + Bindings.BreakpointManager.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); + UI.context.addFlavorChangeListener(SDK.Target, this._onCurrentTargetChanged, this); + UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this._callFrameChanged, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); - WebInspector.targetManager.addModelListener( - WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetAdded, this._pendingTargetAdded, this); - new WebInspector.WorkspaceMappingTip(this, this._workspace); - WebInspector.extensionServer.addEventListener( - WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); - WebInspector.DataSaverInfobar.maybeShowInPanel(this); - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); + SDK.targetManager.addModelListener( + SDK.SubTargetsManager, SDK.SubTargetsManager.Events.PendingTargetAdded, this._pendingTargetAdded, this); + new Sources.WorkspaceMappingTip(this, this._workspace); + Extensions.extensionServer.addEventListener( + Extensions.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); + Components.DataSaverInfobar.maybeShowInPanel(this); + SDK.targetManager.observeTargets(this); } /** - * @return {!WebInspector.SourcesPanel} + * @return {!Sources.SourcesPanel} */ static instance() { - if (WebInspector.SourcesPanel._instance) - return WebInspector.SourcesPanel._instance; - return /** @type {!WebInspector.SourcesPanel} */ (self.runtime.sharedInstance(WebInspector.SourcesPanel)); + if (Sources.SourcesPanel._instance) + return Sources.SourcesPanel._instance; + return /** @type {!Sources.SourcesPanel} */ (self.runtime.sharedInstance(Sources.SourcesPanel)); } /** - * @param {!WebInspector.SourcesPanel} panel + * @param {!Sources.SourcesPanel} panel */ static updateResizerAndSidebarButtons(panel) { panel._sourcesView.leftToolbar().removeToolbarItems(); panel._sourcesView.rightToolbar().removeToolbarItems(); panel._sourcesView.bottomToolbar().removeToolbarItems(); var isInWrapper = - WebInspector.SourcesPanel.WrapperView.isShowing() && !WebInspector.inspectorView.isDrawerMinimized(); + Sources.SourcesPanel.WrapperView.isShowing() && !UI.inspectorView.isDrawerMinimized(); if (panel._splitWidget.isVertical() || isInWrapper) panel._splitWidget.uninstallResizer(panel._sourcesView.toolbarContainerElement()); else @@ -160,7 +160,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._showThreadsIfNeeded(); @@ -168,7 +168,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } @@ -178,8 +178,8 @@ } _showThreadsIfNeeded() { - if (WebInspector.ThreadsSidebarPane.shouldBeShown() && !this._threadsSidebarPane) { - this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view('sources.threads')); + if (Sources.ThreadsSidebarPane.shouldBeShown() && !this._threadsSidebarPane) { + this._threadsSidebarPane = /** @type {!UI.View} */ (UI.viewManager.view('sources.threads')); if (this._sidebarPaneStack) this._sidebarPaneStack.showView(this._threadsSidebarPane, this._splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane); } @@ -187,18 +187,18 @@ /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ _setTarget(target) { if (!target) return; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return; if (debuggerModel.isPaused()) { this._showDebuggerPausedDetails( - /** @type {!WebInspector.DebuggerPausedDetails} */ (debuggerModel.debuggerPausedDetails())); + /** @type {!SDK.DebuggerPausedDetails} */ (debuggerModel.debuggerPausedDetails())); } else { this._paused = false; this._clearInterface(); @@ -207,10 +207,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onCurrentTargetChanged(event) { - var target = /** @type {?WebInspector.Target} */ (event.data); + var target = /** @type {?SDK.Target} */ (event.data); this._setTarget(target); } /** @@ -224,12 +224,12 @@ * @override */ wasShown() { - WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); + UI.context.setFlavor(Sources.SourcesPanel, this); super.wasShown(); - var wrapper = WebInspector.SourcesPanel.WrapperView._instance; + var wrapper = Sources.SourcesPanel.WrapperView._instance; if (wrapper && wrapper.isShowing()) { - WebInspector.inspectorView.setDrawerMinimized(true); - WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); + UI.inspectorView.setDrawerMinimized(true); + Sources.SourcesPanel.updateResizerAndSidebarButtons(this); } this.editorView.setMainWidget(this._sourcesView); } @@ -239,18 +239,18 @@ */ willHide() { super.willHide(); - WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); - if (WebInspector.SourcesPanel.WrapperView.isShowing()) { - WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper(); - WebInspector.inspectorView.setDrawerMinimized(false); - WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); + UI.context.setFlavor(Sources.SourcesPanel, null); + if (Sources.SourcesPanel.WrapperView.isShowing()) { + Sources.SourcesPanel.WrapperView._instance._showViewInWrapper(); + UI.inspectorView.setDrawerMinimized(false); + Sources.SourcesPanel.updateResizerAndSidebarButtons(this); } } /** * @override * @param {string} locationName - * @return {?WebInspector.ViewLocation} + * @return {?UI.ViewLocation} */ resolveLocation(locationName) { if (locationName === 'sources-sidebar') @@ -263,11 +263,11 @@ * @return {boolean} */ _ensureSourcesViewVisible() { - if (WebInspector.SourcesPanel.WrapperView.isShowing()) + if (Sources.SourcesPanel.WrapperView.isShowing()) return true; - if (!WebInspector.inspectorView.canSelectPanel('sources')) + if (!UI.inspectorView.canSelectPanel('sources')) return false; - WebInspector.viewManager.showView('sources'); + UI.viewManager.showView('sources'); return true; } @@ -275,51 +275,51 @@ * @override */ onResize() { - if (WebInspector.moduleSetting('sidebarPosition').get() === 'auto') + if (Common.moduleSetting('sidebarPosition').get() === 'auto') this.element.window().requestAnimationFrame(this._updateSidebarPosition.bind(this)); // Do not force layout. } /** * @override - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._sourcesView.searchableView(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerPaused(event) { - var details = /** @type {!WebInspector.DebuggerPausedDetails} */ (event.data); + var details = /** @type {!SDK.DebuggerPausedDetails} */ (event.data); if (!this._paused) this._setAsCurrentPanel(); - if (WebInspector.context.flavor(WebInspector.Target) === details.target()) + if (UI.context.flavor(SDK.Target) === details.target()) this._showDebuggerPausedDetails(details); else if (!this._paused) - WebInspector.context.setFlavor(WebInspector.Target, details.target()); + UI.context.setFlavor(SDK.Target, details.target()); } /** - * @param {!WebInspector.DebuggerPausedDetails} details + * @param {!SDK.DebuggerPausedDetails} details */ _showDebuggerPausedDetails(details) { this._paused = true; this._updateDebuggerButtonsAndStatus(); - WebInspector.context.setFlavor(WebInspector.DebuggerPausedDetails, details); + UI.context.setFlavor(SDK.DebuggerPausedDetails, details); this._toggleDebuggerSidebarButton.setEnabled(false); window.focus(); InspectorFrontendHost.bringToFront(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerResumed(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); var target = debuggerModel.target(); - if (WebInspector.context.flavor(WebInspector.Target) !== target) + if (UI.context.flavor(SDK.Target) !== target) return; this._paused = false; this._clearInterface(); @@ -328,40 +328,40 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerWasEnabled(event) { - var target = /** @type {!WebInspector.Target} */ (event.target.target()); - if (WebInspector.context.flavor(WebInspector.Target) !== target) + var target = /** @type {!SDK.Target} */ (event.target.target()); + if (UI.context.flavor(SDK.Target) !== target) return; this._updateDebuggerButtonsAndStatus(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _debuggerReset(event) { this._debuggerResumed(event); } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ get visibleView() { return this._sourcesView.visibleView(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number=} lineNumber 0-based * @param {number=} columnNumber * @param {boolean=} omitFocus */ showUISourceCode(uiSourceCode, lineNumber, columnNumber, omitFocus) { if (omitFocus) { - var wrapperShowing = WebInspector.SourcesPanel.WrapperView._instance && - WebInspector.SourcesPanel.WrapperView._instance.isShowing(); + var wrapperShowing = Sources.SourcesPanel.WrapperView._instance && + Sources.SourcesPanel.WrapperView._instance.isShowing(); if (!this.isShowing() && !wrapperShowing) return; } else { @@ -371,13 +371,13 @@ } _showEditor() { - if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.SourcesPanel.WrapperView._instance.isShowing()) + if (Sources.SourcesPanel.WrapperView._instance && Sources.SourcesPanel.WrapperView._instance.isShowing()) return; this._setAsCurrentPanel(); } /** - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation * @param {boolean=} omitFocus */ showUILocation(uiLocation, omitFocus) { @@ -385,45 +385,45 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean=} skipReveal */ _revealInNavigator(uiSourceCode, skipReveal) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (binding && binding.network === uiSourceCode) uiSourceCode = binding.fileSystem; - var extensions = self.runtime.extensions(WebInspector.NavigatorView); + var extensions = self.runtime.extensions(Sources.NavigatorView); Promise.all(extensions.map(extension => extension.instance())).then(filterNavigators.bind(this)); /** - * @this {WebInspector.SourcesPanel} + * @this {Sources.SourcesPanel} * @param {!Array.<!Object>} objects */ function filterNavigators(objects) { for (var i = 0; i < objects.length; ++i) { - var navigatorView = /** @type {!WebInspector.NavigatorView} */ (objects[i]); + var navigatorView = /** @type {!Sources.NavigatorView} */ (objects[i]); var viewId = extensions[i].descriptor()['viewId']; if (navigatorView.accept(uiSourceCode)) { navigatorView.revealUISourceCode(uiSourceCode, true); if (skipReveal) this._navigatorTabbedLocation.tabbedPane().selectTab(viewId); else - WebInspector.viewManager.showView(viewId); + UI.viewManager.showView(viewId); } } } } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _populateNavigatorMenu(contextMenu) { - var groupByFolderSetting = WebInspector.moduleSetting('navigatorGroupByFolder'); + var groupByFolderSetting = Common.moduleSetting('navigatorGroupByFolder'); contextMenu.appendItemsAtLocation('navigatorMenu'); contextMenu.appendSeparator(); contextMenu.appendCheckboxItem( - WebInspector.UIString('Group by folder'), () => groupByFolderSetting.set(!groupByFolderSetting.get()), + Common.UIString('Group by folder'), () => groupByFolderSetting.set(!groupByFolderSetting.get()), groupByFolderSetting.get()); } @@ -439,7 +439,7 @@ } /** - * @param {!WebInspector.LiveLocation} liveLocation + * @param {!Bindings.LiveLocation} liveLocation */ _executionLineChanged(liveLocation) { var uiLocation = liveLocation.uiLocation(); @@ -447,41 +447,41 @@ return; this._sourcesView.clearCurrentExecutionLine(); this._sourcesView.setExecutionLocation(uiLocation); - if (window.performance.now() - this._lastModificationTime < WebInspector.SourcesPanel._lastModificationTimeout) + if (window.performance.now() - this._lastModificationTime < Sources.SourcesPanel._lastModificationTimeout) return; this._sourcesView.showSourceLocation( uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, undefined, true); } _lastModificationTimeoutPassedForTest() { - WebInspector.SourcesPanel._lastModificationTimeout = Number.MIN_VALUE; + Sources.SourcesPanel._lastModificationTimeout = Number.MIN_VALUE; } _updateLastModificationTimeForTest() { - WebInspector.SourcesPanel._lastModificationTimeout = Number.MAX_VALUE; + Sources.SourcesPanel._lastModificationTimeout = Number.MAX_VALUE; } _callFrameChanged() { - var callFrame = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); + var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); if (!callFrame) return; if (this._executionLineLocation) this._executionLineLocation.dispose(); - this._executionLineLocation = WebInspector.debuggerWorkspaceBinding.createCallFrameLiveLocation( + this._executionLineLocation = Bindings.debuggerWorkspaceBinding.createCallFrameLiveLocation( callFrame.location(), this._executionLineChanged.bind(this), this._liveLocationPool); } _pauseOnExceptionEnabledChanged() { - var enabled = WebInspector.moduleSetting('pauseOnExceptionEnabled').get(); + var enabled = Common.moduleSetting('pauseOnExceptionEnabled').get(); this._pauseOnExceptionButton.setToggled(enabled); this._pauseOnExceptionButton.setTitle( - WebInspector.UIString(enabled ? 'Don\'t pause on exceptions' : 'Pause on exceptions')); + Common.UIString(enabled ? 'Don\'t pause on exceptions' : 'Pause on exceptions')); this._debugToolbarDrawer.classList.toggle('expanded', enabled); } _updateDebuggerButtonsAndStatus() { - var currentTarget = WebInspector.context.flavor(WebInspector.Target); - var currentDebuggerModel = WebInspector.DebuggerModel.fromTarget(currentTarget); + var currentTarget = UI.context.flavor(SDK.Target); + var currentDebuggerModel = SDK.DebuggerModel.fromTarget(currentTarget); if (!currentDebuggerModel) { this._togglePauseAction.setEnabled(false); this._stepOverAction.setEnabled(false); @@ -502,13 +502,13 @@ } var details = currentDebuggerModel ? currentDebuggerModel.debuggerPausedDetails() : null; - this._debuggerPausedMessage.render(details, WebInspector.debuggerWorkspaceBinding, WebInspector.breakpointManager); + this._debuggerPausedMessage.render(details, Bindings.debuggerWorkspaceBinding, Bindings.breakpointManager); } _clearInterface() { this._sourcesView.clearCurrentExecutionLine(); this._updateDebuggerButtonsAndStatus(); - WebInspector.context.setFlavor(WebInspector.DebuggerPausedDetails, null); + UI.context.setFlavor(SDK.DebuggerPausedDetails, null); if (this._switchToPausedTargetTimeout) clearTimeout(this._switchToPausedTargetTimeout); @@ -516,26 +516,26 @@ } /** - * @param {!WebInspector.DebuggerModel} debuggerModel + * @param {!SDK.DebuggerModel} debuggerModel */ _switchToPausedTarget(debuggerModel) { delete this._switchToPausedTargetTimeout; if (this._paused) return; - var target = WebInspector.context.flavor(WebInspector.Target); + var target = UI.context.flavor(SDK.Target); if (debuggerModel.isPaused()) return; - var debuggerModels = WebInspector.DebuggerModel.instances(); + var debuggerModels = SDK.DebuggerModel.instances(); for (var i = 0; i < debuggerModels.length; ++i) { if (debuggerModels[i].isPaused()) { - WebInspector.context.setFlavor(WebInspector.Target, debuggerModels[i].target()); + UI.context.setFlavor(SDK.Target, debuggerModels[i].target()); break; } } } _togglePauseOnExceptions() { - WebInspector.moduleSetting('pauseOnExceptionEnabled').set(!this._pauseOnExceptionButton.toggled()); + Common.moduleSetting('pauseOnExceptionEnabled').set(!this._pauseOnExceptionButton.toggled()); } /** @@ -543,23 +543,23 @@ */ _runSnippet() { var uiSourceCode = this._sourcesView.currentUISourceCode(); - if (uiSourceCode.project().type() !== WebInspector.projectTypes.Snippets) + if (uiSourceCode.project().type() !== Workspace.projectTypes.Snippets) return false; - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (!currentExecutionContext) return false; - WebInspector.scriptSnippetModel.evaluateScriptSnippet(currentExecutionContext, uiSourceCode); + Snippets.scriptSnippetModel.evaluateScriptSnippet(currentExecutionContext, uiSourceCode); return true; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorSelected(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); - if (this.editorView.mainWidget() && WebInspector.moduleSetting('autoRevealInNavigator').get()) + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); + if (this.editorView.mainWidget() && Common.moduleSetting('autoRevealInNavigator').get()) this._revealInNavigator(uiSourceCode, true); } @@ -567,10 +567,10 @@ * @return {boolean} */ _togglePause() { - var target = WebInspector.context.flavor(WebInspector.Target); + var target = UI.context.flavor(SDK.Target); if (!target) return true; - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!debuggerModel) return true; @@ -587,7 +587,7 @@ } /** - * @return {?WebInspector.DebuggerModel} + * @return {?SDK.DebuggerModel} */ _prepareToResume() { if (!this._paused) @@ -596,8 +596,8 @@ this._paused = false; this._clearInterface(); - var target = WebInspector.context.flavor(WebInspector.Target); - return target ? WebInspector.DebuggerModel.fromTarget(target) : null; + var target = UI.context.flavor(SDK.Target); + return target ? SDK.DebuggerModel.fromTarget(target) : null; } /** @@ -650,15 +650,15 @@ } /** - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation */ _continueToLocation(uiLocation) { - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (!executionContext) return; // Always use 0 column. - var rawLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocation( + var rawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation( executionContext.target(), uiLocation.uiSourceCode, uiLocation.lineNumber, 0); if (!rawLocation) return; @@ -670,7 +670,7 @@ } _toggleBreakpointsActive() { - WebInspector.breakpointManager.setBreakpointsActive(!WebInspector.breakpointManager.breakpointsActive()); + Bindings.breakpointManager.setBreakpointsActive(!Bindings.breakpointManager.breakpointsActive()); } _breakpointsActiveStateChanged(event) { @@ -680,31 +680,31 @@ } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ _createDebugToolbar() { - var debugToolbar = new WebInspector.Toolbar('scripts-debug-toolbar'); + var debugToolbar = new UI.Toolbar('scripts-debug-toolbar'); - var longResumeButton = new WebInspector.ToolbarButton( - WebInspector.UIString('Resume with all pauses blocked for 500 ms'), 'largeicon-play'); + var longResumeButton = new UI.ToolbarButton( + Common.UIString('Resume with all pauses blocked for 500 ms'), 'largeicon-play'); longResumeButton.addEventListener('click', this._longResume.bind(this), this); debugToolbar.appendToolbarItem( - WebInspector.Toolbar.createActionButton(this._togglePauseAction, [longResumeButton], [])); + UI.Toolbar.createActionButton(this._togglePauseAction, [longResumeButton], [])); - debugToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._stepOverAction)); - debugToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._stepIntoAction)); - debugToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._stepOutAction)); + debugToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._stepOverAction)); + debugToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._stepIntoAction)); + debugToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._stepOutAction)); debugToolbar.appendSeparator(); - debugToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._toggleBreakpointsActiveAction)); + debugToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._toggleBreakpointsActiveAction)); - this._pauseOnExceptionButton = new WebInspector.ToolbarToggle('', 'largeicon-pause-on-exceptions'); + this._pauseOnExceptionButton = new UI.ToolbarToggle('', 'largeicon-pause-on-exceptions'); this._pauseOnExceptionButton.addEventListener('click', this._togglePauseOnExceptions, this); debugToolbar.appendToolbarItem(this._pauseOnExceptionButton); debugToolbar.appendSeparator(); - debugToolbar.appendToolbarItem(new WebInspector.ToolbarCheckbox( - WebInspector.UIString('Async'), WebInspector.UIString('Capture async stack traces'), - WebInspector.moduleSetting('enableAsyncStackTraces'))); + debugToolbar.appendToolbarItem(new UI.ToolbarCheckbox( + Common.UIString('Async'), Common.UIString('Capture async stack traces'), + Common.moduleSetting('enableAsyncStackTraces'))); return debugToolbar; } @@ -712,24 +712,24 @@ _createDebugToolbarDrawer() { var debugToolbarDrawer = createElementWithClass('div', 'scripts-debug-toolbar-drawer'); - var label = WebInspector.UIString('Pause On Caught Exceptions'); - var setting = WebInspector.moduleSetting('pauseOnCaughtException'); - debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingCheckbox(label, setting, true)); + var label = Common.UIString('Pause On Caught Exceptions'); + var setting = Common.moduleSetting('pauseOnCaughtException'); + debugToolbarDrawer.appendChild(UI.SettingsUI.createSettingCheckbox(label, setting, true)); return debugToolbarDrawer; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _showLocalHistory(uiSourceCode) { - WebInspector.RevisionHistoryView.showHistory(uiSourceCode); + Sources.RevisionHistoryView.showHistory(uiSourceCode); } /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { @@ -741,16 +741,16 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ mapFileSystemToNetwork(uiSourceCode) { - WebInspector.SelectUISourceCodeForProjectTypesDialog.show( - uiSourceCode.name(), [WebInspector.projectTypes.Network, WebInspector.projectTypes.ContentScripts], + Sources.SelectUISourceCodeForProjectTypesDialog.show( + uiSourceCode.name(), [Workspace.projectTypes.Network, Workspace.projectTypes.ContentScripts], mapFileSystemToNetwork.bind(this)); /** - * @param {?WebInspector.UISourceCode} networkUISourceCode - * @this {WebInspector.SourcesPanel} + * @param {?Workspace.UISourceCode} networkUISourceCode + * @this {Sources.SourcesPanel} */ function mapFileSystemToNetwork(networkUISourceCode) { if (!networkUISourceCode) @@ -760,15 +760,15 @@ } /** - * @param {!WebInspector.UISourceCode} networkUISourceCode + * @param {!Workspace.UISourceCode} networkUISourceCode */ mapNetworkToFileSystem(networkUISourceCode) { - WebInspector.SelectUISourceCodeForProjectTypesDialog.show( - networkUISourceCode.name(), [WebInspector.projectTypes.FileSystem], mapNetworkToFileSystem.bind(this)); + Sources.SelectUISourceCodeForProjectTypesDialog.show( + networkUISourceCode.name(), [Workspace.projectTypes.FileSystem], mapNetworkToFileSystem.bind(this)); /** - * @param {?WebInspector.UISourceCode} uiSourceCode - * @this {WebInspector.SourcesPanel} + * @param {?Workspace.UISourceCode} uiSourceCode + * @this {Sources.SourcesPanel} */ function mapNetworkToFileSystem(uiSourceCode) { if (!uiSourceCode) @@ -778,114 +778,114 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeNetworkMapping(uiSourceCode) { this._networkMapping.removeMapping(uiSourceCode); } /** - * @param {!WebInspector.ContextMenu} contextMenu - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!UI.ContextMenu} contextMenu + * @param {!Workspace.UISourceCode} uiSourceCode */ _appendUISourceCodeMappingItems(contextMenu, uiSourceCode) { - WebInspector.NavigatorView.appendAddFolderItem(contextMenu); + Sources.NavigatorView.appendAddFolderItem(contextMenu); if (Runtime.experiments.isEnabled('persistence2')) return; - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) { - var binding = WebInspector.persistence.binding(uiSourceCode); + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) { + var binding = Persistence.persistence.binding(uiSourceCode); if (!binding) contextMenu.appendItem( - WebInspector.UIString.capitalize('Map to ^network ^resource\u2026'), + Common.UIString.capitalize('Map to ^network ^resource\u2026'), this.mapFileSystemToNetwork.bind(this, uiSourceCode)); else contextMenu.appendItem( - WebInspector.UIString.capitalize('Remove ^network ^mapping'), + Common.UIString.capitalize('Remove ^network ^mapping'), this._removeNetworkMapping.bind(this, binding.network)); } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project */ function filterProject(project) { - return project.type() === WebInspector.projectTypes.FileSystem; + return project.type() === Workspace.projectTypes.FileSystem; } - if (uiSourceCode.project().type() === WebInspector.projectTypes.Network || - uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) { + if (uiSourceCode.project().type() === Workspace.projectTypes.Network || + uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts) { if (!this._workspace.projects().filter(filterProject).length) return; if (this._networkMapping.uiSourceCodeForURLForAnyTarget(uiSourceCode.url()) === uiSourceCode) contextMenu.appendItem( - WebInspector.UIString.capitalize('Map to ^file ^system ^resource\u2026'), + Common.UIString.capitalize('Map to ^file ^system ^resource\u2026'), this.mapNetworkToFileSystem.bind(this, uiSourceCode)); } } /** * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendUISourceCodeItems(event, contextMenu, target) { - if (!(target instanceof WebInspector.UISourceCode)) + if (!(target instanceof Workspace.UISourceCode)) return; - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (target); var projectType = uiSourceCode.project().type(); - if (projectType !== WebInspector.projectTypes.Debugger && + if (projectType !== Workspace.projectTypes.Debugger && !event.target.isSelfOrDescendant(this._navigatorTabbedLocation.widget().element)) { contextMenu.appendItem( - WebInspector.UIString.capitalize('Reveal in ^navigator'), + Common.UIString.capitalize('Reveal in ^navigator'), this._handleContextMenuReveal.bind(this, uiSourceCode)); contextMenu.appendSeparator(); } this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode); - if (projectType !== WebInspector.projectTypes.FileSystem) + if (projectType !== Workspace.projectTypes.FileSystem) contextMenu.appendItem( - WebInspector.UIString.capitalize('Local ^modifications\u2026'), + Common.UIString.capitalize('Local ^modifications\u2026'), this._showLocalHistory.bind(this, uiSourceCode)); } /** * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendUISourceCodeFrameItems(event, contextMenu, target) { - if (!(target instanceof WebInspector.UISourceCodeFrame)) + if (!(target instanceof Sources.UISourceCodeFrame)) return; contextMenu.appendAction('debugger.evaluate-selection'); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} object */ appendUILocationItems(contextMenu, object) { - if (!(object instanceof WebInspector.UILocation)) + if (!(object instanceof Workspace.UILocation)) return; - var uiLocation = /** @type {!WebInspector.UILocation} */ (object); + var uiLocation = /** @type {!Workspace.UILocation} */ (object); var uiSourceCode = uiLocation.uiSourceCode; var projectType = uiSourceCode.project().type(); var contentType = uiSourceCode.contentType(); if (contentType.hasScripts()) { - var target = WebInspector.context.flavor(WebInspector.Target); - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var target = UI.context.flavor(SDK.Target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (debuggerModel && debuggerModel.isPaused()) contextMenu.appendItem( - WebInspector.UIString.capitalize('Continue to ^here'), this._continueToLocation.bind(this, uiLocation)); + Common.UIString.capitalize('Continue to ^here'), this._continueToLocation.bind(this, uiLocation)); } - if (contentType.hasScripts() && projectType !== WebInspector.projectTypes.Snippets) + if (contentType.hasScripts() && projectType !== Workspace.projectTypes.Snippets) this._callstackPane.appendBlackboxURLContextMenuItems(contextMenu, uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _handleContextMenuReveal(uiSourceCode) { this.editorView.showBoth(); @@ -893,48 +893,48 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendRemoteObjectItems(contextMenu, target) { - if (!(target instanceof WebInspector.RemoteObject)) + if (!(target instanceof SDK.RemoteObject)) return; - var remoteObject = /** @type {!WebInspector.RemoteObject} */ (target); + var remoteObject = /** @type {!SDK.RemoteObject} */ (target); contextMenu.appendItem( - WebInspector.UIString.capitalize('Store as ^global ^variable'), + Common.UIString.capitalize('Store as ^global ^variable'), this._saveToTempVariable.bind(this, remoteObject)); if (remoteObject.type === 'function') contextMenu.appendItem( - WebInspector.UIString.capitalize('Show ^function ^definition'), + Common.UIString.capitalize('Show ^function ^definition'), this._showFunctionDefinition.bind(this, remoteObject)); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ _appendNetworkRequestItems(contextMenu, target) { - if (!(target instanceof WebInspector.NetworkRequest)) + if (!(target instanceof SDK.NetworkRequest)) return; - var request = /** @type {!WebInspector.NetworkRequest} */ (target); + var request = /** @type {!SDK.NetworkRequest} */ (target); var uiSourceCode = this._networkMapping.uiSourceCodeForURLForAnyTarget(request.url); if (!uiSourceCode) return; - var openText = WebInspector.UIString.capitalize('Open in Sources ^panel'); + var openText = Common.UIString.capitalize('Open in Sources ^panel'); contextMenu.appendItem(openText, this.showUILocation.bind(this, uiSourceCode.uiLocation(0, 0))); } /** - * @param {!WebInspector.RemoteObject} remoteObject + * @param {!SDK.RemoteObject} remoteObject */ _saveToTempVariable(remoteObject) { - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (!currentExecutionContext) return; currentExecutionContext.globalObject('', false, didGetGlobalObject); /** - * @param {?WebInspector.RemoteObject} global + * @param {?SDK.RemoteObject} global * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ function didGetGlobalObject(global, exceptionDetails) { @@ -956,12 +956,12 @@ failedToSave(global); else global.callFunction( - remoteFunction, [WebInspector.RemoteObject.toCallArgument(remoteObject)], didSave.bind(null, global)); + remoteFunction, [SDK.RemoteObject.toCallArgument(remoteObject)], didSave.bind(null, global)); } /** - * @param {!WebInspector.RemoteObject} global - * @param {?WebInspector.RemoteObject} result + * @param {!SDK.RemoteObject} global + * @param {?SDK.RemoteObject} result * @param {boolean=} wasThrown */ function didSave(global, result, wasThrown) { @@ -969,32 +969,32 @@ if (wasThrown || !result || result.type !== 'string') failedToSave(result); else - WebInspector.ConsoleModel.evaluateCommandInConsole( - /** @type {!WebInspector.ExecutionContext} */ (currentExecutionContext), result.value); + SDK.ConsoleModel.evaluateCommandInConsole( + /** @type {!SDK.ExecutionContext} */ (currentExecutionContext), result.value); } /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result */ function failedToSave(result) { - var message = WebInspector.UIString('Failed to save to temp variable.'); + var message = Common.UIString('Failed to save to temp variable.'); if (result) { message += ' ' + result.description; result.release(); } - WebInspector.console.error(message); + Common.console.error(message); } } /** - * @param {!WebInspector.RemoteObject} remoteObject + * @param {!SDK.RemoteObject} remoteObject */ _showFunctionDefinition(remoteObject) { remoteObject.debuggerModel().functionDetailsPromise(remoteObject).then(this._didGetFunctionDetails.bind(this)); } /** - * @param {?{location: ?WebInspector.DebuggerModel.Location}} response + * @param {?{location: ?SDK.DebuggerModel.Location}} response */ _didGetFunctionDetails(response) { if (!response || !response.location) @@ -1004,7 +1004,7 @@ if (!location) return; - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location); if (uiLocation) this.showUILocation(uiLocation); } @@ -1025,13 +1025,13 @@ _updateSidebarPosition() { var vertically; - var position = WebInspector.moduleSetting('sidebarPosition').get(); + var position = Common.moduleSetting('sidebarPosition').get(); if (position === 'right') vertically = false; else if (position === 'bottom') vertically = true; else - vertically = WebInspector.inspectorView.element.offsetWidth < 680; + vertically = UI.inspectorView.element.offsetWidth < 680; if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical()) return; @@ -1045,13 +1045,13 @@ this._splitWidget.setVertical(!vertically); this._splitWidget.element.classList.toggle('sources-split-view-vertical', vertically); - WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); + Sources.SourcesPanel.updateResizerAndSidebarButtons(this); // Create vertical box with stack. - var vbox = new WebInspector.VBox(); + var vbox = new UI.VBox(); vbox.element.appendChild(this._debugToolbarDrawer); - vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minToolbarWidth, 100); - this._sidebarPaneStack = WebInspector.viewManager.createStackLocation(this._revealDebuggerSidebar.bind(this)); + vbox.setMinimumAndPreferredSizes(25, 25, Sources.SourcesPanel.minToolbarWidth, 100); + this._sidebarPaneStack = UI.viewManager.createStackLocation(this._revealDebuggerSidebar.bind(this)); this._sidebarPaneStack.widget().element.classList.add('overflow-auto'); this._sidebarPaneStack.widget().show(vbox.element); this._sidebarPaneStack.widget().element.appendChild(this._debuggerPausedMessage.element()); @@ -1064,8 +1064,8 @@ this._sidebarPaneStack.appendView(this._watchSidebarPane); this._sidebarPaneStack.showView(this._callstackPane); - var jsBreakpoints = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view('sources.jsBreakpoints')); - var scopeChainView = /** @type {!WebInspector.View} */ (WebInspector.viewManager.view('sources.scopeChain')); + var jsBreakpoints = /** @type {!UI.View} */ (UI.viewManager.view('sources.jsBreakpoints')); + var scopeChainView = /** @type {!UI.View} */ (UI.viewManager.view('sources.scopeChain')); if (!vertically) { // Populate the rest of the stack. @@ -1074,13 +1074,13 @@ this._extensionSidebarPanesContainer = this._sidebarPaneStack; this.sidebarPaneView = vbox; } else { - var splitWidget = new WebInspector.SplitWidget(true, true, 'sourcesPanelDebuggerSidebarSplitViewState', 0.5); + var splitWidget = new UI.SplitWidget(true, true, 'sourcesPanelDebuggerSidebarSplitViewState', 0.5); splitWidget.setMainWidget(vbox); // Populate the left stack. this._sidebarPaneStack.showView(jsBreakpoints); - var tabbedLocation = WebInspector.viewManager.createTabbedLocation(this._revealDebuggerSidebar.bind(this)); + var tabbedLocation = UI.viewManager.createTabbedLocation(this._revealDebuggerSidebar.bind(this)); splitWidget.setSidebarWidget(tabbedLocation.tabbedPane()); tabbedLocation.appendView(scopeChainView); tabbedLocation.appendView(this._watchSidebarPane); @@ -1089,7 +1089,7 @@ } this._sidebarPaneStack.appendApplicableItems('sources-sidebar'); - var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); + var extensionSidebarPanes = Extensions.extensionServer.sidebarPanes(); for (var i = 0; i < extensionSidebarPanes.length; ++i) this._addExtensionSidebarPane(extensionSidebarPanes[i]); @@ -1100,19 +1100,19 @@ * @return {!Promise} */ _setAsCurrentPanel() { - return WebInspector.viewManager.showView('sources'); + return UI.viewManager.showView('sources'); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _extensionSidebarPaneAdded(event) { - var pane = /** @type {!WebInspector.ExtensionSidebarPane} */ (event.data); + var pane = /** @type {!Extensions.ExtensionSidebarPane} */ (event.data); this._addExtensionSidebarPane(pane); } /** - * @param {!WebInspector.ExtensionSidebarPane} pane + * @param {!Extensions.ExtensionSidebarPane} pane */ _addExtensionSidebarPane(pane) { if (pane.panelName() === this.name) @@ -1120,7 +1120,7 @@ } /** - * @return {!WebInspector.SourcesView} + * @return {!Sources.SourcesView} */ sourcesView() { return this._sourcesView; @@ -1140,15 +1140,15 @@ } }; -WebInspector.SourcesPanel._lastModificationTimeout = 200; +Sources.SourcesPanel._lastModificationTimeout = 200; -WebInspector.SourcesPanel.minToolbarWidth = 215; +Sources.SourcesPanel.minToolbarWidth = 215; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.SourcesPanel.UILocationRevealer = class { +Sources.SourcesPanel.UILocationRevealer = class { /** * @override * @param {!Object} uiLocation @@ -1156,18 +1156,18 @@ * @return {!Promise} */ reveal(uiLocation, omitFocus) { - if (!(uiLocation instanceof WebInspector.UILocation)) + if (!(uiLocation instanceof Workspace.UILocation)) return Promise.reject(new Error('Internal error: not a ui location')); - WebInspector.SourcesPanel.instance().showUILocation(uiLocation, omitFocus); + Sources.SourcesPanel.instance().showUILocation(uiLocation, omitFocus); return Promise.resolve(); } }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.SourcesPanel.DebuggerLocationRevealer = class { +Sources.SourcesPanel.DebuggerLocationRevealer = class { /** * @override * @param {!Object} rawLocation @@ -1175,19 +1175,19 @@ * @return {!Promise} */ reveal(rawLocation, omitFocus) { - if (!(rawLocation instanceof WebInspector.DebuggerModel.Location)) + if (!(rawLocation instanceof SDK.DebuggerModel.Location)) return Promise.reject(new Error('Internal error: not a debugger location')); - WebInspector.SourcesPanel.instance().showUILocation( - WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation), omitFocus); + Sources.SourcesPanel.instance().showUILocation( + Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation), omitFocus); return Promise.resolve(); } }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.SourcesPanel.UISourceCodeRevealer = class { +Sources.SourcesPanel.UISourceCodeRevealer = class { /** * @override * @param {!Object} uiSourceCode @@ -1195,41 +1195,41 @@ * @return {!Promise} */ reveal(uiSourceCode, omitFocus) { - if (!(uiSourceCode instanceof WebInspector.UISourceCode)) + if (!(uiSourceCode instanceof Workspace.UISourceCode)) return Promise.reject(new Error('Internal error: not a ui source code')); - WebInspector.SourcesPanel.instance().showUISourceCode(uiSourceCode, undefined, undefined, omitFocus); + Sources.SourcesPanel.instance().showUISourceCode(uiSourceCode, undefined, undefined, omitFocus); return Promise.resolve(); } }; /** - * @implements {WebInspector.Revealer} + * @implements {Common.Revealer} * @unrestricted */ -WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer = class { +Sources.SourcesPanel.DebuggerPausedDetailsRevealer = class { /** * @override * @param {!Object} object * @return {!Promise} */ reveal(object) { - return WebInspector.SourcesPanel.instance()._setAsCurrentPanel(); + return Sources.SourcesPanel.instance()._setAsCurrentPanel(); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SourcesPanel.RevealingActionDelegate = class { +Sources.SourcesPanel.RevealingActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var panel = WebInspector.SourcesPanel.instance(); + var panel = Sources.SourcesPanel.instance(); if (!panel._ensureSourcesViewVisible()) return false; switch (actionId) { @@ -1245,18 +1245,18 @@ }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SourcesPanel.DebuggingActionDelegate = class { +Sources.SourcesPanel.DebuggingActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var panel = WebInspector.SourcesPanel.instance(); + var panel = Sources.SourcesPanel.instance(); switch (actionId) { case 'debugger.step-over': panel._stepOver(); @@ -1274,12 +1274,12 @@ panel._toggleBreakpointsActive(); return true; case 'debugger.evaluate-selection': - var frame = WebInspector.context.flavor(WebInspector.UISourceCodeFrame); + var frame = UI.context.flavor(Sources.UISourceCodeFrame); if (frame) { var text = frame.textEditor.text(frame.textEditor.selection()); - var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var executionContext = UI.context.flavor(SDK.ExecutionContext); if (executionContext) - WebInspector.ConsoleModel.evaluateCommandInConsole(executionContext, text); + SDK.ConsoleModel.evaluateCommandInConsole(executionContext, text); } return true; } @@ -1291,39 +1291,39 @@ /** * @unrestricted */ -WebInspector.SourcesPanel.WrapperView = class extends WebInspector.VBox { +Sources.SourcesPanel.WrapperView = class extends UI.VBox { constructor() { super(); this.element.classList.add('sources-view-wrapper'); - WebInspector.SourcesPanel.WrapperView._instance = this; - this._view = WebInspector.SourcesPanel.instance()._sourcesView; + Sources.SourcesPanel.WrapperView._instance = this; + this._view = Sources.SourcesPanel.instance()._sourcesView; } /** * @return {boolean} */ static isShowing() { - return !!WebInspector.SourcesPanel.WrapperView._instance && - WebInspector.SourcesPanel.WrapperView._instance.isShowing(); + return !!Sources.SourcesPanel.WrapperView._instance && + Sources.SourcesPanel.WrapperView._instance.isShowing(); } /** * @override */ wasShown() { - if (!WebInspector.SourcesPanel.instance().isShowing()) + if (!Sources.SourcesPanel.instance().isShowing()) this._showViewInWrapper(); else - WebInspector.inspectorView.setDrawerMinimized(true); - WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.SourcesPanel.instance()); + UI.inspectorView.setDrawerMinimized(true); + Sources.SourcesPanel.updateResizerAndSidebarButtons(Sources.SourcesPanel.instance()); } /** * @override */ willHide() { - WebInspector.inspectorView.setDrawerMinimized(false); - setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.SourcesPanel.instance())); + UI.inspectorView.setDrawerMinimized(false); + setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sources.SourcesPanel.instance())); } _showViewInWrapper() {
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js index e42eb9f..abfc54f 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js
@@ -26,18 +26,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.SearchScope} + * @implements {Sources.SearchScope} * @unrestricted */ -WebInspector.SourcesSearchScope = class { +Sources.SourcesSearchScope = class { constructor() { // FIXME: Add title once it is used by search controller. this._searchId = 0; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode1 - * @param {!WebInspector.UISourceCode} uiSourceCode2 + * @param {!Workspace.UISourceCode} uiSourceCode1 + * @param {!Workspace.UISourceCode} uiSourceCode2 * @return {number} */ static _filesComparator(uiSourceCode1, uiSourceCode2) { @@ -56,13 +56,13 @@ /** * @override - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ performIndexing(progress) { this.stopSearch(); var projects = this._projects(); - var compositeProgress = new WebInspector.CompositeProgress(progress); + var compositeProgress = new Common.CompositeProgress(progress); for (var i = 0; i < projects.length; ++i) { var project = projects[i]; var projectProgress = compositeProgress.createSubProgress(project.uiSourceCodes().length); @@ -71,34 +71,34 @@ } /** - * @return {!Array.<!WebInspector.Project>} + * @return {!Array.<!Workspace.Project>} */ _projects() { /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ function filterOutServiceProjects(project) { - return project.type() !== WebInspector.projectTypes.Service; + return project.type() !== Workspace.projectTypes.Service; } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ function filterOutContentScriptsIfNeeded(project) { - return WebInspector.moduleSetting('searchInContentScripts').get() || - project.type() !== WebInspector.projectTypes.ContentScripts; + return Common.moduleSetting('searchInContentScripts').get() || + project.type() !== Workspace.projectTypes.ContentScripts; } - return WebInspector.workspace.projects().filter(filterOutServiceProjects).filter(filterOutContentScriptsIfNeeded); + return Workspace.workspace.projects().filter(filterOutServiceProjects).filter(filterOutContentScriptsIfNeeded); } /** * @override - * @param {!WebInspector.ProjectSearchConfig} searchConfig - * @param {!WebInspector.Progress} progress - * @param {function(!WebInspector.FileBasedSearchResult)} searchResultCallback + * @param {!Workspace.ProjectSearchConfig} searchConfig + * @param {!Common.Progress} progress + * @param {function(!Sources.FileBasedSearchResult)} searchResultCallback * @param {function(boolean)} searchFinishedCallback */ performSearch(searchConfig, progress, searchResultCallback, searchFinishedCallback) { @@ -110,9 +110,9 @@ var projects = this._projects(); var barrier = new CallbackBarrier(); - var compositeProgress = new WebInspector.CompositeProgress(progress); + var compositeProgress = new Common.CompositeProgress(progress); var searchContentProgress = compositeProgress.createSubProgress(); - var findMatchingFilesProgress = new WebInspector.CompositeProgress(compositeProgress.createSubProgress()); + var findMatchingFilesProgress = new Common.CompositeProgress(compositeProgress.createSubProgress()); for (var i = 0; i < projects.length; ++i) { var project = projects[i]; var weight = project.uiSourceCodes().length; @@ -129,8 +129,8 @@ } /** - * @param {!WebInspector.Project} project - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.Project} project + * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {boolean=} dirtyOnly * @return {!Array.<string>} */ @@ -139,7 +139,7 @@ var uiSourceCodes = project.uiSourceCodes(); for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); if (binding && binding.fileSystem === uiSourceCode) continue; if (dirtyOnly && !uiSourceCode.isDirty()) @@ -153,7 +153,7 @@ /** * @param {number} searchId - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {!Array.<string>} filesMathingFileQuery * @param {function()} callback * @param {!Array.<string>} files @@ -173,21 +173,21 @@ for (var i = 0; i < files.length; ++i) { var uiSourceCode = project.uiSourceCodeForURL(files[i]); if (uiSourceCode) { - var script = WebInspector.DefaultScriptMapping.scriptForUISourceCode(uiSourceCode); + var script = Bindings.DefaultScriptMapping.scriptForUISourceCode(uiSourceCode); if (script && !script.isAnonymousScript()) continue; uiSourceCodes.push(uiSourceCode); } } - uiSourceCodes.sort(WebInspector.SourcesSearchScope._filesComparator); + uiSourceCodes.sort(Sources.SourcesSearchScope._filesComparator); this._searchResultCandidates = - this._searchResultCandidates.mergeOrdered(uiSourceCodes, WebInspector.SourcesSearchScope._filesComparator); + this._searchResultCandidates.mergeOrdered(uiSourceCodes, Sources.SourcesSearchScope._filesComparator); callback(); } /** * @param {number} searchId - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {function()} callback */ _processMatchingFiles(searchId, progress, callback) { @@ -213,8 +213,8 @@ scheduleSearchInNextFileOrFinish.call(this); /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @this {WebInspector.SourcesSearchScope} + * @param {!Workspace.UISourceCode} uiSourceCode + * @this {Sources.SourcesSearchScope} */ function searchInNextFile(uiSourceCode) { if (uiSourceCode.isDirty()) @@ -224,15 +224,15 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @this {WebInspector.SourcesSearchScope} + * @param {!Workspace.UISourceCode} uiSourceCode + * @this {Sources.SourcesSearchScope} */ function contentUpdated(uiSourceCode) { uiSourceCode.requestContent().then(contentLoaded.bind(this, uiSourceCode)); } /** - * @this {WebInspector.SourcesSearchScope} + * @this {Sources.SourcesSearchScope} */ function scheduleSearchInNextFileOrFinish() { if (fileIndex >= files.length) { @@ -250,14 +250,14 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {?string} content - * @this {WebInspector.SourcesSearchScope} + * @this {Sources.SourcesSearchScope} */ function contentLoaded(uiSourceCode, content) { /** - * @param {!WebInspector.ContentProvider.SearchMatch} a - * @param {!WebInspector.ContentProvider.SearchMatch} b + * @param {!Common.ContentProvider.SearchMatch} a + * @param {!Common.ContentProvider.SearchMatch} b */ function matchesComparator(a, b) { return a.lineNumber - b.lineNumber; @@ -268,13 +268,13 @@ var queries = this._searchConfig.queries(); if (content !== null) { for (var i = 0; i < queries.length; ++i) { - var nextMatches = WebInspector.ContentProvider.performSearchInContent( + var nextMatches = Common.ContentProvider.performSearchInContent( content, queries[i], !this._searchConfig.ignoreCase(), this._searchConfig.isRegex()); matches = matches.mergeOrdered(nextMatches, matchesComparator); } } if (matches) { - var searchResult = new WebInspector.FileBasedSearchResult(uiSourceCode, matches); + var searchResult = new Sources.FileBasedSearchResult(uiSourceCode, matches); this._searchResultCallback(searchResult); } @@ -292,10 +292,10 @@ /** * @override - * @param {!WebInspector.ProjectSearchConfig} searchConfig - * @return {!WebInspector.FileBasedSearchResultsPane} + * @param {!Workspace.ProjectSearchConfig} searchConfig + * @return {!Sources.FileBasedSearchResultsPane} */ createSearchResultsPane(searchConfig) { - return new WebInspector.FileBasedSearchResultsPane(searchConfig); + return new Sources.FileBasedSearchResultsPane(searchConfig); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js index b7aa868..64c6fdf9 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TabbedEditorContainerDelegate} - * @implements {WebInspector.Searchable} - * @implements {WebInspector.Replaceable} + * @implements {Sources.TabbedEditorContainerDelegate} + * @implements {UI.Searchable} + * @implements {UI.Replaceable} * @unrestricted */ -WebInspector.SourcesView = class extends WebInspector.VBox { +Sources.SourcesView = class extends UI.VBox { /** * @suppressGlobalPropertiesCheck */ @@ -17,50 +17,50 @@ this.element.id = 'sources-panel-sources-view'; this.setMinimumAndPreferredSizes(50, 52, 150, 100); - var workspace = WebInspector.workspace; + var workspace = Workspace.workspace; - this._searchableView = new WebInspector.SearchableView(this, 'sourcesViewSearchConfig'); + this._searchableView = new UI.SearchableView(this, 'sourcesViewSearchConfig'); this._searchableView.setMinimalSearchQuerySize(0); this._searchableView.show(this.element); - /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.Widget>} */ + /** @type {!Map.<!Workspace.UISourceCode, !UI.Widget>} */ this._sourceViewByUISourceCode = new Map(); - var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIString('Hit \u2318+P to open a file') : - WebInspector.UIString('Hit Ctrl+P to open a file'); - this._editorContainer = new WebInspector.TabbedEditorContainer( - this, WebInspector.settings.createLocalSetting('previouslyViewedFiles', []), tabbedEditorPlaceholderText); + var tabbedEditorPlaceholderText = Host.isMac() ? Common.UIString('Hit \u2318+P to open a file') : + Common.UIString('Hit Ctrl+P to open a file'); + this._editorContainer = new Sources.TabbedEditorContainer( + this, Common.settings.createLocalSetting('previouslyViewedFiles', []), tabbedEditorPlaceholderText); this._editorContainer.show(this._searchableView.element); this._editorContainer.addEventListener( - WebInspector.TabbedEditorContainer.Events.EditorSelected, this._editorSelected, this); + Sources.TabbedEditorContainer.Events.EditorSelected, this._editorSelected, this); this._editorContainer.addEventListener( - WebInspector.TabbedEditorContainer.Events.EditorClosed, this._editorClosed, this); + Sources.TabbedEditorContainer.Events.EditorClosed, this._editorClosed, this); - this._historyManager = new WebInspector.EditingLocationHistoryManager(this, this.currentSourceFrame.bind(this)); + this._historyManager = new Sources.EditingLocationHistoryManager(this, this.currentSourceFrame.bind(this)); this._toolbarContainerElement = this.element.createChild('div', 'sources-toolbar'); - this._toolbarEditorActions = new WebInspector.Toolbar('', this._toolbarContainerElement); + this._toolbarEditorActions = new UI.Toolbar('', this._toolbarContainerElement); - self.runtime.allInstances(WebInspector.SourcesView.EditorAction).then(appendButtonsForExtensions.bind(this)); + self.runtime.allInstances(Sources.SourcesView.EditorAction).then(appendButtonsForExtensions.bind(this)); /** - * @param {!Array.<!WebInspector.SourcesView.EditorAction>} actions - * @this {WebInspector.SourcesView} + * @param {!Array.<!Sources.SourcesView.EditorAction>} actions + * @this {Sources.SourcesView} */ function appendButtonsForExtensions(actions) { for (var i = 0; i < actions.length; ++i) this._toolbarEditorActions.appendToolbarItem(actions[i].button(this)); } - this._scriptViewToolbar = new WebInspector.Toolbar('', this._toolbarContainerElement); + this._scriptViewToolbar = new UI.Toolbar('', this._toolbarContainerElement); this._scriptViewToolbar.element.style.flex = 'auto'; - this._bottomToolbar = new WebInspector.Toolbar('', this._toolbarContainerElement); + this._bottomToolbar = new UI.Toolbar('', this._toolbarContainerElement); - WebInspector.startBatchUpdate(); + UI.startBatchUpdate(); workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); - WebInspector.endBatchUpdate(); + UI.endBatchUpdate(); - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); - workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved, this._projectRemoved.bind(this), this); + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); + workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); + workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved.bind(this), this); /** * @param {!Event} event @@ -70,24 +70,24 @@ return; var unsavedSourceCodes = []; - var projects = WebInspector.workspace.projectsForType(WebInspector.projectTypes.FileSystem); + var projects = Workspace.workspace.projectsForType(Workspace.projectTypes.FileSystem); for (var i = 0; i < projects.length; ++i) unsavedSourceCodes = unsavedSourceCodes.concat(projects[i].uiSourceCodes().filter(isUnsaved)); if (!unsavedSourceCodes.length) return; - event.returnValue = WebInspector.UIString('DevTools have unsaved changes that will be permanently lost.'); - WebInspector.viewManager.showView('sources'); + event.returnValue = Common.UIString('DevTools have unsaved changes that will be permanently lost.'); + UI.viewManager.showView('sources'); for (var i = 0; i < unsavedSourceCodes.length; ++i) - WebInspector.Revealer.reveal(unsavedSourceCodes[i]); + Common.Revealer.reveal(unsavedSourceCodes[i]); /** - * @param {!WebInspector.UISourceCode} sourceCode + * @param {!Workspace.UISourceCode} sourceCode * @return {boolean} */ function isUnsaved(sourceCode) { - var binding = WebInspector.persistence.binding(sourceCode); + var binding = Persistence.persistence.binding(sourceCode); if (binding) return binding.network.isDirty(); return sourceCode.isDirty(); @@ -102,12 +102,12 @@ } /** - * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate + * @param {function(!Array.<!UI.KeyboardShortcut.Descriptor>, function(!Event=):boolean)} registerShortcutDelegate */ registerShortcuts(registerShortcutDelegate) { /** - * @this {WebInspector.SourcesView} - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} shortcuts + * @this {Sources.SourcesView} + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} shortcuts * @param {function(!Event=):boolean} handler */ function registerShortcut(shortcuts, handler) { @@ -116,46 +116,46 @@ } registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, + this, Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, this._onJumpToPreviousLocation.bind(this)); registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, + this, Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this._onJumpToNextLocation.bind(this)); registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onCloseEditorTab.bind(this)); + this, Components.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onCloseEditorTab.bind(this)); registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToLineDialog.bind(this)); + this, Components.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToLineDialog.bind(this)); registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOutlineDialog.bind(this)); + this, Components.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOutlineDialog.bind(this)); registerShortcut.call( - this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._toggleBreakpoint.bind(this)); - registerShortcut.call(this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.Save, this._save.bind(this)); - registerShortcut.call(this, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SaveAll, this._saveAll.bind(this)); + this, Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._toggleBreakpoint.bind(this)); + registerShortcut.call(this, Components.ShortcutsScreen.SourcesPanelShortcuts.Save, this._save.bind(this)); + registerShortcut.call(this, Components.ShortcutsScreen.SourcesPanelShortcuts.SaveAll, this._saveAll.bind(this)); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ leftToolbar() { return this._editorContainer.leftToolbar(); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ rightToolbar() { return this._editorContainer.rightToolbar(); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ bottomToolbar() { return this._bottomToolbar; } /** - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys * @param {function(!Event=):boolean} handler */ _registerShortcuts(keys, handler) { @@ -164,7 +164,7 @@ } _handleKeyDown(event) { - var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); + var shortcutKey = UI.KeyboardShortcut.makeKeyFromEvent(event); var handler = this._shortcuts[shortcutKey]; if (handler && handler()) event.consume(true); @@ -175,14 +175,14 @@ */ wasShown() { super.wasShown(); - WebInspector.context.setFlavor(WebInspector.SourcesView, this); + UI.context.setFlavor(Sources.SourcesView, this); } /** * @override */ willHide() { - WebInspector.context.setFlavor(WebInspector.SourcesView, null); + UI.context.setFlavor(Sources.SourcesView, null); super.willHide(); } @@ -194,31 +194,31 @@ } /** - * @return {!WebInspector.SearchableView} + * @return {!UI.SearchableView} */ searchableView() { return this._searchableView; } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ visibleView() { return this._editorContainer.visibleView; } /** - * @return {?WebInspector.UISourceCodeFrame} + * @return {?Sources.UISourceCodeFrame} */ currentSourceFrame() { var view = this.visibleView(); - if (!(view instanceof WebInspector.UISourceCodeFrame)) + if (!(view instanceof Sources.UISourceCodeFrame)) return null; - return /** @type {!WebInspector.UISourceCodeFrame} */ (view); + return /** @type {!Sources.UISourceCodeFrame} */ (view); } /** - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ currentUISourceCode() { return this._editorContainer.currentFile(); @@ -252,15 +252,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeAdded(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._addUISourceCode(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _addUISourceCode(uiSourceCode) { if (uiSourceCode.isFromServiceProject()) @@ -269,12 +269,12 @@ } _uiSourceCodeRemoved(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._removeUISourceCodes([uiSourceCode]); } /** - * @param {!Array.<!WebInspector.UISourceCode>} uiSourceCodes + * @param {!Array.<!Workspace.UISourceCode>} uiSourceCodes */ _removeUISourceCodes(uiSourceCodes) { this._editorContainer.removeUISourceCodes(uiSourceCodes); @@ -293,14 +293,14 @@ _updateScriptViewToolbarItems() { this._scriptViewToolbar.removeToolbarItems(); var view = this.visibleView(); - if (view instanceof WebInspector.SimpleView) { - for (var item of (/** @type {?WebInspector.SimpleView} */ (view)).syncToolbarItems()) + if (view instanceof UI.SimpleView) { + for (var item of (/** @type {?UI.SimpleView} */ (view)).syncToolbarItems()) this._scriptViewToolbar.appendToolbarItem(item); } } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number=} lineNumber 0-based * @param {number=} columnNumber * @param {boolean=} omitFocus @@ -318,8 +318,8 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!WebInspector.Widget} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!UI.Widget} */ _createSourceView(uiSourceCode) { var sourceFrame; @@ -327,59 +327,59 @@ var contentType = uiSourceCode.contentType(); if (contentType.hasScripts()) - sourceFrame = new WebInspector.JavaScriptSourceFrame(uiSourceCode); + sourceFrame = new Sources.JavaScriptSourceFrame(uiSourceCode); else if (contentType.isStyleSheet()) - sourceFrame = new WebInspector.CSSSourceFrame(uiSourceCode); - else if (contentType === WebInspector.resourceTypes.Image) + sourceFrame = new Sources.CSSSourceFrame(uiSourceCode); + else if (contentType === Common.resourceTypes.Image) sourceView = - new WebInspector.ImageView(WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode), uiSourceCode); - else if (contentType === WebInspector.resourceTypes.Font) + new SourceFrame.ImageView(Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode), uiSourceCode); + else if (contentType === Common.resourceTypes.Font) sourceView = - new WebInspector.FontView(WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode), uiSourceCode); + new SourceFrame.FontView(Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode), uiSourceCode); else - sourceFrame = new WebInspector.UISourceCodeFrame(uiSourceCode); + sourceFrame = new Sources.UISourceCodeFrame(uiSourceCode); if (sourceFrame) { - sourceFrame.setHighlighterType(WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + sourceFrame.setHighlighterType(Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); this._historyManager.trackSourceFrameCursorJumps(sourceFrame); } - var widget = /** @type {!WebInspector.Widget} */ (sourceFrame || sourceView); + var widget = /** @type {!UI.Widget} */ (sourceFrame || sourceView); this._sourceViewByUISourceCode.set(uiSourceCode, widget); - uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); + uiSourceCode.addEventListener(Workspace.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); return widget; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!WebInspector.Widget} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!UI.Widget} */ _getOrCreateSourceView(uiSourceCode) { return this._sourceViewByUISourceCode.get(uiSourceCode) || this._createSourceView(uiSourceCode); } /** - * @param {!WebInspector.UISourceCodeFrame} sourceFrame - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Sources.UISourceCodeFrame} sourceFrame + * @param {!Workspace.UISourceCode} uiSourceCode * @return {boolean} */ _sourceFrameMatchesUISourceCode(sourceFrame, uiSourceCode) { if (uiSourceCode.contentType().hasScripts()) - return sourceFrame instanceof WebInspector.JavaScriptSourceFrame; + return sourceFrame instanceof Sources.JavaScriptSourceFrame; if (uiSourceCode.contentType().isStyleSheet()) - return sourceFrame instanceof WebInspector.CSSSourceFrame; - return !(sourceFrame instanceof WebInspector.JavaScriptSourceFrame); + return sourceFrame instanceof Sources.CSSSourceFrame; + return !(sourceFrame instanceof Sources.JavaScriptSourceFrame); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _recreateSourceFrameIfNeeded(uiSourceCode) { var oldSourceView = this._sourceViewByUISourceCode.get(uiSourceCode); - if (!oldSourceView || !(oldSourceView instanceof WebInspector.UISourceCodeFrame)) + if (!oldSourceView || !(oldSourceView instanceof Sources.UISourceCodeFrame)) return; - var oldSourceFrame = /** @type {!WebInspector.UISourceCodeFrame} */ (oldSourceView); + var oldSourceFrame = /** @type {!Sources.UISourceCodeFrame} */ (oldSourceView); if (this._sourceFrameMatchesUISourceCode(oldSourceFrame, uiSourceCode)) { - oldSourceFrame.setHighlighterType(WebInspector.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); + oldSourceFrame.setHighlighterType(Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode)); } else { this._editorContainer.removeUISourceCode(uiSourceCode); this._removeSourceFrame(uiSourceCode); @@ -388,23 +388,23 @@ /** * @override - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!WebInspector.Widget} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!UI.Widget} */ viewForFile(uiSourceCode) { return this._getOrCreateSourceView(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeSourceFrame(uiSourceCode) { var sourceView = this._sourceViewByUISourceCode.get(uiSourceCode); this._sourceViewByUISourceCode.remove(uiSourceCode); uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); - if (sourceView && sourceView instanceof WebInspector.UISourceCodeFrame) - /** @type {!WebInspector.UISourceCodeFrame} */ (sourceView).dispose(); + Workspace.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); + if (sourceView && sourceView instanceof Sources.UISourceCodeFrame) + /** @type {!Sources.UISourceCodeFrame} */ (sourceView).dispose(); } clearCurrentExecutionLine() { @@ -414,22 +414,22 @@ } /** - * @param {!WebInspector.UILocation} uiLocation + * @param {!Workspace.UILocation} uiLocation */ setExecutionLocation(uiLocation) { var sourceView = this._getOrCreateSourceView(uiLocation.uiSourceCode); - if (sourceView instanceof WebInspector.UISourceCodeFrame) { - var sourceFrame = /** @type {!WebInspector.UISourceCodeFrame} */ (sourceView); + if (sourceView instanceof Sources.UISourceCodeFrame) { + var sourceFrame = /** @type {!Sources.UISourceCodeFrame} */ (sourceView); sourceFrame.setExecutionLocation(uiLocation); this._executionSourceFrame = sourceFrame; } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorClosed(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); this._historyManager.removeHistoryForSourceCode(uiSourceCode); var wasSelected = false; @@ -443,19 +443,19 @@ var data = {}; data.uiSourceCode = uiSourceCode; data.wasSelected = wasSelected; - this.dispatchEventToListeners(WebInspector.SourcesView.Events.EditorClosed, data); + this.dispatchEventToListeners(Sources.SourcesView.Events.EditorClosed, data); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorSelected(event) { var previousSourceFrame = - event.data.previousView instanceof WebInspector.UISourceCodeFrame ? event.data.previousView : null; + event.data.previousView instanceof Sources.UISourceCodeFrame ? event.data.previousView : null; if (previousSourceFrame) previousSourceFrame.setSearchableView(null); var currentSourceFrame = - event.data.currentView instanceof WebInspector.UISourceCodeFrame ? event.data.currentView : null; + event.data.currentView instanceof Sources.UISourceCodeFrame ? event.data.currentView : null; if (currentSourceFrame) currentSourceFrame.setSearchableView(this._searchableView); @@ -463,14 +463,14 @@ this._searchableView.refreshSearch(); this._updateScriptViewToolbarItems(); - this.dispatchEventToListeners(WebInspector.SourcesView.Events.EditorSelected, this._editorContainer.currentFile()); + this.dispatchEventToListeners(Sources.SourcesView.Events.EditorSelected, this._editorContainer.currentFile()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _uiSourceCodeTitleChanged(event) { - this._recreateSourceFrameIfNeeded(/** @type {!WebInspector.UISourceCode} */ (event.target)); + this._recreateSourceFrameIfNeeded(/** @type {!Workspace.UISourceCode} */ (event.target)); } /** @@ -486,7 +486,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -551,7 +551,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceSelectionWith(searchConfig, replacement) { @@ -565,7 +565,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceAllWith(searchConfig, replacement) { @@ -587,12 +587,12 @@ return false; if (uiSourceCode.contentType().hasScripts()) { - WebInspector.JavaScriptOutlineDialog.show(uiSourceCode, this.showSourceLocation.bind(this, uiSourceCode)); + Sources.JavaScriptOutlineDialog.show(uiSourceCode, this.showSourceLocation.bind(this, uiSourceCode)); return true; } if (uiSourceCode.contentType().isStyleSheet()) { - WebInspector.StyleSheetOutlineDialog.show(uiSourceCode, this.showSourceLocation.bind(this, uiSourceCode)); + Sources.StyleSheetOutlineDialog.show(uiSourceCode, this.showSourceLocation.bind(this, uiSourceCode)); return true; } @@ -605,13 +605,13 @@ */ showOpenResourceDialog(query) { var uiSourceCodes = this._editorContainer.historyUISourceCodes(); - /** @type {!Map.<!WebInspector.UISourceCode, number>} */ + /** @type {!Map.<!Workspace.UISourceCode, number>} */ var defaultScores = new Map(); for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i); if (!this._openResourceDialogHistory) this._openResourceDialogHistory = []; - WebInspector.OpenResourceDialog.show(this, query || '', defaultScores, this._openResourceDialogHistory); + Sources.OpenResourceDialog.show(this, query || '', defaultScores, this._openResourceDialogHistory); } /** @@ -642,12 +642,12 @@ } /** - * @param {?WebInspector.Widget} sourceFrame + * @param {?UI.Widget} sourceFrame */ _saveSourceFrame(sourceFrame) { - if (!(sourceFrame instanceof WebInspector.UISourceCodeFrame)) + if (!(sourceFrame instanceof Sources.UISourceCodeFrame)) return; - var uiSourceCodeFrame = /** @type {!WebInspector.UISourceCodeFrame} */ (sourceFrame); + var uiSourceCodeFrame = /** @type {!Sources.UISourceCodeFrame} */ (sourceFrame); uiSourceCodeFrame.commitEditing(); } @@ -659,8 +659,8 @@ if (!sourceFrame) return false; - if (sourceFrame instanceof WebInspector.JavaScriptSourceFrame) { - var javaScriptSourceFrame = /** @type {!WebInspector.JavaScriptSourceFrame} */ (sourceFrame); + if (sourceFrame instanceof Sources.JavaScriptSourceFrame) { + var javaScriptSourceFrame = /** @type {!Sources.JavaScriptSourceFrame} */ (sourceFrame); javaScriptSourceFrame.toggleBreakpointOnCurrentLine(); return true; } @@ -676,7 +676,7 @@ }; /** @enum {symbol} */ -WebInspector.SourcesView.Events = { +Sources.SourcesView.Events = { EditorClosed: Symbol('EditorClosed'), EditorSelected: Symbol('EditorSelected'), }; @@ -684,24 +684,24 @@ /** * @interface */ -WebInspector.SourcesView.EditorAction = function() {}; +Sources.SourcesView.EditorAction = function() {}; -WebInspector.SourcesView.EditorAction.prototype = { +Sources.SourcesView.EditorAction.prototype = { /** - * @param {!WebInspector.SourcesView} sourcesView - * @return {!WebInspector.ToolbarButton} + * @param {!Sources.SourcesView} sourcesView + * @return {!UI.ToolbarButton} */ button: function(sourcesView) {} }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SourcesView.SwitchFileActionDelegate = class { +Sources.SourcesView.SwitchFileActionDelegate = class { /** - * @param {!WebInspector.UISourceCode} currentUISourceCode - * @return {?WebInspector.UISourceCode} + * @param {!Workspace.UISourceCode} currentUISourceCode + * @return {?Workspace.UISourceCode} */ static _nextFile(currentUISourceCode) { /** @@ -735,16 +735,16 @@ /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView); + var sourcesView = UI.context.flavor(Sources.SourcesView); var currentUISourceCode = sourcesView.currentUISourceCode(); if (!currentUISourceCode) return false; - var nextUISourceCode = WebInspector.SourcesView.SwitchFileActionDelegate._nextFile(currentUISourceCode); + var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nextFile(currentUISourceCode); if (!nextUISourceCode) return false; sourcesView.showSourceLocation(nextUISourceCode); @@ -754,18 +754,18 @@ /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.SourcesView.CloseAllActionDelegate = class { +Sources.SourcesView.CloseAllActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView); + var sourcesView = UI.context.flavor(Sources.SourcesView); if (!sourcesView) return false; sourcesView._editorContainer.closeAllFiles();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/StyleSheetOutlineDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/StyleSheetOutlineDialog.js index 10a297dd..83dc4ba 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/StyleSheetOutlineDialog.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/StyleSheetOutlineDialog.js
@@ -29,27 +29,27 @@ /** * @unrestricted */ -WebInspector.StyleSheetOutlineDialog = class extends WebInspector.FilteredListWidget.Delegate { +Sources.StyleSheetOutlineDialog = class extends UI.FilteredListWidget.Delegate { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(number, number)} selectItemCallback */ constructor(uiSourceCode, selectItemCallback) { super([]); this._selectItemCallback = selectItemCallback; - this._cssParser = new WebInspector.CSSParser(); - this._cssParser.addEventListener(WebInspector.CSSParser.Events.RulesParsed, this.refresh.bind(this)); + this._cssParser = new SDK.CSSParser(); + this._cssParser.addEventListener(SDK.CSSParser.Events.RulesParsed, this.refresh.bind(this)); this._cssParser.parse(uiSourceCode.workingCopy()); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(number, number)} selectItemCallback */ static show(uiSourceCode, selectItemCallback) { - WebInspector.StyleSheetOutlineDialog._instanceForTests = - new WebInspector.StyleSheetOutlineDialog(uiSourceCode, selectItemCallback); - new WebInspector.FilteredListWidget(WebInspector.StyleSheetOutlineDialog._instanceForTests).showAsDialog(); + Sources.StyleSheetOutlineDialog._instanceForTests = + new Sources.StyleSheetOutlineDialog(uiSourceCode, selectItemCallback); + new UI.FilteredListWidget(Sources.StyleSheetOutlineDialog._instanceForTests).showAsDialog(); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js index 28e964b..ef3fc2b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
@@ -28,12 +28,12 @@ /** * @interface */ -WebInspector.TabbedEditorContainerDelegate = function() {}; +Sources.TabbedEditorContainerDelegate = function() {}; -WebInspector.TabbedEditorContainerDelegate.prototype = { +Sources.TabbedEditorContainerDelegate.prototype = { /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!WebInspector.Widget} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!UI.Widget} */ viewForFile: function(uiSourceCode) {}, }; @@ -41,43 +41,43 @@ /** * @unrestricted */ -WebInspector.TabbedEditorContainer = class extends WebInspector.Object { +Sources.TabbedEditorContainer = class extends Common.Object { /** - * @param {!WebInspector.TabbedEditorContainerDelegate} delegate - * @param {!WebInspector.Setting} setting + * @param {!Sources.TabbedEditorContainerDelegate} delegate + * @param {!Common.Setting} setting * @param {string} placeholderText */ constructor(delegate, setting, placeholderText) { super(); this._delegate = delegate; - this._tabbedPane = new WebInspector.TabbedPane(); + this._tabbedPane = new UI.TabbedPane(); this._tabbedPane.setPlaceholderText(placeholderText); - this._tabbedPane.setTabDelegate(new WebInspector.EditorContainerTabDelegate(this)); + this._tabbedPane.setTabDelegate(new Sources.EditorContainerTabDelegate(this)); this._tabbedPane.setCloseableTabs(true); this._tabbedPane.setAllowTabReorder(true, true); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabClosed, this._tabClosed, this); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabSelected, this); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabClosed, this._tabClosed, this); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingCreated, this._onBindingCreated, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingRemoved, this._onBindingRemoved, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingCreated, this._onBindingCreated, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingRemoved, this._onBindingRemoved, this); this._tabIds = new Map(); this._files = {}; this._previouslyViewedFilesSetting = setting; - this._history = WebInspector.TabbedEditorContainer.History.fromObject(this._previouslyViewedFilesSetting.get()); + this._history = Sources.TabbedEditorContainer.History.fromObject(this._previouslyViewedFilesSetting.get()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingCreated(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); this._updateFileTitle(binding.network); var networkTabId = this._tabIds.get(binding.network); @@ -100,15 +100,15 @@ if (wasSelectedInFileSystem) this._tabbedPane.selectTab(networkTabId, false); - var networkTabView = /** @type {!WebInspector.Widget} */ (this._tabbedPane.tabView(networkTabId)); + var networkTabView = /** @type {!UI.Widget} */ (this._tabbedPane.tabView(networkTabId)); this._restoreEditorProperties(networkTabView, currentSelectionRange, currentScrollLineNumber); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingRemoved(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); this._updateFileTitle(binding.network); var networkTabId = this._tabIds.get(binding.network); @@ -123,42 +123,42 @@ if (wasSelected) this._tabbedPane.selectTab(fileSystemTabId, false); - var fileSystemTabView = /** @type {!WebInspector.Widget} */ (this._tabbedPane.tabView(fileSystemTabId)); + var fileSystemTabView = /** @type {!UI.Widget} */ (this._tabbedPane.tabView(fileSystemTabId)); var savedSelectionRange = this._history.selectionRange(binding.network.url()); var savedScrollLineNumber = this._history.scrollLineNumber(binding.network.url()); this._restoreEditorProperties(fileSystemTabView, savedSelectionRange, savedScrollLineNumber); } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ get view() { return this._tabbedPane; } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ get visibleView() { return this._tabbedPane.visibleView; } /** - * @return {!Array.<!WebInspector.Widget>} + * @return {!Array.<!UI.Widget>} */ fileViews() { - return /** @type {!Array.<!WebInspector.Widget>} */ (this._tabbedPane.tabViews()); + return /** @type {!Array.<!UI.Widget>} */ (this._tabbedPane.tabViews()); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ leftToolbar() { return this._tabbedPane.leftToolbar(); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ rightToolbar() { return this._tabbedPane.rightToolbar(); @@ -172,14 +172,14 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ showFile(uiSourceCode) { this._innerShowFile(uiSourceCode, true); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ closeFile(uiSourceCode) { var tabId = this._tabIds.get(uiSourceCode); @@ -193,7 +193,7 @@ } /** - * @return {!Array.<!WebInspector.UISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ historyUISourceCodes() { // FIXME: there should be a way to fetch UISourceCode for its uri. @@ -217,22 +217,22 @@ if (!this._currentView || !this._currentView.textEditor) return; this._currentView.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.ScrollChanged, this._scrollChanged, this); + SourceFrame.SourcesTextEditor.Events.ScrollChanged, this._scrollChanged, this); this._currentView.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.SelectionChanged, this._selectionChanged, this); + SourceFrame.SourcesTextEditor.Events.SelectionChanged, this._selectionChanged, this); } _removeViewListeners() { if (!this._currentView || !this._currentView.textEditor) return; this._currentView.textEditor.removeEventListener( - WebInspector.SourcesTextEditor.Events.ScrollChanged, this._scrollChanged, this); + SourceFrame.SourcesTextEditor.Events.ScrollChanged, this._scrollChanged, this); this._currentView.textEditor.removeEventListener( - WebInspector.SourcesTextEditor.Events.SelectionChanged, this._selectionChanged, this); + SourceFrame.SourcesTextEditor.Events.SelectionChanged, this._selectionChanged, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _scrollChanged(event) { if (this._scrollTimer) @@ -242,7 +242,7 @@ this._history.updateScrollLineNumber(this._currentFile.url(), lineNumber); /** - * @this {WebInspector.TabbedEditorContainer} + * @this {Sources.TabbedEditorContainer} */ function saveHistory() { this._history.save(this._previouslyViewedFilesSetting); @@ -250,20 +250,20 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _selectionChanged(event) { - var range = /** @type {!WebInspector.TextRange} */ (event.data); + var range = /** @type {!Common.TextRange} */ (event.data); this._history.updateSelectionRange(this._currentFile.url(), range); this._history.save(this._previouslyViewedFilesSetting); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean=} userGesture */ _innerShowFile(uiSourceCode, userGesture) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); uiSourceCode = binding ? binding.network : uiSourceCode; if (this._currentFile === uiSourceCode) return; @@ -287,19 +287,19 @@ previousView: previousView, userGesture: userGesture }; - this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.EditorSelected, eventData); + this.dispatchEventToListeners(Sources.TabbedEditorContainer.Events.EditorSelected, eventData); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ _titleForFile(uiSourceCode) { - var binding = WebInspector.persistence.binding(uiSourceCode); + var binding = Persistence.persistence.binding(uiSourceCode); var titleUISourceCode = binding ? binding.fileSystem : uiSourceCode; var maxDisplayNameLength = 30; var title = titleUISourceCode.displayName(true).trimMiddle(maxDisplayNameLength); - if (uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommittedChanges(uiSourceCode)) + if (uiSourceCode.isDirty() || Persistence.persistence.hasUnsavedCommittedChanges(uiSourceCode)) title += '*'; return title; } @@ -313,7 +313,7 @@ var shouldPrompt = uiSourceCode.isDirty() && uiSourceCode.project().canSetFileContent(); // FIXME: this should be replaced with common Save/Discard/Cancel dialog. if (!shouldPrompt || - confirm(WebInspector.UIString('Are you sure you want to close unsaved file: %s?', uiSourceCode.name()))) { + confirm(Common.UIString('Are you sure you want to close unsaved file: %s?', uiSourceCode.name()))) { uiSourceCode.resetWorkingCopy(); var previousView = this._currentView; if (nextTabId) @@ -351,7 +351,7 @@ /** * @param {string} tabId - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _onContextMenu(tabId, contextMenu) { var uiSourceCode = this._files[tabId]; @@ -360,7 +360,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ addUISourceCode(uiSourceCode) { var uri = uiSourceCode.url(); @@ -381,21 +381,21 @@ return; var currentProjectType = this._currentFile.project().type(); var addedProjectType = uiSourceCode.project().type(); - var snippetsProjectType = WebInspector.projectTypes.Snippets; + var snippetsProjectType = Workspace.projectTypes.Snippets; if (this._history.index(this._currentFile.url()) && currentProjectType === snippetsProjectType && addedProjectType !== snippetsProjectType) this._innerShowFile(uiSourceCode, false); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ removeUISourceCode(uiSourceCode) { this.removeUISourceCodes([uiSourceCode]); } /** - * @param {!Array.<!WebInspector.UISourceCode>} uiSourceCodes + * @param {!Array.<!Workspace.UISourceCode>} uiSourceCodes */ removeUISourceCodes(uiSourceCodes) { var tabIds = []; @@ -409,7 +409,7 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _editorClosedByUserAction(uiSourceCode) { this._history.remove(uiSourceCode.url()); @@ -422,11 +422,11 @@ _updateHistory() { var tabIds = - this._tabbedPane.lastOpenedTabIds(WebInspector.TabbedEditorContainer.maximalPreviouslyViewedFilesCount); + this._tabbedPane.lastOpenedTabIds(Sources.TabbedEditorContainer.maximalPreviouslyViewedFilesCount); /** * @param {string} tabId - * @this {WebInspector.TabbedEditorContainer} + * @this {Sources.TabbedEditorContainer} */ function tabIdToURI(tabId) { return this._files[tabId].url(); @@ -437,16 +437,16 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @return {string} */ _tooltipForFile(uiSourceCode) { - uiSourceCode = WebInspector.persistence.fileSystem(uiSourceCode) || uiSourceCode; + uiSourceCode = Persistence.persistence.fileSystem(uiSourceCode) || uiSourceCode; return uiSourceCode.url(); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean=} userGesture * @param {number=} index * @return {string} @@ -472,13 +472,13 @@ } /** - * @param {!WebInspector.Widget} editorView - * @param {!WebInspector.TextRange=} selection + * @param {!UI.Widget} editorView + * @param {!Common.TextRange=} selection * @param {number=} firstLineNumber */ _restoreEditorProperties(editorView, selection, firstLineNumber) { var sourceFrame = - editorView instanceof WebInspector.SourceFrame ? /** @type {!WebInspector.SourceFrame} */ (editorView) : null; + editorView instanceof SourceFrame.SourceFrame ? /** @type {!SourceFrame.SourceFrame} */ (editorView) : null; if (!sourceFrame) return; if (selection) @@ -488,7 +488,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabClosed(event) { var tabId = /** @type {string} */ (event.data.tabId); @@ -505,14 +505,14 @@ this._removeUISourceCodeListeners(uiSourceCode); - this.dispatchEventToListeners(WebInspector.TabbedEditorContainer.Events.EditorClosed, uiSourceCode); + this.dispatchEventToListeners(Sources.TabbedEditorContainer.Events.EditorClosed, uiSourceCode); if (userGesture) this._editorClosedByUserAction(uiSourceCode); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabSelected(event) { var tabId = /** @type {string} */ (event.data.tabId); @@ -523,42 +523,42 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _addUISourceCodeListeners(uiSourceCode) { - uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); + uiSourceCode.addEventListener(Workspace.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this); uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._uiSourceCodeWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._uiSourceCodeWorkingCopyCommitted, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _removeUISourceCodeListeners(uiSourceCode) { uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); + Workspace.UISourceCode.Events.TitleChanged, this._uiSourceCodeTitleChanged, this); uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._uiSourceCodeWorkingCopyChanged, this); uiSourceCode.removeEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._uiSourceCodeWorkingCopyCommitted, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._uiSourceCodeWorkingCopyCommitted, this); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _updateFileTitle(uiSourceCode) { var tabId = this._tabIds.get(uiSourceCode); if (tabId) { var title = this._titleForFile(uiSourceCode); this._tabbedPane.changeTabTitle(tabId, title); - if (WebInspector.persistence.hasUnsavedCommittedChanges(uiSourceCode)) { + if (Persistence.persistence.hasUnsavedCommittedChanges(uiSourceCode)) { this._tabbedPane.setTabIcon( - tabId, 'smallicon-warning', WebInspector.UIString('Changes to this file were not saved to file system.')); - } else if (Runtime.experiments.isEnabled('persistence2') && WebInspector.persistence.binding(uiSourceCode)) { - var binding = WebInspector.persistence.binding(uiSourceCode); - this._tabbedPane.setTabIcon(tabId, 'smallicon-green-checkmark', WebInspector.PersistenceUtils.tooltipForUISourceCode(binding.fileSystem)); + tabId, 'smallicon-warning', Common.UIString('Changes to this file were not saved to file system.')); + } else if (Runtime.experiments.isEnabled('persistence2') && Persistence.persistence.binding(uiSourceCode)) { + var binding = Persistence.persistence.binding(uiSourceCode); + this._tabbedPane.setTabIcon(tabId, 'smallicon-green-checkmark', Persistence.PersistenceUtils.tooltipForUISourceCode(binding.fileSystem)); } else { this._tabbedPane.setTabIcon(tabId, ''); } @@ -566,18 +566,18 @@ } _uiSourceCodeTitleChanged(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); this._updateFileTitle(uiSourceCode); this._updateHistory(); } _uiSourceCodeWorkingCopyChanged(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); this._updateFileTitle(uiSourceCode); } _uiSourceCodeWorkingCopyCommitted(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.target); this._updateFileTitle(uiSourceCode); } @@ -585,11 +585,11 @@ * @return {string} */ _generateTabId() { - return 'tab_' + (WebInspector.TabbedEditorContainer._tabId++); + return 'tab_' + (Sources.TabbedEditorContainer._tabId++); } /** - * @return {?WebInspector.UISourceCode} uiSourceCode + * @return {?Workspace.UISourceCode} uiSourceCode */ currentFile() { return this._currentFile || null; @@ -597,41 +597,41 @@ }; /** @enum {symbol} */ -WebInspector.TabbedEditorContainer.Events = { +Sources.TabbedEditorContainer.Events = { EditorSelected: Symbol('EditorSelected'), EditorClosed: Symbol('EditorClosed') }; -WebInspector.TabbedEditorContainer._tabId = 0; +Sources.TabbedEditorContainer._tabId = 0; -WebInspector.TabbedEditorContainer.maximalPreviouslyViewedFilesCount = 30; +Sources.TabbedEditorContainer.maximalPreviouslyViewedFilesCount = 30; /** * @unrestricted */ -WebInspector.TabbedEditorContainer.HistoryItem = class { +Sources.TabbedEditorContainer.HistoryItem = class { /** * @param {string} url - * @param {!WebInspector.TextRange=} selectionRange + * @param {!Common.TextRange=} selectionRange * @param {number=} scrollLineNumber */ constructor(url, selectionRange, scrollLineNumber) { /** @const */ this.url = url; /** @const */ this._isSerializable = - url.length < WebInspector.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit; + url.length < Sources.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit; this.selectionRange = selectionRange; this.scrollLineNumber = scrollLineNumber; } /** * @param {!Object} serializedHistoryItem - * @return {!WebInspector.TabbedEditorContainer.HistoryItem} + * @return {!Sources.TabbedEditorContainer.HistoryItem} */ static fromObject(serializedHistoryItem) { var selectionRange = serializedHistoryItem.selectionRange ? - WebInspector.TextRange.fromObject(serializedHistoryItem.selectionRange) : + Common.TextRange.fromObject(serializedHistoryItem.selectionRange) : undefined; - return new WebInspector.TabbedEditorContainer.HistoryItem( + return new Sources.TabbedEditorContainer.HistoryItem( serializedHistoryItem.url, selectionRange, serializedHistoryItem.scrollLineNumber); } @@ -649,15 +649,15 @@ } }; -WebInspector.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit = 4096; +Sources.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit = 4096; /** * @unrestricted */ -WebInspector.TabbedEditorContainer.History = class { +Sources.TabbedEditorContainer.History = class { /** - * @param {!Array.<!WebInspector.TabbedEditorContainer.HistoryItem>} items + * @param {!Array.<!Sources.TabbedEditorContainer.HistoryItem>} items */ constructor(items) { this._items = items; @@ -666,13 +666,13 @@ /** * @param {!Array.<!Object>} serializedHistory - * @return {!WebInspector.TabbedEditorContainer.History} + * @return {!Sources.TabbedEditorContainer.History} */ static fromObject(serializedHistory) { var items = []; for (var i = 0; i < serializedHistory.length; ++i) - items.push(WebInspector.TabbedEditorContainer.HistoryItem.fromObject(serializedHistory[i])); - return new WebInspector.TabbedEditorContainer.History(items); + items.push(Sources.TabbedEditorContainer.HistoryItem.fromObject(serializedHistory[i])); + return new Sources.TabbedEditorContainer.History(items); } /** @@ -694,7 +694,7 @@ /** * @param {string} url - * @return {!WebInspector.TextRange|undefined} + * @return {!Common.TextRange|undefined} */ selectionRange(url) { var index = this.index(url); @@ -703,7 +703,7 @@ /** * @param {string} url - * @param {!WebInspector.TextRange=} selectionRange + * @param {!Common.TextRange=} selectionRange */ updateSelectionRange(url, selectionRange) { if (!selectionRange) @@ -745,7 +745,7 @@ item = this._items[index]; this._items.splice(index, 1); } else - item = new WebInspector.TabbedEditorContainer.HistoryItem(urls[i]); + item = new Sources.TabbedEditorContainer.HistoryItem(urls[i]); this._items.unshift(item); this._rebuildItemIndex(); } @@ -763,7 +763,7 @@ } /** - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting */ save(setting) { setting.set(this._serializeToObject()); @@ -778,7 +778,7 @@ var serializedItem = this._items[i].serializeToObject(); if (serializedItem) serializedHistory.push(serializedItem); - if (serializedHistory.length === WebInspector.TabbedEditorContainer.maximalPreviouslyViewedFilesCount) + if (serializedHistory.length === Sources.TabbedEditorContainer.maximalPreviouslyViewedFilesCount) break; } return serializedHistory; @@ -797,12 +797,12 @@ /** - * @implements {WebInspector.TabbedPaneTabDelegate} + * @implements {UI.TabbedPaneTabDelegate} * @unrestricted */ -WebInspector.EditorContainerTabDelegate = class { +Sources.EditorContainerTabDelegate = class { /** - * @param {!WebInspector.TabbedEditorContainer} editorContainer + * @param {!Sources.TabbedEditorContainer} editorContainer */ constructor(editorContainer) { this._editorContainer = editorContainer; @@ -810,7 +810,7 @@ /** * @override - * @param {!WebInspector.TabbedPane} tabbedPane + * @param {!UI.TabbedPane} tabbedPane * @param {!Array.<string>} ids */ closeTabs(tabbedPane, ids) { @@ -820,7 +820,7 @@ /** * @override * @param {string} tabId - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ onContextMenu(tabId, contextMenu) { this._editorContainer._onContextMenu(tabId, contextMenu);
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js index 58d8fc8..25da14ff 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
@@ -2,47 +2,47 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.ThreadsSidebarPane = class extends WebInspector.VBox { +Sources.ThreadsSidebarPane = class extends UI.VBox { constructor() { super(); - /** @type {?WebInspector.UIList.Item} */ + /** @type {?Sources.UIList.Item} */ this._selectedListItem = null; - /** @type {!Map<!WebInspector.PendingTarget, !WebInspector.UIList.Item>} */ + /** @type {!Map<!SDK.PendingTarget, !Sources.UIList.Item>} */ this._pendingToListItem = new Map(); - /** @type {!Map<!WebInspector.Target, !WebInspector.PendingTarget>} */ + /** @type {!Map<!SDK.Target, !SDK.PendingTarget>} */ this._targetToPending = new Map(); - /** @type {?WebInspector.PendingTarget} */ + /** @type {?SDK.PendingTarget} */ this._mainTargetPending = null; - this.threadList = new WebInspector.UIList(); + this.threadList = new Sources.UIList(); this.threadList.show(this.element); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._onDebuggerStateChanged, + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this._onDebuggerStateChanged, this); - WebInspector.targetManager.addModelListener( - WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._onDebuggerStateChanged, + SDK.targetManager.addModelListener( + SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._onDebuggerStateChanged, this); - WebInspector.targetManager.addModelListener( - WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextChanged, + SDK.targetManager.addModelListener( + SDK.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextChanged, this._onExecutionContextChanged, this); - WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.NameChanged, this._targetNameChanged, this); - WebInspector.targetManager.addModelListener(WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetAdded, this._addTargetItem, this); - WebInspector.targetManager.addModelListener(WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetRemoved, this._pendingTargetRemoved, this); - WebInspector.targetManager.addModelListener(WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetAttached, this._addTargetItem, this); - WebInspector.targetManager.addModelListener(WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.PendingTargetDetached, this._targetDetached, this); - WebInspector.targetManager.observeTargets(this); + UI.context.addFlavorChangeListener(SDK.Target, this._targetChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.NameChanged, this._targetNameChanged, this); + SDK.targetManager.addModelListener(SDK.SubTargetsManager, SDK.SubTargetsManager.Events.PendingTargetAdded, this._addTargetItem, this); + SDK.targetManager.addModelListener(SDK.SubTargetsManager, SDK.SubTargetsManager.Events.PendingTargetRemoved, this._pendingTargetRemoved, this); + SDK.targetManager.addModelListener(SDK.SubTargetsManager, SDK.SubTargetsManager.Events.PendingTargetAttached, this._addTargetItem, this); + SDK.targetManager.addModelListener(SDK.SubTargetsManager, SDK.SubTargetsManager.Events.PendingTargetDetached, this._targetDetached, this); + SDK.targetManager.observeTargets(this); var pendingTargets = []; - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Target)) - pendingTargets = pendingTargets.concat(WebInspector.SubTargetsManager.fromTarget(target).pendingTargets()); + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Target)) + pendingTargets = pendingTargets.concat(SDK.SubTargetsManager.fromTarget(target).pendingTargets()); pendingTargets - .sort(WebInspector.ThreadsSidebarPane._pendingTargetsComparator) + .sort(Sources.ThreadsSidebarPane._pendingTargetsComparator) .forEach(pendingTarget => this._addListItem(pendingTarget)); } @@ -50,10 +50,10 @@ * @return {boolean} */ static shouldBeShown() { - if (WebInspector.targetManager.targets(WebInspector.Target.Capability.JS).length > 1) + if (SDK.targetManager.targets(SDK.Target.Capability.JS).length > 1) return true; - for (var target of WebInspector.targetManager.targets(WebInspector.Target.Capability.Target)) { - var pendingTargets = WebInspector.SubTargetsManager.fromTarget(target).pendingTargets(); + for (var target of SDK.targetManager.targets(SDK.Target.Capability.Target)) { + var pendingTargets = SDK.SubTargetsManager.fromTarget(target).pendingTargets(); if (pendingTargets.some(pendingTarget => pendingTarget.canConnect())) return true; } @@ -63,8 +63,8 @@ /** * Sorts show tha connected targets appear first, followed by pending subtargets. * - * @param {!WebInspector.PendingTarget} c1 - * @param {!WebInspector.PendingTarget} c2 + * @param {!SDK.PendingTarget} c1 + * @param {!SDK.PendingTarget} c2 * @return {number} */ static _pendingTargetsComparator(c1, c2) @@ -82,28 +82,28 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _addTargetItem(event) { - this._addListItem(/** @type {!WebInspector.PendingTarget} */ (event.data)); + this._addListItem(/** @type {!SDK.PendingTarget} */ (event.data)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _pendingTargetRemoved(event) { - this._removeListItem(/** @type {!WebInspector.PendingTarget} */ (event.data)); + this._removeListItem(/** @type {!SDK.PendingTarget} */ (event.data)); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetDetached(event) { - this._targetRemoved(/** @type {!WebInspector.PendingTarget} */ (event.data)); + this._targetRemoved(/** @type {!SDK.PendingTarget} */ (event.data)); } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget */ _addListItem(pendingTarget) { var target = pendingTarget.target(); @@ -112,16 +112,16 @@ var listItem = this._pendingToListItem.get(pendingTarget); if (!listItem) { - listItem = new WebInspector.UIList.Item('', '', false); - listItem[WebInspector.ThreadsSidebarPane._pendingTargetSymbol] = pendingTarget; - listItem[WebInspector.ThreadsSidebarPane._targetSymbol] = target; + listItem = new Sources.UIList.Item('', '', false); + listItem[Sources.ThreadsSidebarPane._pendingTargetSymbol] = pendingTarget; + listItem[Sources.ThreadsSidebarPane._targetSymbol] = target; this._pendingToListItem.set(pendingTarget, listItem); this.threadList.addItem(listItem); listItem.element.addEventListener('click', this._onListItemClick.bind(this, listItem), false); } this._updateListItem(listItem, pendingTarget); this._updateDebuggerState(pendingTarget); - var currentTarget = WebInspector.context.flavor(WebInspector.Target); + var currentTarget = UI.context.flavor(SDK.Target); if (currentTarget === target) this._selectListItem(listItem); if (target) @@ -130,55 +130,55 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { - if (target !== WebInspector.targetManager.mainTarget()) + if (target !== SDK.targetManager.mainTarget()) return; console.assert(!this._mainTargetPending); - this._mainTargetPending = new WebInspector.ThreadsSidebarPane.MainTargetConnection(target); + this._mainTargetPending = new Sources.ThreadsSidebarPane.MainTargetConnection(target); this._addListItem(this._mainTargetPending); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { - var subtargetManager = WebInspector.SubTargetsManager.fromTarget(target); + var subtargetManager = SDK.SubTargetsManager.fromTarget(target); var pendingTargets = subtargetManager ? subtargetManager.pendingTargets() : []; for (var pendingTarget of pendingTargets) { if (pendingTarget.target()) this._targetRemoved(pendingTarget); } - if (target === WebInspector.targetManager.mainTarget() && this._mainTargetPending) { + if (target === SDK.targetManager.mainTarget() && this._mainTargetPending) { this._targetRemoved(this._mainTargetPending); this._mainTargetPending = null; } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetNameChanged(event) { - var target = /** @type {!WebInspector.Target} */ (event.data); + var target = /** @type {!SDK.Target} */ (event.data); var listItem = this._listItemForTarget(target); if (listItem) listItem.setTitle(this._titleForPending(this._targetToPending.get(target))); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _targetChanged(event) { - var listItem = this._listItemForTarget(/** @type {!WebInspector.Target} */ (event.data)); + var listItem = this._listItemForTarget(/** @type {!SDK.Target} */ (event.data)); if (listItem) this._selectListItem(listItem); } /** - * @param {!WebInspector.Target} target - * @return {?WebInspector.UIList.Item} + * @param {!SDK.Target} target + * @return {?Sources.UIList.Item} */ _listItemForTarget(target) { var pendingTarget = this._targetToPending.get(target); @@ -186,7 +186,7 @@ } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget * @return {string} */ _titleForPending(pendingTarget) { @@ -198,19 +198,19 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onDebuggerStateChanged(event) { - var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.target); var pendingTarget = this._targetToPending.get(debuggerModel.target()); this._updateDebuggerState(pendingTarget); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onExecutionContextChanged(event) { - var executionContext = /** @type {!WebInspector.ExecutionContext} */ (event.data); + var executionContext = /** @type {!SDK.ExecutionContext} */ (event.data); if (!executionContext.isDefault) return; var pendingTarget = this._targetToPending.get(executionContext.target()); @@ -220,18 +220,18 @@ } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget */ _updateDebuggerState(pendingTarget) { var listItem = this._pendingToListItem.get(pendingTarget); var target = pendingTarget.target(); - var debuggerModel = target && WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = target && SDK.DebuggerModel.fromTarget(target); var isPaused = !!debuggerModel && debuggerModel.isPaused(); - listItem.setSubtitle(WebInspector.UIString(isPaused ? 'paused' : '')); + listItem.setSubtitle(Common.UIString(isPaused ? 'paused' : '')); } /** - * @param {!WebInspector.UIList.Item} listItem + * @param {!Sources.UIList.Item} listItem */ _selectListItem(listItem) { if (listItem === this._selectedListItem) @@ -245,20 +245,20 @@ } /** - * @param {!WebInspector.UIList.Item} listItem + * @param {!Sources.UIList.Item} listItem */ _onListItemClick(listItem) { - var pendingTarget = listItem[WebInspector.ThreadsSidebarPane._pendingTargetSymbol]; + var pendingTarget = listItem[Sources.ThreadsSidebarPane._pendingTargetSymbol]; var target = pendingTarget.target(); if (!target) return; - WebInspector.context.setFlavor(WebInspector.Target, target); + UI.context.setFlavor(SDK.Target, target); listItem.element.scrollIntoViewIfNeeded(); } /** - * @param {!WebInspector.UIList.Item} item - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!Sources.UIList.Item} item + * @param {!SDK.PendingTarget} pendingTarget */ _updateListItem(item, pendingTarget) { item.setTitle(this._titleForPending(pendingTarget)); @@ -275,14 +275,14 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _selectNewlyAddedTarget(target) { - setTimeout(() => WebInspector.context.setFlavor(WebInspector.Target, target)); + setTimeout(() => UI.context.setFlavor(SDK.Target, target)); } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget * @return {!Promise} */ _toggleConnection(pendingTarget) { @@ -294,14 +294,14 @@ } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget */ _targetRemoved(pendingTarget) { var item = this._pendingToListItem.get(pendingTarget); if (!item) // Not all targets are represented in the UI. return; - var target = item[WebInspector.ThreadsSidebarPane._targetSymbol]; - item[WebInspector.ThreadsSidebarPane._targetSymbol] = null; + var target = item[Sources.ThreadsSidebarPane._targetSymbol]; + item[Sources.ThreadsSidebarPane._targetSymbol] = null; this._targetToPending.remove(target); if (pendingTarget.canConnect()) this._updateListItem(item, pendingTarget); @@ -310,7 +310,7 @@ } /** - * @param {!WebInspector.PendingTarget} pendingTarget + * @param {!SDK.PendingTarget} pendingTarget */ _removeListItem(pendingTarget) { var item = this._pendingToListItem.get(pendingTarget); @@ -321,15 +321,15 @@ } }; -WebInspector.ThreadsSidebarPane._pendingTargetSymbol = Symbol('_subtargetSymbol'); -WebInspector.ThreadsSidebarPane._targetSymbol = Symbol('_targetSymbol'); +Sources.ThreadsSidebarPane._pendingTargetSymbol = Symbol('_subtargetSymbol'); +Sources.ThreadsSidebarPane._targetSymbol = Symbol('_targetSymbol'); /** * @unrestricted */ -WebInspector.ThreadsSidebarPane.MainTargetConnection = class extends WebInspector.PendingTarget { +Sources.ThreadsSidebarPane.MainTargetConnection = class extends SDK.PendingTarget { /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ constructor(target) { super('main-target-list-node-' + target.id(), target.title, false, null); @@ -338,7 +338,7 @@ /** * @override - * @return {!WebInspector.Target} + * @return {!SDK.Target} */ target() { return this._target;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UIList.js b/third_party/WebKit/Source/devtools/front_end/sources/UIList.js index b5327fcc..2f4b2f5 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/UIList.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/UIList.js
@@ -27,21 +27,21 @@ /** * @unrestricted */ -WebInspector.UIList = class extends WebInspector.VBox { +Sources.UIList = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('sources/uiList.css'); - /** @type {!Array.<!WebInspector.UIList.Item>} */ + /** @type {!Array.<!Sources.UIList.Item>} */ this._items = []; } /** - * @param {!WebInspector.UIList.Item} item - * @param {?WebInspector.UIList.Item=} beforeItem + * @param {!Sources.UIList.Item} item + * @param {?Sources.UIList.Item=} beforeItem */ addItem(item, beforeItem) { - item[WebInspector.UIList._Key] = this; + item[Sources.UIList._Key] = this; var beforeElement = beforeItem ? beforeItem.element : null; this.contentElement.insertBefore(item.element, beforeElement); @@ -51,7 +51,7 @@ } /** - * @param {!WebInspector.UIList.Item} item + * @param {!Sources.UIList.Item} item */ removeItem(item) { var index = this._items.indexOf(item); @@ -66,12 +66,12 @@ } }; -WebInspector.UIList._Key = Symbol('ownerList'); +Sources.UIList._Key = Symbol('ownerList'); /** * @unrestricted */ -WebInspector.UIList.Item = class { +Sources.UIList.Item = class { /** * @param {string} title * @param {string} subtitle @@ -96,10 +96,10 @@ } /** - * @return {?WebInspector.UIList.Item} + * @return {?Sources.UIList.Item} */ nextSibling() { - var list = this[WebInspector.UIList._Key]; + var list = this[Sources.UIList._Key]; var index = list._items.indexOf(this); console.assert(index >= 0); return list._items[index + 1] || null; @@ -160,7 +160,7 @@ if (this._selected) return; this._selected = true; - this._icon = WebInspector.Icon.create('smallicon-thick-right-arrow', 'selected-icon'); + this._icon = UI.Icon.create('smallicon-thick-right-arrow', 'selected-icon'); this.element.appendChild(this._icon); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js index c202631..efdb524c 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -29,9 +29,9 @@ /** * @unrestricted */ -WebInspector.UISourceCodeFrame = class extends WebInspector.SourceFrame { +Sources.UISourceCodeFrame = class extends SourceFrame.SourceFrame { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ constructor(uiSourceCode) { super(uiSourceCode.contentURL(), workingCopy); @@ -39,41 +39,41 @@ this.setEditable(this._canEditSource()); if (Runtime.experiments.isEnabled('sourceDiff')) - this._diff = new WebInspector.SourceCodeDiff(uiSourceCode.requestOriginalContent(), this.textEditor); + this._diff = new Sources.SourceCodeDiff(uiSourceCode.requestOriginalContent(), this.textEditor); - /** @type {?WebInspector.AutocompleteConfig} */ - this._autocompleteConfig = {isWordChar: WebInspector.TextUtils.isWordChar}; - WebInspector.moduleSetting('textEditorAutocompletion').addChangeListener(this._updateAutocomplete, this); + /** @type {?UI.AutocompleteConfig} */ + this._autocompleteConfig = {isWordChar: Common.TextUtils.isWordChar}; + Common.moduleSetting('textEditorAutocompletion').addChangeListener(this._updateAutocomplete, this); this._updateAutocomplete(); this._rowMessageBuckets = {}; /** @type {!Set<string>} */ this._typeDecorationsPending = new Set(); this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyChanged, this._onWorkingCopyChanged, this); + Workspace.UISourceCode.Events.WorkingCopyChanged, this._onWorkingCopyChanged, this); this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); - this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageAdded, this._onMessageAdded, this); - this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageRemoved, this._onMessageRemoved, this); + Workspace.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this); + this._uiSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageAdded, this._onMessageAdded, this); + this._uiSourceCode.addEventListener(Workspace.UISourceCode.Events.MessageRemoved, this._onMessageRemoved, this); this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.LineDecorationAdded, this._onLineDecorationAdded, this); + Workspace.UISourceCode.Events.LineDecorationAdded, this._onLineDecorationAdded, this); this._uiSourceCode.addEventListener( - WebInspector.UISourceCode.Events.LineDecorationRemoved, this._onLineDecorationRemoved, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingCreated, this._onBindingChanged, this); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingRemoved, this._onBindingChanged, this); + Workspace.UISourceCode.Events.LineDecorationRemoved, this._onLineDecorationRemoved, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingCreated, this._onBindingChanged, this); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingRemoved, this._onBindingChanged, this); this.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.EditorBlurred, - () => WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, null)); + SourceFrame.SourcesTextEditor.Events.EditorBlurred, + () => UI.context.setFlavor(Sources.UISourceCodeFrame, null)); this.textEditor.addEventListener( - WebInspector.SourcesTextEditor.Events.EditorFocused, - () => WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, this)); + SourceFrame.SourcesTextEditor.Events.EditorFocused, + () => UI.context.setFlavor(Sources.UISourceCodeFrame, this)); this._updateStyle(); - this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element); + this._errorPopoverHelper = new UI.PopoverHelper(this.element); this._errorPopoverHelper.initializeCallbacks(this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this)); this._errorPopoverHelper.setTimeout(100, 100); @@ -89,7 +89,7 @@ } /** - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ uiSourceCode() { return this._uiSourceCode; @@ -112,7 +112,7 @@ */ willHide() { super.willHide(); - WebInspector.context.setFlavor(WebInspector.UISourceCodeFrame, null); + UI.context.setFlavor(Sources.UISourceCodeFrame, null); this.element.ownerDocument.defaultView.removeEventListener('focus', this._boundWindowFocused, false); delete this._boundWindowFocused; this._uiSourceCode.removeWorkingCopyGetter(); @@ -122,14 +122,14 @@ * @return {boolean} */ _canEditSource() { - if (WebInspector.persistence.binding(this._uiSourceCode)) + if (Persistence.persistence.binding(this._uiSourceCode)) return true; var projectType = this._uiSourceCode.project().type(); - if (projectType === WebInspector.projectTypes.Service || projectType === WebInspector.projectTypes.Debugger || - projectType === WebInspector.projectTypes.Formatter) + if (projectType === Workspace.projectTypes.Service || projectType === Workspace.projectTypes.Debugger || + projectType === Workspace.projectTypes.Formatter) return false; - if (projectType === WebInspector.projectTypes.Network && - this._uiSourceCode.contentType() === WebInspector.resourceTypes.Document) + if (projectType === Workspace.projectTypes.Network && + this._uiSourceCode.contentType() === Common.resourceTypes.Document) return false; return true; } @@ -167,8 +167,8 @@ /** * @override - * @param {!WebInspector.TextRange} oldRange - * @param {!WebInspector.TextRange} newRange + * @param {!Common.TextRange} oldRange + * @param {!Common.TextRange} newRange */ onTextChanged(oldRange, newRange) { if (this._diff) @@ -186,7 +186,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWorkingCopyChanged(event) { if (this._muteSourceCodeEvents) @@ -196,7 +196,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWorkingCopyCommitted(event) { if (!this._muteSourceCodeEvents) { @@ -208,10 +208,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onBindingChanged(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); if (binding.network === this._uiSourceCode || binding.fileSystem === this._uiSourceCode) this._updateStyle(); } @@ -219,7 +219,7 @@ _updateStyle() { this.element.classList.toggle( 'source-frame-unsaved-committed-changes', - WebInspector.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)); + Persistence.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)); this.setEditable(!this._canEditSource()); } @@ -228,11 +228,11 @@ _updateAutocomplete() { this._textEditor.configureAutocomplete( - WebInspector.moduleSetting('textEditorAutocompletion').get() ? this._autocompleteConfig : null); + Common.moduleSetting('textEditorAutocompletion').get() ? this._autocompleteConfig : null); } /** - * @param {?WebInspector.AutocompleteConfig} config + * @param {?UI.AutocompleteConfig} config */ configureAutocomplete(config) { this._autocompleteConfig = config; @@ -260,11 +260,11 @@ */ populateTextAreaContextMenu(contextMenu, lineNumber, columnNumber) { /** - * @this {WebInspector.UISourceCodeFrame} + * @this {Sources.UISourceCodeFrame} */ function appendItems() { contextMenu.appendApplicableItems(this._uiSourceCode); - contextMenu.appendApplicableItems(new WebInspector.UILocation(this._uiSourceCode, lineNumber, columnNumber)); + contextMenu.appendApplicableItems(new Workspace.UILocation(this._uiSourceCode, lineNumber, columnNumber)); contextMenu.appendApplicableItems(this); } @@ -272,7 +272,7 @@ } /** - * @param {!Array.<!WebInspector.Infobar|undefined>} infobars + * @param {!Array.<!UI.Infobar|undefined>} infobars */ attachInfobars(infobars) { for (var i = infobars.length - 1; i >= 0; --i) { @@ -287,22 +287,22 @@ dispose() { this._textEditor.dispose(); - WebInspector.moduleSetting('textEditorAutocompletion').removeChangeListener(this._updateAutocomplete, this); + Common.moduleSetting('textEditorAutocompletion').removeChangeListener(this._updateAutocomplete, this); this.detach(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onMessageAdded(event) { if (!this.loaded) return; - var message = /** @type {!WebInspector.UISourceCode.Message} */ (event.data); + var message = /** @type {!Workspace.UISourceCode.Message} */ (event.data); this._addMessageToSource(message); } /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ _addMessageToSource(message) { var lineNumber = message.lineNumber(); @@ -313,23 +313,23 @@ if (!this._rowMessageBuckets[lineNumber]) this._rowMessageBuckets[lineNumber] = - new WebInspector.UISourceCodeFrame.RowMessageBucket(this, this._textEditor, lineNumber); + new Sources.UISourceCodeFrame.RowMessageBucket(this, this._textEditor, lineNumber); var messageBucket = this._rowMessageBuckets[lineNumber]; messageBucket.addMessage(message); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onMessageRemoved(event) { if (!this.loaded) return; - var message = /** @type {!WebInspector.UISourceCode.Message} */ (event.data); + var message = /** @type {!Workspace.UISourceCode.Message} */ (event.data); this._removeMessageFromSource(message); } /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ _removeMessageFromSource(message) { var lineNumber = message.lineNumber(); @@ -375,7 +375,7 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showErrorPopover(anchor, popover) { var messageBucket = anchor.enclosingNodeOrSelfWithClass('text-editor-line-decoration')._messageBucket; @@ -393,18 +393,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onLineDecorationAdded(event) { - var marker = /** @type {!WebInspector.UISourceCode.LineMarker} */ (event.data); + var marker = /** @type {!Workspace.UISourceCode.LineMarker} */ (event.data); this._decorateTypeThrottled(marker.type()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onLineDecorationRemoved(event) { - var marker = /** @type {!WebInspector.UISourceCode.LineMarker} */ (event.data); + var marker = /** @type {!Workspace.UISourceCode.LineMarker} */ (event.data); this._decorateTypeThrottled(marker.type()); } @@ -415,7 +415,7 @@ if (this._typeDecorationsPending.has(type)) return; this._typeDecorationsPending.add(type); - self.runtime.extensions(WebInspector.UISourceCodeFrame.LineDecorator) + self.runtime.extensions(Sources.UISourceCodeFrame.LineDecorator) .find(extension => extension.descriptor()['decoratorType'] === type) .instance() .then(decorator => { @@ -425,34 +425,34 @@ } _decorateAllTypes() { - var extensions = self.runtime.extensions(WebInspector.UISourceCodeFrame.LineDecorator); + var extensions = self.runtime.extensions(Sources.UISourceCodeFrame.LineDecorator); extensions.forEach(extension => this._decorateTypeThrottled(extension.descriptor()['decoratorType'])); } }; -WebInspector.UISourceCodeFrame._iconClassPerLevel = {}; -WebInspector.UISourceCodeFrame._iconClassPerLevel[WebInspector.UISourceCode.Message.Level.Error] = 'smallicon-error'; -WebInspector.UISourceCodeFrame._iconClassPerLevel[WebInspector.UISourceCode.Message.Level.Warning] = 'smallicon-warning'; +Sources.UISourceCodeFrame._iconClassPerLevel = {}; +Sources.UISourceCodeFrame._iconClassPerLevel[Workspace.UISourceCode.Message.Level.Error] = 'smallicon-error'; +Sources.UISourceCodeFrame._iconClassPerLevel[Workspace.UISourceCode.Message.Level.Warning] = 'smallicon-warning'; -WebInspector.UISourceCodeFrame._bubbleTypePerLevel = {}; -WebInspector.UISourceCodeFrame._bubbleTypePerLevel[WebInspector.UISourceCode.Message.Level.Error] = 'error'; -WebInspector.UISourceCodeFrame._bubbleTypePerLevel[WebInspector.UISourceCode.Message.Level.Warning] = 'warning'; +Sources.UISourceCodeFrame._bubbleTypePerLevel = {}; +Sources.UISourceCodeFrame._bubbleTypePerLevel[Workspace.UISourceCode.Message.Level.Error] = 'error'; +Sources.UISourceCodeFrame._bubbleTypePerLevel[Workspace.UISourceCode.Message.Level.Warning] = 'warning'; -WebInspector.UISourceCodeFrame._lineClassPerLevel = {}; -WebInspector.UISourceCodeFrame._lineClassPerLevel[WebInspector.UISourceCode.Message.Level.Error] = +Sources.UISourceCodeFrame._lineClassPerLevel = {}; +Sources.UISourceCodeFrame._lineClassPerLevel[Workspace.UISourceCode.Message.Level.Error] = 'text-editor-line-with-error'; -WebInspector.UISourceCodeFrame._lineClassPerLevel[WebInspector.UISourceCode.Message.Level.Warning] = +Sources.UISourceCodeFrame._lineClassPerLevel[Workspace.UISourceCode.Message.Level.Warning] = 'text-editor-line-with-warning'; /** * @interface */ -WebInspector.UISourceCodeFrame.LineDecorator = function() {}; +Sources.UISourceCodeFrame.LineDecorator = function() {}; -WebInspector.UISourceCodeFrame.LineDecorator.prototype = { +Sources.UISourceCodeFrame.LineDecorator.prototype = { /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!TextEditor.CodeMirrorTextEditor} textEditor */ decorate: function(uiSourceCode, textEditor) {} }; @@ -460,18 +460,18 @@ /** * @unrestricted */ -WebInspector.UISourceCodeFrame.RowMessage = class { +Sources.UISourceCodeFrame.RowMessage = class { /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ constructor(message) { this._message = message; this._repeatCount = 1; this.element = createElementWithClass('div', 'text-editor-row-message'); this._icon = this.element.createChild('label', '', 'dt-icon-label'); - this._icon.type = WebInspector.UISourceCodeFrame._iconClassPerLevel[message.level()]; + this._icon.type = Sources.UISourceCodeFrame._iconClassPerLevel[message.level()]; this._repeatCountElement = this.element.createChild('label', 'message-repeat-count hidden', 'dt-small-bubble'); - this._repeatCountElement.type = WebInspector.UISourceCodeFrame._bubbleTypePerLevel[message.level()]; + this._repeatCountElement.type = Sources.UISourceCodeFrame._bubbleTypePerLevel[message.level()]; var linesContainer = this.element.createChild('div', 'text-editor-row-message-lines'); var lines = this._message.text().split('\n'); for (var i = 0; i < lines.length; ++i) { @@ -481,7 +481,7 @@ } /** - * @return {!WebInspector.UISourceCode.Message} + * @return {!Workspace.UISourceCode.Message} */ message() { return this._message; @@ -512,10 +512,10 @@ /** * @unrestricted */ -WebInspector.UISourceCodeFrame.RowMessageBucket = class { +Sources.UISourceCodeFrame.RowMessageBucket = class { /** - * @param {!WebInspector.UISourceCodeFrame} sourceFrame - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!Sources.UISourceCodeFrame} sourceFrame + * @param {!TextEditor.CodeMirrorTextEditor} textEditor * @param {number} lineNumber */ constructor(sourceFrame, textEditor, lineNumber) { @@ -529,7 +529,7 @@ this._hasDecoration = false; this._messagesDescriptionElement = createElementWithClass('div', 'text-editor-messages-description-container'); - /** @type {!Array.<!WebInspector.UISourceCodeFrame.RowMessage>} */ + /** @type {!Array.<!Sources.UISourceCodeFrame.RowMessage>} */ this._messages = []; this._level = null; @@ -543,7 +543,7 @@ lineNumber = Math.min(lineNumber, this._textEditor.linesCount - 1); var lineText = this._textEditor.line(lineNumber); columnNumber = Math.min(columnNumber, lineText.length); - var lineIndent = WebInspector.TextUtils.lineIndent(lineText).length; + var lineIndent = Common.TextUtils.lineIndent(lineText).length; if (this._hasDecoration) this._textEditor.removeDecoration(this._decoration, lineNumber); this._hasDecoration = true; @@ -568,7 +568,7 @@ var lineNumber = position.lineNumber; if (this._level) this._textEditor.toggleLineClass( - lineNumber, WebInspector.UISourceCodeFrame._lineClassPerLevel[this._level], false); + lineNumber, Sources.UISourceCodeFrame._lineClassPerLevel[this._level], false); if (this._hasDecoration) this._textEditor.removeDecoration(this._decoration, lineNumber); this._hasDecoration = false; @@ -582,7 +582,7 @@ } /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ addMessage(message) { for (var i = 0; i < this._messages.length; ++i) { @@ -593,13 +593,13 @@ } } - var rowMessage = new WebInspector.UISourceCodeFrame.RowMessage(message); + var rowMessage = new Sources.UISourceCodeFrame.RowMessage(message); this._messages.push(rowMessage); this._updateDecoration(); } /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ removeMessage(message) { for (var i = 0; i < this._messages.length; ++i) { @@ -629,35 +629,35 @@ for (var i = 0; i < this._messages.length; ++i) { var message = this._messages[i].message(); columnNumber = Math.min(columnNumber, message.columnNumber()); - if (!maxMessage || WebInspector.UISourceCode.Message.messageLevelComparator(maxMessage, message) < 0) + if (!maxMessage || Workspace.UISourceCode.Message.messageLevelComparator(maxMessage, message) < 0) maxMessage = message; } this._updateWavePosition(lineNumber, columnNumber); if (this._level) { this._textEditor.toggleLineClass( - lineNumber, WebInspector.UISourceCodeFrame._lineClassPerLevel[this._level], false); + lineNumber, Sources.UISourceCodeFrame._lineClassPerLevel[this._level], false); this._icon.type = ''; } this._level = maxMessage.level(); if (!this._level) return; - this._textEditor.toggleLineClass(lineNumber, WebInspector.UISourceCodeFrame._lineClassPerLevel[this._level], true); - this._icon.type = WebInspector.UISourceCodeFrame._iconClassPerLevel[this._level]; + this._textEditor.toggleLineClass(lineNumber, Sources.UISourceCodeFrame._lineClassPerLevel[this._level], true); + this._icon.type = Sources.UISourceCodeFrame._iconClassPerLevel[this._level]; } }; -WebInspector.UISourceCode.Message._messageLevelPriority = { +Workspace.UISourceCode.Message._messageLevelPriority = { 'Warning': 3, 'Error': 4 }; /** - * @param {!WebInspector.UISourceCode.Message} a - * @param {!WebInspector.UISourceCode.Message} b + * @param {!Workspace.UISourceCode.Message} a + * @param {!Workspace.UISourceCode.Message} b * @return {number} */ -WebInspector.UISourceCode.Message.messageLevelComparator = function(a, b) { - return WebInspector.UISourceCode.Message._messageLevelPriority[a.level()] - - WebInspector.UISourceCode.Message._messageLevelPriority[b.level()]; +Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { + return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - + Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js index 6bd6dcc..ff645a0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
@@ -28,38 +28,38 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ActionDelegate} - * @implements {WebInspector.ToolbarItem.ItemsProvider} - * @implements {WebInspector.ContextMenu.Provider} + * @implements {UI.ActionDelegate} + * @implements {UI.ToolbarItem.ItemsProvider} + * @implements {UI.ContextMenu.Provider} * @unrestricted */ -WebInspector.WatchExpressionsSidebarPane = class extends WebInspector.ThrottledWidget { +Sources.WatchExpressionsSidebarPane = class extends UI.ThrottledWidget { constructor() { super(); this.registerRequiredCSS('components/objectValue.css'); - /** @type {!Array.<!WebInspector.WatchExpression>} */ + /** @type {!Array.<!Sources.WatchExpression>} */ this._watchExpressions = []; - this._watchExpressionsSetting = WebInspector.settings.createLocalSetting('watchExpressions', []); + this._watchExpressionsSetting = Common.settings.createLocalSetting('watchExpressions', []); - this._addButton = new WebInspector.ToolbarButton(WebInspector.UIString('Add expression'), 'largeicon-add'); + this._addButton = new UI.ToolbarButton(Common.UIString('Add expression'), 'largeicon-add'); this._addButton.addEventListener('click', this._addButtonClicked.bind(this)); - this._refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh'); + this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh'); this._refreshButton.addEventListener('click', this._refreshButtonClicked.bind(this)); this._bodyElement = this.element.createChild('div', 'vbox watch-expressions'); this._bodyElement.addEventListener('contextmenu', this._contextMenu.bind(this), false); - this._expandController = new WebInspector.ObjectPropertiesSectionExpandController(); + this._expandController = new Components.ObjectPropertiesSectionExpandController(); - WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this.update, this); - WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.CallFrame, this.update, this); - this._linkifier = new WebInspector.Linkifier(); + UI.context.addFlavorChangeListener(SDK.ExecutionContext, this.update, this); + UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this.update, this); + this._linkifier = new Components.Linkifier(); this.update(); } /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ toolbarItems() { return [this._addButton, this._refreshButton]; @@ -82,17 +82,17 @@ } /** - * @param {!WebInspector.Event=} event + * @param {!Common.Event=} event */ _addButtonClicked(event) { if (event) event.consume(true); - WebInspector.viewManager.showView('sources.watch'); + UI.viewManager.showView('sources.watch'); this._createWatchExpression(null).startEditing(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _refreshButtonClicked(event) { event.consume(); @@ -108,7 +108,7 @@ this._bodyElement.removeChildren(); this._watchExpressions = []; this._emptyElement = this._bodyElement.createChild('div', 'gray-info-message'); - this._emptyElement.textContent = WebInspector.UIString('No Watch Expressions'); + this._emptyElement.textContent = Common.UIString('No Watch Expressions'); var watchExpressionStrings = this._watchExpressionsSetting.get(); for (var i = 0; i < watchExpressionStrings.length; ++i) { var expression = watchExpressionStrings[i]; @@ -122,23 +122,23 @@ /** * @param {?string} expression - * @return {!WebInspector.WatchExpression} + * @return {!Sources.WatchExpression} */ _createWatchExpression(expression) { this._emptyElement.classList.add('hidden'); - var watchExpression = new WebInspector.WatchExpression(expression, this._expandController, this._linkifier); + var watchExpression = new Sources.WatchExpression(expression, this._expandController, this._linkifier); watchExpression.addEventListener( - WebInspector.WatchExpression.Events.ExpressionUpdated, this._watchExpressionUpdated.bind(this)); + Sources.WatchExpression.Events.ExpressionUpdated, this._watchExpressionUpdated.bind(this)); this._bodyElement.appendChild(watchExpression.element()); this._watchExpressions.push(watchExpression); return watchExpression; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _watchExpressionUpdated(event) { - var watchExpression = /** @type {!WebInspector.WatchExpression} */ (event.target); + var watchExpression = /** @type {!Sources.WatchExpression} */ (event.target); if (!watchExpression.expression()) { this._watchExpressions.remove(watchExpression); this._bodyElement.removeChild(watchExpression.element()); @@ -152,13 +152,13 @@ * @param {!Event} event */ _contextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); this._populateContextMenu(contextMenu, event); contextMenu.show(); } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Event} event */ _populateContextMenu(contextMenu, event) { @@ -168,11 +168,11 @@ if (!isEditing) contextMenu.appendItem( - WebInspector.UIString.capitalize('Add ^watch ^expression'), this._addButtonClicked.bind(this)); + Common.UIString.capitalize('Add ^watch ^expression'), this._addButtonClicked.bind(this)); if (this._watchExpressions.length > 1) contextMenu.appendItem( - WebInspector.UIString.capitalize('Delete ^all ^watch ^expressions'), this._deleteAllButtonClicked.bind(this)); + Common.UIString.capitalize('Delete ^all ^watch ^expressions'), this._deleteAllButtonClicked.bind(this)); var target = event.deepElementFromPoint(); if (!target) @@ -190,16 +190,16 @@ /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var frame = WebInspector.context.flavor(WebInspector.UISourceCodeFrame); + var frame = UI.context.flavor(Sources.UISourceCodeFrame); if (!frame) return false; var text = frame.textEditor.text(frame.textEditor.selection()); - WebInspector.viewManager.showView('sources.watch'); + UI.viewManager.showView('sources.watch'); this.doUpdate(); this._createWatchExpression(text); this._saveExpressions(); @@ -209,7 +209,7 @@ /** * @override * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems(event, contextMenu, target) { @@ -220,11 +220,11 @@ /** * @unrestricted */ -WebInspector.WatchExpression = class extends WebInspector.Object { +Sources.WatchExpression = class extends Common.Object { /** * @param {?string} expression - * @param {!WebInspector.ObjectPropertiesSectionExpandController} expandController - * @param {!WebInspector.Linkifier} linkifier + * @param {!Components.ObjectPropertiesSectionExpandController} expandController + * @param {!Components.Linkifier} linkifier */ constructor(expression, expandController, linkifier) { super(); @@ -253,10 +253,10 @@ } update() { - var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext); + var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (currentExecutionContext && this._expression) currentExecutionContext.evaluate( - this._expression, WebInspector.WatchExpression._watchObjectGroupId, false, true, false, false, false, + this._expression, Sources.WatchExpression._watchObjectGroupId, false, true, false, false, false, this._createWatchExpression.bind(this)); } @@ -265,7 +265,7 @@ this._element.removeChild(this._objectPresentationElement); var newDiv = this._element.createChild('div'); newDiv.textContent = this._nameElement.textContent; - this._textPrompt = new WebInspector.ObjectPropertyPrompt(); + this._textPrompt = new Components.ObjectPropertyPrompt(); this._textPrompt.renderAsBlock(); var proxyElement = this._textPrompt.attachAndStartEditing(newDiv, this._finishEditing.bind(this)); proxyElement.classList.add('watch-expression-text-prompt-proxy'); @@ -314,7 +314,7 @@ this._expandController.stopWatchSectionsWithId(this._expression); this._expression = newExpression; this.update(); - this.dispatchEventToListeners(WebInspector.WatchExpression.Events.ExpressionUpdated); + this.dispatchEventToListeners(Sources.WatchExpression.Events.ExpressionUpdated); } /** @@ -326,7 +326,7 @@ } /** - * @param {?WebInspector.RemoteObject} result + * @param {?SDK.RemoteObject} result * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails */ _createWatchExpression(result, exceptionDetails) { @@ -334,17 +334,17 @@ var headerElement = createElementWithClass('div', 'watch-expression-header'); var deleteButton = headerElement.createChild('button', 'watch-expression-delete-button'); - deleteButton.title = WebInspector.UIString('Delete watch expression'); + deleteButton.title = Common.UIString('Delete watch expression'); deleteButton.addEventListener('click', this._deleteWatchExpression.bind(this), false); var titleElement = headerElement.createChild('div', 'watch-expression-title'); - this._nameElement = WebInspector.ObjectPropertiesSection.createNameElement(this._expression); + this._nameElement = Components.ObjectPropertiesSection.createNameElement(this._expression); if (!!exceptionDetails || !result) { this._valueElement = createElementWithClass('span', 'watch-expression-error value'); titleElement.classList.add('dimmed'); - this._valueElement.textContent = WebInspector.UIString('<not available>'); + this._valueElement.textContent = Common.UIString('<not available>'); } else { - this._valueElement = WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport( + this._valueElement = Components.ObjectPropertiesSection.createValueElementWithCustomSupport( result, !!exceptionDetails, titleElement, this._linkifier); } var separatorElement = createElementWithClass('span', 'watch-expressions-separator'); @@ -355,7 +355,7 @@ this._objectPropertiesSection = null; if (!exceptionDetails && result && result.hasChildren && !result.customPreview()) { headerElement.classList.add('watch-expression-object-header'); - this._objectPropertiesSection = new WebInspector.ObjectPropertiesSection(result, headerElement, this._linkifier); + this._objectPropertiesSection = new Components.ObjectPropertiesSection(result, headerElement, this._linkifier); this._objectPresentationElement = this._objectPropertiesSection.element; this._expandController.watchSection(/** @type {string} */ (this._expression), this._objectPropertiesSection); var objectTreeElement = this._objectPropertiesSection.objectTreeElement(); @@ -383,7 +383,7 @@ } /** - * @this {WebInspector.WatchExpression} + * @this {Sources.WatchExpression} */ function handleClick() { if (!this._objectPropertiesSection) @@ -406,16 +406,16 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Event} event */ _populateContextMenu(contextMenu, event) { if (!this.isEditing()) contextMenu.appendItem( - WebInspector.UIString.capitalize('Delete ^watch ^expression'), this._updateExpression.bind(this, null)); + Common.UIString.capitalize('Delete ^watch ^expression'), this._updateExpression.bind(this, null)); if (!this.isEditing() && this._result && (this._result.type === 'number' || this._result.type === 'string')) - contextMenu.appendItem(WebInspector.UIString.capitalize('Copy ^value'), this._copyValueButtonClicked.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Copy ^value'), this._copyValueButtonClicked.bind(this)); var target = event.deepElementFromPoint(); if (target && this._valueElement.isSelfOrAncestor(target)) @@ -427,9 +427,9 @@ } }; -WebInspector.WatchExpression._watchObjectGroupId = 'watch-group'; +Sources.WatchExpression._watchObjectGroupId = 'watch-group'; /** @enum {symbol} */ -WebInspector.WatchExpression.Events = { +Sources.WatchExpression.Events = { ExpressionUpdated: Symbol('ExpressionUpdated') };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js b/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js index 220b181..d048d5df 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js
@@ -4,68 +4,68 @@ /** * @unrestricted */ -WebInspector.WorkspaceMappingTip = class { +Sources.WorkspaceMappingTip = class { /** - * @param {!WebInspector.SourcesPanel} sourcesPanel - * @param {!WebInspector.Workspace} workspace + * @param {!Sources.SourcesPanel} sourcesPanel + * @param {!Workspace.Workspace} workspace */ constructor(sourcesPanel, workspace) { this._sourcesPanel = sourcesPanel; this._workspace = workspace; this._sourcesView = this._sourcesPanel.sourcesView(); - this._workspaceInfobarDisabledSetting = WebInspector.settings.createSetting('workspaceInfobarDisabled', false); + this._workspaceInfobarDisabledSetting = Common.settings.createSetting('workspaceInfobarDisabled', false); this._workspaceMappingInfobarDisabledSetting = - WebInspector.settings.createSetting('workspaceMappingInfobarDisabled', false); + Common.settings.createSetting('workspaceMappingInfobarDisabled', false); if (this._workspaceInfobarDisabledSetting.get() && this._workspaceMappingInfobarDisabledSetting.get()) return; - this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); - WebInspector.persistence.addEventListener( - WebInspector.Persistence.Events.BindingCreated, this._bindingCreated, this); + this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); + Persistence.persistence.addEventListener( + Persistence.Persistence.Events.BindingCreated, this._bindingCreated, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _bindingCreated(event) { - var binding = /** @type {!WebInspector.PersistenceBinding} */ (event.data); - if (binding.network[WebInspector.WorkspaceMappingTip._infobarSymbol]) - binding.network[WebInspector.WorkspaceMappingTip._infobarSymbol].dispose(); - if (binding.fileSystem[WebInspector.WorkspaceMappingTip._infobarSymbol]) - binding.fileSystem[WebInspector.WorkspaceMappingTip._infobarSymbol].dispose(); + var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data); + if (binding.network[Sources.WorkspaceMappingTip._infobarSymbol]) + binding.network[Sources.WorkspaceMappingTip._infobarSymbol].dispose(); + if (binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol]) + binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol].dispose(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _editorSelected(event) { - var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data); + var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); if (this._editorSelectedTimer) clearTimeout(this._editorSelectedTimer); this._editorSelectedTimer = setTimeout(this._updateSuggestedMappingInfobar.bind(this, uiSourceCode), 3000); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _updateSuggestedMappingInfobar(uiSourceCode) { var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); if (!uiSourceCodeFrame.isShowing()) return; - if (uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol]) + if (uiSourceCode[Sources.WorkspaceMappingTip._infobarSymbol]) return; // First try mapping filesystem -> network. if (!this._workspaceMappingInfobarDisabledSetting.get() && - uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) { - if (WebInspector.persistence.binding(uiSourceCode)) + uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) { + if (Persistence.persistence.binding(uiSourceCode)) return; - var networkProjects = this._workspace.projectsForType(WebInspector.projectTypes.Network); + var networkProjects = this._workspace.projectsForType(Workspace.projectTypes.Network); networkProjects = - networkProjects.concat(this._workspace.projectsForType(WebInspector.projectTypes.ContentScripts)); + networkProjects.concat(this._workspace.projectsForType(Workspace.projectTypes.ContentScripts)); for (var i = 0; i < networkProjects.length; ++i) { var name = uiSourceCode.name(); var networkUiSourceCodes = networkProjects[i].uiSourceCodes(); @@ -79,13 +79,13 @@ } // Then map network -> filesystem. - if (uiSourceCode.project().type() === WebInspector.projectTypes.Network || - uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) { + if (uiSourceCode.project().type() === Workspace.projectTypes.Network || + uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts) { // Suggest for localhost only. - if (!this._isLocalHost(uiSourceCode.url()) || WebInspector.persistence.binding(uiSourceCode)) + if (!this._isLocalHost(uiSourceCode.url()) || Persistence.persistence.binding(uiSourceCode)) return; - var filesystemProjects = this._workspace.projectsForType(WebInspector.projectTypes.FileSystem); + var filesystemProjects = this._workspace.projectsForType(Workspace.projectTypes.FileSystem); for (var i = 0; i < filesystemProjects.length; ++i) { var name = uiSourceCode.name(); var fsUiSourceCodes = filesystemProjects[i].uiSourceCodes(); @@ -111,75 +111,75 @@ } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode */ _showWorkspaceInfobar(uiSourceCode) { - var infobar = WebInspector.Infobar.create( - WebInspector.Infobar.Type.Info, - WebInspector.UIString('Serving from the file system? Add your files into the workspace.'), + var infobar = UI.Infobar.create( + UI.Infobar.Type.Info, + Common.UIString('Serving from the file system? Add your files into the workspace.'), this._workspaceInfobarDisabledSetting); if (!infobar) return; - infobar.createDetailsRowMessage(WebInspector.UIString( + infobar.createDetailsRowMessage(Common.UIString( 'If you add files into your DevTools workspace, your changes will be persisted to disk.')); infobar.createDetailsRowMessage( - WebInspector.UIString('To add a folder into the workspace, drag and drop it into the Sources panel.')); + Common.UIString('To add a folder into the workspace, drag and drop it into the Sources panel.')); this._appendInfobar(uiSourceCode, infobar); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean} isNetwork */ _showMappingInfobar(uiSourceCode, isNetwork) { var title; if (isNetwork) - title = WebInspector.UIString('Map network resource \'%s\' to workspace?', uiSourceCode.url()); + title = Common.UIString('Map network resource \'%s\' to workspace?', uiSourceCode.url()); else - title = WebInspector.UIString('Map workspace resource \'%s\' to network?', uiSourceCode.url()); + title = Common.UIString('Map workspace resource \'%s\' to network?', uiSourceCode.url()); - var infobar = WebInspector.Infobar.create( - WebInspector.Infobar.Type.Info, title, this._workspaceMappingInfobarDisabledSetting); + var infobar = UI.Infobar.create( + UI.Infobar.Type.Info, title, this._workspaceMappingInfobarDisabledSetting); if (!infobar) return; - infobar.createDetailsRowMessage(WebInspector.UIString( + infobar.createDetailsRowMessage(Common.UIString( 'You can map files in your workspace to the ones loaded over the network. As a result, changes made in DevTools will be persisted to disk.')); - infobar.createDetailsRowMessage(WebInspector.UIString('Use context menu to establish the mapping at any time.')); + infobar.createDetailsRowMessage(Common.UIString('Use context menu to establish the mapping at any time.')); var anchor = createElementWithClass('a', 'link'); - anchor.textContent = WebInspector.UIString('Establish the mapping now...'); + anchor.textContent = Common.UIString('Establish the mapping now...'); anchor.addEventListener('click', this._establishTheMapping.bind(this, uiSourceCode), false); infobar.createDetailsRowMessage('').appendChild(anchor); this._appendInfobar(uiSourceCode, infobar); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {?Event} event */ _establishTheMapping(uiSourceCode, event) { event.consume(true); - if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) + if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) this._sourcesPanel.mapFileSystemToNetwork(uiSourceCode); else this._sourcesPanel.mapNetworkToFileSystem(uiSourceCode); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.Infobar} infobar + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!UI.Infobar} infobar */ _appendInfobar(uiSourceCode, infobar) { var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); var rowElement = - infobar.createDetailsRowMessage(WebInspector.UIString('For more information on workspaces, refer to the ')); - rowElement.appendChild(WebInspector.linkifyDocumentationURLAsNode( - '../setup/setup-workflow', WebInspector.UIString('workspaces documentation'))); + infobar.createDetailsRowMessage(Common.UIString('For more information on workspaces, refer to the ')); + rowElement.appendChild(UI.linkifyDocumentationURLAsNode( + '../setup/setup-workflow', Common.UIString('workspaces documentation'))); rowElement.createTextChild('.'); - uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol] = infobar; + uiSourceCode[Sources.WorkspaceMappingTip._infobarSymbol] = infobar; uiSourceCodeFrame.attachInfobars([infobar]); - WebInspector.runCSSAnimationOnce(infobar.element, 'source-frame-infobar-animation'); + UI.runCSSAnimationOnce(infobar.element, 'source-frame-infobar-animation'); } }; -WebInspector.WorkspaceMappingTip._infobarSymbol = Symbol('infobar'); +Sources.WorkspaceMappingTip._infobarSymbol = Symbol('infobar');
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js index 0fb597c..ceed7cb 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/XHRBreakpointsSidebarPane.js
@@ -2,30 +2,30 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ContextFlavorListener} - * @implements {WebInspector.TargetManager.Observer} - * @implements {WebInspector.ToolbarItem.ItemsProvider} + * @implements {UI.ContextFlavorListener} + * @implements {SDK.TargetManager.Observer} + * @implements {UI.ToolbarItem.ItemsProvider} * @unrestricted */ -WebInspector.XHRBreakpointsSidebarPane = class extends WebInspector.BreakpointsSidebarPaneBase { +Sources.XHRBreakpointsSidebarPane = class extends Components.BreakpointsSidebarPaneBase { constructor() { super(); - this._xhrBreakpointsSetting = WebInspector.settings.createLocalSetting('xhrBreakpoints', []); + this._xhrBreakpointsSetting = Common.settings.createLocalSetting('xhrBreakpoints', []); /** @type {!Map.<string, !Element>} */ this._breakpointElements = new Map(); - this._addButton = new WebInspector.ToolbarButton(WebInspector.UIString('Add breakpoint'), 'largeicon-add'); + this._addButton = new UI.ToolbarButton(Common.UIString('Add breakpoint'), 'largeicon-add'); this._addButton.addEventListener('click', this._addButtonClicked.bind(this)); this.emptyElement.addEventListener('contextmenu', this._emptyElementContextMenu.bind(this), true); - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); this._update(); } /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._restoreBreakpoints(target); @@ -33,22 +33,22 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { } /** * @override - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ toolbarItems() { return [this._addButton]; } _emptyElementContextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); - contextMenu.appendItem(WebInspector.UIString.capitalize('Add ^breakpoint'), this._addButtonClicked.bind(this)); + var contextMenu = new UI.ContextMenu(event); + contextMenu.appendItem(Common.UIString.capitalize('Add ^breakpoint'), this._addButtonClicked.bind(this)); contextMenu.show(); } @@ -56,10 +56,10 @@ if (event) event.consume(); - WebInspector.viewManager.showView('sources.xhrBreakpoints'); + UI.viewManager.showView('sources.xhrBreakpoints'); var inputElementContainer = createElementWithClass('p', 'breakpoint-condition'); - inputElementContainer.textContent = WebInspector.UIString('Break when URL contains:'); + inputElementContainer.textContent = Common.UIString('Break when URL contains:'); var inputElement = inputElementContainer.createChild('span', 'editing'); inputElement.id = 'breakpoint-condition-input'; @@ -69,7 +69,7 @@ * @param {boolean} accept * @param {!Element} e * @param {string} text - * @this {WebInspector.XHRBreakpointsSidebarPane} + * @this {Sources.XHRBreakpointsSidebarPane} */ function finishEditing(accept, e, text) { this.removeListElement(inputElementContainer); @@ -79,14 +79,14 @@ } } - var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false)); - WebInspector.InplaceEditor.startEditing(inputElement, config); + var config = new UI.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false)); + UI.InplaceEditor.startEditing(inputElement, config); } /** * @param {string} url * @param {boolean} enabled - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _setBreakpoint(url, enabled, target) { if (enabled) @@ -101,7 +101,7 @@ element._url = url; element.addEventListener('contextmenu', this._contextMenu.bind(this, url), true); - var title = url ? WebInspector.UIString('URL contains "%s"', url) : WebInspector.UIString('Any XHR'); + var title = url ? Common.UIString('URL contains "%s"', url) : Common.UIString('Any XHR'); var label = createCheckboxLabel(title, enabled); element.appendChild(label); label.checkboxElement.addEventListener('click', this._checkboxClicked.bind(this, url), false); @@ -122,7 +122,7 @@ /** * @param {string} url - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _removeBreakpoint(url, target) { var element = this._breakpointElements.get(url); @@ -138,10 +138,10 @@ /** * @param {string} url * @param {boolean} enable - * @param {!WebInspector.Target=} target + * @param {!SDK.Target=} target */ _updateBreakpointOnTarget(url, enable, target) { - var targets = target ? [target] : WebInspector.targetManager.targets(WebInspector.Target.Capability.Browser); + var targets = target ? [target] : SDK.targetManager.targets(SDK.Target.Capability.Browser); for (target of targets) { if (enable) target.domdebuggerAgent().setXHRBreakpoint(url); @@ -151,10 +151,10 @@ } _contextMenu(url, event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); /** - * @this {WebInspector.XHRBreakpointsSidebarPane} + * @this {Sources.XHRBreakpointsSidebarPane} */ function removeBreakpoint() { this._removeBreakpoint(url); @@ -162,17 +162,17 @@ } /** - * @this {WebInspector.XHRBreakpointsSidebarPane} + * @this {Sources.XHRBreakpointsSidebarPane} */ function removeAllBreakpoints() { for (var url of this._breakpointElements.keys()) this._removeBreakpoint(url); this._saveBreakpoints(); } - var removeAllTitle = WebInspector.UIString.capitalize('Remove ^all ^breakpoints'); + var removeAllTitle = Common.UIString.capitalize('Remove ^all ^breakpoints'); - contextMenu.appendItem(WebInspector.UIString.capitalize('Add ^breakpoint'), this._addButtonClicked.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Remove ^breakpoint'), removeBreakpoint.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Add ^breakpoint'), this._addButtonClicked.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Remove ^breakpoint'), removeBreakpoint.bind(this)); contextMenu.appendItem(removeAllTitle, removeAllBreakpoints.bind(this)); contextMenu.show(); } @@ -193,7 +193,7 @@ * @param {boolean} accept * @param {!Element} e * @param {string} text - * @this {WebInspector.XHRBreakpointsSidebarPane} + * @this {Sources.XHRBreakpointsSidebarPane} */ function finishEditing(accept, e, text) { this.removeListElement(inputElement); @@ -205,9 +205,9 @@ element.classList.remove('hidden'); } - WebInspector.InplaceEditor.startEditing( + UI.InplaceEditor.startEditing( inputElement, - new WebInspector.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false))); + new UI.InplaceEditor.Config(finishEditing.bind(this, true), finishEditing.bind(this, false))); } /** @@ -219,8 +219,8 @@ } _update() { - var details = WebInspector.context.flavor(WebInspector.DebuggerPausedDetails); - if (!details || details.reason !== WebInspector.DebuggerModel.BreakReason.XHR) { + var details = UI.context.flavor(SDK.DebuggerPausedDetails); + if (!details || details.reason !== SDK.DebuggerModel.BreakReason.XHR) { if (this._highlightedElement) { this._highlightedElement.classList.remove('breakpoint-hit'); delete this._highlightedElement; @@ -231,7 +231,7 @@ var element = this._breakpointElements.get(url); if (!element) return; - WebInspector.viewManager.showView('sources.xhrBreakpoints'); + UI.viewManager.showView('sources.xhrBreakpoints'); element.classList.add('breakpoint-hit'); this._highlightedElement = element; } @@ -244,7 +244,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ _restoreBreakpoints(target) { var breakpoints = this._xhrBreakpointsSetting.get();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/module.json b/third_party/WebKit/Source/devtools/front_end/sources/module.json index cc05e3e1..6c5e2a9 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sources/module.json
@@ -6,21 +6,21 @@ "id": "sources", "title": "Sources", "order": 30, - "className": "WebInspector.SourcesPanel" + "className": "Sources.SourcesPanel" }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.UISourceCode", "WebInspector.UILocation", "WebInspector.RemoteObject", "WebInspector.NetworkRequest", "WebInspector.UISourceCodeFrame"], - "className": "WebInspector.SourcesPanel" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["Workspace.UISourceCode", "Workspace.UILocation", "SDK.RemoteObject", "SDK.NetworkRequest", "Sources.UISourceCodeFrame"], + "className": "Sources.SourcesPanel" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Debugger", "actionId": "debugger.toggle-pause", "iconClass": "largeicon-pause", "toggledIconClass": "largeicon-resume", - "className": "WebInspector.SourcesPanel.RevealingActionDelegate", - "contextTypes": ["WebInspector.SourcesPanel", "WebInspector.ShortcutRegistry.ForwardedShortcut"], + "className": "Sources.SourcesPanel.RevealingActionDelegate", + "contextTypes": ["Sources.SourcesPanel", "UI.ShortcutRegistry.ForwardedShortcut"], "options": [ { "value": true, "title": "Pause script execution" }, { "value": false, "title": "Resume script execution" } @@ -37,12 +37,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "debugger.step-over", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", + "className": "Sources.SourcesPanel.DebuggingActionDelegate", "title": "Step over next function call", "iconClass": "largeicon-step-over", - "contextTypes": ["WebInspector.SourcesPanel"], + "contextTypes": ["Sources.SourcesPanel"], "bindings": [ { "platform": "windows,linux", @@ -55,12 +55,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "debugger.step-into", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", + "className": "Sources.SourcesPanel.DebuggingActionDelegate", "title": "Step into next function call", "iconClass": "largeicon-step-in", - "contextTypes": ["WebInspector.SourcesPanel"], + "contextTypes": ["Sources.SourcesPanel"], "bindings": [ { "platform": "windows,linux", @@ -73,12 +73,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "debugger.step-out", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", + "className": "Sources.SourcesPanel.DebuggingActionDelegate", "title": "Step out of current function", "iconClass": "largeicon-step-out", - "contextTypes": ["WebInspector.SourcesPanel"], + "contextTypes": ["Sources.SourcesPanel"], "bindings": [ { "platform": "windows,linux", @@ -91,12 +91,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "debugger.run-snippet", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", + "className": "Sources.SourcesPanel.DebuggingActionDelegate", "title": "Run snippet", "iconClass": "largeicon-play", - "contextTypes": ["WebInspector.SourcesPanel"], + "contextTypes": ["Sources.SourcesPanel"], "bindings": [ { "platform": "windows,linux", @@ -109,10 +109,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "sources.search.toggle", "title": "Search all files", - "className": "WebInspector.AdvancedSearchView.ActionDelegate", + "className": "Sources.AdvancedSearchView.ActionDelegate", "category": "DevTools", "bindings": [ { @@ -126,13 +126,13 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Debugger", "actionId": "debugger.toggle-breakpoints-active", "iconClass": "largeicon-deactivate-breakpoints", "toggledIconClass": "largeicon-activate-breakpoints", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", - "contextTypes": ["WebInspector.SourcesPanel"], + "className": "Sources.SourcesPanel.DebuggingActionDelegate", + "contextTypes": ["Sources.SourcesPanel"], "options": [ { "value": true, "title": "Deactivate breakpoints" }, { "value": false, "title": "Activate breakpoints" } @@ -149,11 +149,11 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "sources.add-to-watch", - "className": "WebInspector.WatchExpressionsSidebarPane", + "className": "Sources.WatchExpressionsSidebarPane", "title": "Add selected text to watches", - "contextTypes": ["WebInspector.UISourceCodeFrame"], + "contextTypes": ["Sources.UISourceCodeFrame"], "bindings": [ { "shortcut": "Ctrl+Shift+A'" @@ -161,16 +161,16 @@ ] }, { - "type": "@WebInspector.ContextMenu.Provider", - "contextTypes": ["WebInspector.CodeMirrorTextEditor"], - "className": "WebInspector.WatchExpressionsSidebarPane" + "type": "@UI.ContextMenu.Provider", + "contextTypes": ["TextEditor.CodeMirrorTextEditor"], + "className": "Sources.WatchExpressionsSidebarPane" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "debugger.evaluate-selection", - "className": "WebInspector.SourcesPanel.DebuggingActionDelegate", + "className": "Sources.SourcesPanel.DebuggingActionDelegate", "title": "Evaluate in console", - "contextTypes": ["WebInspector.UISourceCodeFrame"], + "contextTypes": ["Sources.UISourceCodeFrame"], "bindings": [ { "shortcut": "Ctrl+E'" @@ -188,32 +188,32 @@ "actionId": "sources.go-to-source" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.UILocation"], - "className": "WebInspector.SourcesPanel.UILocationRevealer" + "type": "@Common.Revealer", + "contextTypes": ["Workspace.UILocation"], + "className": "Sources.SourcesPanel.UILocationRevealer" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.DebuggerModel.Location"], - "className": "WebInspector.SourcesPanel.DebuggerLocationRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.DebuggerModel.Location"], + "className": "Sources.SourcesPanel.DebuggerLocationRevealer" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.UISourceCode"], - "className": "WebInspector.SourcesPanel.UISourceCodeRevealer" + "type": "@Common.Revealer", + "contextTypes": ["Workspace.UISourceCode"], + "className": "Sources.SourcesPanel.UISourceCodeRevealer" }, { - "type": "@WebInspector.Revealer", - "contextTypes": ["WebInspector.DebuggerPausedDetails"], - "className": "WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer" + "type": "@Common.Revealer", + "contextTypes": ["SDK.DebuggerPausedDetails"], + "className": "Sources.SourcesPanel.DebuggerPausedDetailsRevealer" }, { - "type": "@WebInspector.SourcesView.EditorAction", - "className": "WebInspector.InplaceFormatterEditorAction" + "type": "@Sources.SourcesView.EditorAction", + "className": "Sources.InplaceFormatterEditorAction" }, { - "type": "@WebInspector.SourcesView.EditorAction", - "className": "WebInspector.ScriptFormatterEditorAction" + "type": "@Sources.SourcesView.EditorAction", + "className": "Sources.ScriptFormatterEditorAction" }, { "type": "view", @@ -222,7 +222,7 @@ "title": "Sources", "order": 1, "persistence": "permanent", - "className": "WebInspector.SourcesNavigatorView", + "className": "Sources.SourcesNavigatorView", "experiment": "!persistence2" }, { @@ -232,7 +232,7 @@ "title": "Network", "order": 2, "persistence": "permanent", - "className": "WebInspector.NetworkNavigatorView", + "className": "Sources.NetworkNavigatorView", "experiment": "persistence2" }, { @@ -242,7 +242,7 @@ "title": "Filesystem", "order": 3, "persistence": "permanent", - "className": "WebInspector.FilesNavigatorView", + "className": "Sources.FilesNavigatorView", "experiment": "persistence2" }, { @@ -252,7 +252,7 @@ "title": "Content scripts", "order": 4, "persistence": "permanent", - "className": "WebInspector.ContentScriptsNavigatorView" + "className": "Sources.ContentScriptsNavigatorView" }, { "type": "view", @@ -261,41 +261,41 @@ "title": "Snippets", "order": 5, "persistence": "permanent", - "className": "WebInspector.SnippetsNavigatorView" + "className": "Sources.SnippetsNavigatorView" }, { - "type": "@WebInspector.NavigatorView", + "type": "@Sources.NavigatorView", "viewId": "navigator-sources", - "className": "WebInspector.SourcesNavigatorView", + "className": "Sources.SourcesNavigatorView", "experiment": "!persistence2" }, { - "type": "@WebInspector.NavigatorView", + "type": "@Sources.NavigatorView", "viewId": "navigator-network", - "className": "WebInspector.NetworkNavigatorView", + "className": "Sources.NetworkNavigatorView", "experiment": "persistence2" }, { - "type": "@WebInspector.NavigatorView", + "type": "@Sources.NavigatorView", "viewId": "navigator-files", - "className": "WebInspector.FilesNavigatorView", + "className": "Sources.FilesNavigatorView", "experiment": "persistence2" }, { - "type": "@WebInspector.NavigatorView", + "type": "@Sources.NavigatorView", "viewId": "navigator-contentScripts", - "className": "WebInspector.ContentScriptsNavigatorView" + "className": "Sources.ContentScriptsNavigatorView" }, { - "type": "@WebInspector.NavigatorView", + "type": "@Sources.NavigatorView", "viewId": "navigator-snippets", - "className": "WebInspector.SnippetsNavigatorView" + "className": "Sources.SnippetsNavigatorView" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "sources.go-to-source", "title": "Go to file...", - "className": "WebInspector.SourcesPanel.RevealingActionDelegate", + "className": "Sources.SourcesPanel.RevealingActionDelegate", "order": 100, "bindings": [ { @@ -309,10 +309,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "sources.switch-file", - "className": "WebInspector.SourcesView.SwitchFileActionDelegate", - "contextTypes": ["WebInspector.SourcesView"], + "className": "Sources.SourcesView.SwitchFileActionDelegate", + "contextTypes": ["Sources.SourcesView"], "bindings": [ { "shortcut": "Alt+O" @@ -409,7 +409,7 @@ "title": "Search", "persistence": "closeable", "order": 100, - "className": "WebInspector.AdvancedSearchView" + "className": "Sources.AdvancedSearchView" }, { "type": "view", @@ -417,7 +417,7 @@ "id": "sources.history", "title": "History", "persistence": "transient", - "className": "WebInspector.RevisionHistoryView" + "className": "Sources.RevisionHistoryView" }, { "type": "view", @@ -426,24 +426,24 @@ "title": "Quick source", "persistence": "closeable", "order": 1000, - "className": "WebInspector.SourcesPanel.WrapperView" + "className": "Sources.SourcesPanel.WrapperView" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Sources", "actionId": "sources.close-all", - "className": "WebInspector.SourcesView.CloseAllActionDelegate", + "className": "Sources.SourcesView.CloseAllActionDelegate", "title": "Close All" }, { - "type": "@WebInspector.ViewLocationResolver", + "type": "@UI.ViewLocationResolver", "name": "navigator-view", - "className": "WebInspector.SourcesPanel" + "className": "Sources.SourcesPanel" }, { - "type": "@WebInspector.ViewLocationResolver", + "type": "@UI.ViewLocationResolver", "name": "sources-sidebar", - "className": "WebInspector.SourcesPanel" + "className": "Sources.SourcesPanel" }, { "type": "view", @@ -453,7 +453,7 @@ "order": 5, "hasToolbar": "true", "persistence": "permanent", - "className": "WebInspector.XHRBreakpointsSidebarPane" + "className": "Sources.XHRBreakpointsSidebarPane" }, { "type": "view", @@ -462,7 +462,7 @@ "title": "DOM Breakpoints", "order": 7, "persistence": "permanent", - "factoryName": "WebInspector.DOMBreakpointsSidebarPane.Proxy" + "factoryName": "Components.DOMBreakpointsSidebarPane.Proxy" }, { "type": "view", @@ -472,7 +472,7 @@ "order": 8, "hasToolbar": "true", "persistence": "permanent", - "className": "WebInspector.ObjectEventListenersSidebarPane" + "className": "Sources.ObjectEventListenersSidebarPane" }, { "type": "view", @@ -481,21 +481,21 @@ "title": "Event Listener Breakpoints", "order": 9, "persistence": "permanent", - "className": "WebInspector.EventListenerBreakpointsSidebarPane" + "className": "Sources.EventListenerBreakpointsSidebarPane" }, { "type": "view", "id": "sources.threads", "title": "Threads", "persistence": "permanent", - "className": "WebInspector.ThreadsSidebarPane" + "className": "Sources.ThreadsSidebarPane" }, { "type": "view", "id": "sources.scopeChain", "title": "Scope", "persistence": "permanent", - "className": "WebInspector.ScopeChainSidebarPane" + "className": "Sources.ScopeChainSidebarPane" }, { "type": "view", @@ -503,39 +503,39 @@ "title": "Watch", "hasToolbar": true, "persistence": "permanent", - "className": "WebInspector.WatchExpressionsSidebarPane" + "className": "Sources.WatchExpressionsSidebarPane" }, { "type": "view", "id": "sources.jsBreakpoints", "title": "Breakpoints", "persistence": "permanent", - "className": "WebInspector.JavaScriptBreakpointsSidebarPane" + "className": "Sources.JavaScriptBreakpointsSidebarPane" }, { - "type": "@WebInspector.ContextFlavorListener", - "contextTypes": ["WebInspector.DebuggerPausedDetails"], - "className": "WebInspector.JavaScriptBreakpointsSidebarPane" + "type": "@UI.ContextFlavorListener", + "contextTypes": ["SDK.DebuggerPausedDetails"], + "className": "Sources.JavaScriptBreakpointsSidebarPane" }, { - "type": "@WebInspector.ContextFlavorListener", - "contextTypes": ["WebInspector.DebuggerPausedDetails"], - "className": "WebInspector.XHRBreakpointsSidebarPane" + "type": "@UI.ContextFlavorListener", + "contextTypes": ["SDK.DebuggerPausedDetails"], + "className": "Sources.XHRBreakpointsSidebarPane" }, { - "type": "@WebInspector.ContextFlavorListener", - "contextTypes": ["WebInspector.DebuggerPausedDetails"], - "className": "WebInspector.DOMBreakpointsSidebarPane" + "type": "@UI.ContextFlavorListener", + "contextTypes": ["SDK.DebuggerPausedDetails"], + "className": "Components.DOMBreakpointsSidebarPane" }, { - "type": "@WebInspector.ContextFlavorListener", - "contextTypes": ["WebInspector.DebuggerPausedDetails"], - "className": "WebInspector.CallStackSidebarPane" + "type": "@UI.ContextFlavorListener", + "contextTypes": ["SDK.DebuggerPausedDetails"], + "className": "Sources.CallStackSidebarPane" }, { - "type": "@WebInspector.ContextFlavorListener", - "contextTypes": ["WebInspector.DebuggerModel.CallFrame"], - "className": "WebInspector.ScopeChainSidebarPane" + "type": "@UI.ContextFlavorListener", + "contextTypes": ["SDK.DebuggerModel.CallFrame"], + "className": "Sources.ScopeChainSidebarPane" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/terminal/TerminalWidget.js b/third_party/WebKit/Source/devtools/front_end/terminal/TerminalWidget.js index 3f44032..ca55518a 100644 --- a/third_party/WebKit/Source/devtools/front_end/terminal/TerminalWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/terminal/TerminalWidget.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.TerminalWidget = class extends WebInspector.VBox { +Terminal.TerminalWidget = class extends UI.VBox { constructor() { super(false); this.registerRequiredCSS('terminal/xterm.js/build/xterm.css'); @@ -12,23 +12,23 @@ this.element.classList.add('terminal-root'); this.element.addEventListener('mousemove', this._mouseMove.bind(this), false); this._init(); - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); this._linkifyFunction = this._linkifyURL.bind(this); } _init() { - WebInspector.serviceManager.createRemoteService('Terminal').then(this._initialized.bind(this)); + Services.serviceManager.createRemoteService('Terminal').then(this._initialized.bind(this)); } /** - * @param {?WebInspector.ServiceManager.Service} backend + * @param {?Services.ServiceManager.Service} backend */ _initialized(backend) { if (!backend) { if (!this._unavailableLabel) { this._unavailableLabel = this.element.createChild('div', 'terminal-error-message fill'); this._unavailableLabel.createChild('div').textContent = - WebInspector.UIString('Terminal service is not available'); + Common.UIString('Terminal service is not available'); } if (this.isShowing()) setTimeout(this._init.bind(this), 2000); @@ -111,7 +111,7 @@ } var nextNode = node.nextSibling; node.remove(); - var linkified = WebInspector.linkifyStringAsFragmentWithCustomLinkifier(node.textContent, this._linkifyFunction); + var linkified = Components.linkifyStringAsFragmentWithCustomLinkifier(node.textContent, this._linkifyFunction); line.insertBefore(linkified, nextNode); node = nextNode; }
diff --git a/third_party/WebKit/Source/devtools/front_end/terminal/module.json b/third_party/WebKit/Source/devtools/front_end/terminal/module.json index 1c4dfc6..c00e963 100644 --- a/third_party/WebKit/Source/devtools/front_end/terminal/module.json +++ b/third_party/WebKit/Source/devtools/front_end/terminal/module.json
@@ -7,7 +7,7 @@ "title": "Terminal", "order": 10, "persistence": "closeable", - "factoryName": "WebInspector.TerminalWidget" + "factoryName": "Terminal.TerminalWidget" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js index 8e3f3f71..5e1c09da 100644 --- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
@@ -28,12 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TextEditor} + * @implements {UI.TextEditor} * @unrestricted */ -WebInspector.CodeMirrorTextEditor = class extends WebInspector.VBox { +TextEditor.CodeMirrorTextEditor = class extends UI.VBox { /** - * @param {!WebInspector.TextEditor.Options} options + * @param {!UI.TextEditor.Options} options */ constructor(options) { super(); @@ -42,7 +42,7 @@ this.registerRequiredCSS('cm/codemirror.css'); this.registerRequiredCSS('text_editor/cmdevtools.css'); - WebInspector.CodeMirrorUtils.appendThemeStyle(this.element); + TextEditor.CodeMirrorUtils.appendThemeStyle(this.element); this._codeMirror = new window.CodeMirror(this.element, { lineNumbers: options.lineNumbers, @@ -128,22 +128,22 @@ options.bracketMatchingSetting.addChangeListener(this._enableBracketMatchingIfNeeded, this); this._enableBracketMatchingIfNeeded(); - this._codeMirror.setOption('keyMap', WebInspector.isMac() ? 'devtools-mac' : 'devtools-pc'); + this._codeMirror.setOption('keyMap', Host.isMac() ? 'devtools-mac' : 'devtools-pc'); this._codeMirror.addKeyMap({'\'': 'maybeAvoidSmartSingleQuotes', '\'"\'': 'maybeAvoidSmartDoubleQuotes'}); this._codeMirror.setOption('flattenSpans', false); - this._codeMirror.setOption('maxHighlightLength', WebInspector.CodeMirrorTextEditor.maxHighlightLength); + this._codeMirror.setOption('maxHighlightLength', TextEditor.CodeMirrorTextEditor.maxHighlightLength); this._codeMirror.setOption('mode', null); this._codeMirror.setOption('crudeMeasuringFrom', 1000); this._shouldClearHistory = true; this._lineSeparator = '\n'; - this._fixWordMovement = new WebInspector.CodeMirrorTextEditor.FixWordMovement(this._codeMirror); + this._fixWordMovement = new TextEditor.CodeMirrorTextEditor.FixWordMovement(this._codeMirror); this._selectNextOccurrenceController = - new WebInspector.CodeMirrorTextEditor.SelectNextOccurrenceController(this, this._codeMirror); + new TextEditor.CodeMirrorTextEditor.SelectNextOccurrenceController(this, this._codeMirror); this._codeMirror.on('changes', this._changes.bind(this)); this._codeMirror.on('beforeSelectionChange', this._beforeSelectionChange.bind(this)); @@ -153,7 +153,7 @@ this._codeMirrorElement.classList.add('source-code'); this._codeMirrorElement.classList.add('fill'); - /** @type {!Multimap<number, !WebInspector.CodeMirrorTextEditor.Decoration>} */ + /** @type {!Multimap<number, !TextEditor.CodeMirrorTextEditor.Decoration>} */ this._decorations = new Multimap(); this._nestedUpdatesCounter = 0; @@ -267,10 +267,10 @@ * @return {!Promise} */ static _loadMimeTypeModes(mimeType) { - var installed = WebInspector.CodeMirrorTextEditor._loadedMimeModeExtensions; + var installed = TextEditor.CodeMirrorTextEditor._loadedMimeModeExtensions; var nameToExtension = new Map(); - var extensions = self.runtime.extensions(WebInspector.CodeMirrorMimeMode); + var extensions = self.runtime.extensions(TextEditor.CodeMirrorMimeMode); for (var extension of extensions) nameToExtension.set(extension.descriptor()['fileName'], extension); @@ -301,7 +301,7 @@ function installMode(extension, instance) { if (installed.has(extension)) return; - var mode = /** @type {!WebInspector.CodeMirrorMimeMode} */ (instance); + var mode = /** @type {!TextEditor.CodeMirrorMimeMode} */ (instance); mode.install(extension); installed.add(extension); } @@ -317,14 +317,14 @@ /** * @override - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ widget() { return this; } _onKeyHandled() { - WebInspector.shortcutRegistry.dismissPendingShortcutAction(); + UI.shortcutRegistry.dismissPendingShortcutAction(); } /** @@ -373,8 +373,8 @@ var position = charNumber; var nextPosition = charNumber + 1; return valid(position, text.length) && valid(nextPosition, text.length) && - WebInspector.TextUtils.isWordChar(text[position]) && WebInspector.TextUtils.isWordChar(text[nextPosition]) && - WebInspector.TextUtils.isUpperCase(text[position]) && WebInspector.TextUtils.isLowerCase(text[nextPosition]); + Common.TextUtils.isWordChar(text[position]) && Common.TextUtils.isWordChar(text[nextPosition]) && + Common.TextUtils.isUpperCase(text[position]) && Common.TextUtils.isLowerCase(text[nextPosition]); } /** @@ -386,8 +386,8 @@ var position = charNumber; var prevPosition = charNumber - 1; return valid(position, text.length) && valid(prevPosition, text.length) && - WebInspector.TextUtils.isWordChar(text[position]) && WebInspector.TextUtils.isWordChar(text[prevPosition]) && - WebInspector.TextUtils.isUpperCase(text[position]) && WebInspector.TextUtils.isLowerCase(text[prevPosition]); + Common.TextUtils.isWordChar(text[position]) && Common.TextUtils.isWordChar(text[prevPosition]) && + Common.TextUtils.isUpperCase(text[position]) && Common.TextUtils.isLowerCase(text[prevPosition]); } /** @@ -409,13 +409,13 @@ var charNumber = direction === 1 ? columnNumber : columnNumber - 1; // Move through initial spaces if any. - while (valid(charNumber, length) && WebInspector.TextUtils.isSpaceChar(text[charNumber])) + while (valid(charNumber, length) && Common.TextUtils.isSpaceChar(text[charNumber])) charNumber += direction; if (!valid(charNumber, length)) return constrainPosition(lineNumber, length, charNumber); - if (WebInspector.TextUtils.isStopChar(text[charNumber])) { - while (valid(charNumber, length) && WebInspector.TextUtils.isStopChar(text[charNumber])) + if (Common.TextUtils.isStopChar(text[charNumber])) { + while (valid(charNumber, length) && Common.TextUtils.isStopChar(text[charNumber])) charNumber += direction; if (!valid(charNumber, length)) return constrainPosition(lineNumber, length, charNumber); @@ -424,7 +424,7 @@ charNumber += direction; while (valid(charNumber, length) && !isWordStart(text, charNumber) && !isWordEnd(text, charNumber) && - WebInspector.TextUtils.isWordChar(text[charNumber])) + Common.TextUtils.isWordChar(text[charNumber])) charNumber += direction; if (!valid(charNumber, length)) @@ -518,7 +518,7 @@ /** * @override - * @param {?WebInspector.AutocompleteConfig} config + * @param {?UI.AutocompleteConfig} config */ configureAutocomplete(config) { if (this._autocompleteController) { @@ -527,7 +527,7 @@ } if (config) - this._autocompleteController = new WebInspector.TextEditorAutocompleteController(this, this._codeMirror, config); + this._autocompleteController = new TextEditor.TextEditorAutocompleteController(this, this._codeMirror, config); } /** @@ -546,7 +546,7 @@ /** * @param {number} x * @param {number} y - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ coordinatesToCursorPosition(x, y) { var element = this.element.ownerDocument.elementFromPoint(x, y); @@ -557,7 +557,7 @@ y <= gutterBox.y + gutterBox.height) return null; var coords = this._codeMirror.coordsChar({left: x, top: y}); - return WebInspector.CodeMirrorUtils.toRange(coords, coords); + return TextEditor.CodeMirrorUtils.toRange(coords, coords); } /** @@ -590,7 +590,7 @@ */ _hasLongLines() { function lineIterator(lineHandle) { - if (lineHandle.text.length > WebInspector.CodeMirrorTextEditor.LongLineModeLineLengthThreshold) + if (lineHandle.text.length > TextEditor.CodeMirrorTextEditor.LongLineModeLineLengthThreshold) hasLongLines = true; return hasLongLines; } @@ -616,7 +616,7 @@ this._enableLongLinesMode(); else this._disableLongLinesMode(); - return WebInspector.CodeMirrorTextEditor._loadMimeTypeModes(mimeType).then( + return TextEditor.CodeMirrorTextEditor._loadMimeTypeModes(mimeType).then( () => this._codeMirror.setOption('mode', mimeType)); } @@ -649,10 +649,10 @@ * @param {!Element} element * @param {symbol} type * @param {boolean=} insertBefore - * @return {!WebInspector.TextEditorBookMark} + * @return {!TextEditor.TextEditorBookMark} */ addBookmark(lineNumber, columnNumber, element, type, insertBefore) { - var bookmark = new WebInspector.TextEditorBookMark( + var bookmark = new TextEditor.TextEditorBookMark( this._codeMirror.setBookmark( new CodeMirror.Pos(lineNumber, columnNumber), {widget: element, insertLeft: insertBefore}), type, this); @@ -661,12 +661,12 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {symbol=} type - * @return {!Array.<!WebInspector.TextEditorBookMark>} + * @return {!Array.<!TextEditor.TextEditorBookMark>} */ bookmarks(range, type) { - var pos = WebInspector.CodeMirrorUtils.toPos(range); + var pos = TextEditor.CodeMirrorUtils.toPos(range); var markers = this._codeMirror.findMarksAt(pos.start); if (!range.isEmpty()) { var middleMarkers = this._codeMirror.findMarks(pos.start, pos.end); @@ -675,7 +675,7 @@ } var bookmarks = []; for (var i = 0; i < markers.length; i++) { - var bookmark = markers[i][WebInspector.TextEditorBookMark._symbol]; + var bookmark = markers[i][TextEditor.TextEditorBookMark._symbol]; if (bookmark && (!type || bookmark.type() === type)) bookmarks.push(bookmark); } @@ -772,7 +772,7 @@ this._decorations.get(lineNumber).forEach(innerUpdateDecorations); /** - * @param {!WebInspector.CodeMirrorTextEditor.Decoration} decoration + * @param {!TextEditor.CodeMirrorTextEditor.Decoration} decoration */ function innerUpdateDecorations(decoration) { if (decoration.update) @@ -788,8 +788,8 @@ this._decorations.get(lineNumber).forEach(innerRemoveDecoration.bind(this)); /** - * @this {WebInspector.CodeMirrorTextEditor} - * @param {!WebInspector.CodeMirrorTextEditor.Decoration} decoration + * @this {TextEditor.CodeMirrorTextEditor} + * @param {!TextEditor.CodeMirrorTextEditor.Decoration} decoration */ function innerRemoveDecoration(decoration) { if (decoration.element !== element) @@ -819,7 +819,7 @@ this._codeMirror.addLineClass(this._highlightedLine, null, 'cm-highlight'); this._clearHighlightTimeout = setTimeout(this.clearPositionHighlight.bind(this), 2000); } - this.setSelection(WebInspector.TextRange.createFromLocation(lineNumber, columnNumber)); + this.setSelection(Common.TextRange.createFromLocation(lineNumber, columnNumber)); } clearPositionHighlight() { @@ -893,15 +893,15 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {string} text * @param {string=} origin - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ editRange(range, text, origin) { - var pos = WebInspector.CodeMirrorUtils.toPos(range); + var pos = TextEditor.CodeMirrorUtils.toPos(range); this._codeMirror.replaceRange(text, pos.start, pos.end, origin); - return WebInspector.CodeMirrorUtils.toRange( + return TextEditor.CodeMirrorUtils.toRange( pos.start, this._codeMirror.posFromIndex(this._codeMirror.indexFromPos(pos.start) + text.length)); } @@ -917,7 +917,7 @@ * @param {number} lineNumber * @param {number} column * @param {function(string):boolean} isWordChar - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ wordRangeForCursorPosition(lineNumber, column, isWordChar) { var line = this.line(lineNumber); @@ -930,7 +930,7 @@ var wordEnd = column; while (wordEnd < line.length && isWordChar(line.charAt(wordEnd))) ++wordEnd; - return new WebInspector.TextRange(lineNumber, wordStart, lineNumber, wordEnd); + return new Common.TextRange(lineNumber, wordStart, lineNumber, wordEnd); } /** @@ -998,30 +998,30 @@ /** * @override - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ selection() { var start = this._codeMirror.getCursor('anchor'); var end = this._codeMirror.getCursor('head'); - return WebInspector.CodeMirrorUtils.toRange(start, end); + return TextEditor.CodeMirrorUtils.toRange(start, end); } /** - * @return {!Array.<!WebInspector.TextRange>} + * @return {!Array.<!Common.TextRange>} */ selections() { var selectionList = this._codeMirror.listSelections(); var result = []; for (var i = 0; i < selectionList.length; ++i) { var selection = selectionList[i]; - result.push(WebInspector.CodeMirrorUtils.toRange(selection.anchor, selection.head)); + result.push(TextEditor.CodeMirrorUtils.toRange(selection.anchor, selection.head)); } return result; } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ lastSelection() { return this._lastSelection; @@ -1029,7 +1029,7 @@ /** * @override - * @param {!WebInspector.TextRange} textRange + * @param {!Common.TextRange} textRange */ setSelection(textRange) { this._lastSelection = textRange; @@ -1037,18 +1037,18 @@ this._selectionSetScheduled = true; return; } - var pos = WebInspector.CodeMirrorUtils.toPos(textRange); + var pos = TextEditor.CodeMirrorUtils.toPos(textRange); this._codeMirror.setSelection(pos.start, pos.end); } /** - * @param {!Array.<!WebInspector.TextRange>} ranges + * @param {!Array.<!Common.TextRange>} ranges * @param {number=} primarySelectionIndex */ setSelections(ranges, primarySelectionIndex) { var selections = []; for (var i = 0; i < ranges.length; ++i) { - var selection = WebInspector.CodeMirrorUtils.toPos(ranges[i]); + var selection = TextEditor.CodeMirrorUtils.toPos(ranges[i]); selections.push({anchor: selection.start, head: selection.end}); } primarySelectionIndex = primarySelectionIndex || 0; @@ -1067,7 +1067,7 @@ * @param {string} text */ setText(text) { - if (text.length > WebInspector.CodeMirrorTextEditor.MaxEditableTextSize) { + if (text.length > TextEditor.CodeMirrorTextEditor.MaxEditableTextSize) { this.configureAutocomplete(null); this.setReadOnly(true); } @@ -1081,24 +1081,24 @@ /** * @override - * @param {!WebInspector.TextRange=} textRange + * @param {!Common.TextRange=} textRange * @return {string} */ text(textRange) { if (!textRange) return this._codeMirror.getValue().replace(/\n/g, this._lineSeparator); - var pos = WebInspector.CodeMirrorUtils.toPos(textRange.normalize()); + var pos = TextEditor.CodeMirrorUtils.toPos(textRange.normalize()); return this._codeMirror.getRange(pos.start, pos.end).replace(/\n/g, this._lineSeparator); } /** * @override - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ fullRange() { var lineCount = this.linesCount; var lastLine = this._codeMirror.getLine(lineCount - 1); - return WebInspector.CodeMirrorUtils.toRange( + return TextEditor.CodeMirrorUtils.toRange( new CodeMirror.Pos(0, 0), new CodeMirror.Pos(lineCount - 1, lastLine.length)); } @@ -1166,31 +1166,31 @@ /** * @param {number} lineNumber * @param {number} columnNumber - * @return {!WebInspector.TextEditorPositionHandle} + * @return {!TextEditor.TextEditorPositionHandle} */ textEditorPositionHandle(lineNumber, columnNumber) { - return new WebInspector.CodeMirrorPositionHandle(this._codeMirror, new CodeMirror.Pos(lineNumber, columnNumber)); + return new TextEditor.CodeMirrorPositionHandle(this._codeMirror, new CodeMirror.Pos(lineNumber, columnNumber)); } }; -WebInspector.CodeMirrorTextEditor.maxHighlightLength = 1000; +TextEditor.CodeMirrorTextEditor.maxHighlightLength = 1000; -CodeMirror.commands.autocomplete = WebInspector.CodeMirrorTextEditor.autocompleteCommand; +CodeMirror.commands.autocomplete = TextEditor.CodeMirrorTextEditor.autocompleteCommand; -CodeMirror.commands.undoLastSelection = WebInspector.CodeMirrorTextEditor.undoLastSelectionCommand; +CodeMirror.commands.undoLastSelection = TextEditor.CodeMirrorTextEditor.undoLastSelectionCommand; -CodeMirror.commands.selectNextOccurrence = WebInspector.CodeMirrorTextEditor.selectNextOccurrenceCommand; +CodeMirror.commands.selectNextOccurrence = TextEditor.CodeMirrorTextEditor.selectNextOccurrenceCommand; -CodeMirror.commands.moveCamelLeft = WebInspector.CodeMirrorTextEditor.moveCamelLeftCommand.bind(null, false); -CodeMirror.commands.selectCamelLeft = WebInspector.CodeMirrorTextEditor.moveCamelLeftCommand.bind(null, true); +CodeMirror.commands.moveCamelLeft = TextEditor.CodeMirrorTextEditor.moveCamelLeftCommand.bind(null, false); +CodeMirror.commands.selectCamelLeft = TextEditor.CodeMirrorTextEditor.moveCamelLeftCommand.bind(null, true); -CodeMirror.commands.moveCamelRight = WebInspector.CodeMirrorTextEditor.moveCamelRightCommand.bind(null, false); -CodeMirror.commands.selectCamelRight = WebInspector.CodeMirrorTextEditor.moveCamelRightCommand.bind(null, true); +CodeMirror.commands.moveCamelRight = TextEditor.CodeMirrorTextEditor.moveCamelRightCommand.bind(null, false); +CodeMirror.commands.selectCamelRight = TextEditor.CodeMirrorTextEditor.moveCamelRightCommand.bind(null, true); /** * @param {!CodeMirror} codeMirror @@ -1245,7 +1245,7 @@ var selections = codemirror.listSelections(); var selection = selections[0]; if (selections.length === 1) { - if (WebInspector.CodeMirrorUtils.toRange(selection.anchor, selection.head).isEmpty()) + if (TextEditor.CodeMirrorUtils.toRange(selection.anchor, selection.head).isEmpty()) return CodeMirror.Pass; codemirror.setSelection(selection.anchor, selection.anchor, {scroll: false}); codemirror._codeMirrorTextEditor.scrollLineIntoView(selection.anchor.line); @@ -1260,7 +1260,7 @@ * @return {!Object|undefined} */ CodeMirror.commands.smartPageUp = function(codemirror) { - if (codemirror._codeMirrorTextEditor.selection().equal(WebInspector.TextRange.createFromLocation(0, 0))) + if (codemirror._codeMirrorTextEditor.selection().equal(Common.TextRange.createFromLocation(0, 0))) return CodeMirror.Pass; codemirror.execCommand('goPageUp'); }; @@ -1276,18 +1276,18 @@ CodeMirror.commands.maybeAvoidSmartSingleQuotes = - WebInspector.CodeMirrorTextEditor._maybeAvoidSmartQuotes.bind(null, '\''); + TextEditor.CodeMirrorTextEditor._maybeAvoidSmartQuotes.bind(null, '\''); CodeMirror.commands.maybeAvoidSmartDoubleQuotes = - WebInspector.CodeMirrorTextEditor._maybeAvoidSmartQuotes.bind(null, '"'); + TextEditor.CodeMirrorTextEditor._maybeAvoidSmartQuotes.bind(null, '"'); -WebInspector.CodeMirrorTextEditor.LongLineModeLineLengthThreshold = 2000; -WebInspector.CodeMirrorTextEditor.MaxEditableTextSize = 1024 * 1024 * 10; +TextEditor.CodeMirrorTextEditor.LongLineModeLineLengthThreshold = 2000; +TextEditor.CodeMirrorTextEditor.MaxEditableTextSize = 1024 * 1024 * 10; /** - * @implements {WebInspector.TextEditorPositionHandle} + * @implements {TextEditor.TextEditorPositionHandle} * @unrestricted */ -WebInspector.CodeMirrorPositionHandle = class { +TextEditor.CodeMirrorPositionHandle = class { /** * @param {!CodeMirror} codeMirror * @param {!CodeMirror.Pos} pos @@ -1311,7 +1311,7 @@ /** * @override - * @param {!WebInspector.TextEditorPositionHandle} positionHandle + * @param {!TextEditor.TextEditorPositionHandle} positionHandle * @return {boolean} */ equal(positionHandle) { @@ -1323,7 +1323,7 @@ /** * @unrestricted */ -WebInspector.CodeMirrorTextEditor.FixWordMovement = class { +TextEditor.CodeMirrorTextEditor.FixWordMovement = class { /** * @param {!CodeMirror} codeMirror */ @@ -1360,7 +1360,7 @@ codeMirror.setExtending(false); } - var modifierKey = WebInspector.isMac() ? 'Alt' : 'Ctrl'; + var modifierKey = Host.isMac() ? 'Alt' : 'Ctrl'; var leftKey = modifierKey + '-Left'; var rightKey = modifierKey + '-Right'; var keyMap = {}; @@ -1375,9 +1375,9 @@ /** * @unrestricted */ -WebInspector.CodeMirrorTextEditor.SelectNextOccurrenceController = class { +TextEditor.CodeMirrorTextEditor.SelectNextOccurrenceController = class { /** - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!TextEditor.CodeMirrorTextEditor} textEditor * @param {!CodeMirror} codeMirror */ constructor(textEditor, codeMirror) { @@ -1391,8 +1391,8 @@ } /** - * @param {!Array.<!WebInspector.TextRange>} selections - * @param {!WebInspector.TextRange} range + * @param {!Array.<!Common.TextRange>} selections + * @param {!Common.TextRange} range * @return {boolean} */ _findRange(selections, range) { @@ -1441,19 +1441,19 @@ } /** - * @param {!Array.<!WebInspector.TextRange>} selections + * @param {!Array.<!Common.TextRange>} selections */ _expandSelectionsToWords(selections) { var newSelections = []; for (var i = 0; i < selections.length; ++i) { var selection = selections[i]; var startRangeWord = this._textEditor.wordRangeForCursorPosition( - selection.startLine, selection.startColumn, WebInspector.TextUtils.isWordChar) || - WebInspector.TextRange.createFromLocation(selection.startLine, selection.startColumn); + selection.startLine, selection.startColumn, Common.TextUtils.isWordChar) || + Common.TextRange.createFromLocation(selection.startLine, selection.startColumn); var endRangeWord = this._textEditor.wordRangeForCursorPosition( - selection.endLine, selection.endColumn, WebInspector.TextUtils.isWordChar) || - WebInspector.TextRange.createFromLocation(selection.endLine, selection.endColumn); - var newSelection = new WebInspector.TextRange( + selection.endLine, selection.endColumn, Common.TextUtils.isWordChar) || + Common.TextRange.createFromLocation(selection.endLine, selection.endColumn); + var newSelection = new Common.TextRange( startRangeWord.startLine, startRangeWord.startColumn, endRangeWord.endLine, endRangeWord.endColumn); newSelections.push(newSelection); } @@ -1462,9 +1462,9 @@ } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @param {boolean} fullWord - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ _findNextOccurrence(range, fullWord) { range = range.normalize(); @@ -1504,7 +1504,7 @@ if (typeof matchedLineNumber !== 'number') return null; - return new WebInspector.TextRange( + return new Common.TextRange( matchedLineNumber, matchedColumnNumber, matchedLineNumber, matchedColumnNumber + textToFind.length); } }; @@ -1513,35 +1513,35 @@ /** * @interface */ -WebInspector.TextEditorPositionHandle = function() {}; +TextEditor.TextEditorPositionHandle = function() {}; -WebInspector.TextEditorPositionHandle.prototype = { +TextEditor.TextEditorPositionHandle.prototype = { /** * @return {?{lineNumber: number, columnNumber: number}} */ resolve: function() {}, /** - * @param {!WebInspector.TextEditorPositionHandle} positionHandle + * @param {!TextEditor.TextEditorPositionHandle} positionHandle * @return {boolean} */ equal: function(positionHandle) {} }; -WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('css', 'css-'); -WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('javascript', 'js-'); -WebInspector.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('xml', 'xml-'); +TextEditor.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('css', 'css-'); +TextEditor.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('javascript', 'js-'); +TextEditor.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('xml', 'xml-'); /** @type {!Set<!Runtime.Extension>} */ -WebInspector.CodeMirrorTextEditor._loadedMimeModeExtensions = new Set(); +TextEditor.CodeMirrorTextEditor._loadedMimeModeExtensions = new Set(); /** * @interface */ -WebInspector.CodeMirrorMimeMode = function() {}; +TextEditor.CodeMirrorMimeMode = function() {}; -WebInspector.CodeMirrorMimeMode.prototype = { +TextEditor.CodeMirrorMimeMode.prototype = { /** * @param {!Runtime.Extension} extension */ @@ -1551,14 +1551,14 @@ /** * @unrestricted */ -WebInspector.TextEditorBookMark = class { +TextEditor.TextEditorBookMark = class { /** * @param {!CodeMirror.TextMarker} marker * @param {symbol} type - * @param {!WebInspector.CodeMirrorTextEditor} editor + * @param {!TextEditor.CodeMirrorTextEditor} editor */ constructor(marker, type, editor) { - marker[WebInspector.TextEditorBookMark._symbol] = this; + marker[TextEditor.TextEditorBookMark._symbol] = this; this._marker = marker; this._type = type; @@ -1587,15 +1587,15 @@ } /** - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ position() { var pos = this._marker.find(); - return pos ? WebInspector.TextRange.createFromLocation(pos.line, pos.ch) : null; + return pos ? Common.TextRange.createFromLocation(pos.line, pos.ch) : null; } }; -WebInspector.TextEditorBookMark._symbol = Symbol('WebInspector.TextEditorBookMark'); +TextEditor.TextEditorBookMark._symbol = Symbol('TextEditor.TextEditorBookMark'); /** * @typedef {{ @@ -1604,19 +1604,19 @@ * update: ?function() * }} */ -WebInspector.CodeMirrorTextEditor.Decoration; +TextEditor.CodeMirrorTextEditor.Decoration; /** - * @implements {WebInspector.TextEditorFactory} + * @implements {UI.TextEditorFactory} * @unrestricted */ -WebInspector.CodeMirrorTextEditorFactory = class { +TextEditor.CodeMirrorTextEditorFactory = class { /** * @override - * @param {!WebInspector.TextEditor.Options} options - * @return {!WebInspector.CodeMirrorTextEditor} + * @param {!UI.TextEditor.Options} options + * @return {!TextEditor.CodeMirrorTextEditor} */ createEditor(options) { - return new WebInspector.CodeMirrorTextEditor(options); + return new TextEditor.CodeMirrorTextEditor(options); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorUtils.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorUtils.js index 273205e..7879da12 100644 --- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorUtils.js
@@ -31,13 +31,13 @@ /** * @unrestricted */ -WebInspector.CodeMirrorUtils = class extends WebInspector.InplaceEditor { +TextEditor.CodeMirrorUtils = class extends UI.InplaceEditor { constructor() { super(); } /** - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range * @return {!{start: !CodeMirror.Pos, end: !CodeMirror.Pos}} */ static toPos(range) { @@ -50,18 +50,18 @@ /** * @param {!CodeMirror.Pos} start * @param {!CodeMirror.Pos} end - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ static toRange(start, end) { - return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch); + return new Common.TextRange(start.line, start.ch, end.line, end.ch); } /** * @param {!CodeMirror.ChangeObject} changeObject - * @return {{oldRange: !WebInspector.TextRange, newRange: !WebInspector.TextRange}} + * @return {{oldRange: !Common.TextRange, newRange: !Common.TextRange}} */ static changeObjectToEditOperation(changeObject) { - var oldRange = WebInspector.CodeMirrorUtils.toRange(changeObject.from, changeObject.to); + var oldRange = TextEditor.CodeMirrorUtils.toRange(changeObject.from, changeObject.to); var newRange = oldRange.clone(); var linesAdded = changeObject.text.length; if (linesAdded === 0) { @@ -99,7 +99,7 @@ * @param {!Element} element */ static appendThemeStyle(element) { - if (WebInspector.themeSupport.hasTheme()) + if (UI.themeSupport.hasTheme()) return; var backgroundColor = InspectorFrontendHost.getSelectionBackgroundColor(); var backgroundColorRule = @@ -136,7 +136,7 @@ setUpEditor(editingContext) { var element = editingContext.element; var config = editingContext.config; - editingContext.cssLoadView = new WebInspector.CodeMirrorCSSLoadView(); + editingContext.cssLoadView = new TextEditor.CodeMirrorCSSLoadView(); editingContext.cssLoadView.show(element); element.focus(); element.addEventListener('copy', this._consumeCopy, false); @@ -189,10 +189,10 @@ /** - * @implements {WebInspector.TokenizerFactory} + * @implements {Common.TokenizerFactory} * @unrestricted */ -WebInspector.CodeMirrorUtils.TokenizerFactory = class { +TextEditor.CodeMirrorUtils.TokenizerFactory = class { /** * @override * @param {string} mimeType @@ -217,7 +217,7 @@ /** * @unrestricted */ -WebInspector.CodeMirrorCSSLoadView = class extends WebInspector.VBox { +TextEditor.CodeMirrorCSSLoadView = class extends UI.VBox { /** * This bogus view is needed to load/unload CodeMirror-related CSS on demand. */ @@ -226,6 +226,6 @@ this.element.classList.add('hidden'); this.registerRequiredCSS('cm/codemirror.css'); this.registerRequiredCSS('text_editor/cmdevtools.css'); - WebInspector.CodeMirrorUtils.appendThemeStyle(this.element); + TextEditor.CodeMirrorUtils.appendThemeStyle(this.element); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js b/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js index 368d8388..808ee2cd 100644 --- a/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js +++ b/third_party/WebKit/Source/devtools/front_end/text_editor/TextEditorAutocompleteController.js
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.SuggestBoxDelegate} + * @implements {UI.SuggestBoxDelegate} * @unrestricted */ -WebInspector.TextEditorAutocompleteController = class { +TextEditor.TextEditorAutocompleteController = class { /** - * @param {!WebInspector.CodeMirrorTextEditor} textEditor + * @param {!TextEditor.CodeMirrorTextEditor} textEditor * @param {!CodeMirror} codeMirror - * @param {!WebInspector.AutocompleteConfig} config + * @param {!UI.AutocompleteConfig} config */ constructor(textEditor, codeMirror, config) { this._textEditor = textEditor; @@ -38,7 +38,7 @@ this._codeMirror.on('blur', this._blur); if (this._config.isWordChar) { this._codeMirror.on('beforeChange', this._beforeChange); - this._dictionary = new WebInspector.TextDictionary(); + this._dictionary = new Common.TextDictionary(); this._addWordsFromText(this._codeMirror.getValue()); } } @@ -71,12 +71,12 @@ * @param {string} text */ _addWordsFromText(text) { - WebInspector.TextUtils.textToWords( + Common.TextUtils.textToWords( text, /** @type {function(string):boolean} */ (this._config.isWordChar), addWord.bind(this)); /** * @param {string} word - * @this {WebInspector.TextEditorAutocompleteController} + * @this {TextEditor.TextEditorAutocompleteController} */ function addWord(word) { if (word.length && (word[0] < '0' || word[0] > '9')) @@ -88,7 +88,7 @@ * @param {string} text */ _removeWordsFromText(text) { - WebInspector.TextUtils.textToWords( + Common.TextUtils.textToWords( text, /** @type {function(string):boolean} */ (this._config.isWordChar), (word) => this._dictionary.removeWord(word)); } @@ -96,7 +96,7 @@ /** * @param {number} lineNumber * @param {number} columnNumber - * @return {?WebInspector.TextRange} + * @return {?Common.TextRange} */ _substituteRange(lineNumber, columnNumber) { var range = @@ -107,11 +107,11 @@ } /** - * @param {!WebInspector.TextRange} queryRange - * @param {!WebInspector.TextRange} substituteRange + * @param {!Common.TextRange} queryRange + * @param {!Common.TextRange} substituteRange * @param {boolean=} force * @param {string=} tokenType - * @return {!Promise.<!WebInspector.SuggestBox.Suggestions>} + * @return {!Promise.<!UI.SuggestBox.Suggestions>} */ _wordsWithQuery(queryRange, substituteRange, force, tokenType) { var external = @@ -147,7 +147,7 @@ var linesToUpdate = {}; for (var changeIndex = 0; changeIndex < changes.length; ++changeIndex) { var changeObject = changes[changeIndex]; - var editInfo = WebInspector.CodeMirrorUtils.changeObjectToEditOperation(changeObject); + var editInfo = TextEditor.CodeMirrorUtils.changeObjectToEditOperation(changeObject); for (var i = editInfo.newRange.startLine; i <= editInfo.newRange.endLine; ++i) linesToUpdate[i] = this._codeMirror.getLine(i); } @@ -192,7 +192,7 @@ } /** - * @param {!WebInspector.TextRange} mainSelection + * @param {!Common.TextRange} mainSelection * @return {boolean} */ _validateSelectionsContexts(mainSelection) { @@ -239,8 +239,8 @@ this._wordsWithQuery(queryRange, substituteRange, force, tokenType).then(wordsAcquired.bind(this)); /** - * @param {!WebInspector.SuggestBox.Suggestions} wordsWithQuery - * @this {WebInspector.TextEditorAutocompleteController} + * @param {!UI.SuggestBox.Suggestions} wordsWithQuery + * @this {TextEditor.TextEditorAutocompleteController} */ function wordsAcquired(wordsWithQuery) { if (!wordsWithQuery.length || (wordsWithQuery.length === 1 && query === wordsWithQuery[0].title) || @@ -250,7 +250,7 @@ return; } if (!this._suggestBox) - this._suggestBox = new WebInspector.SuggestBox(this, 20, this._config.captureEnter); + this._suggestBox = new UI.SuggestBox(this, 20, this._config.captureEnter); var oldQueryRange = this._queryRange; this._queryRange = queryRange; @@ -277,7 +277,7 @@ var cursor = this._codeMirror.getCursor('to'); if (this._hintMarker) { var position = this._hintMarker.position(); - if (!position || !position.equal(WebInspector.TextRange.createFromLocation(cursor.line, cursor.ch))) { + if (!position || !position.equal(Common.TextRange.createFromLocation(cursor.line, cursor.ch))) { this._hintMarker.clear(); this._hintMarker = null; } @@ -285,7 +285,7 @@ if (!this._hintMarker) this._hintMarker = this._textEditor.addBookmark( - cursor.line, cursor.ch, this._hintElement, WebInspector.TextEditorAutocompleteController.HintBookmark, true); + cursor.line, cursor.ch, this._hintElement, TextEditor.TextEditorAutocompleteController.HintBookmark, true); else if (this._lastHintText !== hint) this._hintMarker.refresh(); this._lastHintText = hint; @@ -301,7 +301,7 @@ } /** - * @param {!WebInspector.SuggestBox.Suggestions} suggestions + * @param {!UI.SuggestBox.Suggestions} suggestions */ _onSuggestionsShownForTest(suggestions) { } @@ -328,12 +328,12 @@ if (!this._suggestBox) return false; switch (event.keyCode) { - case WebInspector.KeyboardShortcut.Keys.Tab.code: + case UI.KeyboardShortcut.Keys.Tab.code: this._suggestBox.acceptSuggestion(); this.clearAutocomplete(); return true; - case WebInspector.KeyboardShortcut.Keys.End.code: - case WebInspector.KeyboardShortcut.Keys.Right.code: + case UI.KeyboardShortcut.Keys.End.code: + case UI.KeyboardShortcut.Keys.Right.code: if (this._isCursorAtEndOfLine()) { this._suggestBox.acceptSuggestion(); this.clearAutocomplete(); @@ -342,11 +342,11 @@ this.clearAutocomplete(); return false; } - case WebInspector.KeyboardShortcut.Keys.Left.code: - case WebInspector.KeyboardShortcut.Keys.Home.code: + case UI.KeyboardShortcut.Keys.Left.code: + case UI.KeyboardShortcut.Keys.Home.code: this.clearAutocomplete(); return false; - case WebInspector.KeyboardShortcut.Keys.Esc.code: + case UI.KeyboardShortcut.Keys.Esc.code: this.clearAutocomplete(); return true; } @@ -427,4 +427,4 @@ } }; -WebInspector.TextEditorAutocompleteController.HintBookmark = Symbol('hint'); +TextEditor.TextEditorAutocompleteController.HintBookmark = Symbol('hint');
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/module.json b/third_party/WebKit/Source/devtools/front_end/text_editor/module.json index c73cf0e..770c408 100644 --- a/third_party/WebKit/Source/devtools/front_end/text_editor/module.json +++ b/third_party/WebKit/Source/devtools/front_end/text_editor/module.json
@@ -1,16 +1,16 @@ { "extensions": [ { - "type": "@WebInspector.InplaceEditor", - "className": "WebInspector.CodeMirrorUtils" + "type": "@UI.InplaceEditor", + "className": "TextEditor.CodeMirrorUtils" }, { - "type": "@WebInspector.TokenizerFactory", - "className": "WebInspector.CodeMirrorUtils.TokenizerFactory" + "type": "@Common.TokenizerFactory", + "className": "TextEditor.CodeMirrorUtils.TokenizerFactory" }, { - "type": "@WebInspector.TextEditorFactory", - "className": "WebInspector.CodeMirrorTextEditorFactory" + "type": "@UI.TextEditorFactory", + "className": "TextEditor.CodeMirrorTextEditorFactory" } ], "dependencies": [
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js b/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js index 6e9766eb..9fd19ae 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js
@@ -28,14 +28,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TimelineModeView} + * @implements {Timeline.TimelineModeView} * @unrestricted */ -WebInspector.CountersGraph = class extends WebInspector.VBox { +Timeline.CountersGraph = class extends UI.VBox { /** - * @param {!WebInspector.TimelineModeViewDelegate} delegate - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!Timeline.TimelineModeViewDelegate} delegate + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(delegate, model, filters) { super(); @@ -45,16 +45,16 @@ this._delegate = delegate; this._model = model; this._filters = filters; - this._calculator = new WebInspector.CounterGraphCalculator(this._model); + this._calculator = new Timeline.CounterGraphCalculator(this._model); // Create selectors - this._infoWidget = new WebInspector.HBox(); + this._infoWidget = new UI.HBox(); this._infoWidget.element.classList.add('memory-counter-selector-swatches', 'timeline-toolbar-resizer'); this._infoWidget.show(this.element); - this._graphsContainer = new WebInspector.VBox(); + this._graphsContainer = new UI.VBox(); this._graphsContainer.show(this.element); - var canvasWidget = new WebInspector.VBoxWithResizeCallback(this._resize.bind(this)); + var canvasWidget = new UI.VBoxWithResizeCallback(this._resize.bind(this)); canvasWidget.show(this._graphsContainer.element); this._createCurrentValuesBar(); this._canvasContainer = canvasWidget.element; @@ -67,7 +67,7 @@ this._canvasContainer.addEventListener('mouseleave', this._onMouseLeave.bind(this), true); this._canvasContainer.addEventListener('click', this._onClick.bind(this), true); // We create extra timeline grid here to reuse its event dividers. - this._timelineGrid = new WebInspector.TimelineGrid(); + this._timelineGrid = new UI.TimelineGrid(); this._canvasContainer.appendChild(this._timelineGrid.dividersElement); this._counters = []; @@ -84,19 +84,19 @@ * @param {string} uiValueTemplate * @param {string} color * @param {function(number):string=} formatter - * @return {!WebInspector.CountersGraph.Counter} + * @return {!Timeline.CountersGraph.Counter} */ createCounter(uiName, uiValueTemplate, color, formatter) { - var counter = new WebInspector.CountersGraph.Counter(); + var counter = new Timeline.CountersGraph.Counter(); this._counters.push(counter); this._counterUI.push( - new WebInspector.CountersGraph.CounterUI(this, uiName, uiValueTemplate, color, counter, formatter)); + new Timeline.CountersGraph.CounterUI(this, uiName, uiValueTemplate, color, counter, formatter)); return counter; } /** * @override - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ view() { return this; @@ -147,7 +147,7 @@ } scheduleRefresh() { - WebInspector.invokeOnceAfterBatchUpdate(this, this.refresh); + UI.invokeOnceAfterBatchUpdate(this, this.refresh); } draw() { @@ -231,7 +231,7 @@ /** * @override - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event * @param {string=} regex * @param {boolean=} select */ @@ -240,14 +240,14 @@ /** * @override - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event */ highlightEvent(event) { } /** * @override - * @param {?WebInspector.TimelineSelection} selection + * @param {?Timeline.TimelineSelection} selection */ setSelection(selection) { } @@ -256,7 +256,7 @@ /** * @unrestricted */ -WebInspector.CountersGraph.Counter = class { +Timeline.CountersGraph.Counter = class { constructor() { this.times = []; this.values = []; @@ -309,7 +309,7 @@ } /** - * @param {!WebInspector.CounterGraphCalculator} calculator + * @param {!Timeline.CounterGraphCalculator} calculator */ _calculateVisibleIndexes(calculator) { var start = calculator.minimumBoundary(); @@ -344,13 +344,13 @@ /** * @unrestricted */ -WebInspector.CountersGraph.CounterUI = class { +Timeline.CountersGraph.CounterUI = class { /** - * @param {!WebInspector.CountersGraph} memoryCountersPane + * @param {!Timeline.CountersGraph} memoryCountersPane * @param {string} title * @param {string} currentValueLabel * @param {string} graphColor - * @param {!WebInspector.CountersGraph.Counter} counter + * @param {!Timeline.CountersGraph.Counter} counter * @param {(function(number): string)|undefined} formatter */ constructor(memoryCountersPane, title, currentValueLabel, graphColor, counter, formatter) { @@ -359,10 +359,10 @@ this._formatter = formatter || Number.withThousandsSeparator; var container = memoryCountersPane._infoWidget.element.createChild('div', 'memory-counter-selector-info'); - this._setting = WebInspector.settings.createSetting('timelineCountersGraph-' + title, true); - this._filter = new WebInspector.ToolbarCheckbox(title, title, this._setting); + this._setting = Common.settings.createSetting('timelineCountersGraph-' + title, true); + this._filter = new UI.ToolbarCheckbox(title, title, this._setting); this._filter.inputElement.classList.add('-theme-preserve'); - var color = WebInspector.Color.parse(graphColor).setAlpha(0.5).asString(WebInspector.Color.Format.RGBA); + var color = Common.Color.parse(graphColor).setAlpha(0.5).asString(Common.Color.Format.RGBA); if (color) { this._filter.element.backgroundColor = color; this._filter.element.borderColor = 'transparent'; @@ -374,7 +374,7 @@ this._value = memoryCountersPane._currentValuesBar.createChild('span', 'memory-counter-value'); this._value.style.color = graphColor; this.graphColor = graphColor; - this.limitColor = WebInspector.Color.parse(graphColor).setAlpha(0.3).asString(WebInspector.Color.Format.RGBA); + this.limitColor = Common.Color.parse(graphColor).setAlpha(0.3).asString(Common.Color.Format.RGBA); this.graphYValues = []; this._verticalPadding = 10; @@ -395,11 +395,11 @@ setRange(minValue, maxValue) { var min = this._formatter(minValue); var max = this._formatter(maxValue); - this._range.textContent = WebInspector.UIString('[%s\u2009\u2013\u2009%s]', min, max); + this._range.textContent = Common.UIString('[%s\u2009\u2013\u2009%s]', min, max); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _toggleCounterGraph(event) { this._value.classList.toggle('hidden', !this._filter.checked()); @@ -424,7 +424,7 @@ return; var index = this._recordIndexAt(x); var value = Number.withThousandsSeparator(this.counter.values[index]); - this._value.textContent = WebInspector.UIString(this._currentValueLabel, value); + this._value.textContent = Common.UIString(this._currentValueLabel, value); var y = this.graphYValues[index] / window.devicePixelRatio; this._marker.style.left = x + 'px'; this._marker.style.top = y + 'px'; @@ -508,12 +508,12 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.CounterGraphCalculator = class { +Timeline.CounterGraphCalculator = class { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { this._model = model; @@ -547,7 +547,7 @@ */ setDisplayWindow(clientWidth, paddingLeft) { this._paddingLeft = paddingLeft || 0; - this._workingArea = clientWidth - WebInspector.CounterGraphCalculator._minWidth - this._paddingLeft; + this._workingArea = clientWidth - Timeline.CounterGraphCalculator._minWidth - this._paddingLeft; } /** @@ -593,4 +593,4 @@ } }; -WebInspector.CounterGraphCalculator._minWidth = 5; +Timeline.CounterGraphCalculator._minWidth = 5;
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js b/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js index b014a170..20af2111 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js
@@ -28,29 +28,29 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.TimelineModeView} + * @implements {Timeline.TimelineModeView} * @unrestricted */ -WebInspector.MemoryCountersGraph = class extends WebInspector.CountersGraph { +Timeline.MemoryCountersGraph = class extends Timeline.CountersGraph { /** - * @param {!WebInspector.TimelineModeViewDelegate} delegate - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!Timeline.TimelineModeViewDelegate} delegate + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(delegate, model, filters) { super(delegate, model, filters); this._countersByName = {}; this._countersByName['jsHeapSizeUsed'] = this.createCounter( - WebInspector.UIString('JS Heap'), WebInspector.UIString('JS Heap: %s'), 'hsl(220, 90%, 43%)', + Common.UIString('JS Heap'), Common.UIString('JS Heap: %s'), 'hsl(220, 90%, 43%)', Number.bytesToString); this._countersByName['documents'] = this.createCounter( - WebInspector.UIString('Documents'), WebInspector.UIString('Documents: %s'), 'hsl(0, 90%, 43%)'); + Common.UIString('Documents'), Common.UIString('Documents: %s'), 'hsl(0, 90%, 43%)'); this._countersByName['nodes'] = - this.createCounter(WebInspector.UIString('Nodes'), WebInspector.UIString('Nodes: %s'), 'hsl(120, 90%, 43%)'); + this.createCounter(Common.UIString('Nodes'), Common.UIString('Nodes: %s'), 'hsl(120, 90%, 43%)'); this._countersByName['jsEventListeners'] = this.createCounter( - WebInspector.UIString('Listeners'), WebInspector.UIString('Listeners: %s'), 'hsl(38, 90%, 43%)'); + Common.UIString('Listeners'), Common.UIString('Listeners: %s'), 'hsl(38, 90%, 43%)'); this._gpuMemoryCounter = this.createCounter( - WebInspector.UIString('GPU Memory'), WebInspector.UIString('GPU Memory [KB]: %s'), 'hsl(300, 90%, 43%)', + Common.UIString('GPU Memory'), Common.UIString('GPU Memory [KB]: %s'), 'hsl(300, 90%, 43%)', Number.bytesToString); this._countersByName['gpuMemoryUsedKB'] = this._gpuMemoryCounter; } @@ -63,7 +63,7 @@ var events = this._model.mainThreadEvents(); for (var i = 0; i < events.length; ++i) { var event = events[i]; - if (event.name !== WebInspector.TimelineModel.RecordType.UpdateCounters) + if (event.name !== TimelineModel.TimelineModel.RecordType.UpdateCounters) continue; var counters = event.args.data;
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js index 1d4b1346..a02f1b6 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js
@@ -3,28 +3,28 @@ // found in the LICENSE file. /** @typedef {!{range: !Protocol.CSS.SourceRange, styleSheetId: !Protocol.CSS.StyleSheetId, wasUsed: boolean}} */ -WebInspector.CSSModel.RuleUsage; +SDK.CSSModel.RuleUsage; /** - * @implements {WebInspector.TargetManager.Observer} - * @implements {WebInspector.TracingManagerClient} + * @implements {SDK.TargetManager.Observer} + * @implements {SDK.TracingManagerClient} * @unrestricted */ -WebInspector.TimelineController = class { +Timeline.TimelineController = class { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.TimelineLifecycleDelegate} delegate - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.Target} target + * @param {!Timeline.TimelineLifecycleDelegate} delegate + * @param {!SDK.TracingModel} tracingModel */ constructor(target, delegate, tracingModel) { this._delegate = delegate; this._target = target; this._tracingModel = tracingModel; this._targets = []; - WebInspector.targetManager.observeTargets(this); + SDK.targetManager.observeTargets(this); if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) - this._markUnusedCSS = WebInspector.settings.createSetting('timelineMarkUnusedCSS', false); + this._markUnusedCSS = Common.settings.createSetting('timelineMarkUnusedCSS', false); } /** @@ -35,17 +35,17 @@ * @param {boolean} captureFilmStrip */ startRecording(captureCauses, enableJSSampling, captureMemory, capturePictures, captureFilmStrip) { - this._extensionTraceProviders = WebInspector.extensionServer.traceProviders().slice(); + this._extensionTraceProviders = Extensions.extensionServer.traceProviders().slice(); function disabledByDefault(category) { return 'disabled-by-default-' + category; } var categoriesArray = [ '-*', 'devtools.timeline', 'v8.execute', disabledByDefault('devtools.timeline'), - disabledByDefault('devtools.timeline.frame'), WebInspector.TracingModel.TopLevelEventCategory, - WebInspector.TimelineModel.Category.Console, WebInspector.TimelineModel.Category.UserTiming + disabledByDefault('devtools.timeline.frame'), SDK.TracingModel.TopLevelEventCategory, + TimelineModel.TimelineModel.Category.Console, TimelineModel.TimelineModel.Category.UserTiming ]; - categoriesArray.push(WebInspector.TimelineModel.Category.LatencyInfo); + categoriesArray.push(TimelineModel.TimelineModel.Category.LatencyInfo); if (Runtime.experiments.isEnabled('timelineFlowEvents')) { categoriesArray.push(disabledByDefault('toplevel.flow'), disabledByDefault('ipc.flow')); @@ -54,7 +54,7 @@ categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling')); if (Runtime.experiments.isEnabled('timelineTracingJSProfile') && enableJSSampling) { categoriesArray.push(disabledByDefault('v8.cpu_profiler')); - if (WebInspector.moduleSetting('highResolutionCpuProfiling').get()) + if (Common.moduleSetting('highResolutionCpuProfiling').get()) categoriesArray.push(disabledByDefault('v8.cpu_profiler.hires')); } if (captureCauses || enableJSSampling) @@ -83,7 +83,7 @@ this._target.tracingManager.stop(); if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._markUnusedCSS.get()) - tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets()); + tracingStoppedPromises.push(SDK.targetManager.resumeAllTargets()); else this._addUnusedRulesToCoverage(); @@ -97,7 +97,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._targets.push(target); @@ -107,7 +107,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._targets.remove(target, true); @@ -116,13 +116,13 @@ } _addUnusedRulesToCoverage() { - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (!mainTarget) return; - var cssModel = WebInspector.CSSModel.fromTarget(mainTarget); + var cssModel = SDK.CSSModel.fromTarget(mainTarget); /** - * @param {!Array<!WebInspector.CSSModel.RuleUsage>} ruleUsageList + * @param {!Array<!SDK.CSSModel.RuleUsage>} ruleUsageList */ function ruleListReceived(ruleUsageList) { @@ -133,7 +133,7 @@ var styleSheetHeader = cssModel.styleSheetHeaderForId(rule.styleSheetId); var url = styleSheetHeader.sourceURL; - WebInspector.CoverageProfile.instance().appendUnusedRule(url, rule.range); + Components.CoverageProfile.instance().appendUnusedRule(url, rule.range); } } @@ -141,7 +141,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {!Promise} */ _startProfilingOnTarget(target) { @@ -152,14 +152,14 @@ * @return {!Promise} */ _startProfilingOnAllTargets() { - var intervalUs = WebInspector.moduleSetting('highResolutionCpuProfiling').get() ? 100 : 1000; + var intervalUs = Common.moduleSetting('highResolutionCpuProfiling').get() ? 100 : 1000; this._target.profilerAgent().setSamplingInterval(intervalUs); this._profiling = true; return Promise.all(this._targets.map(this._startProfilingOnTarget)); } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {!Promise} */ _stopProfilingOnTarget(target) { @@ -174,7 +174,7 @@ */ _addCpuProfile(targetId, error, cpuProfile) { if (!cpuProfile) { - WebInspector.console.warn(WebInspector.UIString('CPU profile for a target is not available. %s', error || '')); + Common.console.warn(Common.UIString('CPU profile for a target is not available. %s', error || '')); return; } if (!this._cpuProfiles) @@ -199,22 +199,22 @@ _startRecordingWithCategories(categories, enableJSSampling, callback) { if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._markUnusedCSS.get()) - WebInspector.targetManager.suspendAllTargets(); + SDK.targetManager.suspendAllTargets(); var profilingStartedPromise = enableJSSampling && !Runtime.experiments.isEnabled('timelineTracingJSProfile') ? this._startProfilingOnAllTargets() : Promise.resolve(); - var samplingFrequencyHz = WebInspector.moduleSetting('highResolutionCpuProfiling').get() ? 10000 : 1000; + var samplingFrequencyHz = Common.moduleSetting('highResolutionCpuProfiling').get() ? 10000 : 1000; var options = 'sampling-frequency=' + samplingFrequencyHz; var target = this._target; var tracingManager = target.tracingManager; - WebInspector.targetManager.suspendReload(target); + SDK.targetManager.suspendReload(target); profilingStartedPromise.then(tracingManager.start.bind(tracingManager, this, categories, options, onTraceStarted)); /** * @param {?string} error */ function onTraceStarted(error) { - WebInspector.targetManager.resumeReload(target); + SDK.targetManager.resumeReload(target); if (callback) callback(error); } @@ -229,7 +229,7 @@ } /** - * @param {!Array.<!WebInspector.TracingManager.EventPayload>} events + * @param {!Array.<!SDK.TracingManager.EventPayload>} events * @override */ traceEventsCollected(events) { @@ -258,13 +258,13 @@ _injectCpuProfileEvent(pid, tid, cpuProfile) { if (!cpuProfile) return; - var cpuProfileEvent = /** @type {!WebInspector.TracingManager.EventPayload} */ ({ - cat: WebInspector.TracingModel.DevToolsMetadataEventCategory, - ph: WebInspector.TracingModel.Phase.Instant, + var cpuProfileEvent = /** @type {!SDK.TracingManager.EventPayload} */ ({ + cat: SDK.TracingModel.DevToolsMetadataEventCategory, + ph: SDK.TracingModel.Phase.Instant, ts: this._tracingModel.maximumRecordTime() * 1000, pid: pid, tid: tid, - name: WebInspector.TimelineModel.RecordType.CpuProfile, + name: TimelineModel.TimelineModel.RecordType.CpuProfile, args: {data: {cpuProfile: cpuProfile}} }); this._tracingModel.addEvents([cpuProfileEvent]); @@ -274,7 +274,7 @@ if (!this._cpuProfiles) return; - var metadataEventTypes = WebInspector.TimelineModel.DevToolsMetadataEvent; + var metadataEventTypes = TimelineModel.TimelineModel.DevToolsMetadataEvent; var metadataEvents = this._tracingModel.devToolsMetadataEvents(); var mainMetaEvent = metadataEvents.filter(event => event.name === metadataEventTypes.TracingStartedInPage).peekLast();
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js index fed1da0d..797109f 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -31,11 +31,11 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverview = class extends WebInspector.TimelineOverviewBase { +Timeline.TimelineEventOverview = class extends UI.TimelineOverviewBase { /** * @param {string} id * @param {?string} title - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(id, title, model) { super(); @@ -92,9 +92,9 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverviewInput = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewInput = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { super('input', null, model); @@ -107,8 +107,8 @@ super.update(); var events = this._model.mainThreadEvents(); var height = this._canvas.height; - var descriptors = WebInspector.TimelineUIUtils.eventDispatchDesciptors(); - /** @type {!Map.<string,!WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor>} */ + var descriptors = Timeline.TimelineUIUtils.eventDispatchDesciptors(); + /** @type {!Map.<string,!Timeline.TimelineUIUtils.EventDispatchTypeDescriptor>} */ var descriptorsByType = new Map(); var maxPriority = -1; for (var descriptor of descriptors) { @@ -126,7 +126,7 @@ for (var priority = 0; priority <= maxPriority; ++priority) { for (var i = 0; i < events.length; ++i) { var event = events[i]; - if (event.name !== WebInspector.TimelineModel.RecordType.EventDispatch) + if (event.name !== TimelineModel.TimelineModel.RecordType.EventDispatch) continue; var descriptor = descriptorsByType.get(event.args['data']['type']); if (!descriptor || descriptor.priority !== priority) @@ -143,12 +143,12 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverviewNetwork = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewNetwork = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { - super('network', WebInspector.UIString('NET'), model); + super('network', Common.UIString('NET'), model); } /** @@ -157,7 +157,7 @@ update() { super.update(); var height = this._canvas.height; - var numBands = categoryBand(WebInspector.TimelineUIUtils.NetworkCategory.Other) + 1; + var numBands = categoryBand(Timeline.TimelineUIUtils.NetworkCategory.Other) + 1; var bandHeight = Math.floor(height / numBands); var devicePixelRatio = window.devicePixelRatio; var timeOffset = this._model.minimumRecordTime(); @@ -178,11 +178,11 @@ } /** - * @param {!WebInspector.TimelineUIUtils.NetworkCategory} category + * @param {!Timeline.TimelineUIUtils.NetworkCategory} category * @return {number} */ function categoryBand(category) { - var categories = WebInspector.TimelineUIUtils.NetworkCategory; + var categories = Timeline.TimelineUIUtils.NetworkCategory; switch (category) { case categories.HTML: return 0; @@ -198,12 +198,12 @@ } /** - * @param {!WebInspector.TimelineModel.NetworkRequest} request + * @param {!TimelineModel.TimelineModel.NetworkRequest} request */ function drawRequest(request) { var tickWidth = 2 * devicePixelRatio; - var category = WebInspector.TimelineUIUtils.networkRequestCategory(request); - var style = WebInspector.TimelineUIUtils.networkCategoryColor(category); + var category = Timeline.TimelineUIUtils.networkRequestCategory(request); + var style = Timeline.TimelineUIUtils.networkCategoryColor(category); var band = categoryBand(category); var y = band * bandHeight; var path = paths.get(style); @@ -226,12 +226,12 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverviewCPUActivity = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewCPUActivity = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { - super('cpu-activity', WebInspector.UIString('CPU'), model); + super('cpu-activity', Common.UIString('CPU'), model); this._backgroundCanvas = this.element.createChild('canvas', 'fill background'); } @@ -257,7 +257,7 @@ var timeSpan = this._model.maximumRecordTime() - timeOffset; var scale = width / timeSpan; var quantTime = quantSizePx / scale; - var categories = WebInspector.TimelineUIUtils.categories(); + var categories = Timeline.TimelineUIUtils.categories(); var categoryOrder = ['idle', 'loading', 'painting', 'rendering', 'scripting', 'other']; var otherIndex = categoryOrder.indexOf('other'); var idleIndex = 0; @@ -273,10 +273,10 @@ /** * @param {!CanvasRenderingContext2D} ctx - * @param {!Array<!WebInspector.TracingModel.Event>} events + * @param {!Array<!SDK.TracingModel.Event>} events */ function drawThreadEvents(ctx, events) { - var quantizer = new WebInspector.Quantizer(timeOffset, quantTime, drawSample); + var quantizer = new Timeline.Quantizer(timeOffset, quantTime, drawSample); var x = 0; var categoryIndexStack = []; var paths = []; @@ -302,22 +302,22 @@ } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onEventStart(e) { var index = categoryIndexStack.length ? categoryIndexStack.peekLast() : idleIndex; quantizer.appendInterval(e.startTime, index); - categoryIndexStack.push(WebInspector.TimelineUIUtils.eventStyle(e).category._overviewIndex || otherIndex); + categoryIndexStack.push(Timeline.TimelineUIUtils.eventStyle(e).category._overviewIndex || otherIndex); } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onEventEnd(e) { quantizer.appendInterval(e.endTime, categoryIndexStack.pop()); } - WebInspector.TimelineModel.forEachEvent(events, onEventStart, onEventEnd); + TimelineModel.TimelineModel.forEachEvent(events, onEventStart, onEventEnd); quantizer.appendInterval(timeOffset + timeSpan + quantTime, idleIndex); // Kick drawing the last bucket. for (var i = categoryOrder.length - 1; i > 0; --i) { paths[i].lineTo(width, height); @@ -347,10 +347,10 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverviewResponsiveness = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewResponsiveness = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineModel} model + * @param {!TimelineModel.TimelineFrameModel} frameModel */ constructor(model, frameModel) { super('responsiveness', null, model); @@ -379,7 +379,7 @@ var events = this._model.mainThreadEvents(); for (var i = 0; i < events.length; ++i) { - if (!WebInspector.TimelineData.forEvent(events[i]).warning) + if (!TimelineModel.TimelineData.forEvent(events[i]).warning) continue; paintWarningDecoration(events[i].startTime, events[i].duration); } @@ -407,10 +407,10 @@ /** * @unrestricted */ -WebInspector.TimelineFilmStripOverview = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineFilmStripOverview = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.FilmStripModel} filmStripModel + * @param {!TimelineModel.TimelineModel} model + * @param {!Components.FilmStripModel} filmStripModel */ constructor(model, filmStripModel) { super('filmstrip', null, model); @@ -434,7 +434,7 @@ return; if (!image.naturalWidth || !image.naturalHeight) return; - var imageHeight = this._canvas.height - 2 * WebInspector.TimelineFilmStripOverview.Padding; + var imageHeight = this._canvas.height - 2 * Timeline.TimelineFilmStripOverview.Padding; var imageWidth = Math.ceil(imageHeight * image.naturalWidth / image.naturalHeight); var popoverScale = Math.min(200 / image.naturalWidth, 1); this._emptyImage = new Image(image.naturalWidth * popoverScale, image.naturalHeight * popoverScale); @@ -443,7 +443,7 @@ } /** - * @param {!WebInspector.FilmStripModel.Frame} frame + * @param {!Components.FilmStripModel.Frame} frame * @return {!Promise<!HTMLImageElement>} */ _imageByFrame(frame) { @@ -484,7 +484,7 @@ return; if (!this._filmStripModel.frames().length) return; - var padding = WebInspector.TimelineFilmStripOverview.Padding; + var padding = Timeline.TimelineFilmStripOverview.Padding; var width = this._canvas.width; var zeroTime = this._filmStripModel.zeroTime(); var spanTime = this._filmStripModel.spanTime(); @@ -507,7 +507,7 @@ /** * @param {number} x * @param {!HTMLImageElement} image - * @this {WebInspector.TimelineFilmStripOverview} + * @this {Timeline.TimelineFilmStripOverview} */ function drawFrameImage(x, image) { // Ignore draws deferred from a previous update call. @@ -534,14 +534,14 @@ return imagePromise.then(createFrameElement.bind(this)); /** - * @this {WebInspector.TimelineFilmStripOverview} + * @this {Timeline.TimelineFilmStripOverview} * @param {!HTMLImageElement} image * @return {?Element} */ function createFrameElement(image) { var element = createElementWithClass('div', 'frame'); element.createChild('div', 'thumbnail').appendChild(image); - WebInspector.appendStyle(element, 'timeline/timelinePanel.css'); + UI.appendStyle(element, 'timeline/timelinePanel.css'); this._lastFrame = frame; this._lastElement = element; return element; @@ -554,24 +554,24 @@ reset() { this._lastFrame = undefined; this._lastElement = null; - /** @type {!Map<!WebInspector.FilmStripModel.Frame,!Promise<!HTMLImageElement>>} */ + /** @type {!Map<!Components.FilmStripModel.Frame,!Promise<!HTMLImageElement>>} */ this._frameToImagePromise = new Map(); this._imageWidth = 0; } }; -WebInspector.TimelineFilmStripOverview.Padding = 2; +Timeline.TimelineFilmStripOverview.Padding = 2; /** * @unrestricted */ -WebInspector.TimelineEventOverviewFrames = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewFrames = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineModel} model + * @param {!TimelineModel.TimelineFrameModel} frameModel */ constructor(model, frameModel) { - super('framerate', WebInspector.UIString('FPS'), model); + super('framerate', Common.UIString('FPS'), model); this._frameModel = frameModel; } @@ -627,12 +627,12 @@ /** * @unrestricted */ -WebInspector.TimelineEventOverviewMemory = class extends WebInspector.TimelineEventOverview { +Timeline.TimelineEventOverviewMemory = class extends Timeline.TimelineEventOverview { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { - super('memory', WebInspector.UIString('HEAP'), model); + super('memory', Common.UIString('HEAP'), model); this._heapSizeLabel = this.element.createChild('div', 'memory-graph-label'); } @@ -659,15 +659,15 @@ var minTime = this._model.minimumRecordTime(); var maxTime = this._model.maximumRecordTime(); /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ function isUpdateCountersEvent(event) { - return event.name === WebInspector.TimelineModel.RecordType.UpdateCounters; + return event.name === TimelineModel.TimelineModel.RecordType.UpdateCounters; } events = events.filter(isUpdateCountersEvent); /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ function calculateMinMaxSizes(event) { var counters = event.args.data; @@ -688,7 +688,7 @@ var histogram = new Array(width); /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ function buildHistogram(event) { var counters = event.args.data; @@ -734,7 +734,7 @@ ctx.strokeStyle = 'hsl(220, 90%, 70%)'; ctx.stroke(); - this._heapSizeLabel.textContent = WebInspector.UIString( + this._heapSizeLabel.textContent = Common.UIString( '%s \u2013 %s', Number.bytesToString(minUsedHeapSize), Number.bytesToString(maxUsedHeapSize)); } }; @@ -742,7 +742,7 @@ /** * @unrestricted */ -WebInspector.Quantizer = class { +Timeline.Quantizer = class { /** * @param {number} startTime * @param {number} quantDuration
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js index 23ce2d3..ceb4193 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js
@@ -28,21 +28,21 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.FlameChartDataProvider} + * @implements {UI.FlameChartDataProvider} * @unrestricted */ -WebInspector.TimelineFlameChartDataProviderBase = class { +Timeline.TimelineFlameChartDataProviderBase = class { /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(model, filters) { - WebInspector.FlameChartDataProvider.call(this); + UI.FlameChartDataProvider.call(this); this.reset(); this._model = model; - /** @type {?WebInspector.FlameChart.TimelineData} */ + /** @type {?UI.FlameChart.TimelineData} */ this._timelineData; - this._font = '11px ' + WebInspector.fontFamily(); + this._font = '11px ' + Host.fontFamily(); this._filters = filters; } @@ -198,7 +198,7 @@ /** * @param {number} entryIndex - * @return {?WebInspector.TimelineSelection} + * @return {?Timeline.TimelineSelection} */ createSelection(entryIndex) { return null; @@ -206,14 +206,14 @@ /** * @override - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ timelineData() { throw new Error('Not implemented'); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ _isVisible(event) { @@ -226,7 +226,7 @@ /** * @enum {symbol} */ -WebInspector.TimelineFlameChartEntryType = { +Timeline.TimelineFlameChartEntryType = { Frame: Symbol('Frame'), Event: Symbol('Event'), InteractionRecord: Symbol('InteractionRecord'), @@ -235,27 +235,27 @@ /** * @unrestricted */ -WebInspector.TimelineFlameChartDataProvider = class extends WebInspector.TimelineFlameChartDataProviderBase { +Timeline.TimelineFlameChartDataProvider = class extends Timeline.TimelineFlameChartDataProviderBase { /** - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.TimelineFrameModel} frameModel - * @param {!WebInspector.TimelineIRModel} irModel - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!TimelineModel.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineIRModel} irModel + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(model, frameModel, irModel, filters) { super(model, filters); this._frameModel = frameModel; this._irModel = irModel; this._consoleColorGenerator = - new WebInspector.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max: 100, count: 6}, 50, 0.7); + new UI.FlameChart.ColorGenerator({min: 30, max: 55}, {min: 70, max: 100, count: 6}, 50, 0.7); this._headerLevel1 = { padding: 4, height: 17, collapsible: true, - color: WebInspector.themeSupport.patchColor('#222', WebInspector.ThemeSupport.ColorUsage.Foreground), + color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreground), font: this._font, - backgroundColor: WebInspector.themeSupport.patchColor('white', WebInspector.ThemeSupport.ColorUsage.Background), + backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background), nestingLevel: 0 }; @@ -264,8 +264,8 @@ height: 17, collapsible: false, font: this._font, - color: WebInspector.themeSupport.patchColor('#222', WebInspector.ThemeSupport.ColorUsage.Foreground), - backgroundColor: WebInspector.themeSupport.patchColor('white', WebInspector.ThemeSupport.ColorUsage.Background), + color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreground), + backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background), nestingLevel: 1, shareHeaderLine: true }; @@ -274,9 +274,9 @@ padding: 4, height: 17, collapsible: true, - color: WebInspector.themeSupport.patchColor('#222', WebInspector.ThemeSupport.ColorUsage.Foreground), + color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreground), font: this._font, - backgroundColor: WebInspector.themeSupport.patchColor('white', WebInspector.ThemeSupport.ColorUsage.Background), + backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background), nestingLevel: 0, useFirstLineForOverview: true, shareHeaderLine: true @@ -286,9 +286,9 @@ padding: 2, height: 17, collapsible: true, - color: WebInspector.themeSupport.patchColor('#222', WebInspector.ThemeSupport.ColorUsage.Foreground), + color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreground), font: this._font, - backgroundColor: WebInspector.themeSupport.patchColor('white', WebInspector.ThemeSupport.ColorUsage.Background), + backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background), nestingLevel: 1, shareHeaderLine: true }; @@ -301,24 +301,24 @@ */ entryTitle(entryIndex) { var entryType = this._entryType(entryIndex); - if (entryType === WebInspector.TimelineFlameChartEntryType.Event) { - var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex]); - if (event.phase === WebInspector.TracingModel.Phase.AsyncStepInto || - event.phase === WebInspector.TracingModel.Phase.AsyncStepPast) + if (entryType === Timeline.TimelineFlameChartEntryType.Event) { + var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]); + if (event.phase === SDK.TracingModel.Phase.AsyncStepInto || + event.phase === SDK.TracingModel.Phase.AsyncStepPast) return event.name + ':' + event.args['step']; if (event._blackboxRoot) - return WebInspector.UIString('Blackboxed'); - var name = WebInspector.TimelineUIUtils.eventStyle(event).title; + return Common.UIString('Blackboxed'); + var name = Timeline.TimelineUIUtils.eventStyle(event).title; // TODO(yurys): support event dividers var detailsText = - WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(event, this._model.targetByEvent(event)); - if (event.name === WebInspector.TimelineModel.RecordType.JSFrame && detailsText) + Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(event, this._model.targetByEvent(event)); + if (event.name === TimelineModel.TimelineModel.RecordType.JSFrame && detailsText) return detailsText; - return detailsText ? WebInspector.UIString('%s (%s)', name, detailsText) : name; + return detailsText ? Common.UIString('%s (%s)', name, detailsText) : name; } var title = this._entryIndexToTitle[entryIndex]; if (!title) { - title = WebInspector.UIString('Unexpected entryIndex %d', entryIndex); + title = Common.UIString('Unexpected entryIndex %d', entryIndex); console.error(title); } return title; @@ -342,29 +342,29 @@ */ reset() { super.reset(); - /** @type {!Array<!WebInspector.TracingModel.Event|!WebInspector.TimelineFrame|!WebInspector.TimelineIRModel.Phases>} */ + /** @type {!Array<!SDK.TracingModel.Event|!TimelineModel.TimelineFrame|!TimelineModel.TimelineIRModel.Phases>} */ this._entryData = []; - /** @type {!Array<!WebInspector.TimelineFlameChartEntryType>} */ + /** @type {!Array<!Timeline.TimelineFlameChartEntryType>} */ this._entryTypeByLevel = []; /** @type {!Array<string>} */ this._entryIndexToTitle = []; - /** @type {!Array<!WebInspector.TimelineFlameChartMarker>} */ + /** @type {!Array<!Timeline.TimelineFlameChartMarker>} */ this._markers = []; - /** @type {!Map<!WebInspector.TimelineCategory, string>} */ + /** @type {!Map<!Timeline.TimelineCategory, string>} */ this._asyncColorByCategory = new Map(); - /** @type {!Map<!WebInspector.TimelineIRModel.Phases, string>} */ + /** @type {!Map<!TimelineModel.TimelineIRModel.Phases, string>} */ this._asyncColorByInteractionPhase = new Map(); } /** * @override - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ timelineData() { if (this._timelineData) return this._timelineData; - this._timelineData = new WebInspector.FlameChart.TimelineData([], [], [], []); + this._timelineData = new UI.FlameChart.TimelineData([], [], [], []); this._flowEventIndexById = {}; this._minimumBoundary = this._model.minimumRecordTime(); @@ -372,27 +372,27 @@ this._currentLevel = 0; this._appendFrameBars(this._frameModel.frames()); - this._appendHeader(WebInspector.UIString('Interactions'), this._interactionsHeaderLevel1); + this._appendHeader(Common.UIString('Interactions'), this._interactionsHeaderLevel1); this._appendInteractionRecords(); - var asyncEventGroups = WebInspector.TimelineModel.AsyncEventGroup; + var asyncEventGroups = TimelineModel.TimelineModel.AsyncEventGroup; var inputLatencies = this._model.mainThreadAsyncEvents().get(asyncEventGroups.input); if (inputLatencies && inputLatencies.length) { - var title = WebInspector.TimelineUIUtils.titleForAsyncEventGroup(asyncEventGroups.input); + var title = Timeline.TimelineUIUtils.titleForAsyncEventGroup(asyncEventGroups.input); this._appendAsyncEventsGroup(title, inputLatencies, this._interactionsHeaderLevel2); } var animations = this._model.mainThreadAsyncEvents().get(asyncEventGroups.animation); if (animations && animations.length) { - var title = WebInspector.TimelineUIUtils.titleForAsyncEventGroup(asyncEventGroups.animation); + var title = Timeline.TimelineUIUtils.titleForAsyncEventGroup(asyncEventGroups.animation); this._appendAsyncEventsGroup(title, animations, this._interactionsHeaderLevel2); } var threads = this._model.virtualThreads(); if (!Runtime.experiments.isEnabled('timelinePerFrameTrack')) { this._appendThreadTimelineData( - WebInspector.UIString('Main'), this._model.mainThreadEvents(), this._model.mainThreadAsyncEvents(), true); + Common.UIString('Main'), this._model.mainThreadEvents(), this._model.mainThreadAsyncEvents(), true); } else { this._appendThreadTimelineData( - WebInspector.UIString('Page'), this._model.eventsForFrame(WebInspector.TimelineModel.PageFrame.mainFrameId), this._model.mainThreadAsyncEvents(), true); + Common.UIString('Page'), this._model.eventsForFrame(TimelineModel.TimelineModel.PageFrame.mainFrameId), this._model.mainThreadAsyncEvents(), true); for (var frame of this._model.rootFrames()) { // Ignore top frame itself, since it should be part of page events. frame.children.forEach(this._appendFrameEvents.bind(this, 0)); @@ -401,10 +401,10 @@ var compositorThreads = threads.filter(thread => thread.name.startsWith('CompositorTileWorker')); var otherThreads = threads.filter(thread => !thread.name.startsWith('CompositorTileWorker')); if (compositorThreads.length) { - this._appendHeader(WebInspector.UIString('Raster'), this._headerLevel1); + this._appendHeader(Common.UIString('Raster'), this._headerLevel1); for (var i = 0; i < compositorThreads.length; ++i) this._appendSyncEvents( - compositorThreads[i].events, WebInspector.UIString('Rasterizer Thread %d', i), this._headerLevel2); + compositorThreads[i].events, Common.UIString('Rasterizer Thread %d', i), this._headerLevel2); } this._appendGPUEvents(); @@ -412,8 +412,8 @@ thread => this._appendThreadTimelineData(thread.name, thread.events, thread.asyncEventsByGroup)); /** - * @param {!WebInspector.TimelineFlameChartMarker} a - * @param {!WebInspector.TimelineFlameChartMarker} b + * @param {!Timeline.TimelineFlameChartMarker} a + * @param {!Timeline.TimelineFlameChartMarker} b */ function compareStartTime(a, b) { return a.startTime() - b.startTime(); @@ -428,21 +428,21 @@ /** * @param {number} level - * @param {!WebInspector.TimelineModel.PageFrame} frame + * @param {!TimelineModel.TimelineModel.PageFrame} frame */ _appendFrameEvents(level, frame) { var events = this._model.eventsForFrame(frame.id); var clonedHeader = Object.assign({}, this._headerLevel1); clonedHeader.nestingLevel = level; - this._appendSyncEvents(events, WebInspector.TimelineUIUtils.displayNameForFrame(frame), - /** @type {!WebInspector.FlameChart.GroupStyle} */ (clonedHeader)); + this._appendSyncEvents(events, Timeline.TimelineUIUtils.displayNameForFrame(frame), + /** @type {!UI.FlameChart.GroupStyle} */ (clonedHeader)); frame.children.forEach(this._appendFrameEvents.bind(this, level + 1)); } /** * @param {string} threadTitle - * @param {!Array<!WebInspector.TracingModel.Event>} syncEvents - * @param {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} asyncEvents + * @param {!Array<!SDK.TracingModel.Event>} syncEvents + * @param {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} asyncEvents * @param {boolean=} forceExpanded */ _appendThreadTimelineData(threadTitle, syncEvents, asyncEvents, forceExpanded) { @@ -451,9 +451,9 @@ } /** - * @param {!Array<!WebInspector.TracingModel.Event>} events + * @param {!Array<!SDK.TracingModel.Event>} events * @param {string} title - * @param {!WebInspector.FlameChart.GroupStyle} style + * @param {!UI.FlameChart.GroupStyle} style * @param {boolean=} forceExpanded */ _appendSyncEvents(events, title, style, forceExpanded) { @@ -463,14 +463,14 @@ var maxStackDepth = 0; for (var i = 0; i < events.length; ++i) { var e = events[i]; - if (WebInspector.TimelineModel.isMarkerEvent(e)) - this._markers.push(new WebInspector.TimelineFlameChartMarker( + if (TimelineModel.TimelineModel.isMarkerEvent(e)) + this._markers.push(new Timeline.TimelineFlameChartMarker( e.startTime, e.startTime - this._model.minimumRecordTime(), - WebInspector.TimelineUIUtils.markerStyleForEvent(e))); - if (!WebInspector.TracingModel.isFlowPhase(e.phase)) { - if (!e.endTime && e.phase !== WebInspector.TracingModel.Phase.Instant) + Timeline.TimelineUIUtils.markerStyleForEvent(e))); + if (!SDK.TracingModel.isFlowPhase(e.phase)) { + if (!e.endTime && e.phase !== SDK.TracingModel.Phase.Instant) continue; - if (WebInspector.TracingModel.isAsyncPhase(e.phase)) + if (SDK.TracingModel.isAsyncPhase(e.phase)) continue; if (!this._isVisible(e)) continue; @@ -498,16 +498,16 @@ openEvents.push(e); } this._entryTypeByLevel.length = this._currentLevel + maxStackDepth; - this._entryTypeByLevel.fill(WebInspector.TimelineFlameChartEntryType.Event, this._currentLevel); + this._entryTypeByLevel.fill(Timeline.TimelineFlameChartEntryType.Event, this._currentLevel); this._currentLevel += maxStackDepth; } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ _isBlackboxedEvent(event) { - if (event.name !== WebInspector.TimelineModel.RecordType.JSFrame) + if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame) return false; var url = event.args['data']['url']; return url && this._isBlackboxedURL(url); @@ -518,14 +518,14 @@ * @return {boolean} */ _isBlackboxedURL(url) { - return WebInspector.blackboxManager.isBlackboxedURL(url); + return Bindings.blackboxManager.isBlackboxedURL(url); } /** - * @param {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} asyncEvents + * @param {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} asyncEvents */ _appendAsyncEvents(asyncEvents) { - var groups = WebInspector.TimelineModel.AsyncEventGroup; + var groups = TimelineModel.TimelineModel.AsyncEventGroup; var groupArray = Object.keys(groups).map(key => groups[key]); groupArray.remove(groups.animation); @@ -536,15 +536,15 @@ var events = asyncEvents.get(group); if (!events) continue; - var title = WebInspector.TimelineUIUtils.titleForAsyncEventGroup(group); + var title = Timeline.TimelineUIUtils.titleForAsyncEventGroup(group); this._appendAsyncEventsGroup(title, events, this._headerLevel1); } } /** * @param {string} header - * @param {!Array<!WebInspector.TracingModel.AsyncEvent>} events - * @param {!WebInspector.FlameChart.GroupStyle} style + * @param {!Array<!SDK.TracingModel.AsyncEvent>} events + * @param {!UI.FlameChart.GroupStyle} style */ _appendAsyncEventsGroup(header, events, style) { var lastUsedTimeByLevel = []; @@ -565,28 +565,28 @@ lastUsedTimeByLevel[level] = asyncEvent.endTime; } this._entryTypeByLevel.length = this._currentLevel + lastUsedTimeByLevel.length; - this._entryTypeByLevel.fill(WebInspector.TimelineFlameChartEntryType.Event, this._currentLevel); + this._entryTypeByLevel.fill(Timeline.TimelineFlameChartEntryType.Event, this._currentLevel); this._currentLevel += lastUsedTimeByLevel.length; } _appendGPUEvents() { - if (this._appendSyncEvents(this._model.gpuEvents(), WebInspector.UIString('GPU'), this._headerLevel1, false)) + if (this._appendSyncEvents(this._model.gpuEvents(), Common.UIString('GPU'), this._headerLevel1, false)) ++this._currentLevel; } _appendInteractionRecords() { this._irModel.interactionRecords().forEach(this._appendSegment, this); - this._entryTypeByLevel[this._currentLevel++] = WebInspector.TimelineFlameChartEntryType.InteractionRecord; + this._entryTypeByLevel[this._currentLevel++] = Timeline.TimelineFlameChartEntryType.InteractionRecord; } /** - * @param {!Array.<!WebInspector.TimelineFrame>} frames + * @param {!Array.<!TimelineModel.TimelineFrame>} frames */ _appendFrameBars(frames) { - var style = WebInspector.TimelineUIUtils.markerStyleForFrame(); - this._entryTypeByLevel[this._currentLevel] = WebInspector.TimelineFlameChartEntryType.Frame; + var style = Timeline.TimelineUIUtils.markerStyleForFrame(); + this._entryTypeByLevel[this._currentLevel] = Timeline.TimelineFlameChartEntryType.Frame; for (var i = 0; i < frames.length; ++i) { - this._markers.push(new WebInspector.TimelineFlameChartMarker( + this._markers.push(new Timeline.TimelineFlameChartMarker( frames[i].startTime, frames[i].startTime - this._model.minimumRecordTime(), style)); this._appendFrame(frames[i]); } @@ -595,7 +595,7 @@ /** * @param {number} entryIndex - * @return {!WebInspector.TimelineFlameChartEntryType} + * @return {!Timeline.TimelineFlameChartEntryType} */ _entryType(entryIndex) { return this._entryTypeByLevel[this._timelineData.entryLevels[entryIndex]]; @@ -611,33 +611,33 @@ var title; var warning; var type = this._entryType(entryIndex); - if (type === WebInspector.TimelineFlameChartEntryType.Event) { - var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex]); + if (type === Timeline.TimelineFlameChartEntryType.Event) { + var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]); var totalTime = event.duration; var selfTime = event.selfTime; var /** @const */ eps = 1e-6; if (typeof totalTime === 'number') { time = Math.abs(totalTime - selfTime) > eps && selfTime > eps ? - WebInspector.UIString( + Common.UIString( '%s (self %s)', Number.millisToString(totalTime, true), Number.millisToString(selfTime, true)) : Number.millisToString(totalTime, true); } title = this.entryTitle(entryIndex); - warning = WebInspector.TimelineUIUtils.eventWarning(event); - } else if (type === WebInspector.TimelineFlameChartEntryType.Frame) { - var frame = /** @type {!WebInspector.TimelineFrame} */ (this._entryData[entryIndex]); - time = WebInspector.UIString( + warning = Timeline.TimelineUIUtils.eventWarning(event); + } else if (type === Timeline.TimelineFlameChartEntryType.Frame) { + var frame = /** @type {!TimelineModel.TimelineFrame} */ (this._entryData[entryIndex]); + time = Common.UIString( '%s ~ %.0f\u2009fps', Number.preciseMillisToString(frame.duration, 1), (1000 / frame.duration)); - title = frame.idle ? WebInspector.UIString('Idle Frame') : WebInspector.UIString('Frame'); + title = frame.idle ? Common.UIString('Idle Frame') : Common.UIString('Frame'); if (frame.hasWarnings()) { warning = createElement('span'); - warning.textContent = WebInspector.UIString('Long frame'); + warning.textContent = Common.UIString('Long frame'); } } else { return null; } var element = createElement('div'); - var root = WebInspector.createShadowRootWithCoreStyles(element, 'timeline/timelineFlamechartPopover.css'); + var root = UI.createShadowRootWithCoreStyles(element, 'timeline/timelineFlamechartPopover.css'); var contents = root.createChild('div', 'timeline-flamechart-popover'); contents.createChild('span', 'timeline-info-time').textContent = time; contents.createChild('span', 'timeline-info-title').textContent = title; @@ -659,32 +659,32 @@ var color = cache.get(key); if (color) return color; - var parsedColor = WebInspector.Color.parse(lookupColor(key)); - color = parsedColor.setAlpha(0.7).asString(WebInspector.Color.Format.RGBA) || ''; + var parsedColor = Common.Color.parse(lookupColor(key)); + color = parsedColor.setAlpha(0.7).asString(Common.Color.Format.RGBA) || ''; cache.set(key, color); return color; } var type = this._entryType(entryIndex); - if (type === WebInspector.TimelineFlameChartEntryType.Event) { - var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex]); - if (!WebInspector.TracingModel.isAsyncPhase(event.phase)) - return WebInspector.TimelineUIUtils.eventColor(event); - if (event.hasCategory(WebInspector.TimelineModel.Category.Console) || - event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) + if (type === Timeline.TimelineFlameChartEntryType.Event) { + var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]); + if (!SDK.TracingModel.isAsyncPhase(event.phase)) + return Timeline.TimelineUIUtils.eventColor(event); + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) || + event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) return this._consoleColorGenerator.colorForID(event.name); - if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) { + if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) { var phase = - WebInspector.TimelineIRModel.phaseForEvent(event) || WebInspector.TimelineIRModel.Phases.Uncategorized; + TimelineModel.TimelineIRModel.phaseForEvent(event) || TimelineModel.TimelineIRModel.Phases.Uncategorized; return patchColorAndCache( - this._asyncColorByInteractionPhase, phase, WebInspector.TimelineUIUtils.interactionPhaseColor); + this._asyncColorByInteractionPhase, phase, Timeline.TimelineUIUtils.interactionPhaseColor); } - var category = WebInspector.TimelineUIUtils.eventStyle(event).category; + var category = Timeline.TimelineUIUtils.eventStyle(event).category; return patchColorAndCache(this._asyncColorByCategory, category, () => category.color); } - if (type === WebInspector.TimelineFlameChartEntryType.Frame) + if (type === Timeline.TimelineFlameChartEntryType.Frame) return 'white'; - if (type === WebInspector.TimelineFlameChartEntryType.InteractionRecord) + if (type === Timeline.TimelineFlameChartEntryType.InteractionRecord) return 'transparent'; return ''; } @@ -705,10 +705,10 @@ decorateEntry(entryIndex, context, text, barX, barY, barWidth, barHeight, unclippedBarX, timeToPixels) { var data = this._entryData[entryIndex]; var type = this._entryType(entryIndex); - if (type === WebInspector.TimelineFlameChartEntryType.Frame) { + if (type === Timeline.TimelineFlameChartEntryType.Frame) { var /** @const */ vPadding = 1; var /** @const */ hPadding = 1; - var frame = /** {!WebInspector.TimelineFrame} */ (data); + var frame = /** {!TimelineModel.TimelineFrame} */ (data); barX += hPadding; barWidth -= 2 * hPadding; barY += vPadding; @@ -724,9 +724,9 @@ return true; } - if (type === WebInspector.TimelineFlameChartEntryType.InteractionRecord) { - var color = WebInspector.TimelineUIUtils.interactionPhaseColor( - /** @type {!WebInspector.TimelineIRModel.Phases} */ (this._entryData[entryIndex])); + if (type === Timeline.TimelineFlameChartEntryType.InteractionRecord) { + var color = Timeline.TimelineUIUtils.interactionPhaseColor( + /** @type {!TimelineModel.TimelineIRModel.Phases} */ (this._entryData[entryIndex])); context.fillStyle = color; context.fillRect(barX, barY, barWidth - 1, 2); context.fillRect(barX, barY - 3, 2, 3); @@ -734,17 +734,17 @@ return false; } - if (type === WebInspector.TimelineFlameChartEntryType.Event) { - var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex]); - if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) { - var timeWaitingForMainThread = WebInspector.TimelineData.forEvent(event).timeWaitingForMainThread; + if (type === Timeline.TimelineFlameChartEntryType.Event) { + var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]); + if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) { + var timeWaitingForMainThread = TimelineModel.TimelineData.forEvent(event).timeWaitingForMainThread; if (timeWaitingForMainThread) { context.fillStyle = 'hsla(0, 70%, 60%, 1)'; var width = Math.floor(unclippedBarX - barX + timeWaitingForMainThread * timeToPixels); context.fillRect(barX, barY + barHeight - 3, width, 2); } } - if (WebInspector.TimelineData.forEvent(event).warning) + if (TimelineModel.TimelineData.forEvent(event).warning) paintWarningDecoration(barX, barWidth - 1.5); } @@ -777,14 +777,14 @@ */ forceDecoration(entryIndex) { var type = this._entryType(entryIndex); - return type === WebInspector.TimelineFlameChartEntryType.Frame || - type === WebInspector.TimelineFlameChartEntryType.Event && - !!WebInspector.TimelineData.forEvent(/** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex])).warning; + return type === Timeline.TimelineFlameChartEntryType.Frame || + type === Timeline.TimelineFlameChartEntryType.Event && + !!TimelineModel.TimelineData.forEvent(/** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex])).warning; } /** * @param {string} title - * @param {!WebInspector.FlameChart.GroupStyle} style + * @param {!UI.FlameChart.GroupStyle} style * @param {boolean=} expanded */ _appendHeader(title, style, expanded) { @@ -792,7 +792,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {number} level */ _appendEvent(event, level) { @@ -800,22 +800,22 @@ this._entryData.push(event); this._timelineData.entryLevels[index] = level; var duration; - if (WebInspector.TimelineModel.isMarkerEvent(event)) + if (TimelineModel.TimelineModel.isMarkerEvent(event)) duration = undefined; else - duration = event.duration || WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs; + duration = event.duration || Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs; this._timelineData.entryTotalTimes[index] = duration; this._timelineData.entryStartTimes[index] = event.startTime; } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {number} level */ _appendFlowEvent(event, level) { var timelineData = this._timelineData; /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {number} */ function pushStartFlow(event) { @@ -826,7 +826,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {number} flowIndex */ function pushEndFlow(event, flowIndex) { @@ -835,14 +835,14 @@ } switch (event.phase) { - case WebInspector.TracingModel.Phase.FlowBegin: + case SDK.TracingModel.Phase.FlowBegin: this._flowEventIndexById[event.id] = pushStartFlow(event); break; - case WebInspector.TracingModel.Phase.FlowStep: + case SDK.TracingModel.Phase.FlowStep: pushEndFlow(event, this._flowEventIndexById[event.id]); this._flowEventIndexById[event.id] = pushStartFlow(event); break; - case WebInspector.TracingModel.Phase.FlowEnd: + case SDK.TracingModel.Phase.FlowEnd: pushEndFlow(event, this._flowEventIndexById[event.id]); delete this._flowEventIndexById[event.id]; break; @@ -850,18 +850,18 @@ } /** - * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent + * @param {!SDK.TracingModel.AsyncEvent} asyncEvent * @param {number} level */ _appendAsyncEvent(asyncEvent, level) { - if (WebInspector.TracingModel.isNestableAsyncPhase(asyncEvent.phase)) { + if (SDK.TracingModel.isNestableAsyncPhase(asyncEvent.phase)) { // FIXME: also add steps once we support event nesting in the FlameChart. this._appendEvent(asyncEvent, level); return; } var steps = asyncEvent.steps; // If we have past steps, put the end event for each range rather than start one. - var eventOffset = steps.length > 1 && steps[1].phase === WebInspector.TracingModel.Phase.AsyncStepPast ? 1 : 0; + var eventOffset = steps.length > 1 && steps[1].phase === SDK.TracingModel.Phase.AsyncStepPast ? 1 : 0; for (var i = 0; i < steps.length - 1; ++i) { var index = this._entryData.length; this._entryData.push(steps[i + eventOffset]); @@ -873,7 +873,7 @@ } /** - * @param {!WebInspector.TimelineFrame} frame + * @param {!TimelineModel.TimelineFrame} frame */ _appendFrame(frame) { var index = this._entryData.length; @@ -885,11 +885,11 @@ } /** - * @param {!WebInspector.Segment} segment + * @param {!Common.Segment} segment */ _appendSegment(segment) { var index = this._entryData.length; - this._entryData.push(/** @type {!WebInspector.TimelineIRModel.Phases} */ (segment.data)); + this._entryData.push(/** @type {!TimelineModel.TimelineIRModel.Phases} */ (segment.data)); this._entryIndexToTitle[index] = /** @type {string} */ (segment.data); this._timelineData.entryLevels[index] = this._currentLevel; this._timelineData.entryTotalTimes[index] = segment.end - segment.begin; @@ -899,67 +899,67 @@ /** * @override * @param {number} entryIndex - * @return {?WebInspector.TimelineSelection} + * @return {?Timeline.TimelineSelection} */ createSelection(entryIndex) { var type = this._entryType(entryIndex); var timelineSelection = null; - if (type === WebInspector.TimelineFlameChartEntryType.Event) - timelineSelection = WebInspector.TimelineSelection.fromTraceEvent( - /** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entryIndex])); - else if (type === WebInspector.TimelineFlameChartEntryType.Frame) - timelineSelection = WebInspector.TimelineSelection.fromFrame( - /** @type {!WebInspector.TimelineFrame} */ (this._entryData[entryIndex])); + if (type === Timeline.TimelineFlameChartEntryType.Event) + timelineSelection = Timeline.TimelineSelection.fromTraceEvent( + /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex])); + else if (type === Timeline.TimelineFlameChartEntryType.Frame) + timelineSelection = Timeline.TimelineSelection.fromFrame( + /** @type {!TimelineModel.TimelineFrame} */ (this._entryData[entryIndex])); if (timelineSelection) - this._lastSelection = new WebInspector.TimelineFlameChartView.Selection(timelineSelection, entryIndex); + this._lastSelection = new Timeline.TimelineFlameChartView.Selection(timelineSelection, entryIndex); return timelineSelection; } /** - * @param {?WebInspector.TimelineSelection} selection + * @param {?Timeline.TimelineSelection} selection * @return {number} */ entryIndexForSelection(selection) { - if (!selection || selection.type() === WebInspector.TimelineSelection.Type.Range) + if (!selection || selection.type() === Timeline.TimelineSelection.Type.Range) return -1; if (this._lastSelection && this._lastSelection.timelineSelection.object() === selection.object()) return this._lastSelection.entryIndex; var index = this._entryData.indexOf( - /** @type {!WebInspector.TracingModel.Event|!WebInspector.TimelineFrame|!WebInspector.TimelineIRModel.Phases} */ + /** @type {!SDK.TracingModel.Event|!TimelineModel.TimelineFrame|!TimelineModel.TimelineIRModel.Phases} */ (selection.object())); if (index !== -1) - this._lastSelection = new WebInspector.TimelineFlameChartView.Selection(selection, index); + this._lastSelection = new Timeline.TimelineFlameChartView.Selection(selection, index); return index; } }; -WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; +Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; /** * @unrestricted */ -WebInspector.TimelineFlameChartNetworkDataProvider = class extends WebInspector.TimelineFlameChartDataProviderBase { +Timeline.TimelineFlameChartNetworkDataProvider = class extends Timeline.TimelineFlameChartDataProviderBase { /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model */ constructor(model) { super(model, []); - var loadingCategory = WebInspector.TimelineUIUtils.categories()['loading']; + var loadingCategory = Timeline.TimelineUIUtils.categories()['loading']; this._waitingColor = loadingCategory.childColor; this._processingColor = loadingCategory.color; } /** * @override - * @return {!WebInspector.FlameChart.TimelineData} + * @return {!UI.FlameChart.TimelineData} */ timelineData() { if (this._timelineData) return this._timelineData; - /** @type {!Array<!WebInspector.TimelineModel.NetworkRequest>} */ + /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ this._requests = []; - this._timelineData = new WebInspector.FlameChart.TimelineData([], [], [], []); + this._timelineData = new UI.FlameChart.TimelineData([], [], [], []); this._appendTimelineData(this._model.mainThreadEvents()); return this._timelineData; } @@ -969,7 +969,7 @@ */ reset() { super.reset(); - /** @type {!Array<!WebInspector.TimelineModel.NetworkRequest>} */ + /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ this._requests = []; } @@ -986,19 +986,19 @@ /** * @override * @param {number} index - * @return {?WebInspector.TimelineSelection} + * @return {?Timeline.TimelineSelection} */ createSelection(index) { if (index === -1) return null; var request = this._requests[index]; - this._lastSelection = new WebInspector.TimelineFlameChartView.Selection( - WebInspector.TimelineSelection.fromNetworkRequest(request), index); + this._lastSelection = new Timeline.TimelineFlameChartView.Selection( + Timeline.TimelineSelection.fromNetworkRequest(request), index); return this._lastSelection.timelineSelection; } /** - * @param {?WebInspector.TimelineSelection} selection + * @param {?Timeline.TimelineSelection} selection * @return {number} */ entryIndexForSelection(selection) { @@ -1008,13 +1008,13 @@ if (this._lastSelection && this._lastSelection.timelineSelection.object() === selection.object()) return this._lastSelection.entryIndex; - if (selection.type() !== WebInspector.TimelineSelection.Type.NetworkRequest) + if (selection.type() !== Timeline.TimelineSelection.Type.NetworkRequest) return -1; - var request = /** @type{!WebInspector.TimelineModel.NetworkRequest} */ (selection.object()); + var request = /** @type{!TimelineModel.TimelineModel.NetworkRequest} */ (selection.object()); var index = this._requests.indexOf(request); if (index !== -1) - this._lastSelection = new WebInspector.TimelineFlameChartView.Selection( - WebInspector.TimelineSelection.fromNetworkRequest(request), index); + this._lastSelection = new Timeline.TimelineFlameChartView.Selection( + Timeline.TimelineSelection.fromNetworkRequest(request), index); return index; } @@ -1024,9 +1024,9 @@ * @return {string} */ entryColor(index) { - var request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */ (this._requests[index]); - var category = WebInspector.TimelineUIUtils.networkRequestCategory(request); - return WebInspector.TimelineUIUtils.networkCategoryColor(category); + var request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._requests[index]); + var category = Timeline.TimelineUIUtils.networkRequestCategory(request); + return Timeline.TimelineUIUtils.networkCategoryColor(category); } /** @@ -1035,7 +1035,7 @@ * @return {?string} */ entryTitle(index) { - var request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */ (this._requests[index]); + var request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._requests[index]); return request.url || null; } @@ -1053,7 +1053,7 @@ * @return {boolean} */ decorateEntry(index, context, text, barX, barY, barWidth, barHeight, unclippedBarX, timeToPixelRatio) { - const request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */ (this._requests[index]); + const request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._requests[index]); if (!request.timing) return false; @@ -1076,7 +1076,7 @@ context.fillStyle = 'hsla(0, 100%, 100%, 0.8)'; context.fillRect(sendStart + 0.5, barY + 0.5, headersEnd - sendStart - 0.5, barHeight - 2); - context.fillStyle = WebInspector.themeSupport.patchColor('white', WebInspector.ThemeSupport.ColorUsage.Background); + context.fillStyle = UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background); context.fillRect(barX, barY - 0.5, sendStart - barX, barHeight); context.fillRect(finish, barY - 0.5, barX + barWidth - finish, barHeight); @@ -1118,7 +1118,7 @@ const text = this.entryTitle(index); if (text && text.length) { context.fillStyle = '#333'; - const trimmedText = WebInspector.trimTextMiddle(context, text, textWidth - 2 * textPadding); + const trimmedText = UI.trimTextMiddle(context, text, textWidth - 2 * textPadding); const textBaseHeight = barHeight - this.textBaseline(); context.fillText(trimmedText, textStart + textPadding, barY + textBaseHeight); } @@ -1143,11 +1143,11 @@ */ prepareHighlightedEntryInfo(index) { var /** @const */ maxURLChars = 80; - var request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */ (this._requests[index]); + var request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._requests[index]); if (!request.url) return null; var element = createElement('div'); - var root = WebInspector.createShadowRootWithCoreStyles(element, 'timeline/timelineFlamechartPopover.css'); + var root = UI.createShadowRootWithCoreStyles(element, 'timeline/timelineFlamechartPopover.css'); var contents = root.createChild('div', 'timeline-flamechart-popover'); var duration = request.endTime - request.startTime; if (request.startTime && isFinite(duration)) @@ -1155,7 +1155,7 @@ if (typeof request.priority === 'string') { var div = contents.createChild('span'); div.textContent = - WebInspector.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePriority} */ (request.priority)); + Components.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePriority} */ (request.priority)); div.style.color = this._colorForPriority(request.priority) || 'black'; } contents.createChild('span').textContent = request.url.trimMiddle(maxURLChars); @@ -1183,7 +1183,7 @@ } /** - * @param {!Array.<!WebInspector.TracingModel.Event>} events + * @param {!Array.<!SDK.TracingModel.Event>} events */ _appendTimelineData(events) { this._minimumBoundary = this._model.minimumRecordTime(); @@ -1215,13 +1215,13 @@ if (this._timelineData.entryLevels[i] === -1) this._timelineData.entryLevels[i] = index; } - this._timelineData = new WebInspector.FlameChart.TimelineData( + this._timelineData = new UI.FlameChart.TimelineData( this._timelineData.entryLevels, this._timelineData.entryTotalTimes, this._timelineData.entryStartTimes, null); this._currentLevel = index; } /** - * @param {!WebInspector.TimelineModel.NetworkRequest} request + * @param {!TimelineModel.TimelineModel.NetworkRequest} request */ _appendEntry(request) { this._requests.push(request); @@ -1232,14 +1232,14 @@ }; /** - * @implements {WebInspector.FlameChartMarker} + * @implements {UI.FlameChartMarker} * @unrestricted */ -WebInspector.TimelineFlameChartMarker = class { +Timeline.TimelineFlameChartMarker = class { /** * @param {number} startTime * @param {number} startOffset - * @param {!WebInspector.TimelineMarkerStyle} style + * @param {!Timeline.TimelineMarkerStyle} style */ constructor(startTime, startOffset, style) { this._startTime = startTime; @@ -1269,7 +1269,7 @@ */ title() { var startTime = Number.millisToString(this._startOffset); - return WebInspector.UIString('%s at %s', this._style.title, startTime); + return Common.UIString('%s at %s', this._style.title, startTime); } /** @@ -1310,17 +1310,17 @@ }; /** - * @implements {WebInspector.TimelineModeView} - * @implements {WebInspector.FlameChartDelegate} + * @implements {Timeline.TimelineModeView} + * @implements {UI.FlameChartDelegate} * @unrestricted */ -WebInspector.TimelineFlameChartView = class extends WebInspector.VBox { +Timeline.TimelineFlameChartView = class extends UI.VBox { /** - * @param {!WebInspector.TimelineModeViewDelegate} delegate - * @param {!WebInspector.TimelineModel} timelineModel - * @param {!WebInspector.TimelineFrameModel} frameModel - * @param {!WebInspector.TimelineIRModel} irModel - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!Timeline.TimelineModeViewDelegate} delegate + * @param {!TimelineModel.TimelineModel} timelineModel + * @param {!TimelineModel.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineIRModel} irModel + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(delegate, timelineModel, frameModel, irModel, filters) { super(); @@ -1328,15 +1328,15 @@ this._delegate = delegate; this._model = timelineModel; - this._splitWidget = new WebInspector.SplitWidget(false, false, 'timelineFlamechartMainView', 150); + this._splitWidget = new UI.SplitWidget(false, false, 'timelineFlamechartMainView', 150); - this._dataProvider = new WebInspector.TimelineFlameChartDataProvider(this._model, frameModel, irModel, filters); + this._dataProvider = new Timeline.TimelineFlameChartDataProvider(this._model, frameModel, irModel, filters); var mainViewGroupExpansionSetting = - WebInspector.settings.createSetting('timelineFlamechartMainViewGroupExpansion', {}); - this._mainView = new WebInspector.FlameChart(this._dataProvider, this, mainViewGroupExpansionSetting); + Common.settings.createSetting('timelineFlamechartMainViewGroupExpansion', {}); + this._mainView = new UI.FlameChart(this._dataProvider, this, mainViewGroupExpansionSetting); - this._networkDataProvider = new WebInspector.TimelineFlameChartNetworkDataProvider(this._model); - this._networkView = new WebInspector.FlameChart(this._networkDataProvider, this); + this._networkDataProvider = new Timeline.TimelineFlameChartNetworkDataProvider(this._model); + this._networkView = new UI.FlameChart(this._networkDataProvider, this); this._splitWidget.setMainWidget(this._mainView); this._splitWidget.setSidebarWidget(this._networkView); @@ -1344,20 +1344,20 @@ this._onMainEntrySelected = this._onEntrySelected.bind(this, this._dataProvider); this._onNetworkEntrySelected = this._onEntrySelected.bind(this, this._networkDataProvider); - this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected, this._onMainEntrySelected, this); + this._mainView.addEventListener(UI.FlameChart.Events.EntrySelected, this._onMainEntrySelected, this); this._networkView.addEventListener( - WebInspector.FlameChart.Events.EntrySelected, this._onNetworkEntrySelected, this); - WebInspector.blackboxManager.addChangeListener(this.refreshRecords, this); + UI.FlameChart.Events.EntrySelected, this._onNetworkEntrySelected, this); + Bindings.blackboxManager.addChangeListener(this.refreshRecords, this); } /** * @override */ dispose() { - this._mainView.removeEventListener(WebInspector.FlameChart.Events.EntrySelected, this._onMainEntrySelected, this); + this._mainView.removeEventListener(UI.FlameChart.Events.EntrySelected, this._onMainEntrySelected, this); this._networkView.removeEventListener( - WebInspector.FlameChart.Events.EntrySelected, this._onNetworkEntrySelected, this); - WebInspector.blackboxManager.removeChangeListener(this.refreshRecords, this); + UI.FlameChart.Events.EntrySelected, this._onNetworkEntrySelected, this); + Bindings.blackboxManager.removeChangeListener(this.refreshRecords, this); } /** @@ -1383,7 +1383,7 @@ * @param {number} endTime */ updateRangeSelection(startTime, endTime) { - this._delegate.select(WebInspector.TimelineSelection.fromRange(startTime, endTime)); + this._delegate.select(Timeline.TimelineSelection.fromRange(startTime, endTime)); } /** @@ -1398,11 +1398,11 @@ /** * @override - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event */ highlightEvent(event) { var entryIndex = - event ? this._dataProvider.entryIndexForSelection(WebInspector.TimelineSelection.fromTraceEvent(event)) : -1; + event ? this._dataProvider.entryIndexForSelection(Timeline.TimelineSelection.fromTraceEvent(event)) : -1; if (entryIndex >= 0) this._mainView.highlightEntry(entryIndex); else @@ -1419,7 +1419,7 @@ /** * @override - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ view() { return this; @@ -1450,7 +1450,7 @@ /** * @override - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event * @param {string=} regex * @param {boolean=} select */ @@ -1467,7 +1467,7 @@ /** * @override - * @param {?WebInspector.TimelineSelection} selection + * @param {?Timeline.TimelineSelection} selection */ setSelection(selection) { var index = this._dataProvider.entryIndexForSelection(selection); @@ -1477,8 +1477,8 @@ } /** - * @param {!WebInspector.FlameChartDataProvider} dataProvider - * @param {!WebInspector.Event} event + * @param {!UI.FlameChartDataProvider} dataProvider + * @param {!Common.Event} event */ _onEntrySelected(dataProvider, event) { var entryIndex = /** @type{number} */ (event.data); @@ -1500,9 +1500,9 @@ /** * @unrestricted */ -WebInspector.TimelineFlameChartView.Selection = class { +Timeline.TimelineFlameChartView.Selection = class { /** - * @param {!WebInspector.TimelineSelection} selection + * @param {!Timeline.TimelineSelection} selection * @param {number} entryIndex */ constructor(selection, entryIndex) {
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js index 6929e3d..fe3f1ed 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js
@@ -7,10 +7,10 @@ /** * @unrestricted */ -WebInspector.TimelineLayersView = class extends WebInspector.SplitWidget { +Timeline.TimelineLayersView = class extends UI.SplitWidget { /** - * @param {!WebInspector.TimelineModel} model - * @param {function(!WebInspector.PaintProfilerSnapshot)} showPaintProfilerCallback + * @param {!TimelineModel.TimelineModel} model + * @param {function(!SDK.PaintProfilerSnapshot)} showPaintProfilerCallback */ constructor(model, showPaintProfilerCallback) { super(true, false, 'timelineLayersView'); @@ -18,31 +18,31 @@ this._showPaintProfilerCallback = showPaintProfilerCallback; this.element.classList.add('timeline-layers-view'); - this._rightSplitWidget = new WebInspector.SplitWidget(true, true, 'timelineLayersViewDetails'); + this._rightSplitWidget = new UI.SplitWidget(true, true, 'timelineLayersViewDetails'); this._rightSplitWidget.element.classList.add('timeline-layers-view-properties'); this.setMainWidget(this._rightSplitWidget); - var vbox = new WebInspector.VBox(); + var vbox = new UI.VBox(); this.setSidebarWidget(vbox); - this._layerViewHost = new WebInspector.LayerViewHost(); + this._layerViewHost = new LayerViewer.LayerViewHost(); - var layerTreeOutline = new WebInspector.LayerTreeOutline(this._layerViewHost); + var layerTreeOutline = new LayerViewer.LayerTreeOutline(this._layerViewHost); vbox.element.appendChild(layerTreeOutline.element); - this._layers3DView = new WebInspector.Layers3DView(this._layerViewHost); + this._layers3DView = new LayerViewer.Layers3DView(this._layerViewHost); this._layers3DView.addEventListener( - WebInspector.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this); + LayerViewer.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this); this._rightSplitWidget.setMainWidget(this._layers3DView); - var layerDetailsView = new WebInspector.LayerDetailsView(this._layerViewHost); + var layerDetailsView = new LayerViewer.LayerDetailsView(this._layerViewHost); this._rightSplitWidget.setSidebarWidget(layerDetailsView); layerDetailsView.addEventListener( - WebInspector.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this); + LayerViewer.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this); } /** - * @param {!WebInspector.TracingFrameLayerTree} frameLayerTree + * @param {!TimelineModel.TracingFrameLayerTree} frameLayerTree */ showLayerTree(frameLayerTree) { this._frameLayerTree = frameLayerTree; @@ -63,10 +63,10 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onPaintProfilerRequested(event) { - var selection = /** @type {!WebInspector.LayerView.Selection} */ (event.data); + var selection = /** @type {!LayerViewer.LayerView.Selection} */ (event.data); this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect => { if (snapshotWithRect) this._showPaintProfilerCallback(snapshotWithRect.snapshot);
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLoader.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLoader.js index bacc777..ba21e38 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLoader.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLoader.js
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.OutputStream} - * @implements {WebInspector.OutputStreamDelegate} + * @implements {Common.OutputStream} + * @implements {Bindings.OutputStreamDelegate} * @unrestricted */ -WebInspector.TimelineLoader = class { +Timeline.TimelineLoader = class { /** - * @param {!WebInspector.TracingModel} model - * @param {!WebInspector.TimelineLifecycleDelegate} delegate + * @param {!SDK.TracingModel} model + * @param {!Timeline.TimelineLifecycleDelegate} delegate */ constructor(model, delegate) { this._model = model; @@ -18,25 +18,25 @@ /** @type {?function()} */ this._canceledCallback = null; - this._state = WebInspector.TimelineLoader.State.Initial; + this._state = Timeline.TimelineLoader.State.Initial; this._buffer = ''; this._firstChunk = true; this._loadedBytes = 0; /** @type {number} */ this._totalSize; - this._jsonTokenizer = new WebInspector.TextUtils.BalancedJSONTokenizer(this._writeBalancedJSON.bind(this), true); + this._jsonTokenizer = new Common.TextUtils.BalancedJSONTokenizer(this._writeBalancedJSON.bind(this), true); } /** - * @param {!WebInspector.TracingModel} model + * @param {!SDK.TracingModel} model * @param {!File} file - * @param {!WebInspector.TimelineLifecycleDelegate} delegate - * @return {!WebInspector.TimelineLoader} + * @param {!Timeline.TimelineLifecycleDelegate} delegate + * @return {!Timeline.TimelineLoader} */ static loadFromFile(model, file, delegate) { - var loader = new WebInspector.TimelineLoader(model, delegate); - var fileReader = WebInspector.TimelineLoader._createFileReader(file, loader); + var loader = new Timeline.TimelineLoader(model, delegate); + var fileReader = Timeline.TimelineLoader._createFileReader(file, loader); loader._canceledCallback = fileReader.cancel.bind(fileReader); loader._totalSize = file.size; fileReader.start(loader); @@ -44,24 +44,24 @@ } /** - * @param {!WebInspector.TracingModel} model + * @param {!SDK.TracingModel} model * @param {string} url - * @param {!WebInspector.TimelineLifecycleDelegate} delegate - * @return {!WebInspector.TimelineLoader} + * @param {!Timeline.TimelineLifecycleDelegate} delegate + * @return {!Timeline.TimelineLoader} */ static loadFromURL(model, url, delegate) { - var stream = new WebInspector.TimelineLoader(model, delegate); - WebInspector.ResourceLoader.loadAsStream(url, null, stream); + var stream = new Timeline.TimelineLoader(model, delegate); + Host.ResourceLoader.loadAsStream(url, null, stream); return stream; } /** * @param {!File} file - * @param {!WebInspector.OutputStreamDelegate} delegate - * @return {!WebInspector.ChunkedReader} + * @param {!Bindings.OutputStreamDelegate} delegate + * @return {!Bindings.ChunkedReader} */ static _createFileReader(file, delegate) { - return new WebInspector.ChunkedFileReader(file, WebInspector.TimelineLoader.TransferChunkLengthBytes, delegate); + return new Bindings.ChunkedFileReader(file, Timeline.TimelineLoader.TransferChunkLengthBytes, delegate); } cancel() { @@ -83,18 +83,18 @@ if (!this._firstChunk) this._delegate.loadingProgress(this._totalSize ? this._loadedBytes / this._totalSize : undefined); - if (this._state === WebInspector.TimelineLoader.State.Initial) { + if (this._state === Timeline.TimelineLoader.State.Initial) { if (chunk[0] === '{') - this._state = WebInspector.TimelineLoader.State.LookingForEvents; + this._state = Timeline.TimelineLoader.State.LookingForEvents; else if (chunk[0] === '[') - this._state = WebInspector.TimelineLoader.State.ReadingEvents; + this._state = Timeline.TimelineLoader.State.ReadingEvents; else { - this._reportErrorAndCancelLoading(WebInspector.UIString('Malformed timeline data: Unknown JSON format')); + this._reportErrorAndCancelLoading(Common.UIString('Malformed timeline data: Unknown JSON format')); return; } } - if (this._state === WebInspector.TimelineLoader.State.LookingForEvents) { + if (this._state === Timeline.TimelineLoader.State.LookingForEvents) { var objectName = '"traceEvents":'; var startPos = this._buffer.length - objectName.length; this._buffer += chunk; @@ -102,16 +102,16 @@ if (pos === -1) return; chunk = this._buffer.slice(pos + objectName.length); - this._state = WebInspector.TimelineLoader.State.ReadingEvents; + this._state = Timeline.TimelineLoader.State.ReadingEvents; } - if (this._state !== WebInspector.TimelineLoader.State.ReadingEvents) + if (this._state !== Timeline.TimelineLoader.State.ReadingEvents) return; if (this._jsonTokenizer.write(chunk)) return; - this._state = WebInspector.TimelineLoader.State.SkippingTail; + this._state = Timeline.TimelineLoader.State.SkippingTail; if (this._firstChunk) { - this._reportErrorAndCancelLoading(WebInspector.UIString('Malformed timeline input, wrong JSON brackets balance')); + this._reportErrorAndCancelLoading(Common.UIString('Malformed timeline input, wrong JSON brackets balance')); return; } } @@ -133,9 +133,9 @@ var items; try { - items = /** @type {!Array.<!WebInspector.TracingManager.EventPayload>} */ (JSON.parse(json)); + items = /** @type {!Array.<!SDK.TracingManager.EventPayload>} */ (JSON.parse(json)); } catch (e) { - this._reportErrorAndCancelLoading(WebInspector.UIString('Malformed timeline data: %s', e.toString())); + this._reportErrorAndCancelLoading(Common.UIString('Malformed timeline data: %s', e.toString())); return; } @@ -143,7 +143,7 @@ this._firstChunk = false; this._model.reset(); if (this._looksLikeAppVersion(items[0])) { - this._reportErrorAndCancelLoading(WebInspector.UIString('Legacy Timeline format is not supported.')); + this._reportErrorAndCancelLoading(Common.UIString('Legacy Timeline format is not supported.')); return; } } @@ -151,7 +151,7 @@ try { this._model.addEvents(items); } catch (e) { - this._reportErrorAndCancelLoading(WebInspector.UIString('Malformed timeline data: %s', e.toString())); + this._reportErrorAndCancelLoading(Common.UIString('Malformed timeline data: %s', e.toString())); return; } } @@ -161,7 +161,7 @@ */ _reportErrorAndCancelLoading(message) { if (message) - WebInspector.console.error(message); + Common.console.error(message); this.cancel(); } @@ -190,7 +190,7 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred(reader) { } @@ -203,34 +203,34 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} event */ onError(reader, event) { switch (event.target.error.name) { case 'NotFoundError': - this._reportErrorAndCancelLoading(WebInspector.UIString('File "%s" not found.', reader.fileName())); + this._reportErrorAndCancelLoading(Common.UIString('File "%s" not found.', reader.fileName())); break; case 'NotReadableError': - this._reportErrorAndCancelLoading(WebInspector.UIString('File "%s" is not readable', reader.fileName())); + this._reportErrorAndCancelLoading(Common.UIString('File "%s" is not readable', reader.fileName())); break; case 'AbortError': break; default: this._reportErrorAndCancelLoading( - WebInspector.UIString('An error occurred while reading the file "%s"', reader.fileName())); + Common.UIString('An error occurred while reading the file "%s"', reader.fileName())); } } }; -WebInspector.TimelineLoader.TransferChunkLengthBytes = 5000000; +Timeline.TimelineLoader.TransferChunkLengthBytes = 5000000; /** * @enum {symbol} */ -WebInspector.TimelineLoader.State = { +Timeline.TimelineLoader.State = { Initial: Symbol('Initial'), LookingForEvents: Symbol('LookingForEvents'), ReadingEvents: Symbol('ReadingEvents'), @@ -238,10 +238,10 @@ }; /** - * @implements {WebInspector.OutputStreamDelegate} + * @implements {Bindings.OutputStreamDelegate} * @unrestricted */ -WebInspector.TracingTimelineSaver = class { +Timeline.TracingTimelineSaver = class { /** * @override */ @@ -256,19 +256,19 @@ /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader */ onChunkTransferred(reader) { } /** * @override - * @param {!WebInspector.ChunkedReader} reader + * @param {!Bindings.ChunkedReader} reader * @param {!Event} event */ onError(reader, event) { var error = event.target.error; - WebInspector.console.error( - WebInspector.UIString('Failed to save timeline: %s (%s, %s)', error.message, error.name, error.code)); + Common.console.error( + Common.UIString('Failed to save timeline: %s (%s, %s)', error.message, error.name, error.code)); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js index 148752b..189d2d99 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.TimelinePaintProfilerView = class extends WebInspector.SplitWidget { +Timeline.TimelinePaintProfilerView = class extends UI.SplitWidget { /** - * @param {!WebInspector.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineFrameModel} frameModel */ constructor(frameModel) { super(false, false); @@ -15,18 +15,18 @@ this.setResizable(false); this._frameModel = frameModel; - this._logAndImageSplitWidget = new WebInspector.SplitWidget(true, false); + this._logAndImageSplitWidget = new UI.SplitWidget(true, false); this._logAndImageSplitWidget.element.classList.add('timeline-paint-profiler-log-split'); this.setMainWidget(this._logAndImageSplitWidget); - this._imageView = new WebInspector.TimelinePaintImageView(); + this._imageView = new Timeline.TimelinePaintImageView(); this._logAndImageSplitWidget.setMainWidget(this._imageView); - this._paintProfilerView = new WebInspector.PaintProfilerView(this._imageView.showImage.bind(this._imageView)); + this._paintProfilerView = new LayerViewer.PaintProfilerView(this._imageView.showImage.bind(this._imageView)); this._paintProfilerView.addEventListener( - WebInspector.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this); + LayerViewer.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this); this.setSidebarWidget(this._paintProfilerView); - this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); + this._logTreeView = new LayerViewer.PaintProfilerCommandLogView(); this._logAndImageSplitWidget.setSidebarWidget(this._logTreeView); } @@ -41,7 +41,7 @@ } /** - * @param {!WebInspector.PaintProfilerSnapshot} snapshot + * @param {!SDK.PaintProfilerSnapshot} snapshot */ setSnapshot(snapshot) { this._releaseSnapshot(); @@ -51,8 +51,8 @@ } /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.Target} target + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ setEvent(target, event) { @@ -62,9 +62,9 @@ this._event = event; this._updateWhenVisible(); - if (this._event.name === WebInspector.TimelineModel.RecordType.Paint) - return !!WebInspector.TimelineData.forEvent(event).picture; - if (this._event.name === WebInspector.TimelineModel.RecordType.RasterTask) + if (this._event.name === TimelineModel.TimelineModel.RecordType.Paint) + return !!TimelineModel.TimelineData.forEvent(event).picture; + if (this._event.name === TimelineModel.TimelineModel.RecordType.RasterTask) return this._frameModel.hasRasterTile(this._event); return false; } @@ -83,12 +83,12 @@ var snapshotPromise; if (this._pendingSnapshot) snapshotPromise = Promise.resolve({rect: null, snapshot: this._pendingSnapshot}); - else if (this._event.name === WebInspector.TimelineModel.RecordType.Paint) { - var picture = WebInspector.TimelineData.forEvent(this._event).picture; + else if (this._event.name === TimelineModel.TimelineModel.RecordType.Paint) { + var picture = TimelineModel.TimelineData.forEvent(this._event).picture; snapshotPromise = picture.objectPromise() - .then(data => WebInspector.PaintProfilerSnapshot.load(this._target, data['skp64'])) + .then(data => SDK.PaintProfilerSnapshot.load(this._target, data['skp64'])) .then(snapshot => snapshot && {rect: null, snapshot: snapshot}); - } else if (this._event.name === WebInspector.TimelineModel.RecordType.RasterTask) { + } else if (this._event.name === TimelineModel.TimelineModel.RecordType.RasterTask) { snapshotPromise = this._frameModel.rasterTilePromise(this._event); } else { console.assert(false, 'Unexpected event type or no snapshot'); @@ -107,10 +107,10 @@ }); /** - * @param {!WebInspector.PaintProfilerSnapshot} snapshot + * @param {!SDK.PaintProfilerSnapshot} snapshot * @param {?Protocol.DOM.Rect} clipRect - * @param {!Array.<!WebInspector.PaintProfilerLogItem>=} log - * @this {WebInspector.TimelinePaintProfilerView} + * @param {!Array.<!SDK.PaintProfilerLogItem>=} log + * @this {Timeline.TimelinePaintProfilerView} */ function onCommandLogDone(snapshot, clipRect, log) { this._logTreeView.setCommandLog(snapshot.target(), log || []); @@ -133,7 +133,7 @@ /** * @unrestricted */ -WebInspector.TimelinePaintImageView = class extends WebInspector.Widget { +Timeline.TimelinePaintImageView = class extends UI.Widget { constructor() { super(true); this.registerRequiredCSS('timeline/timelinePaintProfiler.css'); @@ -143,9 +143,9 @@ this._maskElement = this._imageContainer.createChild('div'); this._imageElement.addEventListener('load', this._updateImagePosition.bind(this), false); - this._transformController = new WebInspector.TransformController(this.contentElement, true); + this._transformController = new LayerViewer.TransformController(this.contentElement, true); this._transformController.addEventListener( - WebInspector.TransformController.Events.TransformChanged, this._updateImagePosition, this); + LayerViewer.TransformController.Events.TransformChanged, this._updateImagePosition, this); } /** @@ -184,7 +184,7 @@ .translate(clientWidth / 2, clientHeight / 2) .scale(scale, scale) .translate(-width / 2, -height / 2); - var bounds = WebInspector.Geometry.boundsForTransformedPoints(matrix, [0, 0, 0, width, height, 0]); + var bounds = Common.Geometry.boundsForTransformedPoints(matrix, [0, 0, 0, width, height, 0]); this._transformController.clampOffsets( paddingX - bounds.maxX, clientWidth - paddingX - bounds.minX, paddingY - bounds.maxY, clientHeight - paddingY - bounds.minY);
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js index 7b61026..e74f5cd 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -30,93 +30,93 @@ */ /** - * @implements {WebInspector.TimelineLifecycleDelegate} - * @implements {WebInspector.TimelineModeViewDelegate} - * @implements {WebInspector.Searchable} + * @implements {Timeline.TimelineLifecycleDelegate} + * @implements {Timeline.TimelineModeViewDelegate} + * @implements {UI.Searchable} * @unrestricted */ -WebInspector.TimelinePanel = class extends WebInspector.Panel { +Timeline.TimelinePanel = class extends UI.Panel { constructor() { super('timeline'); this.registerRequiredCSS('timeline/timelinePanel.css'); this.element.addEventListener('contextmenu', this._contextMenu.bind(this), false); - this._dropTarget = new WebInspector.DropTarget( - this.element, [WebInspector.DropTarget.Types.Files, WebInspector.DropTarget.Types.URIList], - WebInspector.UIString('Drop timeline file or URL here'), this._handleDrop.bind(this)); + this._dropTarget = new UI.DropTarget( + this.element, [UI.DropTarget.Types.Files, UI.DropTarget.Types.URIList], + Common.UIString('Drop timeline file or URL here'), this._handleDrop.bind(this)); - this._state = WebInspector.TimelinePanel.State.Idle; - this._detailsLinkifier = new WebInspector.Linkifier(); + this._state = Timeline.TimelinePanel.State.Idle; + this._detailsLinkifier = new Components.Linkifier(); this._windowStartTime = 0; this._windowEndTime = Infinity; this._millisecondsToRecordAfterLoadEvent = 3000; this._toggleRecordAction = - /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action('timeline.toggle-recording')); + /** @type {!UI.Action }*/ (UI.actionRegistry.action('timeline.toggle-recording')); this._customCPUThrottlingRate = 0; - /** @type {!Array<!WebInspector.TimelineModel.Filter>} */ + /** @type {!Array<!TimelineModel.TimelineModel.Filter>} */ this._filters = []; if (!Runtime.experiments.isEnabled('timelineShowAllEvents')) { - this._filters.push(WebInspector.TimelineUIUtils.visibleEventsFilter()); - this._filters.push(new WebInspector.ExcludeTopLevelFilter()); + this._filters.push(Timeline.TimelineUIUtils.visibleEventsFilter()); + this._filters.push(new TimelineModel.ExcludeTopLevelFilter()); } // Create models. - this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage('tracing'); - this._tracingModel = new WebInspector.TracingModel(this._tracingModelBackingStorage); - this._model = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.visibleEventsFilter()); + this._tracingModelBackingStorage = new Bindings.TempFileBackingStorage('tracing'); + this._tracingModel = new SDK.TracingModel(this._tracingModelBackingStorage); + this._model = new TimelineModel.TimelineModel(Timeline.TimelineUIUtils.visibleEventsFilter()); this._frameModel = - new WebInspector.TimelineFrameModel(event => WebInspector.TimelineUIUtils.eventStyle(event).category.name); - this._filmStripModel = new WebInspector.FilmStripModel(this._tracingModel); - this._irModel = new WebInspector.TimelineIRModel(); + new TimelineModel.TimelineFrameModel(event => Timeline.TimelineUIUtils.eventStyle(event).category.name); + this._filmStripModel = new Components.FilmStripModel(this._tracingModel); + this._irModel = new TimelineModel.TimelineIRModel(); - this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager(); + this._cpuThrottlingManager = new Timeline.CPUThrottlingManager(); - /** @type {!Array.<!WebInspector.TimelineModeView>} */ + /** @type {!Array.<!Timeline.TimelineModeView>} */ this._currentViews = []; - this._captureNetworkSetting = WebInspector.settings.createSetting('timelineCaptureNetwork', false); - this._captureJSProfileSetting = WebInspector.settings.createSetting('timelineEnableJSSampling', true); - this._captureMemorySetting = WebInspector.settings.createSetting('timelineCaptureMemory', false); + this._captureNetworkSetting = Common.settings.createSetting('timelineCaptureNetwork', false); + this._captureJSProfileSetting = Common.settings.createSetting('timelineEnableJSSampling', true); + this._captureMemorySetting = Common.settings.createSetting('timelineCaptureMemory', false); this._captureLayersAndPicturesSetting = - WebInspector.settings.createSetting('timelineCaptureLayersAndPictures', false); - this._captureFilmStripSetting = WebInspector.settings.createSetting('timelineCaptureFilmStrip', false); + Common.settings.createSetting('timelineCaptureLayersAndPictures', false); + this._captureFilmStripSetting = Common.settings.createSetting('timelineCaptureFilmStrip', false); - this._markUnusedCSS = WebInspector.settings.createSetting('timelineMarkUnusedCSS', false); + this._markUnusedCSS = Common.settings.createSetting('timelineMarkUnusedCSS', false); - this._panelToolbar = new WebInspector.Toolbar('', this.element); + this._panelToolbar = new UI.Toolbar('', this.element); this._createToolbarItems(); - var timelinePane = new WebInspector.VBox(); + var timelinePane = new UI.VBox(); timelinePane.show(this.element); var topPaneElement = timelinePane.element.createChild('div', 'hbox'); topPaneElement.id = 'timeline-overview-panel'; // Create top overview component. - this._overviewPane = new WebInspector.TimelineOverviewPane('timeline'); + this._overviewPane = new UI.TimelineOverviewPane('timeline'); this._overviewPane.addEventListener( - WebInspector.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged.bind(this)); + UI.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged.bind(this)); this._overviewPane.show(topPaneElement); this._statusPaneContainer = timelinePane.element.createChild('div', 'status-pane-container fill'); this._createFileSelector(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.PageReloadRequested, this._pageReloadRequested, this); - WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.Load, this._loadEventFired, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.PageReloadRequested, this._pageReloadRequested, this); + SDK.targetManager.addEventListener(SDK.TargetManager.Events.Load, this._loadEventFired, this); // Create top level properties splitter. - this._detailsSplitWidget = new WebInspector.SplitWidget(false, true, 'timelinePanelDetailsSplitViewState'); + this._detailsSplitWidget = new UI.SplitWidget(false, true, 'timelinePanelDetailsSplitViewState'); this._detailsSplitWidget.element.classList.add('timeline-details-split'); - this._detailsView = new WebInspector.TimelineDetailsView(this._model, this._filters, this); + this._detailsView = new Timeline.TimelineDetailsView(this._model, this._filters, this); this._detailsSplitWidget.installResizer(this._detailsView.headerElement()); this._detailsSplitWidget.setSidebarWidget(this._detailsView); - this._searchableView = new WebInspector.SearchableView(this); + this._searchableView = new UI.SearchableView(this); this._searchableView.setMinimumSize(0, 100); this._searchableView.element.classList.add('searchable-view'); this._detailsSplitWidget.setMainWidget(this._searchableView); - this._stackView = new WebInspector.StackView(false); + this._stackView = new UI.StackView(false); this._stackView.element.classList.add('timeline-view-stack'); this._stackView.show(this._searchableView.element); @@ -124,26 +124,26 @@ this._detailsSplitWidget.show(timelinePane.element); this._detailsSplitWidget.hideSidebar(); - WebInspector.targetManager.addEventListener( - WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); + SDK.targetManager.addEventListener( + SDK.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); this._showRecordingHelpMessage(); - /** @type {!WebInspector.TracingModel.Event}|undefined */ + /** @type {!SDK.TracingModel.Event}|undefined */ this._selectedSearchResult; - /** @type {!Array<!WebInspector.TracingModel.Event>}|undefined */ + /** @type {!Array<!SDK.TracingModel.Event>}|undefined */ this._searchResults; } /** - * @return {!WebInspector.TimelinePanel} + * @return {!Timeline.TimelinePanel} */ static instance() { - return /** @type {!WebInspector.TimelinePanel} */ (self.runtime.sharedInstance(WebInspector.TimelinePanel)); + return /** @type {!Timeline.TimelinePanel} */ (self.runtime.sharedInstance(Timeline.TimelinePanel)); } /** * @override - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ searchableView() { return this._searchableView; @@ -153,14 +153,14 @@ * @override */ wasShown() { - WebInspector.context.setFlavor(WebInspector.TimelinePanel, this); + UI.context.setFlavor(Timeline.TimelinePanel, this); } /** * @override */ willHide() { - WebInspector.context.setFlavor(WebInspector.TimelinePanel, null); + UI.context.setFlavor(Timeline.TimelinePanel, null); } /** @@ -182,7 +182,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWindowChanged(event) { this._windowStartTime = event.data.startTime; @@ -191,15 +191,15 @@ for (var i = 0; i < this._currentViews.length; ++i) this._currentViews[i].setWindowTimes(this._windowStartTime, this._windowEndTime); - if (!this._selection || this._selection.type() === WebInspector.TimelineSelection.Type.Range) + if (!this._selection || this._selection.type() === Timeline.TimelineSelection.Type.Range) this.select(null); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onOverviewSelectionChanged(event) { - var selection = /** @type {!WebInspector.TimelineSelection} */ (event.data); + var selection = /** @type {!Timeline.TimelineSelection} */ (event.data); this.select(selection); } @@ -213,25 +213,25 @@ } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ _layersView() { if (this._lazyLayersView) return this._lazyLayersView; this._lazyLayersView = - new WebInspector.TimelineLayersView(this._model, this._showSnapshotInPaintProfiler.bind(this)); + new Timeline.TimelineLayersView(this._model, this._showSnapshotInPaintProfiler.bind(this)); return this._lazyLayersView; } _paintProfilerView() { if (this._lazyPaintProfilerView) return this._lazyPaintProfilerView; - this._lazyPaintProfilerView = new WebInspector.TimelinePaintProfilerView(this._frameModel); + this._lazyPaintProfilerView = new Timeline.TimelinePaintProfilerView(this._frameModel); return this._lazyPaintProfilerView; } /** - * @param {!WebInspector.TimelineModeView} modeView + * @param {!Timeline.TimelineModeView} modeView */ _addModeView(modeView) { modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime()); @@ -253,7 +253,7 @@ } /** - * @param {!WebInspector.TimelinePanel.State} state + * @param {!Timeline.TimelinePanel.State} state */ _setState(state) { this._state = state; @@ -262,14 +262,14 @@ /** * @param {string} name - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting * @param {string} tooltip - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ _createSettingCheckbox(name, setting, tooltip) { if (!this._recordingOptionUIControls) this._recordingOptionUIControls = []; - var checkboxItem = new WebInspector.ToolbarCheckbox(name, tooltip, setting); + var checkboxItem = new UI.ToolbarCheckbox(name, tooltip, setting); this._recordingOptionUIControls.push(checkboxItem); return checkboxItem; } @@ -278,10 +278,10 @@ this._panelToolbar.removeToolbarItems(); var perspectiveSetting = - WebInspector.settings.createSetting('timelinePerspective', WebInspector.TimelinePanel.Perspectives.Load); + Common.settings.createSetting('timelinePerspective', Timeline.TimelinePanel.Perspectives.Load); if (Runtime.experiments.isEnabled('timelineRecordingPerspectives')) { /** - * @this {!WebInspector.TimelinePanel} + * @this {!Timeline.TimelinePanel} */ function onPerspectiveChanged() { perspectiveSetting.set(perspectiveCombobox.selectElement().value); @@ -299,22 +299,22 @@ perspectiveCombobox.select(option); } - var perspectiveCombobox = new WebInspector.ToolbarComboBox(onPerspectiveChanged.bind(this)); - addPerspectiveOption(WebInspector.TimelinePanel.Perspectives.Load, WebInspector.UIString('Page Load')); + var perspectiveCombobox = new UI.ToolbarComboBox(onPerspectiveChanged.bind(this)); + addPerspectiveOption(Timeline.TimelinePanel.Perspectives.Load, Common.UIString('Page Load')); addPerspectiveOption( - WebInspector.TimelinePanel.Perspectives.Responsiveness, WebInspector.UIString('Responsiveness')); - addPerspectiveOption(WebInspector.TimelinePanel.Perspectives.Custom, WebInspector.UIString('Custom')); + Timeline.TimelinePanel.Perspectives.Responsiveness, Common.UIString('Responsiveness')); + addPerspectiveOption(Timeline.TimelinePanel.Perspectives.Custom, Common.UIString('Custom')); this._panelToolbar.appendToolbarItem(perspectiveCombobox); switch (perspectiveSetting.get()) { - case WebInspector.TimelinePanel.Perspectives.Load: + case Timeline.TimelinePanel.Perspectives.Load: this._captureNetworkSetting.set(true); this._captureJSProfileSetting.set(true); this._captureMemorySetting.set(false); this._captureLayersAndPicturesSetting.set(false); this._captureFilmStripSetting.set(true); break; - case WebInspector.TimelinePanel.Perspectives.Responsiveness: + case Timeline.TimelinePanel.Perspectives.Responsiveness: this._captureNetworkSetting.set(true); this._captureJSProfileSetting.set(true); this._captureMemorySetting.set(false); @@ -324,43 +324,43 @@ } } if (Runtime.experiments.isEnabled('timelineRecordingPerspectives') && - perspectiveSetting.get() === WebInspector.TimelinePanel.Perspectives.Load) { + perspectiveSetting.get() === Timeline.TimelinePanel.Perspectives.Load) { this._reloadButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Record & Reload'), 'largeicon-refresh'); - this._reloadButton.addEventListener('click', () => WebInspector.targetManager.reloadPage()); + new UI.ToolbarButton(Common.UIString('Record & Reload'), 'largeicon-refresh'); + this._reloadButton.addEventListener('click', () => SDK.targetManager.reloadPage()); this._panelToolbar.appendToolbarItem(this._reloadButton); } else { - this._panelToolbar.appendToolbarItem(WebInspector.Toolbar.createActionButton(this._toggleRecordAction)); + this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._toggleRecordAction)); } this._updateTimelineControls(); - var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString('Clear recording'), 'largeicon-clear'); + var clearButton = new UI.ToolbarButton(Common.UIString('Clear recording'), 'largeicon-clear'); clearButton.addEventListener('click', this._clear, this); this._panelToolbar.appendToolbarItem(clearButton); this._panelToolbar.appendSeparator(); - this._panelToolbar.appendText(WebInspector.UIString('Capture:')); + this._panelToolbar.appendText(Common.UIString('Capture:')); var screenshotCheckbox = this._createSettingCheckbox( - WebInspector.UIString('Screenshots'), this._captureFilmStripSetting, - WebInspector.UIString('Capture screenshots while recording. (Has small performance overhead)')); + Common.UIString('Screenshots'), this._captureFilmStripSetting, + Common.UIString('Capture screenshots while recording. (Has small performance overhead)')); if (!Runtime.experiments.isEnabled('timelineRecordingPerspectives') || - perspectiveSetting.get() === WebInspector.TimelinePanel.Perspectives.Custom) { + perspectiveSetting.get() === Timeline.TimelinePanel.Perspectives.Custom) { this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( - WebInspector.UIString('Network'), this._captureNetworkSetting, - WebInspector.UIString('Show network requests information'))); + Common.UIString('Network'), this._captureNetworkSetting, + Common.UIString('Show network requests information'))); this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( - WebInspector.UIString('JS Profile'), this._captureJSProfileSetting, - WebInspector.UIString('Capture JavaScript stacks with sampling profiler. (Has small performance overhead)'))); + Common.UIString('JS Profile'), this._captureJSProfileSetting, + Common.UIString('Capture JavaScript stacks with sampling profiler. (Has small performance overhead)'))); this._panelToolbar.appendToolbarItem(screenshotCheckbox); this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( - WebInspector.UIString('Memory'), this._captureMemorySetting, - WebInspector.UIString('Capture memory information on every timeline event.'))); + Common.UIString('Memory'), this._captureMemorySetting, + Common.UIString('Capture memory information on every timeline event.'))); this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( - WebInspector.UIString('Paint'), this._captureLayersAndPicturesSetting, - WebInspector.UIString( + Common.UIString('Paint'), this._captureLayersAndPicturesSetting, + Common.UIString( 'Capture graphics layer positions and rasterization draw calls. (Has large performance overhead)'))); } else { this._panelToolbar.appendToolbarItem(screenshotCheckbox); @@ -368,8 +368,8 @@ if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) { this._panelToolbar.appendToolbarItem(this._createSettingCheckbox( - WebInspector.UIString('CSS coverage'), this._markUnusedCSS, - WebInspector.UIString('Mark unused CSS in souces.'))); + Common.UIString('CSS coverage'), this._markUnusedCSS, + Common.UIString('Mark unused CSS in souces.'))); } this._captureNetworkSetting.addChangeListener(this._onNetworkChanged, this); @@ -378,12 +378,12 @@ this._panelToolbar.appendSeparator(); var garbageCollectButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Collect garbage'), 'largeicon-trash-bin'); + new UI.ToolbarButton(Common.UIString('Collect garbage'), 'largeicon-trash-bin'); garbageCollectButton.addEventListener('click', this._garbageCollectButtonClicked, this); this._panelToolbar.appendToolbarItem(garbageCollectButton); this._panelToolbar.appendSeparator(); - this._cpuThrottlingCombobox = new WebInspector.ToolbarComboBox(this._onCPUThrottlingChanged.bind(this)); + this._cpuThrottlingCombobox = new UI.ToolbarComboBox(this._onCPUThrottlingChanged.bind(this)); this._panelToolbar.appendToolbarItem(this._cpuThrottlingCombobox); this._populateCPUThrottingCombobox(); } @@ -406,27 +406,27 @@ hasSelection = true; } var predefinedRates = new Map([ - [1, WebInspector.UIString('No CPU throttling')], [2, WebInspector.UIString('High end device (2\xD7 slowdown)')], - [5, WebInspector.UIString('Low end device (5\xD7 slowdown)')] + [1, Common.UIString('No CPU throttling')], [2, Common.UIString('High end device (2\xD7 slowdown)')], + [5, Common.UIString('Low end device (5\xD7 slowdown)')] ]); for (var rate of predefinedRates) addGroupingOption(rate[1], rate[0]); if (this._customCPUThrottlingRate && !predefinedRates.has(this._customCPUThrottlingRate)) addGroupingOption( - WebInspector.UIString('Custom rate (%d\xD7 slowdown)', this._customCPUThrottlingRate), + Common.UIString('Custom rate (%d\xD7 slowdown)', this._customCPUThrottlingRate), this._customCPUThrottlingRate); - addGroupingOption(WebInspector.UIString('Set custom rate\u2026'), 0); + addGroupingOption(Common.UIString('Set custom rate\u2026'), 0); } _prepareToLoadTimeline() { - console.assert(this._state === WebInspector.TimelinePanel.State.Idle); - this._setState(WebInspector.TimelinePanel.State.Loading); + console.assert(this._state === Timeline.TimelinePanel.State.Idle); + this._setState(Timeline.TimelinePanel.State.Loading); } _createFileSelector() { if (this._fileSelectorElement) this._fileSelectorElement.remove(); - this._fileSelectorElement = WebInspector.createFileSelectorElement(this._loadFromFile.bind(this)); + this._fileSelectorElement = Bindings.createFileSelectorElement(this._loadFromFile.bind(this)); this.element.appendChild(this._fileSelectorElement); } @@ -434,7 +434,7 @@ * @param {!Event} event */ _contextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendItemsAtLocation('timelineMenu'); contextMenu.show(); } @@ -443,23 +443,23 @@ * @return {boolean} */ _saveToFile() { - if (this._state !== WebInspector.TimelinePanel.State.Idle) + if (this._state !== Timeline.TimelinePanel.State.Idle) return true; if (this._model.isEmpty()) return true; var now = new Date(); var fileName = 'TimelineRawData-' + now.toISO8601Compact() + '.json'; - var stream = new WebInspector.FileOutputStream(); + var stream = new Bindings.FileOutputStream(); /** * @param {boolean} accepted - * @this {WebInspector.TimelinePanel} + * @this {Timeline.TimelinePanel} */ function callback(accepted) { if (!accepted) return; - var saver = new WebInspector.TracingTimelineSaver(); + var saver = new Timeline.TracingTimelineSaver(); this._tracingModelBackingStorage.writeToStream(stream, saver); } stream.open(fileName, callback.bind(this)); @@ -478,10 +478,10 @@ * @param {!File} file */ _loadFromFile(file) { - if (this._state !== WebInspector.TimelinePanel.State.Idle) + if (this._state !== Timeline.TimelinePanel.State.Idle) return; this._prepareToLoadTimeline(); - this._loader = WebInspector.TimelineLoader.loadFromFile(this._tracingModel, file, this); + this._loader = Timeline.TimelineLoader.loadFromFile(this._tracingModel, file, this); this._createFileSelector(); } @@ -489,10 +489,10 @@ * @param {string} url */ _loadFromURL(url) { - if (this._state !== WebInspector.TimelinePanel.State.Idle) + if (this._state !== Timeline.TimelinePanel.State.Idle) return; this._prepareToLoadTimeline(); - this._loader = WebInspector.TimelineLoader.loadFromURL(this._tracingModel, url, this); + this._loader = Timeline.TimelineLoader.loadFromURL(this._tracingModel, url, this); } _refreshViews() { @@ -506,28 +506,28 @@ _onModeChanged() { // Set up overview controls. this._overviewControls = []; - this._overviewControls.push(new WebInspector.TimelineEventOverviewResponsiveness(this._model, this._frameModel)); + this._overviewControls.push(new Timeline.TimelineEventOverviewResponsiveness(this._model, this._frameModel)); if (Runtime.experiments.isEnabled('inputEventsOnTimelineOverview')) - this._overviewControls.push(new WebInspector.TimelineEventOverviewInput(this._model)); - this._overviewControls.push(new WebInspector.TimelineEventOverviewFrames(this._model, this._frameModel)); - this._overviewControls.push(new WebInspector.TimelineEventOverviewCPUActivity(this._model)); - this._overviewControls.push(new WebInspector.TimelineEventOverviewNetwork(this._model)); + this._overviewControls.push(new Timeline.TimelineEventOverviewInput(this._model)); + this._overviewControls.push(new Timeline.TimelineEventOverviewFrames(this._model, this._frameModel)); + this._overviewControls.push(new Timeline.TimelineEventOverviewCPUActivity(this._model)); + this._overviewControls.push(new Timeline.TimelineEventOverviewNetwork(this._model)); if (this._captureFilmStripSetting.get()) - this._overviewControls.push(new WebInspector.TimelineFilmStripOverview(this._model, this._filmStripModel)); + this._overviewControls.push(new Timeline.TimelineFilmStripOverview(this._model, this._filmStripModel)); if (this._captureMemorySetting.get()) - this._overviewControls.push(new WebInspector.TimelineEventOverviewMemory(this._model)); + this._overviewControls.push(new Timeline.TimelineEventOverviewMemory(this._model)); this._overviewPane.setOverviewControls(this._overviewControls); // Set up the main view. this._removeAllModeViews(); this._flameChart = - new WebInspector.TimelineFlameChartView(this, this._model, this._frameModel, this._irModel, this._filters); + new Timeline.TimelineFlameChartView(this, this._model, this._frameModel, this._irModel, this._filters); this._flameChart.enableNetworkPane(this._captureNetworkSetting.get()); this._addModeView(this._flameChart); if (this._captureMemorySetting.get()) - this._addModeView(new WebInspector.MemoryCountersGraph( - this, this._model, [WebInspector.TimelineUIUtils.visibleEventsFilter()])); + this._addModeView(new Timeline.MemoryCountersGraph( + this, this._model, [Timeline.TimelineUIUtils.visibleEventsFilter()])); this.doResize(); this.select(null); @@ -545,7 +545,7 @@ var isLastOption = this._cpuThrottlingCombobox.selectedIndex() === this._cpuThrottlingCombobox.size() - 1; this._populateCPUThrottingCombobox(); var resultPromise = isLastOption ? - WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog.show(this._cpuThrottlingCombobox.element) : + Timeline.TimelinePanel.CustomCPUThrottlingRateDialog.show(this._cpuThrottlingCombobox.element) : Promise.resolve(value); resultPromise.then(text => { var value = Number.parseFloat(text); @@ -563,7 +563,7 @@ */ _setUIControlsEnabled(enabled) { /** - * @param {!WebInspector.ToolbarButton} toolbarButton + * @param {!UI.ToolbarButton} toolbarButton */ function handler(toolbarButton) { toolbarButton.setEnabled(enabled); @@ -576,17 +576,17 @@ */ _startRecording(userInitiated) { console.assert(!this._statusPane, 'Status pane is already opened.'); - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); if (!mainTarget) return; - this._setState(WebInspector.TimelinePanel.State.StartPending); + this._setState(Timeline.TimelinePanel.State.StartPending); this._showRecordingStarted(); if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._markUnusedCSS.get()) - WebInspector.CSSModel.fromTarget(mainTarget).startRuleUsageTracking(); + SDK.CSSModel.fromTarget(mainTarget).startRuleUsageTracking(); this._autoRecordGeneration = userInitiated ? null : Symbol('Generation'); - this._controller = new WebInspector.TimelineController(mainTarget, this, this._tracingModel); + this._controller = new Timeline.TimelineController(mainTarget, this, this._tracingModel); this._controller.startRecording( true, this._captureJSProfileSetting.get(), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get(), @@ -596,7 +596,7 @@ this._overviewControls[i].timelineStarted(); if (userInitiated) - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.TimelineStarted); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted); this._setUIControlsEnabled(false); this._hideRecordingHelpMessage(); } @@ -604,10 +604,10 @@ _stopRecording() { if (this._statusPane) { this._statusPane.finish(); - this._statusPane.updateStatus(WebInspector.UIString('Stopping timeline\u2026')); - this._statusPane.updateProgressBar(WebInspector.UIString('Received'), 0); + this._statusPane.updateStatus(Common.UIString('Stopping timeline\u2026')); + this._statusPane.updateProgressBar(Common.UIString('Received'), 0); } - this._setState(WebInspector.TimelinePanel.State.StopPending); + this._setState(Timeline.TimelinePanel.State.StopPending); this._autoRecordGeneration = null; this._controller.stopRecording(); this._controller = null; @@ -619,7 +619,7 @@ } _updateTimelineControls() { - var state = WebInspector.TimelinePanel.State; + var state = Timeline.TimelinePanel.State; this._toggleRecordAction.setToggled(this._state === state.Recording); this._toggleRecordAction.setEnabled(this._state === state.Recording || this._state === state.Idle); this._panelToolbar.setEnabled(this._state !== state.Loading); @@ -627,23 +627,23 @@ } _toggleRecording() { - if (this._state === WebInspector.TimelinePanel.State.Idle) + if (this._state === Timeline.TimelinePanel.State.Idle) this._startRecording(true); - else if (this._state === WebInspector.TimelinePanel.State.Recording) + else if (this._state === Timeline.TimelinePanel.State.Recording) this._stopRecording(); } _garbageCollectButtonClicked() { - var targets = WebInspector.targetManager.targets(); + var targets = SDK.targetManager.targets(); for (var i = 0; i < targets.length; ++i) targets[i].heapProfilerAgent().collectGarbage(); } _clear() { if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._markUnusedCSS.get()) - WebInspector.CoverageProfile.instance().reset(); + Components.CoverageProfile.instance().reset(); - WebInspector.LineLevelProfile.instance().reset(); + Components.LineLevelProfile.instance().reset(); this._tracingModel.reset(); this._model.reset(); this._showRecordingHelpMessage(); @@ -666,10 +666,10 @@ */ recordingStarted() { this._clear(); - this._setState(WebInspector.TimelinePanel.State.Recording); + this._setState(Timeline.TimelinePanel.State.Recording); this._showRecordingStarted(); - this._statusPane.updateStatus(WebInspector.UIString('Recording\u2026')); - this._statusPane.updateProgressBar(WebInspector.UIString('Buffer usage'), 0); + this._statusPane.updateStatus(Common.UIString('Recording\u2026')); + this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), 0); this._statusPane.startTimer(); this._hideRecordingHelpMessage(); } @@ -679,7 +679,7 @@ * @param {number} usage */ recordingProgress(usage) { - this._statusPane.updateProgressBar(WebInspector.UIString('Buffer usage'), usage * 100); + this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), usage * 100); } _showRecordingHelpMessage() { @@ -695,21 +695,21 @@ } var recordNode = encloseWithTag( - 'b', WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-recording')[0].name); + 'b', UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-recording')[0].name); var reloadNode = - encloseWithTag('b', WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name); - var navigateNode = encloseWithTag('b', WebInspector.UIString('WASD (ZQSD)')); + encloseWithTag('b', UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload')[0].name); + var navigateNode = encloseWithTag('b', Common.UIString('WASD (ZQSD)')); var hintText = createElementWithClass('div'); - hintText.appendChild(WebInspector.formatLocalized( + hintText.appendChild(UI.formatLocalized( 'To capture a new timeline, click the record toolbar button or hit %s.', [recordNode])); hintText.createChild('br'); hintText.appendChild( - WebInspector.formatLocalized('To evaluate page load performance, hit %s to record the reload.', [reloadNode])); + UI.formatLocalized('To evaluate page load performance, hit %s to record the reload.', [reloadNode])); hintText.createChild('p'); hintText.appendChild( - WebInspector.formatLocalized('After recording, select an area of interest in the overview by dragging.', [])); + UI.formatLocalized('After recording, select an area of interest in the overview by dragging.', [])); hintText.createChild('br'); - hintText.appendChild(WebInspector.formatLocalized( + hintText.appendChild(UI.formatLocalized( 'Then, zoom and pan the timeline with the mousewheel and %s keys.', [navigateNode])); this._hideRecordingHelpMessage(); this._helpMessageElement = @@ -731,9 +731,9 @@ if (this._statusPane) this._statusPane.hide(); - this._statusPane = new WebInspector.TimelinePanel.StatusPane(false, this._cancelLoading.bind(this)); + this._statusPane = new Timeline.TimelinePanel.StatusPane(false, this._cancelLoading.bind(this)); this._statusPane.showPane(this._statusPaneContainer); - this._statusPane.updateStatus(WebInspector.UIString('Loading timeline\u2026')); + this._statusPane.updateStatus(Common.UIString('Loading timeline\u2026')); // FIXME: make loading from backend cancelable as well. if (!this._loader) this._statusPane.finish(); @@ -746,7 +746,7 @@ */ loadingProgress(progress) { if (typeof progress === 'number') - this._statusPane.updateProgressBar(WebInspector.UIString('Received'), progress * 100); + this._statusPane.updateProgressBar(Common.UIString('Received'), progress * 100); } /** @@ -756,7 +756,7 @@ loadingComplete(success) { var loadedFromFile = !!this._loader; delete this._loader; - this._setState(WebInspector.TimelinePanel.State.Idle); + this._setState(Timeline.TimelinePanel.State.Idle); if (!success) { this._statusPane.hide(); @@ -766,16 +766,16 @@ } if (this._statusPane) - this._statusPane.updateStatus(WebInspector.UIString('Processing timeline\u2026')); + this._statusPane.updateStatus(Common.UIString('Processing timeline\u2026')); this._model.setEvents(this._tracingModel, loadedFromFile); this._frameModel.reset(); this._frameModel.addTraceEvents( - WebInspector.targetManager.mainTarget(), this._model.inspectedTargetEvents(), this._model.sessionId() || ''); + SDK.targetManager.mainTarget(), this._model.inspectedTargetEvents(), this._model.sessionId() || ''); this._filmStripModel.reset(this._tracingModel); - var groups = WebInspector.TimelineModel.AsyncEventGroup; + var groups = TimelineModel.TimelineModel.AsyncEventGroup; var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEventsByGroup.get(groups.animation)); - this._model.cpuProfiles().forEach(profile => WebInspector.LineLevelProfile.instance().appendCPUProfile(profile)); + this._model.cpuProfiles().forEach(profile => Components.LineLevelProfile.instance().appendCPUProfile(profile)); if (this._statusPane) this._statusPane.hide(); delete this._statusPane; @@ -794,9 +794,9 @@ _showRecordingStarted() { if (this._statusPane) return; - this._statusPane = new WebInspector.TimelinePanel.StatusPane(true, this._stopRecording.bind(this)); + this._statusPane = new Timeline.TimelinePanel.StatusPane(true, this._stopRecording.bind(this)); this._statusPane.showPane(this._statusPaneContainer); - this._statusPane.updateStatus(WebInspector.UIString('Initializing recording\u2026')); + this._statusPane.updateStatus(Common.UIString('Initializing recording\u2026')); } _cancelLoading() { @@ -806,46 +806,46 @@ _setMarkers() { var markers = new Map(); - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var zeroTime = this._model.minimumRecordTime(); for (var record of this._model.eventDividerRecords()) { if (record.type() === recordTypes.TimeStamp || record.type() === recordTypes.ConsoleTime) continue; - markers.set(record.startTime(), WebInspector.TimelineUIUtils.createDividerForRecord(record, zeroTime, 0)); + markers.set(record.startTime(), Timeline.TimelineUIUtils.createDividerForRecord(record, zeroTime, 0)); } this._overviewPane.setMarkers(markers); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _pageReloadRequested(event) { - if (this._state !== WebInspector.TimelinePanel.State.Idle || !this.isShowing()) + if (this._state !== Timeline.TimelinePanel.State.Idle || !this.isShowing()) return; this._startRecording(false); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _loadEventFired(event) { - if (this._state !== WebInspector.TimelinePanel.State.Recording || !this._autoRecordGeneration) + if (this._state !== Timeline.TimelinePanel.State.Recording || !this._autoRecordGeneration) return; setTimeout(stopRecordingOnReload.bind(this, this._autoRecordGeneration), this._millisecondsToRecordAfterLoadEvent); /** - * @this {WebInspector.TimelinePanel} + * @this {Timeline.TimelinePanel} * @param {!Object} recordGeneration */ function stopRecordingOnReload(recordGeneration) { // Check if we're still in the same recording session. - if (this._state !== WebInspector.TimelinePanel.State.Recording || this._autoRecordGeneration !== recordGeneration) + if (this._state !== Timeline.TimelinePanel.State.Recording || this._autoRecordGeneration !== recordGeneration) return; this._stopRecording(); } } - // WebInspector.Searchable implementation + // UI.Searchable implementation /** * @override @@ -929,14 +929,14 @@ // FIXME: search on all threads. var events = this._model.mainThreadEvents(); - var filters = this._filters.concat([new WebInspector.TimelineTextFilter(this._searchRegex)]); + var filters = this._filters.concat([new Timeline.TimelineTextFilter(this._searchRegex)]); var matches = []; for (var index = events.lowerBound(this._windowStartTime, (time, event) => time - event.startTime); index < events.length; ++index) { var event = events[index]; if (event.startTime > this._windowEndTime) break; - if (WebInspector.TimelineModel.isVisible(filters, event)) + if (TimelineModel.TimelineModel.isVisible(filters, event)) matches.push(event); } @@ -967,7 +967,7 @@ /** * @override - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -980,14 +980,14 @@ _updateSelectionDetails() { switch (this._selection.type()) { - case WebInspector.TimelineSelection.Type.TraceEvent: - var event = /** @type {!WebInspector.TracingModel.Event} */ (this._selection.object()); - WebInspector.TimelineUIUtils.buildTraceEventDetails( + case Timeline.TimelineSelection.Type.TraceEvent: + var event = /** @type {!SDK.TracingModel.Event} */ (this._selection.object()); + Timeline.TimelineUIUtils.buildTraceEventDetails( event, this._model, this._detailsLinkifier, true, this._appendDetailsTabsForTraceEventAndShowDetails.bind(this, event)); break; - case WebInspector.TimelineSelection.Type.Frame: - var frame = /** @type {!WebInspector.TimelineFrame} */ (this._selection.object()); + case Timeline.TimelineSelection.Type.Frame: + var frame = /** @type {!TimelineModel.TimelineFrame} */ (this._selection.object()); var screenshotTime = frame.idle ? frame.startTime : frame.endTime; // For idle frames, look at the state at the beginning of the frame. @@ -995,21 +995,21 @@ if (filmStripFrame && filmStripFrame.timestamp - frame.endTime > 10) filmStripFrame = null; this.showInDetails( - WebInspector.TimelineUIUtils.generateDetailsContentForFrame(this._frameModel, frame, filmStripFrame)); + Timeline.TimelineUIUtils.generateDetailsContentForFrame(this._frameModel, frame, filmStripFrame)); if (frame.layerTree) { var layersView = this._layersView(); layersView.showLayerTree(frame.layerTree); - if (!this._detailsView.hasTab(WebInspector.TimelinePanel.DetailsTab.LayerViewer)) + if (!this._detailsView.hasTab(Timeline.TimelinePanel.DetailsTab.LayerViewer)) this._detailsView.appendTab( - WebInspector.TimelinePanel.DetailsTab.LayerViewer, WebInspector.UIString('Layers'), layersView); + Timeline.TimelinePanel.DetailsTab.LayerViewer, Common.UIString('Layers'), layersView); } break; - case WebInspector.TimelineSelection.Type.NetworkRequest: - var request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */ (this._selection.object()); - WebInspector.TimelineUIUtils.buildNetworkRequestDetails(request, this._model, this._detailsLinkifier) + case Timeline.TimelineSelection.Type.NetworkRequest: + var request = /** @type {!TimelineModel.TimelineModel.NetworkRequest} */ (this._selection.object()); + Timeline.TimelineUIUtils.buildNetworkRequestDetails(request, this._model, this._detailsLinkifier) .then(this.showInDetails.bind(this)); break; - case WebInspector.TimelineSelection.Type.Range: + case Timeline.TimelineSelection.Type.Range: this._updateSelectedRangeStats(this._selection._startTime, this._selection._endTime); break; } @@ -1018,16 +1018,16 @@ } /** - * @param {!WebInspector.TimelineSelection} selection - * @return {?WebInspector.TimelineFrame} + * @param {!Timeline.TimelineSelection} selection + * @return {?TimelineModel.TimelineFrame} */ _frameForSelection(selection) { switch (selection.type()) { - case WebInspector.TimelineSelection.Type.Frame: - return /** @type {!WebInspector.TimelineFrame} */ (selection.object()); - case WebInspector.TimelineSelection.Type.Range: + case Timeline.TimelineSelection.Type.Frame: + return /** @type {!TimelineModel.TimelineFrame} */ (selection.object()); + case Timeline.TimelineSelection.Type.Range: return null; - case WebInspector.TimelineSelection.Type.TraceEvent: + case Timeline.TimelineSelection.Type.TraceEvent: return this._frameModel.filteredFrames(selection._endTime, selection._endTime)[0]; default: console.assert(false, 'Should never be reached'); @@ -1048,48 +1048,48 @@ index = Number.constrain(index + offset, 0, frames.length - 1); var frame = frames[index]; this._revealTimeRange(frame.startTime, frame.endTime); - this.select(WebInspector.TimelineSelection.fromFrame(frame)); + this.select(Timeline.TimelineSelection.fromFrame(frame)); return true; } /** - * @param {!WebInspector.PaintProfilerSnapshot} snapshot + * @param {!SDK.PaintProfilerSnapshot} snapshot */ _showSnapshotInPaintProfiler(snapshot) { var paintProfilerView = this._paintProfilerView(); var hasProfileData = paintProfilerView.setSnapshot(snapshot); - if (!this._detailsView.hasTab(WebInspector.TimelinePanel.DetailsTab.PaintProfiler)) + if (!this._detailsView.hasTab(Timeline.TimelinePanel.DetailsTab.PaintProfiler)) this._detailsView.appendTab( - WebInspector.TimelinePanel.DetailsTab.PaintProfiler, WebInspector.UIString('Paint Profiler'), + Timeline.TimelinePanel.DetailsTab.PaintProfiler, Common.UIString('Paint Profiler'), paintProfilerView, undefined, undefined, true); - this._detailsView.selectTab(WebInspector.TimelinePanel.DetailsTab.PaintProfiler, true); + this._detailsView.selectTab(Timeline.TimelinePanel.DetailsTab.PaintProfiler, true); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {!Node} content */ _appendDetailsTabsForTraceEventAndShowDetails(event, content) { this.showInDetails(content); - if (event.name === WebInspector.TimelineModel.RecordType.Paint || - event.name === WebInspector.TimelineModel.RecordType.RasterTask) + if (event.name === TimelineModel.TimelineModel.RecordType.Paint || + event.name === TimelineModel.TimelineModel.RecordType.RasterTask) this._showEventInPaintProfiler(event); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _showEventInPaintProfiler(event) { - var target = WebInspector.targetManager.mainTarget(); + var target = SDK.targetManager.mainTarget(); if (!target) return; var paintProfilerView = this._paintProfilerView(); var hasProfileData = paintProfilerView.setEvent(target, event); if (!hasProfileData) return; - if (!this._detailsView.hasTab(WebInspector.TimelinePanel.DetailsTab.PaintProfiler)) + if (!this._detailsView.hasTab(Timeline.TimelinePanel.DetailsTab.PaintProfiler)) this._detailsView.appendTab( - WebInspector.TimelinePanel.DetailsTab.PaintProfiler, WebInspector.UIString('Paint Profiler'), + Timeline.TimelinePanel.DetailsTab.PaintProfiler, Common.UIString('Paint Profiler'), paintProfilerView, undefined, undefined, false); } @@ -1098,17 +1098,17 @@ * @param {number} endTime */ _updateSelectedRangeStats(startTime, endTime) { - this.showInDetails(WebInspector.TimelineUIUtils.buildRangeStats(this._model, startTime, endTime)); + this.showInDetails(Timeline.TimelineUIUtils.buildRangeStats(this._model, startTime, endTime)); } /** * @override - * @param {?WebInspector.TimelineSelection} selection - * @param {!WebInspector.TimelinePanel.DetailsTab=} preferredTab + * @param {?Timeline.TimelineSelection} selection + * @param {!Timeline.TimelinePanel.DetailsTab=} preferredTab */ select(selection, preferredTab) { if (!selection) - selection = WebInspector.TimelineSelection.fromRange(this._windowStartTime, this._windowEndTime); + selection = Timeline.TimelineSelection.fromRange(this._windowStartTime, this._windowEndTime); this._selection = selection; this._detailsLinkifier.reset(); if (preferredTab) @@ -1129,10 +1129,10 @@ for (var index = events.upperBound(time, (time, event) => time - event.startTime) - 1; index >= 0; --index) { var event = events[index]; var endTime = event.endTime || event.startTime; - if (WebInspector.TracingModel.isTopLevelEvent(event) && endTime < time) + if (SDK.TracingModel.isTopLevelEvent(event) && endTime < time) break; - if (WebInspector.TimelineModel.isVisible(this._filters, event) && endTime >= time) { - this.select(WebInspector.TimelineSelection.fromTraceEvent(event)); + if (TimelineModel.TimelineModel.isVisible(this._filters, event) && endTime >= time) { + this.select(Timeline.TimelineSelection.fromTraceEvent(event)); return; } } @@ -1141,7 +1141,7 @@ /** * @override - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event */ highlightEvent(event) { for (var view of this._currentViews) @@ -1180,7 +1180,7 @@ var item = items[0]; if (item.kind === 'string') { var url = dataTransfer.getData('text/uri-list'); - if (new WebInspector.ParsedURL(url).isValid) + if (new Common.ParsedURL(url).isValid) this._loadFromURL(url); } else if (item.kind === 'file') { var entry = items[0].webkitGetAsEntry(); @@ -1240,7 +1240,7 @@ /** * @enum {string} */ -WebInspector.TimelinePanel.Perspectives = { +Timeline.TimelinePanel.Perspectives = { Load: 'Load', Responsiveness: 'Responsiveness', Custom: 'Custom' @@ -1249,7 +1249,7 @@ /** * @enum {string} */ -WebInspector.TimelinePanel.DetailsTab = { +Timeline.TimelinePanel.DetailsTab = { Details: 'Details', Events: 'Events', CallTree: 'CallTree', @@ -1261,7 +1261,7 @@ /** * @enum {symbol} */ -WebInspector.TimelinePanel.State = { +Timeline.TimelinePanel.State = { Idle: Symbol('Idle'), StartPending: Symbol('StartPending'), Recording: Symbol('Recording'), @@ -1270,15 +1270,15 @@ }; // Define row and header height, should be in sync with styles for timeline graphs. -WebInspector.TimelinePanel.rowHeight = 18; -WebInspector.TimelinePanel.headerHeight = 20; +Timeline.TimelinePanel.rowHeight = 18; +Timeline.TimelinePanel.headerHeight = 20; /** * @interface */ -WebInspector.TimelineLifecycleDelegate = function() {}; +Timeline.TimelineLifecycleDelegate = function() {}; -WebInspector.TimelineLifecycleDelegate.prototype = { +Timeline.TimelineLifecycleDelegate.prototype = { recordingStarted: function() {}, /** @@ -1302,47 +1302,47 @@ /** * @unrestricted */ -WebInspector.TimelineDetailsView = class extends WebInspector.TabbedPane { +Timeline.TimelineDetailsView = class extends UI.TabbedPane { /** - * @param {!WebInspector.TimelineModel} timelineModel - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters - * @param {!WebInspector.TimelineModeViewDelegate} delegate + * @param {!TimelineModel.TimelineModel} timelineModel + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters + * @param {!Timeline.TimelineModeViewDelegate} delegate */ constructor(timelineModel, filters, delegate) { super(); this.element.classList.add('timeline-details'); - var tabIds = WebInspector.TimelinePanel.DetailsTab; - this._defaultDetailsWidget = new WebInspector.VBox(); + var tabIds = Timeline.TimelinePanel.DetailsTab; + this._defaultDetailsWidget = new UI.VBox(); this._defaultDetailsWidget.element.classList.add('timeline-details-view'); this._defaultDetailsContentElement = this._defaultDetailsWidget.element.createChild('div', 'timeline-details-view-body vbox'); - this.appendTab(tabIds.Details, WebInspector.UIString('Summary'), this._defaultDetailsWidget); + this.appendTab(tabIds.Details, Common.UIString('Summary'), this._defaultDetailsWidget); this.setPreferredTab(tabIds.Details); - /** @type Map<string, WebInspector.TimelineTreeView> */ + /** @type Map<string, Timeline.TimelineTreeView> */ this._rangeDetailViews = new Map(); - var bottomUpView = new WebInspector.BottomUpTimelineTreeView(timelineModel, filters); - this.appendTab(tabIds.BottomUp, WebInspector.UIString('Bottom-Up'), bottomUpView); + var bottomUpView = new Timeline.BottomUpTimelineTreeView(timelineModel, filters); + this.appendTab(tabIds.BottomUp, Common.UIString('Bottom-Up'), bottomUpView); this._rangeDetailViews.set(tabIds.BottomUp, bottomUpView); - var callTreeView = new WebInspector.CallTreeTimelineTreeView(timelineModel, filters); - this.appendTab(tabIds.CallTree, WebInspector.UIString('Call Tree'), callTreeView); + var callTreeView = new Timeline.CallTreeTimelineTreeView(timelineModel, filters); + this.appendTab(tabIds.CallTree, Common.UIString('Call Tree'), callTreeView); this._rangeDetailViews.set(tabIds.CallTree, callTreeView); - var eventsView = new WebInspector.EventsTimelineTreeView(timelineModel, filters, delegate); - this.appendTab(tabIds.Events, WebInspector.UIString('Event Log'), eventsView); + var eventsView = new Timeline.EventsTimelineTreeView(timelineModel, filters, delegate); + this.appendTab(tabIds.Events, Common.UIString('Event Log'), eventsView); this._rangeDetailViews.set(tabIds.Events, eventsView); - this.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabSelected, this); + this.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); } /** * @param {!Node} node */ setContent(node) { - var allTabs = this.otherTabs(WebInspector.TimelinePanel.DetailsTab.Details); + var allTabs = this.otherTabs(Timeline.TimelinePanel.DetailsTab.Details); for (var i = 0; i < allTabs.length; ++i) { if (!this._rangeDetailViews.has(allTabs[i])) this.closeTab(allTabs[i]); @@ -1352,7 +1352,7 @@ } /** - * @param {!WebInspector.TimelineSelection} selection + * @param {!Timeline.TimelineSelection} selection */ updateContents(selection) { this._selection = selection; @@ -1365,7 +1365,7 @@ * @override * @param {string} id * @param {string} tabTitle - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {string=} tabTooltip * @param {boolean=} userGesture * @param {boolean=} isCloseable @@ -1384,7 +1384,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabSelected(event) { if (!event.data.isUserGesture) @@ -1397,9 +1397,9 @@ /** * @unrestricted */ -WebInspector.TimelineSelection = class { +Timeline.TimelineSelection = class { /** - * @param {!WebInspector.TimelineSelection.Type} type + * @param {!Timeline.TimelineSelection.Type} type * @param {number} startTime * @param {number} endTime * @param {!Object=} object @@ -1412,44 +1412,44 @@ } /** - * @param {!WebInspector.TimelineFrame} frame - * @return {!WebInspector.TimelineSelection} + * @param {!TimelineModel.TimelineFrame} frame + * @return {!Timeline.TimelineSelection} */ static fromFrame(frame) { - return new WebInspector.TimelineSelection( - WebInspector.TimelineSelection.Type.Frame, frame.startTime, frame.endTime, frame); + return new Timeline.TimelineSelection( + Timeline.TimelineSelection.Type.Frame, frame.startTime, frame.endTime, frame); } /** - * @param {!WebInspector.TimelineModel.NetworkRequest} request - * @return {!WebInspector.TimelineSelection} + * @param {!TimelineModel.TimelineModel.NetworkRequest} request + * @return {!Timeline.TimelineSelection} */ static fromNetworkRequest(request) { - return new WebInspector.TimelineSelection( - WebInspector.TimelineSelection.Type.NetworkRequest, request.startTime, request.endTime || request.startTime, + return new Timeline.TimelineSelection( + Timeline.TimelineSelection.Type.NetworkRequest, request.startTime, request.endTime || request.startTime, request); } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineSelection} + * @param {!SDK.TracingModel.Event} event + * @return {!Timeline.TimelineSelection} */ static fromTraceEvent(event) { - return new WebInspector.TimelineSelection( - WebInspector.TimelineSelection.Type.TraceEvent, event.startTime, event.endTime || (event.startTime + 1), event); + return new Timeline.TimelineSelection( + Timeline.TimelineSelection.Type.TraceEvent, event.startTime, event.endTime || (event.startTime + 1), event); } /** * @param {number} startTime * @param {number} endTime - * @return {!WebInspector.TimelineSelection} + * @return {!Timeline.TimelineSelection} */ static fromRange(startTime, endTime) { - return new WebInspector.TimelineSelection(WebInspector.TimelineSelection.Type.Range, startTime, endTime); + return new Timeline.TimelineSelection(Timeline.TimelineSelection.Type.Range, startTime, endTime); } /** - * @return {!WebInspector.TimelineSelection.Type} + * @return {!Timeline.TimelineSelection.Type} */ type() { return this._type; @@ -1480,7 +1480,7 @@ /** * @enum {string} */ -WebInspector.TimelineSelection.Type = { +Timeline.TimelineSelection.Type = { Frame: 'Frame', NetworkRequest: 'NetworkRequest', TraceEvent: 'TraceEvent', @@ -1490,13 +1490,13 @@ /** * @interface - * @extends {WebInspector.EventTarget} + * @extends {Common.EventTarget} */ -WebInspector.TimelineModeView = function() {}; +Timeline.TimelineModeView = function() {}; -WebInspector.TimelineModeView.prototype = { +Timeline.TimelineModeView.prototype = { /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ view: function() {}, @@ -1512,7 +1512,7 @@ refreshRecords: function() {}, /** - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event * @param {string=} regex * @param {boolean=} select */ @@ -1525,12 +1525,12 @@ setWindowTimes: function(startTime, endTime) {}, /** - * @param {?WebInspector.TimelineSelection} selection + * @param {?Timeline.TimelineSelection} selection */ setSelection: function(selection) {}, /** - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event */ highlightEvent: function(event) {} }; @@ -1538,9 +1538,9 @@ /** * @interface */ -WebInspector.TimelineModeViewDelegate = function() {}; +Timeline.TimelineModeViewDelegate = function() {}; -WebInspector.TimelineModeViewDelegate.prototype = { +Timeline.TimelineModeViewDelegate.prototype = { /** * @param {number} startTime * @param {number} endTime @@ -1548,8 +1548,8 @@ requestWindowTimes: function(startTime, endTime) {}, /** - * @param {?WebInspector.TimelineSelection} selection - * @param {!WebInspector.TimelinePanel.DetailsTab=} preferredTab + * @param {?Timeline.TimelineSelection} selection + * @param {!Timeline.TimelinePanel.DetailsTab=} preferredTab */ select: function(selection, preferredTab) {}, @@ -1564,7 +1564,7 @@ showInDetails: function(node) {}, /** - * @param {?WebInspector.TracingModel.Event} event + * @param {?SDK.TracingModel.Event} event */ highlightEvent: function(event) {} }; @@ -1572,25 +1572,25 @@ /** * @unrestricted */ -WebInspector.TimelineCategoryFilter = class extends WebInspector.TimelineModel.Filter { +Timeline.TimelineCategoryFilter = class extends TimelineModel.TimelineModel.Filter { constructor() { super(); } /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { - return !WebInspector.TimelineUIUtils.eventStyle(event).category.hidden; + return !Timeline.TimelineUIUtils.eventStyle(event).category.hidden; } }; /** * @unrestricted */ -WebInspector.TimelineIsLongFilter = class extends WebInspector.TimelineModel.Filter { +Timeline.TimelineIsLongFilter = class extends TimelineModel.TimelineModel.Filter { constructor() { super(); this._minimumRecordDuration = 0; @@ -1605,7 +1605,7 @@ /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { @@ -1614,7 +1614,7 @@ } }; -WebInspector.TimelineTextFilter = class extends WebInspector.TimelineModel.Filter { +Timeline.TimelineTextFilter = class extends TimelineModel.TimelineModel.Filter { /** * @param {!RegExp=} regExp */ @@ -1634,18 +1634,18 @@ /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { - return !this._regExp || WebInspector.TimelineUIUtils.testContentMatching(event, this._regExp); + return !this._regExp || Timeline.TimelineUIUtils.testContentMatching(event, this._regExp); } }; /** * @unrestricted */ -WebInspector.TimelinePanel.StatusPane = class extends WebInspector.VBox { +Timeline.TimelinePanel.StatusPane = class extends UI.VBox { /** * @param {boolean} showTimer * @param {function()} stopCallback @@ -1656,19 +1656,19 @@ this.contentElement.classList.add('timeline-status-dialog'); var statusLine = this.contentElement.createChild('div', 'status-dialog-line status'); - statusLine.createChild('div', 'label').textContent = WebInspector.UIString('Status'); + statusLine.createChild('div', 'label').textContent = Common.UIString('Status'); this._status = statusLine.createChild('div', 'content'); if (showTimer) { var timeLine = this.contentElement.createChild('div', 'status-dialog-line time'); - timeLine.createChild('div', 'label').textContent = WebInspector.UIString('Time'); + timeLine.createChild('div', 'label').textContent = Common.UIString('Time'); this._time = timeLine.createChild('div', 'content'); } var progressLine = this.contentElement.createChild('div', 'status-dialog-line progress'); this._progressLabel = progressLine.createChild('div', 'label'); this._progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator'); - this._stopButton = createTextButton(WebInspector.UIString('Stop'), stopCallback); + this._stopButton = createTextButton(Common.UIString('Stop'), stopCallback); this.contentElement.createChild('div', 'stop-button').appendChild(this._stopButton); } @@ -1728,41 +1728,41 @@ if (!this._timeUpdateTimer) return; var elapsed = (Date.now() - this._startTime) / 1000; - this._time.textContent = WebInspector.UIString('%s\u2009sec', elapsed.toFixed(precise ? 1 : 0)); + this._time.textContent = Common.UIString('%s\u2009sec', elapsed.toFixed(precise ? 1 : 0)); } }; /** - * @implements {WebInspector.QueryParamHandler} + * @implements {Common.QueryParamHandler} * @unrestricted */ -WebInspector.LoadTimelineHandler = class { +Timeline.LoadTimelineHandler = class { /** * @override * @param {string} value */ handleQueryParam(value) { - WebInspector.viewManager.showView('timeline').then(() => { - WebInspector.TimelinePanel.instance()._loadFromURL(window.decodeURIComponent(value)); + UI.viewManager.showView('timeline').then(() => { + Timeline.TimelinePanel.instance()._loadFromURL(window.decodeURIComponent(value)); }); } }; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.TimelinePanel.ActionDelegate = class { +Timeline.TimelinePanel.ActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - var panel = WebInspector.context.flavor(WebInspector.TimelinePanel); - console.assert(panel && panel instanceof WebInspector.TimelinePanel); + var panel = UI.context.flavor(Timeline.TimelinePanel); + console.assert(panel && panel instanceof Timeline.TimelinePanel); switch (actionId) { case 'timeline.toggle-recording': panel._toggleRecording(); @@ -1787,20 +1787,20 @@ /** * @unrestricted */ -WebInspector.TimelineFilters = class extends WebInspector.Object { +Timeline.TimelineFilters = class extends Common.Object { constructor() { super(); - this._categoryFilter = new WebInspector.TimelineCategoryFilter(); - this._durationFilter = new WebInspector.TimelineIsLongFilter(); - this._textFilter = new WebInspector.TimelineTextFilter(); + this._categoryFilter = new Timeline.TimelineCategoryFilter(); + this._durationFilter = new Timeline.TimelineIsLongFilter(); + this._textFilter = new Timeline.TimelineTextFilter(); this._filters = [this._categoryFilter, this._durationFilter, this._textFilter]; this._createFilterBar(); } /** - * @return {!Array<!WebInspector.TimelineModel.Filter>} + * @return {!Array<!TimelineModel.TimelineModel.Filter>} */ filters() { return this._filters; @@ -1814,60 +1814,60 @@ } /** - * @return {!WebInspector.ToolbarItem} + * @return {!UI.ToolbarItem} */ filterButton() { return this._filterBar.filterButton(); } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ filtersWidget() { return this._filterBar; } _createFilterBar() { - this._filterBar = new WebInspector.FilterBar('timelinePanel'); + this._filterBar = new UI.FilterBar('timelinePanel'); - this._textFilterUI = new WebInspector.TextFilterUI(); - this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, textFilterChanged, this); + this._textFilterUI = new UI.TextFilterUI(); + this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, textFilterChanged, this); this._filterBar.addFilter(this._textFilterUI); var durationOptions = []; - for (var durationMs of WebInspector.TimelineFilters._durationFilterPresetsMs) { + for (var durationMs of Timeline.TimelineFilters._durationFilterPresetsMs) { var durationOption = {}; if (!durationMs) { - durationOption.label = WebInspector.UIString('All'); - durationOption.title = WebInspector.UIString('Show all records'); + durationOption.label = Common.UIString('All'); + durationOption.title = Common.UIString('Show all records'); } else { - durationOption.label = WebInspector.UIString('\u2265 %dms', durationMs); - durationOption.title = WebInspector.UIString('Hide records shorter than %dms', durationMs); + durationOption.label = Common.UIString('\u2265 %dms', durationMs); + durationOption.title = Common.UIString('Hide records shorter than %dms', durationMs); } durationOption.value = durationMs; durationOptions.push(durationOption); } - var durationFilterUI = new WebInspector.ComboBoxFilterUI(durationOptions); - durationFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, durationFilterChanged, this); + var durationFilterUI = new UI.ComboBoxFilterUI(durationOptions); + durationFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, durationFilterChanged, this); this._filterBar.addFilter(durationFilterUI); var categoryFiltersUI = {}; - var categories = WebInspector.TimelineUIUtils.categories(); + var categories = Timeline.TimelineUIUtils.categories(); for (var categoryName in categories) { var category = categories[categoryName]; if (!category.visible) continue; - var filter = new WebInspector.CheckboxFilterUI(category.name, category.title); + var filter = new UI.CheckboxFilterUI(category.name, category.title); filter.setColor(category.color, 'rgba(0, 0, 0, 0.2)'); categoryFiltersUI[category.name] = filter; filter.addEventListener( - WebInspector.FilterUI.Events.FilterChanged, categoriesFilterChanged.bind(this, categoryName)); + UI.FilterUI.Events.FilterChanged, categoriesFilterChanged.bind(this, categoryName)); this._filterBar.addFilter(filter); } return this._filterBar; /** - * @this {WebInspector.TimelineFilters} + * @this {Timeline.TimelineFilters} */ function textFilterChanged() { var searchQuery = this._textFilterUI.value(); @@ -1876,7 +1876,7 @@ } /** - * @this {WebInspector.TimelineFilters} + * @this {Timeline.TimelineFilters} */ function durationFilterChanged() { var duration = durationFilterUI.value(); @@ -1887,37 +1887,37 @@ /** * @param {string} name - * @this {WebInspector.TimelineFilters} + * @this {Timeline.TimelineFilters} */ function categoriesFilterChanged(name) { - var categories = WebInspector.TimelineUIUtils.categories(); + var categories = Timeline.TimelineUIUtils.categories(); categories[name].hidden = !categoryFiltersUI[name].checked(); this._notifyFiltersChanged(); } } _notifyFiltersChanged() { - this.dispatchEventToListeners(WebInspector.TimelineFilters.Events.FilterChanged); + this.dispatchEventToListeners(Timeline.TimelineFilters.Events.FilterChanged); } }; /** @enum {symbol} */ -WebInspector.TimelineFilters.Events = { +Timeline.TimelineFilters.Events = { FilterChanged: Symbol('FilterChanged') }; -WebInspector.TimelineFilters._durationFilterPresetsMs = [0, 1, 15]; +Timeline.TimelineFilters._durationFilterPresetsMs = [0, 1, 15]; /** - * @implements {WebInspector.TargetManager.Observer} + * @implements {SDK.TargetManager.Observer} * @unrestricted */ -WebInspector.CPUThrottlingManager = class extends WebInspector.Object { +Timeline.CPUThrottlingManager = class extends Common.Object { constructor() { super(); this._targets = []; this._throttlingRate = 1.; // No throttling - WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Browser); + SDK.targetManager.observeTargets(this, SDK.Target.Capability.Browser); } /** @@ -1927,10 +1927,10 @@ this._throttlingRate = value; this._targets.forEach(target => target.emulationAgent().setCPUThrottlingRate(value)); if (value !== 1) - WebInspector.inspectorView.setPanelIcon( - 'timeline', 'smallicon-warning', WebInspector.UIString('CPU throttling is enabled')); + UI.inspectorView.setPanelIcon( + 'timeline', 'smallicon-warning', Common.UIString('CPU throttling is enabled')); else - WebInspector.inspectorView.setPanelIcon('timeline', '', ''); + UI.inspectorView.setPanelIcon('timeline', '', ''); } /** @@ -1942,7 +1942,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetAdded(target) { this._targets.push(target); @@ -1951,7 +1951,7 @@ /** * @override - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target */ targetRemoved(target) { this._targets.remove(target, true); @@ -1961,11 +1961,11 @@ /** * @unrestricted */ -WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog = class extends WebInspector.HBox { +Timeline.TimelinePanel.CustomCPUThrottlingRateDialog = class extends UI.HBox { constructor() { super(true); this.registerRequiredCSS('ui_lazy/dialog.css'); - this.contentElement.createChild('label').textContent = WebInspector.UIString('CPU Slowdown Rate: '); + this.contentElement.createChild('label').textContent = Common.UIString('CPU Slowdown Rate: '); this._input = this.contentElement.createChild('input'); this._input.setAttribute('type', 'text'); @@ -1973,7 +1973,7 @@ this._input.addEventListener('keydown', this._onKeyDown.bind(this), false); var addButton = this.contentElement.createChild('button'); - addButton.textContent = WebInspector.UIString('Set'); + addButton.textContent = Common.UIString('Set'); addButton.addEventListener('click', this._apply.bind(this), false); this.setDefaultFocusedElement(this._input); @@ -1986,8 +1986,8 @@ * @return {!Promise<string>} */ static show(anchor) { - var dialog = new WebInspector.Dialog(); - var dialogContent = new WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog(); + var dialog = new UI.Dialog(); + var dialogContent = new Timeline.TimelinePanel.CustomCPUThrottlingRateDialog(); dialogContent.show(dialog.element); dialog.setWrapsContent(true); if (anchor) @@ -2011,7 +2011,7 @@ * @param {!Event} event */ _onKeyDown(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { + if (event.keyCode === UI.KeyboardShortcut.Keys.Enter.code) { event.preventDefault(); this._apply(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js index 9e43ae5b..2a77148 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
@@ -4,60 +4,60 @@ /** * @unrestricted */ -WebInspector.TimelineTreeView = class extends WebInspector.VBox { +Timeline.TimelineTreeView = class extends UI.VBox { constructor() { super(); this.element.classList.add('timeline-tree-view'); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ static eventNameForSorting(event) { - if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { + if (event.name === TimelineModel.TimelineModel.RecordType.JSFrame) { var data = event.args['data']; return data['functionName'] + '@' + (data['scriptId'] || data['url'] || ''); } - return event.name + ':@' + WebInspector.TimelineProfileTree.eventURL(event); + return event.name + ':@' + TimelineModel.TimelineProfileTree.eventURL(event); } /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ _init(model, filters) { this._model = model; - this._linkifier = new WebInspector.Linkifier(); + this._linkifier = new Components.Linkifier(); this._filters = filters.slice(); - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([]); + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([]); this._populateColumns(columns); - var mainView = new WebInspector.VBox(); + var mainView = new UI.VBox(); this._populateToolbar(mainView.element); - this._dataGrid = new WebInspector.SortableDataGrid(columns); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortingChanged, this); + this._dataGrid = new UI.SortableDataGrid(columns); + this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortingChanged, this); this._dataGrid.element.addEventListener('mousemove', this._onMouseMove.bind(this), true); - this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); + this._dataGrid.setResizeMethod(UI.DataGrid.ResizeMethod.Last); this._dataGrid.asWidget().show(mainView.element); - this._splitWidget = new WebInspector.SplitWidget(true, true, 'timelineTreeViewDetailsSplitWidget'); + this._splitWidget = new UI.SplitWidget(true, true, 'timelineTreeViewDetailsSplitWidget'); this._splitWidget.show(this.element); this._splitWidget.setMainWidget(mainView); - this._detailsView = new WebInspector.VBox(); + this._detailsView = new UI.VBox(); this._detailsView.element.classList.add('timeline-details-view', 'timeline-details-view-body'); this._splitWidget.setSidebarWidget(this._detailsView); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._updateDetailsForSelection, this); + this._dataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._updateDetailsForSelection, this); - /** @type {?WebInspector.TimelineProfileTree.Node|undefined} */ + /** @type {?TimelineModel.TimelineProfileTree.Node|undefined} */ this._lastSelectedNode; } /** - * @param {!WebInspector.TimelineSelection} selection + * @param {!Timeline.TimelineSelection} selection */ updateContents(selection) { this.setRange(selection.startTime(), selection.endTime()); @@ -87,27 +87,27 @@ } /** - * @param {?WebInspector.TimelineProfileTree.Node} node + * @param {?TimelineModel.TimelineProfileTree.Node} node */ _onHover(node) { } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {?Element} */ _linkifyLocation(event) { var target = this._model.targetByEvent(event); if (!target) return null; - var frame = WebInspector.TimelineProfileTree.eventStackFrame(event); + var frame = TimelineModel.TimelineProfileTree.eventStackFrame(event); if (!frame) return null; return this._linkifier.maybeLinkifyConsoleCallFrame(target, frame); } /** - * @param {!WebInspector.TimelineProfileTree.Node} treeNode + * @param {!TimelineModel.TimelineProfileTree.Node} treeNode * @param {boolean} suppressSelectedEvent */ selectProfileNode(treeNode, suppressSelectedEvent) { @@ -141,7 +141,7 @@ for (var child of tree.children.values()) { // Exclude the idle time off the total calculation. var gridNode = - new WebInspector.TimelineTreeView.TreeGridNode(child, tree.totalTime, maxSelfTime, maxTotalTime, this); + new Timeline.TimelineTreeView.TreeGridNode(child, tree.totalTime, maxSelfTime, maxTotalTime, this); this._dataGrid.insertChild(gridNode); } this._sortingChanged(); @@ -149,30 +149,30 @@ } /** - * @return {!WebInspector.TimelineProfileTree.Node} + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildTree() { throw new Error('Not Implemented'); } /** - * @param {function(!WebInspector.TracingModel.Event):(string|symbol)=} eventIdCallback - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {function(!SDK.TracingModel.Event):(string|symbol)=} eventIdCallback + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildTopDownTree(eventIdCallback) { - return WebInspector.TimelineProfileTree.buildTopDown( + return TimelineModel.TimelineProfileTree.buildTopDown( this._model.mainThreadEvents(), this._filters, this._startTime, this._endTime, eventIdCallback); } /** - * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns + * @param {!Array<!UI.DataGrid.ColumnDescriptor>} columns */ _populateColumns(columns) { columns.push( - {id: 'self', title: WebInspector.UIString('Self Time'), width: '110px', fixedWidth: true, sortable: true}); + {id: 'self', title: Common.UIString('Self Time'), width: '110px', fixedWidth: true, sortable: true}); columns.push( - {id: 'total', title: WebInspector.UIString('Total Time'), width: '110px', fixedWidth: true, sortable: true}); - columns.push({id: 'activity', title: WebInspector.UIString('Activity'), disclosure: true, sortable: true}); + {id: 'total', title: Common.UIString('Total Time'), width: '110px', fixedWidth: true, sortable: true}); + columns.push({id: 'activity', title: Common.UIString('Activity'), disclosure: true, sortable: true}); } _sortingChanged() { @@ -201,44 +201,44 @@ /** * @param {string} field - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ function compareNumericField(field, a, b) { - var nodeA = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (a); - var nodeB = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (b); + var nodeA = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (a); + var nodeB = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (b); return nodeA._profileNode[field] - nodeB._profileNode[field]; } /** - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ function compareStartTime(a, b) { - var nodeA = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (a); - var nodeB = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (b); + var nodeA = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (a); + var nodeB = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (b); return nodeA._profileNode.event.startTime - nodeB._profileNode.event.startTime; } /** - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ function compareName(a, b) { - var nodeA = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (a); - var nodeB = /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (b); - var nameA = WebInspector.TimelineTreeView.eventNameForSorting(nodeA._profileNode.event); - var nameB = WebInspector.TimelineTreeView.eventNameForSorting(nodeB._profileNode.event); + var nodeA = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (a); + var nodeB = /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (b); + var nameA = Timeline.TimelineTreeView.eventNameForSorting(nodeA._profileNode.event); + var nameB = Timeline.TimelineTreeView.eventNameForSorting(nodeB._profileNode.event); return nameA.localeCompare(nameB); } } _updateDetailsForSelection() { var selectedNode = this._dataGrid.selectedNode ? - /** @type {!WebInspector.TimelineTreeView.TreeGridNode} */ (this._dataGrid.selectedNode)._profileNode : + /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (this._dataGrid.selectedNode)._profileNode : null; if (selectedNode === this._lastSelectedNode) return; @@ -247,12 +247,12 @@ this._detailsView.element.removeChildren(); if (!selectedNode || !this._showDetailsForNode(selectedNode)) { var banner = this._detailsView.element.createChild('div', 'full-widget-dimmed-banner'); - banner.createTextChild(WebInspector.UIString('Select item for details.')); + banner.createTextChild(Common.UIString('Select item for details.')); } } /** - * @param {!WebInspector.TimelineProfileTree.Node} node + * @param {!TimelineModel.TimelineProfileTree.Node} node * @return {boolean} */ _showDetailsForNode(node) { @@ -264,7 +264,7 @@ */ _onMouseMove(event) { var gridNode = event.target && (event.target instanceof Node) ? - /** @type {?WebInspector.TimelineTreeView.TreeGridNode} */ ( + /** @type {?Timeline.TimelineTreeView.TreeGridNode} */ ( this._dataGrid.dataGridNodeFromNode(/** @type {!Node} */ (event.target))) : null; var profileNode = gridNode && gridNode._profileNode; @@ -275,11 +275,11 @@ } /** - * @param {!WebInspector.TimelineProfileTree.Node} treeNode - * @return {?WebInspector.TimelineTreeView.GridNode} + * @param {!TimelineModel.TimelineProfileTree.Node} treeNode + * @return {?Timeline.TimelineTreeView.GridNode} */ _dataGridNodeForTreeNode(treeNode) { - return treeNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol] || null; + return treeNode[Timeline.TimelineTreeView.TreeGridNode._gridNodeSymbol] || null; } }; @@ -287,13 +287,13 @@ /** * @unrestricted */ -WebInspector.TimelineTreeView.GridNode = class extends WebInspector.SortableDataGridNode { +Timeline.TimelineTreeView.GridNode = class extends UI.SortableDataGridNode { /** - * @param {!WebInspector.TimelineProfileTree.Node} profileNode + * @param {!TimelineModel.TimelineProfileTree.Node} profileNode * @param {number} grandTotalTime * @param {number} maxSelfTime * @param {number} maxTotalTime - * @param {!WebInspector.TimelineTreeView} treeView + * @param {!Timeline.TimelineTreeView} treeView */ constructor(profileNode, grandTotalTime, maxSelfTime, maxTotalTime, treeView) { super(null, false); @@ -328,7 +328,7 @@ const name = container.createChild('div', 'activity-name'); const event = this._profileNode.event; if (this._profileNode.isGroupNode()) { - const treeView = /** @type {!WebInspector.AggregatedTimelineTreeView} */ (this._treeView); + const treeView = /** @type {!Timeline.AggregatedTimelineTreeView} */ (this._treeView); const info = treeView._displayInfoForGroupNode(this._profileNode); name.textContent = info.name; icon.style.backgroundColor = info.color; @@ -337,13 +337,13 @@ const deoptReason = data && data['deoptReason']; if (deoptReason) { container.createChild('div', 'activity-warning').title = - WebInspector.UIString('Not optimized: %s', deoptReason); + Common.UIString('Not optimized: %s', deoptReason); } - name.textContent = WebInspector.TimelineUIUtils.eventTitle(event); + name.textContent = Timeline.TimelineUIUtils.eventTitle(event); const link = this._treeView._linkifyLocation(event); if (link) container.createChild('div', 'activity-link').appendChild(link); - icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor(event); + icon.style.backgroundColor = Timeline.TimelineUIUtils.eventColor(event); } return cell; } @@ -379,11 +379,11 @@ var cell = this.createTD(columnId); cell.className = 'numeric-column'; var textDiv = cell.createChild('div'); - textDiv.createChild('span').textContent = WebInspector.UIString('%.1f\u2009ms', value); + textDiv.createChild('span').textContent = Common.UIString('%.1f\u2009ms', value); if (showPercents && this._treeView._exposePercentages()) textDiv.createChild('span', 'percent-column').textContent = - WebInspector.UIString('%.1f\u2009%%', value / this._grandTotalTime * 100); + Common.UIString('%.1f\u2009%%', value / this._grandTotalTime * 100); if (maxTime) { textDiv.classList.add('background-percent-bar'); cell.createChild('div', 'background-bar-container').createChild('div', 'background-bar').style.width = @@ -396,18 +396,18 @@ /** * @unrestricted */ -WebInspector.TimelineTreeView.TreeGridNode = class extends WebInspector.TimelineTreeView.GridNode { +Timeline.TimelineTreeView.TreeGridNode = class extends Timeline.TimelineTreeView.GridNode { /** - * @param {!WebInspector.TimelineProfileTree.Node} profileNode + * @param {!TimelineModel.TimelineProfileTree.Node} profileNode * @param {number} grandTotalTime * @param {number} maxSelfTime * @param {number} maxTotalTime - * @param {!WebInspector.TimelineTreeView} treeView + * @param {!Timeline.TimelineTreeView} treeView */ constructor(profileNode, grandTotalTime, maxSelfTime, maxTotalTime, treeView) { super(profileNode, grandTotalTime, maxSelfTime, maxTotalTime, treeView); this.hasChildren = this._profileNode.children ? this._profileNode.children.size > 0 : false; - profileNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol] = this; + profileNode[Timeline.TimelineTreeView.TreeGridNode._gridNodeSymbol] = this; } /** @@ -420,41 +420,41 @@ if (!this._profileNode.children) return; for (var node of this._profileNode.children.values()) { - var gridNode = new WebInspector.TimelineTreeView.TreeGridNode( + var gridNode = new Timeline.TimelineTreeView.TreeGridNode( node, this._grandTotalTime, this._maxSelfTime, this._maxTotalTime, this._treeView); this.insertChildOrdered(gridNode); } } }; -WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol = Symbol('treeGridNode'); +Timeline.TimelineTreeView.TreeGridNode._gridNodeSymbol = Symbol('treeGridNode'); /** * @unrestricted */ -WebInspector.AggregatedTimelineTreeView = class extends WebInspector.TimelineTreeView { +Timeline.AggregatedTimelineTreeView = class extends Timeline.TimelineTreeView { /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(model, filters) { super(); this._groupBySetting = - WebInspector.settings.createSetting('timelineTreeGroupBy', WebInspector.AggregatedTimelineTreeView.GroupBy.Category); + Common.settings.createSetting('timelineTreeGroupBy', Timeline.AggregatedTimelineTreeView.GroupBy.Category); this._init(model, filters); var nonessentialEvents = [ - WebInspector.TimelineModel.RecordType.EventDispatch, WebInspector.TimelineModel.RecordType.FunctionCall, - WebInspector.TimelineModel.RecordType.TimerFire + TimelineModel.TimelineModel.RecordType.EventDispatch, TimelineModel.TimelineModel.RecordType.FunctionCall, + TimelineModel.TimelineModel.RecordType.TimerFire ]; - this._filters.push(new WebInspector.ExclusiveNameFilter(nonessentialEvents)); - this._stackView = new WebInspector.TimelineStackView(this); + this._filters.push(new TimelineModel.ExclusiveNameFilter(nonessentialEvents)); + this._stackView = new Timeline.TimelineStackView(this); this._stackView.addEventListener( - WebInspector.TimelineStackView.Events.SelectionChanged, this._onStackViewSelectionChanged, this); + Timeline.TimelineStackView.Events.SelectionChanged, this._onStackViewSelectionChanged, this); } /** * @override - * @param {!WebInspector.TimelineSelection} selection + * @param {!Timeline.TimelineSelection} selection */ updateContents(selection) { this._updateExtensionResolver(); @@ -466,50 +466,50 @@ _updateExtensionResolver() { this._executionContextNamesByOrigin = new Map(); - for (var target of WebInspector.targetManager.targets()) { + for (var target of SDK.targetManager.targets()) { for (var context of target.runtimeModel.executionContexts()) this._executionContextNamesByOrigin.set(context.origin, context.name); } } /** - * @param {!WebInspector.TimelineProfileTree.Node} node + * @param {!TimelineModel.TimelineProfileTree.Node} node * @return {!{name: string, color: string}} */ _displayInfoForGroupNode(node) { - var categories = WebInspector.TimelineUIUtils.categories(); - var color = node.id ? WebInspector.TimelineUIUtils.eventColor(node.event) : categories['other'].color; + var categories = Timeline.TimelineUIUtils.categories(); + var color = node.id ? Timeline.TimelineUIUtils.eventColor(node.event) : categories['other'].color; switch (this._groupBySetting.get()) { - case WebInspector.AggregatedTimelineTreeView.GroupBy.Category: + case Timeline.AggregatedTimelineTreeView.GroupBy.Category: var category = categories[node.id] || categories['other']; return {name: category.title, color: category.color}; - case WebInspector.AggregatedTimelineTreeView.GroupBy.Domain: - case WebInspector.AggregatedTimelineTreeView.GroupBy.Subdomain: + case Timeline.AggregatedTimelineTreeView.GroupBy.Domain: + case Timeline.AggregatedTimelineTreeView.GroupBy.Subdomain: var name = node.id; - if (WebInspector.AggregatedTimelineTreeView._isExtensionInternalURL(name)) - name = WebInspector.UIString('[Chrome extensions overhead]'); + if (Timeline.AggregatedTimelineTreeView._isExtensionInternalURL(name)) + name = Common.UIString('[Chrome extensions overhead]'); else if (name.startsWith('chrome-extension')) name = this._executionContextNamesByOrigin.get(name) || name; - return {name: name || WebInspector.UIString('unattributed'), color: color}; + return {name: name || Common.UIString('unattributed'), color: color}; - case WebInspector.AggregatedTimelineTreeView.GroupBy.EventName: - var name = node.event.name === WebInspector.TimelineModel.RecordType.JSFrame ? - WebInspector.UIString('JavaScript') : - WebInspector.TimelineUIUtils.eventTitle(node.event); + case Timeline.AggregatedTimelineTreeView.GroupBy.EventName: + var name = node.event.name === TimelineModel.TimelineModel.RecordType.JSFrame ? + Common.UIString('JavaScript') : + Timeline.TimelineUIUtils.eventTitle(node.event); return { name: name, - color: node.event.name === WebInspector.TimelineModel.RecordType.JSFrame ? - WebInspector.TimelineUIUtils.eventStyle(node.event).category.color : + color: node.event.name === TimelineModel.TimelineModel.RecordType.JSFrame ? + Timeline.TimelineUIUtils.eventStyle(node.event).category.color : color }; - case WebInspector.AggregatedTimelineTreeView.GroupBy.URL: + case Timeline.AggregatedTimelineTreeView.GroupBy.URL: break; - case WebInspector.AggregatedTimelineTreeView.GroupBy.Frame: + case Timeline.AggregatedTimelineTreeView.GroupBy.Frame: var frame = this._model.pageFrameById(node.id); - var frameName = frame ? WebInspector.TimelineUIUtils.displayNameForFrame(frame, 80) : WebInspector.UIString('Page'); + var frameName = frame ? Timeline.TimelineUIUtils.displayNameForFrame(frame, 80) : Common.UIString('Page'); return { name: frameName, color: color @@ -519,7 +519,7 @@ default: console.assert(false, 'Unexpected aggregation type'); } - return {name: node.id || WebInspector.UIString('unattributed'), color: color}; + return {name: node.id || Common.UIString('unattributed'), color: color}; } /** @@ -527,12 +527,12 @@ * @param {!Element} parent */ _populateToolbar(parent) { - var panelToolbar = new WebInspector.Toolbar('', parent); - this._groupByCombobox = new WebInspector.ToolbarComboBox(this._onGroupByChanged.bind(this)); + var panelToolbar = new UI.Toolbar('', parent); + this._groupByCombobox = new UI.ToolbarComboBox(this._onGroupByChanged.bind(this)); /** * @param {string} name * @param {string} id - * @this {WebInspector.TimelineTreeView} + * @this {Timeline.TimelineTreeView} */ function addGroupingOption(name, id) { var option = this._groupByCombobox.createOption(name, '', id); @@ -540,20 +540,20 @@ if (id === this._groupBySetting.get()) this._groupByCombobox.select(option); } - const groupBy = WebInspector.AggregatedTimelineTreeView.GroupBy; - addGroupingOption.call(this, WebInspector.UIString('No Grouping'), groupBy.None); - addGroupingOption.call(this, WebInspector.UIString('Group by Activity'), groupBy.EventName); - addGroupingOption.call(this, WebInspector.UIString('Group by Category'), groupBy.Category); - addGroupingOption.call(this, WebInspector.UIString('Group by Domain'), groupBy.Domain); - addGroupingOption.call(this, WebInspector.UIString('Group by Subdomain'), groupBy.Subdomain); - addGroupingOption.call(this, WebInspector.UIString('Group by URL'), groupBy.URL); - addGroupingOption.call(this, WebInspector.UIString('Group by Frame'), groupBy.Frame); + const groupBy = Timeline.AggregatedTimelineTreeView.GroupBy; + addGroupingOption.call(this, Common.UIString('No Grouping'), groupBy.None); + addGroupingOption.call(this, Common.UIString('Group by Activity'), groupBy.EventName); + addGroupingOption.call(this, Common.UIString('Group by Category'), groupBy.Category); + addGroupingOption.call(this, Common.UIString('Group by Domain'), groupBy.Domain); + addGroupingOption.call(this, Common.UIString('Group by Subdomain'), groupBy.Subdomain); + addGroupingOption.call(this, Common.UIString('Group by URL'), groupBy.URL); + addGroupingOption.call(this, Common.UIString('Group by Frame'), groupBy.Frame); panelToolbar.appendToolbarItem(this._groupByCombobox); } /** - * @param {!WebInspector.TimelineProfileTree.Node} treeNode - * @return {!Array<!WebInspector.TimelineProfileTree.Node>} + * @param {!TimelineModel.TimelineProfileTree.Node} treeNode + * @return {!Array<!TimelineModel.TimelineProfileTree.Node>} */ _buildHeaviestStack(treeNode) { console.assert(!!treeNode.parent, 'Attempt to build stack for tree root'); @@ -591,7 +591,7 @@ /** * @override - * @param {!WebInspector.TimelineProfileTree.Node} node + * @param {!TimelineModel.TimelineProfileTree.Node} node * @return {boolean} */ _showDetailsForNode(node) { @@ -602,27 +602,27 @@ } /** - * @param {!WebInspector.AggregatedTimelineTreeView.GroupBy} groupBy - * @return {function(!WebInspector.TracingModel.Event):string} + * @param {!Timeline.AggregatedTimelineTreeView.GroupBy} groupBy + * @return {function(!SDK.TracingModel.Event):string} */ _groupingFunction(groupBy) { /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ function groupByURL(event) { - return WebInspector.TimelineProfileTree.eventURL(event) || ''; + return TimelineModel.TimelineProfileTree.eventURL(event) || ''; } /** * @param {boolean} groupSubdomains - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ function groupByDomain(groupSubdomains, event) { - var url = WebInspector.TimelineProfileTree.eventURL(event) || ''; - if (WebInspector.AggregatedTimelineTreeView._isExtensionInternalURL(url)) - return WebInspector.AggregatedTimelineTreeView._extensionInternalPrefix; + var url = TimelineModel.TimelineProfileTree.eventURL(event) || ''; + if (Timeline.AggregatedTimelineTreeView._isExtensionInternalURL(url)) + return Timeline.AggregatedTimelineTreeView._extensionInternalPrefix; var parsedURL = url.asParsedURL(); if (!parsedURL) return ''; @@ -637,20 +637,20 @@ } switch (groupBy) { - case WebInspector.AggregatedTimelineTreeView.GroupBy.None: + case Timeline.AggregatedTimelineTreeView.GroupBy.None: return () => Symbol('uniqueGroupId'); - case WebInspector.AggregatedTimelineTreeView.GroupBy.EventName: - return event => WebInspector.TimelineUIUtils.eventStyle(event).title; - case WebInspector.AggregatedTimelineTreeView.GroupBy.Category: - return event => WebInspector.TimelineUIUtils.eventStyle(event).category.name; - case WebInspector.AggregatedTimelineTreeView.GroupBy.Subdomain: + case Timeline.AggregatedTimelineTreeView.GroupBy.EventName: + return event => Timeline.TimelineUIUtils.eventStyle(event).title; + case Timeline.AggregatedTimelineTreeView.GroupBy.Category: + return event => Timeline.TimelineUIUtils.eventStyle(event).category.name; + case Timeline.AggregatedTimelineTreeView.GroupBy.Subdomain: return groupByDomain.bind(null, false); - case WebInspector.AggregatedTimelineTreeView.GroupBy.Domain: + case Timeline.AggregatedTimelineTreeView.GroupBy.Domain: return groupByDomain.bind(null, true); - case WebInspector.AggregatedTimelineTreeView.GroupBy.URL: + case Timeline.AggregatedTimelineTreeView.GroupBy.URL: return groupByURL; - case WebInspector.AggregatedTimelineTreeView.GroupBy.Frame: - return event => WebInspector.TimelineData.forEvent(event).frameId; + case Timeline.AggregatedTimelineTreeView.GroupBy.Frame: + return event => TimelineModel.TimelineData.forEvent(event).frameId; default: console.assert(false, `Unexpected aggregation setting: ${groupBy}`); return () => Symbol('uniqueGroupId'); @@ -662,16 +662,16 @@ * @return {boolean} */ static _isExtensionInternalURL(url) { - return url.startsWith(WebInspector.AggregatedTimelineTreeView._extensionInternalPrefix); + return url.startsWith(Timeline.AggregatedTimelineTreeView._extensionInternalPrefix); } }; -WebInspector.AggregatedTimelineTreeView._extensionInternalPrefix = 'extensions::'; +Timeline.AggregatedTimelineTreeView._extensionInternalPrefix = 'extensions::'; /** * @enum {string} */ -WebInspector.AggregatedTimelineTreeView.GroupBy = { +Timeline.AggregatedTimelineTreeView.GroupBy = { None: 'None', EventName: 'EventName', Category: 'Category', @@ -684,87 +684,87 @@ /** * @unrestricted */ -WebInspector.CallTreeTimelineTreeView = class extends WebInspector.AggregatedTimelineTreeView { +Timeline.CallTreeTimelineTreeView = class extends Timeline.AggregatedTimelineTreeView { /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(model, filters) { super(model, filters); - this._dataGrid.markColumnAsSortedBy('total', WebInspector.DataGrid.Order.Descending); + this._dataGrid.markColumnAsSortedBy('total', UI.DataGrid.Order.Descending); } /** * @override - * @return {!WebInspector.TimelineProfileTree.Node} + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildTree() { var grouping = this._groupBySetting.get(); var topDown = this._buildTopDownTree(this._groupingFunction(grouping)); - if (grouping === WebInspector.AggregatedTimelineTreeView.GroupBy.None) + if (grouping === Timeline.AggregatedTimelineTreeView.GroupBy.None) return topDown; - return new WebInspector.TimelineAggregator().performGrouping(topDown); + return new TimelineModel.TimelineAggregator().performGrouping(topDown); } }; /** * @unrestricted */ -WebInspector.BottomUpTimelineTreeView = class extends WebInspector.AggregatedTimelineTreeView { +Timeline.BottomUpTimelineTreeView = class extends Timeline.AggregatedTimelineTreeView { /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters */ constructor(model, filters) { super(model, filters); - this._dataGrid.markColumnAsSortedBy('self', WebInspector.DataGrid.Order.Descending); + this._dataGrid.markColumnAsSortedBy('self', UI.DataGrid.Order.Descending); } /** * @override - * @return {!WebInspector.TimelineProfileTree.Node} + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildTree() { var topDown = this._buildTopDownTree(this._groupingFunction(this._groupBySetting.get())); - return WebInspector.TimelineProfileTree.buildBottomUp(topDown); + return TimelineModel.TimelineProfileTree.buildBottomUp(topDown); } }; /** * @unrestricted */ -WebInspector.EventsTimelineTreeView = class extends WebInspector.TimelineTreeView { +Timeline.EventsTimelineTreeView = class extends Timeline.TimelineTreeView { /** - * @param {!WebInspector.TimelineModel} model - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters - * @param {!WebInspector.TimelineModeViewDelegate} delegate + * @param {!TimelineModel.TimelineModel} model + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters + * @param {!Timeline.TimelineModeViewDelegate} delegate */ constructor(model, filters, delegate) { super(); - this._filtersControl = new WebInspector.TimelineFilters(); + this._filtersControl = new Timeline.TimelineFilters(); this._filtersControl.addEventListener( - WebInspector.TimelineFilters.Events.FilterChanged, this._onFilterChanged, this); + Timeline.TimelineFilters.Events.FilterChanged, this._onFilterChanged, this); this._init(model, filters); this._delegate = delegate; this._filters.push.apply(this._filters, this._filtersControl.filters()); - this._dataGrid.markColumnAsSortedBy('startTime', WebInspector.DataGrid.Order.Ascending); + this._dataGrid.markColumnAsSortedBy('startTime', UI.DataGrid.Order.Ascending); } /** * @override - * @param {!WebInspector.TimelineSelection} selection + * @param {!Timeline.TimelineSelection} selection */ updateContents(selection) { super.updateContents(selection); - if (selection.type() === WebInspector.TimelineSelection.Type.TraceEvent) { - var event = /** @type {!WebInspector.TracingModel.Event} */ (selection.object()); + if (selection.type() === Timeline.TimelineSelection.Type.TraceEvent) { + var event = /** @type {!SDK.TracingModel.Event} */ (selection.object()); this._selectEvent(event, true); } } /** * @override - * @return {!WebInspector.TimelineProfileTree.Node} + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildTree() { this._currentTree = this._buildTopDownTree(); @@ -779,8 +779,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {?WebInspector.TimelineProfileTree.Node} + * @param {!SDK.TracingModel.Event} event + * @return {?TimelineModel.TimelineProfileTree.Node} */ _findNodeWithEvent(event) { var iterators = [this._currentTree.children.values()]; @@ -791,7 +791,7 @@ iterators.pop(); continue; } - var child = /** @type {!WebInspector.TimelineProfileTree.Node} */ (iterator.value); + var child = /** @type {!TimelineModel.TimelineProfileTree.Node} */ (iterator.value); if (child.event === event) return child; if (child.children) @@ -801,7 +801,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {boolean=} expand */ _selectEvent(event, expand) { @@ -815,12 +815,12 @@ /** * @override - * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns + * @param {!Array<!UI.DataGrid.ColumnDescriptor>} columns */ _populateColumns(columns) { columns.push({ id: 'startTime', - title: WebInspector.UIString('Start Time'), + title: Common.UIString('Start Time'), width: '110px', fixedWidth: true, sortable: true @@ -840,20 +840,20 @@ /** * @override - * @param {!WebInspector.TimelineProfileTree.Node} node + * @param {!TimelineModel.TimelineProfileTree.Node} node * @return {boolean} */ _showDetailsForNode(node) { var traceEvent = node.event; if (!traceEvent) return false; - WebInspector.TimelineUIUtils.buildTraceEventDetails( + Timeline.TimelineUIUtils.buildTraceEventDetails( traceEvent, this._model, this._linkifier, false, showDetails.bind(this)); return true; /** * @param {!DocumentFragment} fragment - * @this {WebInspector.EventsTimelineTreeView} + * @this {Timeline.EventsTimelineTreeView} */ function showDetails(fragment) { this._detailsView.element.appendChild(fragment); @@ -862,7 +862,7 @@ /** * @override - * @param {?WebInspector.TimelineProfileTree.Node} node + * @param {?TimelineModel.TimelineProfileTree.Node} node */ _onHover(node) { this._delegate.highlightEvent(node && node.event); @@ -872,25 +872,25 @@ /** * @unrestricted */ -WebInspector.TimelineStackView = class extends WebInspector.VBox { +Timeline.TimelineStackView = class extends UI.VBox { constructor(treeView) { super(); var header = this.element.createChild('div', 'timeline-stack-view-header'); - header.textContent = WebInspector.UIString('Heaviest stack'); + header.textContent = Common.UIString('Heaviest stack'); this._treeView = treeView; - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([ - {id: 'total', title: WebInspector.UIString('Total Time'), fixedWidth: true, width: '110px'}, - {id: 'activity', title: WebInspector.UIString('Activity')} + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([ + {id: 'total', title: Common.UIString('Total Time'), fixedWidth: true, width: '110px'}, + {id: 'activity', title: Common.UIString('Activity')} ]); - this._dataGrid = new WebInspector.ViewportDataGrid(columns); - this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); - this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._onSelectionChanged, this); + this._dataGrid = new UI.ViewportDataGrid(columns); + this._dataGrid.setResizeMethod(UI.DataGrid.ResizeMethod.Last); + this._dataGrid.addEventListener(UI.DataGrid.Events.SelectedNode, this._onSelectionChanged, this); this._dataGrid.asWidget().show(this.element); } /** - * @param {!Array<!WebInspector.TimelineProfileTree.Node>} stack - * @param {!WebInspector.TimelineProfileTree.Node} selectedNode + * @param {!Array<!TimelineModel.TimelineProfileTree.Node>} stack + * @param {!TimelineModel.TimelineProfileTree.Node} selectedNode */ setStack(stack, selectedNode) { var rootNode = this._dataGrid.rootNode(); @@ -898,7 +898,7 @@ var nodeToReveal = null; var totalTime = Math.max.apply(Math, stack.map(node => node.totalTime)); for (var node of stack) { - var gridNode = new WebInspector.TimelineTreeView.GridNode(node, totalTime, totalTime, totalTime, this._treeView); + var gridNode = new Timeline.TimelineTreeView.GridNode(node, totalTime, totalTime, totalTime, this._treeView); rootNode.appendChild(gridNode); if (node === selectedNode) nodeToReveal = gridNode; @@ -907,19 +907,19 @@ } /** - * @return {?WebInspector.TimelineProfileTree.Node} + * @return {?TimelineModel.TimelineProfileTree.Node} */ selectedTreeNode() { var selectedNode = this._dataGrid.selectedNode; - return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNode} */ (selectedNode)._profileNode; + return selectedNode && /** @type {!Timeline.TimelineTreeView.GridNode} */ (selectedNode)._profileNode; } _onSelectionChanged() { - this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.SelectionChanged); + this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionChanged); } }; /** @enum {symbol} */ -WebInspector.TimelineStackView.Events = { +Timeline.TimelineStackView.Events = { SelectionChanged: Symbol('SelectionChanged') };
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js index ea68f739..5adeac4 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -32,195 +32,195 @@ /** * @unrestricted */ -WebInspector.TimelineUIUtils = class { +Timeline.TimelineUIUtils = class { /** - * @return {!Object.<string, !WebInspector.TimelineRecordStyle>} + * @return {!Object.<string, !Timeline.TimelineRecordStyle>} */ static _initEventStyles() { - if (WebInspector.TimelineUIUtils._eventStylesMap) - return WebInspector.TimelineUIUtils._eventStylesMap; + if (Timeline.TimelineUIUtils._eventStylesMap) + return Timeline.TimelineUIUtils._eventStylesMap; - var recordTypes = WebInspector.TimelineModel.RecordType; - var categories = WebInspector.TimelineUIUtils.categories(); + var recordTypes = TimelineModel.TimelineModel.RecordType; + var categories = Timeline.TimelineUIUtils.categories(); var eventStyles = {}; eventStyles[recordTypes.Task] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Task'), categories['other']); + new Timeline.TimelineRecordStyle(Common.UIString('Task'), categories['other']); eventStyles[recordTypes.Program] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Other'), categories['other']); + new Timeline.TimelineRecordStyle(Common.UIString('Other'), categories['other']); eventStyles[recordTypes.Animation] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Animation'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Animation'), categories['rendering']); eventStyles[recordTypes.EventDispatch] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Event'), categories['scripting']); - eventStyles[recordTypes.RequestMainThreadFrame] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('Request Main Thread Frame'), categories['rendering'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Event'), categories['scripting']); + eventStyles[recordTypes.RequestMainThreadFrame] = new Timeline.TimelineRecordStyle( + Common.UIString('Request Main Thread Frame'), categories['rendering'], true); eventStyles[recordTypes.BeginFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Frame Start'), categories['rendering'], true); - eventStyles[recordTypes.BeginMainThreadFrame] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('Frame Start (main thread)'), categories['rendering'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Frame Start'), categories['rendering'], true); + eventStyles[recordTypes.BeginMainThreadFrame] = new Timeline.TimelineRecordStyle( + Common.UIString('Frame Start (main thread)'), categories['rendering'], true); eventStyles[recordTypes.DrawFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Draw Frame'), categories['rendering'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Draw Frame'), categories['rendering'], true); eventStyles[recordTypes.HitTest] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Hit Test'), categories['rendering']); - eventStyles[recordTypes.ScheduleStyleRecalculation] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('Schedule Style Recalculation'), categories['rendering'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Hit Test'), categories['rendering']); + eventStyles[recordTypes.ScheduleStyleRecalculation] = new Timeline.TimelineRecordStyle( + Common.UIString('Schedule Style Recalculation'), categories['rendering'], true); eventStyles[recordTypes.RecalculateStyles] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Recalculate Style'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Recalculate Style'), categories['rendering']); eventStyles[recordTypes.UpdateLayoutTree] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Recalculate Style'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Recalculate Style'), categories['rendering']); eventStyles[recordTypes.InvalidateLayout] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Invalidate Layout'), categories['rendering'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Invalidate Layout'), categories['rendering'], true); eventStyles[recordTypes.Layout] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Layout'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Layout'), categories['rendering']); eventStyles[recordTypes.PaintSetup] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Paint Setup'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Paint Setup'), categories['painting']); eventStyles[recordTypes.PaintImage] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Paint Image'), categories['painting'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Paint Image'), categories['painting'], true); eventStyles[recordTypes.UpdateLayer] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Update Layer'), categories['painting'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Update Layer'), categories['painting'], true); eventStyles[recordTypes.UpdateLayerTree] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Update Layer Tree'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Update Layer Tree'), categories['rendering']); eventStyles[recordTypes.Paint] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Paint'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Paint'), categories['painting']); eventStyles[recordTypes.RasterTask] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Rasterize Paint'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Rasterize Paint'), categories['painting']); eventStyles[recordTypes.ScrollLayer] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Scroll'), categories['rendering']); + new Timeline.TimelineRecordStyle(Common.UIString('Scroll'), categories['rendering']); eventStyles[recordTypes.CompositeLayers] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Composite Layers'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Composite Layers'), categories['painting']); eventStyles[recordTypes.ParseHTML] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Parse HTML'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Parse HTML'), categories['loading']); eventStyles[recordTypes.ParseAuthorStyleSheet] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Parse Stylesheet'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Parse Stylesheet'), categories['loading']); eventStyles[recordTypes.TimerInstall] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Install Timer'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Install Timer'), categories['scripting']); eventStyles[recordTypes.TimerRemove] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Remove Timer'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Remove Timer'), categories['scripting']); eventStyles[recordTypes.TimerFire] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Timer Fired'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Timer Fired'), categories['scripting']); eventStyles[recordTypes.XHRReadyStateChange] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('XHR Ready State Change'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('XHR Ready State Change'), categories['scripting']); eventStyles[recordTypes.XHRLoad] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('XHR Load'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('XHR Load'), categories['scripting']); eventStyles[recordTypes.CompileScript] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Compile Script'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Compile Script'), categories['scripting']); eventStyles[recordTypes.EvaluateScript] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Evaluate Script'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Evaluate Script'), categories['scripting']); eventStyles[recordTypes.ParseScriptOnBackground] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Parse Script'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Parse Script'), categories['scripting']); eventStyles[recordTypes.MarkLoad] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Load event'), categories['scripting'], true); - eventStyles[recordTypes.MarkDOMContent] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('DOMContentLoaded event'), categories['scripting'], true); + new Timeline.TimelineRecordStyle(Common.UIString('Load event'), categories['scripting'], true); + eventStyles[recordTypes.MarkDOMContent] = new Timeline.TimelineRecordStyle( + Common.UIString('DOMContentLoaded event'), categories['scripting'], true); eventStyles[recordTypes.MarkFirstPaint] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('First paint'), categories['painting'], true); + new Timeline.TimelineRecordStyle(Common.UIString('First paint'), categories['painting'], true); eventStyles[recordTypes.TimeStamp] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Timestamp'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Timestamp'), categories['scripting']); eventStyles[recordTypes.ConsoleTime] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Console Time'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Console Time'), categories['scripting']); eventStyles[recordTypes.UserTiming] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('User Timing'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('User Timing'), categories['scripting']); eventStyles[recordTypes.ResourceSendRequest] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Send Request'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Send Request'), categories['loading']); eventStyles[recordTypes.ResourceReceiveResponse] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Receive Response'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Receive Response'), categories['loading']); eventStyles[recordTypes.ResourceFinish] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Finish Loading'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Finish Loading'), categories['loading']); eventStyles[recordTypes.ResourceReceivedData] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Receive Data'), categories['loading']); + new Timeline.TimelineRecordStyle(Common.UIString('Receive Data'), categories['loading']); eventStyles[recordTypes.RunMicrotasks] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Run Microtasks'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Run Microtasks'), categories['scripting']); eventStyles[recordTypes.FunctionCall] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Function Call'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Function Call'), categories['scripting']); eventStyles[recordTypes.GCEvent] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('GC Event'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('GC Event'), categories['scripting']); eventStyles[recordTypes.MajorGC] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Major GC'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Major GC'), categories['scripting']); eventStyles[recordTypes.MinorGC] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Minor GC'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Minor GC'), categories['scripting']); eventStyles[recordTypes.JSFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('JS Frame'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('JS Frame'), categories['scripting']); eventStyles[recordTypes.RequestAnimationFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Request Animation Frame'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Request Animation Frame'), categories['scripting']); eventStyles[recordTypes.CancelAnimationFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Cancel Animation Frame'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Cancel Animation Frame'), categories['scripting']); eventStyles[recordTypes.FireAnimationFrame] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Animation Frame Fired'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Animation Frame Fired'), categories['scripting']); eventStyles[recordTypes.RequestIdleCallback] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Request Idle Callback'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Request Idle Callback'), categories['scripting']); eventStyles[recordTypes.CancelIdleCallback] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Cancel Idle Callback'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Cancel Idle Callback'), categories['scripting']); eventStyles[recordTypes.FireIdleCallback] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Fire Idle Callback'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Fire Idle Callback'), categories['scripting']); eventStyles[recordTypes.WebSocketCreate] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Create WebSocket'), categories['scripting']); - eventStyles[recordTypes.WebSocketSendHandshakeRequest] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('Send WebSocket Handshake'), categories['scripting']); - eventStyles[recordTypes.WebSocketReceiveHandshakeResponse] = new WebInspector.TimelineRecordStyle( - WebInspector.UIString('Receive WebSocket Handshake'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Create WebSocket'), categories['scripting']); + eventStyles[recordTypes.WebSocketSendHandshakeRequest] = new Timeline.TimelineRecordStyle( + Common.UIString('Send WebSocket Handshake'), categories['scripting']); + eventStyles[recordTypes.WebSocketReceiveHandshakeResponse] = new Timeline.TimelineRecordStyle( + Common.UIString('Receive WebSocket Handshake'), categories['scripting']); eventStyles[recordTypes.WebSocketDestroy] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Destroy WebSocket'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Destroy WebSocket'), categories['scripting']); eventStyles[recordTypes.EmbedderCallback] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Embedder Callback'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Embedder Callback'), categories['scripting']); eventStyles[recordTypes.DecodeImage] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Image Decode'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Image Decode'), categories['painting']); eventStyles[recordTypes.ResizeImage] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Image Resize'), categories['painting']); + new Timeline.TimelineRecordStyle(Common.UIString('Image Resize'), categories['painting']); eventStyles[recordTypes.GPUTask] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('GPU'), categories['gpu']); + new Timeline.TimelineRecordStyle(Common.UIString('GPU'), categories['gpu']); eventStyles[recordTypes.LatencyInfo] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('Input Latency'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('Input Latency'), categories['scripting']); eventStyles[recordTypes.GCIdleLazySweep] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('DOM GC'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('DOM GC'), categories['scripting']); eventStyles[recordTypes.GCCompleteSweep] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('DOM GC'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('DOM GC'), categories['scripting']); eventStyles[recordTypes.GCCollectGarbage] = - new WebInspector.TimelineRecordStyle(WebInspector.UIString('DOM GC'), categories['scripting']); + new Timeline.TimelineRecordStyle(Common.UIString('DOM GC'), categories['scripting']); - WebInspector.TimelineUIUtils._eventStylesMap = eventStyles; + Timeline.TimelineUIUtils._eventStylesMap = eventStyles; return eventStyles; } /** - * @param {!WebInspector.TimelineIRModel.InputEvents} inputEventType + * @param {!TimelineModel.TimelineIRModel.InputEvents} inputEventType * @return {?string} */ static inputEventDisplayName(inputEventType) { - if (!WebInspector.TimelineUIUtils._inputEventToDisplayName) { - var inputEvent = WebInspector.TimelineIRModel.InputEvents; + if (!Timeline.TimelineUIUtils._inputEventToDisplayName) { + var inputEvent = TimelineModel.TimelineIRModel.InputEvents; - /** @type {!Map<!WebInspector.TimelineIRModel.InputEvents, string>} */ - WebInspector.TimelineUIUtils._inputEventToDisplayName = new Map([ - [inputEvent.Char, WebInspector.UIString('Key Character')], - [inputEvent.KeyDown, WebInspector.UIString('Key Down')], - [inputEvent.KeyDownRaw, WebInspector.UIString('Key Down')], - [inputEvent.KeyUp, WebInspector.UIString('Key Up')], - [inputEvent.Click, WebInspector.UIString('Click')], - [inputEvent.ContextMenu, WebInspector.UIString('Context Menu')], - [inputEvent.MouseDown, WebInspector.UIString('Mouse Down')], - [inputEvent.MouseMove, WebInspector.UIString('Mouse Move')], - [inputEvent.MouseUp, WebInspector.UIString('Mouse Up')], - [inputEvent.MouseWheel, WebInspector.UIString('Mouse Wheel')], - [inputEvent.ScrollBegin, WebInspector.UIString('Scroll Begin')], - [inputEvent.ScrollEnd, WebInspector.UIString('Scroll End')], - [inputEvent.ScrollUpdate, WebInspector.UIString('Scroll Update')], - [inputEvent.FlingStart, WebInspector.UIString('Fling Start')], - [inputEvent.FlingCancel, WebInspector.UIString('Fling Halt')], - [inputEvent.Tap, WebInspector.UIString('Tap')], - [inputEvent.TapCancel, WebInspector.UIString('Tap Halt')], - [inputEvent.ShowPress, WebInspector.UIString('Tap Begin')], - [inputEvent.TapDown, WebInspector.UIString('Tap Down')], - [inputEvent.TouchCancel, WebInspector.UIString('Touch Cancel')], - [inputEvent.TouchEnd, WebInspector.UIString('Touch End')], - [inputEvent.TouchMove, WebInspector.UIString('Touch Move')], - [inputEvent.TouchStart, WebInspector.UIString('Touch Start')], - [inputEvent.PinchBegin, WebInspector.UIString('Pinch Begin')], - [inputEvent.PinchEnd, WebInspector.UIString('Pinch End')], - [inputEvent.PinchUpdate, WebInspector.UIString('Pinch Update')] + /** @type {!Map<!TimelineModel.TimelineIRModel.InputEvents, string>} */ + Timeline.TimelineUIUtils._inputEventToDisplayName = new Map([ + [inputEvent.Char, Common.UIString('Key Character')], + [inputEvent.KeyDown, Common.UIString('Key Down')], + [inputEvent.KeyDownRaw, Common.UIString('Key Down')], + [inputEvent.KeyUp, Common.UIString('Key Up')], + [inputEvent.Click, Common.UIString('Click')], + [inputEvent.ContextMenu, Common.UIString('Context Menu')], + [inputEvent.MouseDown, Common.UIString('Mouse Down')], + [inputEvent.MouseMove, Common.UIString('Mouse Move')], + [inputEvent.MouseUp, Common.UIString('Mouse Up')], + [inputEvent.MouseWheel, Common.UIString('Mouse Wheel')], + [inputEvent.ScrollBegin, Common.UIString('Scroll Begin')], + [inputEvent.ScrollEnd, Common.UIString('Scroll End')], + [inputEvent.ScrollUpdate, Common.UIString('Scroll Update')], + [inputEvent.FlingStart, Common.UIString('Fling Start')], + [inputEvent.FlingCancel, Common.UIString('Fling Halt')], + [inputEvent.Tap, Common.UIString('Tap')], + [inputEvent.TapCancel, Common.UIString('Tap Halt')], + [inputEvent.ShowPress, Common.UIString('Tap Begin')], + [inputEvent.TapDown, Common.UIString('Tap Down')], + [inputEvent.TouchCancel, Common.UIString('Touch Cancel')], + [inputEvent.TouchEnd, Common.UIString('Touch End')], + [inputEvent.TouchMove, Common.UIString('Touch Move')], + [inputEvent.TouchStart, Common.UIString('Touch Start')], + [inputEvent.PinchBegin, Common.UIString('Pinch Begin')], + [inputEvent.PinchEnd, Common.UIString('Pinch End')], + [inputEvent.PinchUpdate, Common.UIString('Pinch Update')] ]); } - return WebInspector.TimelineUIUtils._inputEventToDisplayName.get(inputEventType) || null; + return Timeline.TimelineUIUtils._inputEventToDisplayName.get(inputEventType) || null; } /** @@ -228,26 +228,26 @@ * @return {string} */ static frameDisplayName(frame) { - if (!WebInspector.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) - return WebInspector.beautifyFunctionName(frame.functionName); - const nativeGroup = WebInspector.TimelineJSProfileProcessor.nativeGroup(frame.functionName); - const groups = WebInspector.TimelineJSProfileProcessor.NativeGroups; + if (!TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) + return UI.beautifyFunctionName(frame.functionName); + const nativeGroup = TimelineModel.TimelineJSProfileProcessor.nativeGroup(frame.functionName); + const groups = TimelineModel.TimelineJSProfileProcessor.NativeGroups; switch (nativeGroup) { - case groups.Compile: return WebInspector.UIString('Compile'); - case groups.Parse: return WebInspector.UIString('Parse'); + case groups.Compile: return Common.UIString('Compile'); + case groups.Parse: return Common.UIString('Parse'); } return frame.functionName; } /** - * @param {!WebInspector.TracingModel.Event} traceEvent + * @param {!SDK.TracingModel.Event} traceEvent * @param {!RegExp} regExp * @return {boolean} */ static testContentMatching(traceEvent, regExp) { - var title = WebInspector.TimelineUIUtils.eventStyle(traceEvent).title; + var title = Timeline.TimelineUIUtils.eventStyle(traceEvent).title; var tokens = [title]; - var url = WebInspector.TimelineData.forEvent(traceEvent).url; + var url = TimelineModel.TimelineData.forEvent(traceEvent).url; if (url) tokens.push(url); for (var argName in traceEvent.args) { @@ -259,121 +259,121 @@ } /** - * @param {!WebInspector.TimelineModel.Record} record - * @return {!WebInspector.TimelineCategory} + * @param {!TimelineModel.TimelineModel.Record} record + * @return {!Timeline.TimelineCategory} */ static categoryForRecord(record) { - return WebInspector.TimelineUIUtils.eventStyle(record.traceEvent()).category; + return Timeline.TimelineUIUtils.eventStyle(record.traceEvent()).category; } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {!{title: string, category: !WebInspector.TimelineCategory}} + * @param {!SDK.TracingModel.Event} event + * @return {!{title: string, category: !Timeline.TimelineCategory}} */ static eventStyle(event) { - var eventStyles = WebInspector.TimelineUIUtils._initEventStyles(); - if (event.hasCategory(WebInspector.TimelineModel.Category.Console) || - event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) - return {title: event.name, category: WebInspector.TimelineUIUtils.categories()['scripting']}; + var eventStyles = Timeline.TimelineUIUtils._initEventStyles(); + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) || + event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) + return {title: event.name, category: Timeline.TimelineUIUtils.categories()['scripting']}; - if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) { + if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) { /** @const */ var prefix = 'InputLatency::'; var inputEventType = event.name.startsWith(prefix) ? event.name.substr(prefix.length) : event.name; - var displayName = WebInspector.TimelineUIUtils.inputEventDisplayName( - /** @type {!WebInspector.TimelineIRModel.InputEvents} */ (inputEventType)); - return {title: displayName || inputEventType, category: WebInspector.TimelineUIUtils.categories()['scripting']}; + var displayName = Timeline.TimelineUIUtils.inputEventDisplayName( + /** @type {!TimelineModel.TimelineIRModel.InputEvents} */ (inputEventType)); + return {title: displayName || inputEventType, category: Timeline.TimelineUIUtils.categories()['scripting']}; } var result = eventStyles[event.name]; if (!result) { result = - new WebInspector.TimelineRecordStyle(event.name, WebInspector.TimelineUIUtils.categories()['other'], true); + new Timeline.TimelineRecordStyle(event.name, Timeline.TimelineUIUtils.categories()['other'], true); eventStyles[event.name] = result; } return result; } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ static eventColor(event) { - if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { + if (event.name === TimelineModel.TimelineModel.RecordType.JSFrame) { var frame = event.args['data']; - if (WebInspector.TimelineUIUtils.isUserFrame(frame)) - return WebInspector.TimelineUIUtils.colorForURL(frame.url); + if (Timeline.TimelineUIUtils.isUserFrame(frame)) + return Timeline.TimelineUIUtils.colorForURL(frame.url); } - return WebInspector.TimelineUIUtils.eventStyle(event).category.color; + return Timeline.TimelineUIUtils.eventStyle(event).category.color; } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ static eventTitle(event) { - const recordType = WebInspector.TimelineModel.RecordType; + const recordType = TimelineModel.TimelineModel.RecordType; const eventData = event.args['data']; if (event.name === recordType.JSFrame) - return WebInspector.TimelineUIUtils.frameDisplayName(eventData); - const title = WebInspector.TimelineUIUtils.eventStyle(event).title; - if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) + return Timeline.TimelineUIUtils.frameDisplayName(eventData); + const title = Timeline.TimelineUIUtils.eventStyle(event).title; + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console)) return title; if (event.name === recordType.TimeStamp) - return WebInspector.UIString('%s: %s', title, eventData['message']); + return Common.UIString('%s: %s', title, eventData['message']); if (event.name === recordType.Animation && eventData && eventData['name']) - return WebInspector.UIString('%s: %s', title, eventData['name']); + return Common.UIString('%s: %s', title, eventData['name']); return title; } /** - * !Map<!WebInspector.TimelineIRModel.Phases, !{color: string, label: string}> + * !Map<!TimelineModel.TimelineIRModel.Phases, !{color: string, label: string}> */ static _interactionPhaseStyles() { - var map = WebInspector.TimelineUIUtils._interactionPhaseStylesMap; + var map = Timeline.TimelineUIUtils._interactionPhaseStylesMap; if (!map) { map = new Map([ - [WebInspector.TimelineIRModel.Phases.Idle, {color: 'white', label: 'Idle'}], + [TimelineModel.TimelineIRModel.Phases.Idle, {color: 'white', label: 'Idle'}], [ - WebInspector.TimelineIRModel.Phases.Response, - {color: 'hsl(43, 83%, 64%)', label: WebInspector.UIString('Response')} + TimelineModel.TimelineIRModel.Phases.Response, + {color: 'hsl(43, 83%, 64%)', label: Common.UIString('Response')} ], [ - WebInspector.TimelineIRModel.Phases.Scroll, - {color: 'hsl(256, 67%, 70%)', label: WebInspector.UIString('Scroll')} + TimelineModel.TimelineIRModel.Phases.Scroll, + {color: 'hsl(256, 67%, 70%)', label: Common.UIString('Scroll')} ], [ - WebInspector.TimelineIRModel.Phases.Fling, - {color: 'hsl(256, 67%, 70%)', label: WebInspector.UIString('Fling')} + TimelineModel.TimelineIRModel.Phases.Fling, + {color: 'hsl(256, 67%, 70%)', label: Common.UIString('Fling')} ], - [WebInspector.TimelineIRModel.Phases.Drag, {color: 'hsl(256, 67%, 70%)', label: WebInspector.UIString('Drag')}], + [TimelineModel.TimelineIRModel.Phases.Drag, {color: 'hsl(256, 67%, 70%)', label: Common.UIString('Drag')}], [ - WebInspector.TimelineIRModel.Phases.Animation, - {color: 'hsl(256, 67%, 70%)', label: WebInspector.UIString('Animation')} + TimelineModel.TimelineIRModel.Phases.Animation, + {color: 'hsl(256, 67%, 70%)', label: Common.UIString('Animation')} ], [ - WebInspector.TimelineIRModel.Phases.Uncategorized, - {color: 'hsl(0, 0%, 87%)', label: WebInspector.UIString('Uncategorized')} + TimelineModel.TimelineIRModel.Phases.Uncategorized, + {color: 'hsl(0, 0%, 87%)', label: Common.UIString('Uncategorized')} ] ]); - WebInspector.TimelineUIUtils._interactionPhaseStylesMap = map; + Timeline.TimelineUIUtils._interactionPhaseStylesMap = map; } return map; } /** - * @param {!WebInspector.TimelineIRModel.Phases} phase + * @param {!TimelineModel.TimelineIRModel.Phases} phase * @return {string} */ static interactionPhaseColor(phase) { - return WebInspector.TimelineUIUtils._interactionPhaseStyles().get(phase).color; + return Timeline.TimelineUIUtils._interactionPhaseStyles().get(phase).color; } /** - * @param {!WebInspector.TimelineIRModel.Phases} phase + * @param {!TimelineModel.TimelineIRModel.Phases} phase * @return {string} */ static interactionPhaseLabel(phase) { - return WebInspector.TimelineUIUtils._interactionPhaseStyles().get(phase).label; + return Timeline.TimelineUIUtils._interactionPhaseStyles().get(phase).label; } /** @@ -385,11 +385,11 @@ } /** - * @param {!WebInspector.TimelineModel.NetworkRequest} request - * @return {!WebInspector.TimelineUIUtils.NetworkCategory} + * @param {!TimelineModel.TimelineModel.NetworkRequest} request + * @return {!Timeline.TimelineUIUtils.NetworkCategory} */ static networkRequestCategory(request) { - var categories = WebInspector.TimelineUIUtils.NetworkCategory; + var categories = Timeline.TimelineUIUtils.NetworkCategory; switch (request.mimeType) { case 'text/html': return categories.HTML; @@ -416,11 +416,11 @@ } /** - * @param {!WebInspector.TimelineUIUtils.NetworkCategory} category + * @param {!Timeline.TimelineUIUtils.NetworkCategory} category * @return {string} */ static networkCategoryColor(category) { - var categories = WebInspector.TimelineUIUtils.NetworkCategory; + var categories = Timeline.TimelineUIUtils.NetworkCategory; switch (category) { case categories.HTML: return 'hsl(214, 67%, 66%)'; @@ -436,12 +436,12 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {?WebInspector.Target} target + * @param {!SDK.TracingModel.Event} event + * @param {?SDK.Target} target * @return {?string} */ static buildDetailsTextForTraceEvent(event, target) { - var recordType = WebInspector.TimelineModel.RecordType; + var recordType = TimelineModel.TimelineModel.RecordType; var detailsText; var eventData = event.args['data']; switch (event.name) { @@ -449,7 +449,7 @@ case recordType.MajorGC: case recordType.MinorGC: var delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter']; - detailsText = WebInspector.UIString('%s collected', Number.bytesToString(delta)); + detailsText = Common.UIString('%s collected', Number.bytesToString(delta)); break; case recordType.FunctionCall: // Omit internally generated script names. @@ -457,21 +457,21 @@ detailsText = linkifyLocationAsText(eventData['scriptId'], eventData['lineNumber'], 0); break; case recordType.JSFrame: - detailsText = WebInspector.TimelineUIUtils.frameDisplayName(eventData); + detailsText = Timeline.TimelineUIUtils.frameDisplayName(eventData); break; case recordType.EventDispatch: detailsText = eventData ? eventData['type'] : null; break; case recordType.Paint: - var width = WebInspector.TimelineUIUtils.quadWidth(eventData.clip); - var height = WebInspector.TimelineUIUtils.quadHeight(eventData.clip); + var width = Timeline.TimelineUIUtils.quadWidth(eventData.clip); + var height = Timeline.TimelineUIUtils.quadHeight(eventData.clip); if (width && height) - detailsText = WebInspector.UIString('%d\u2009\u00d7\u2009%d', width, height); + detailsText = Common.UIString('%d\u2009\u00d7\u2009%d', width, height); break; case recordType.ParseHTML: var endLine = event.args['endData'] && event.args['endData']['endLine']; - var url = WebInspector.displayNameForURL(event.args['beginData']['url']); - detailsText = WebInspector.UIString( + var url = Bindings.displayNameForURL(event.args['beginData']['url']); + detailsText = Common.UIString( '%s [%s\u2026%s]', url, event.args['beginData']['startLine'] + 1, endLine >= 0 ? endLine + 1 : ''); break; @@ -479,14 +479,14 @@ case recordType.EvaluateScript: var url = eventData && eventData['url']; if (url) - detailsText = WebInspector.displayNameForURL(url) + ':' + (eventData['lineNumber'] + 1); + detailsText = Bindings.displayNameForURL(url) + ':' + (eventData['lineNumber'] + 1); break; case recordType.ParseScriptOnBackground: case recordType.XHRReadyStateChange: case recordType.XHRLoad: var url = eventData['url']; if (url) - detailsText = WebInspector.displayNameForURL(url); + detailsText = Bindings.displayNameForURL(url); break; case recordType.TimeStamp: detailsText = eventData['message']; @@ -504,9 +504,9 @@ case recordType.DecodeImage: case recordType.ResizeImage: case recordType.DecodeLazyPixelRef: - var url = WebInspector.TimelineData.forEvent(event).url; + var url = TimelineModel.TimelineData.forEvent(event).url; if (url) - detailsText = WebInspector.displayNameForURL(url); + detailsText = Bindings.displayNameForURL(url); break; case recordType.EmbedderCallback: @@ -518,19 +518,19 @@ break; case recordType.GCIdleLazySweep: - detailsText = WebInspector.UIString('idle sweep'); + detailsText = Common.UIString('idle sweep'); break; case recordType.GCCompleteSweep: - detailsText = WebInspector.UIString('complete sweep'); + detailsText = Common.UIString('complete sweep'); break; case recordType.GCCollectGarbage: - detailsText = WebInspector.UIString('collect'); + detailsText = Common.UIString('collect'); break; default: - if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console)) detailsText = null; else detailsText = linkifyTopCallFrameAsText(); @@ -546,13 +546,13 @@ * @return {?string} */ function linkifyLocationAsText(scriptId, lineNumber, columnNumber) { - var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); + var debuggerModel = SDK.DebuggerModel.fromTarget(target); if (!target || target.isDisposed() || !scriptId || !debuggerModel) return null; var rawLocation = debuggerModel.createRawLocationByScriptId(scriptId, lineNumber, columnNumber); if (!rawLocation) return null; - var uiLocation = WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation); + var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation); return uiLocation.linkText(); } @@ -560,7 +560,7 @@ * @return {?string} */ function linkifyTopCallFrameAsText() { - var frame = WebInspector.TimelineData.forEvent(event).topFrame(); + var frame = TimelineModel.TimelineData.forEvent(event).topFrame(); if (!frame) return null; var text = linkifyLocationAsText(frame.scriptId, frame.lineNumber, frame.columnNumber); @@ -574,13 +574,13 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {?WebInspector.Target} target - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.TracingModel.Event} event + * @param {?SDK.Target} target + * @param {!Components.Linkifier} linkifier * @return {?Node} */ static buildDetailsNodeForTraceEvent(event, target, linkifier) { - var recordType = WebInspector.TimelineModel.RecordType; + var recordType = TimelineModel.TimelineModel.RecordType; var details = null; var detailsText; var eventData = event.args['data']; @@ -600,7 +600,7 @@ case recordType.GCIdleLazySweep: case recordType.GCCompleteSweep: case recordType.GCCollectGarbage: - detailsText = WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(event, target); + detailsText = Timeline.TimelineUIUtils.buildDetailsTextForTraceEvent(event, target); break; case recordType.PaintImage: case recordType.DecodeImage: @@ -612,14 +612,14 @@ case recordType.ResourceReceivedData: case recordType.ResourceReceiveResponse: case recordType.ResourceFinish: - var url = WebInspector.TimelineData.forEvent(event).url; + var url = TimelineModel.TimelineData.forEvent(event).url; if (url) - details = WebInspector.linkifyResourceAsNode(url); + details = Components.linkifyResourceAsNode(url); break; case recordType.FunctionCall: case recordType.JSFrame: details = createElement('span'); - details.createTextChild(WebInspector.TimelineUIUtils.frameDisplayName(eventData)); + details.createTextChild(Timeline.TimelineUIUtils.frameDisplayName(eventData)); const location = linkifyLocation( eventData['scriptId'], eventData['url'], eventData['lineNumber'], eventData['columnNumber']); if (location) { @@ -639,7 +639,7 @@ details = linkifyLocation('', url, 0, 0); break; default: - if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console)) detailsText = null; else details = linkifyTopCallFrame(); @@ -665,15 +665,15 @@ * @return {?Element} */ function linkifyTopCallFrame() { - var frame = WebInspector.TimelineData.forEvent(event).topFrame(); + var frame = TimelineModel.TimelineData.forEvent(event).topFrame(); return frame ? linkifier.maybeLinkifyConsoleCallFrame(target, frame, 'timeline-details') : null; } } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.TracingModel.Event} event + * @param {!TimelineModel.TimelineModel} model + * @param {!Components.Linkifier} linkifier * @param {boolean} detailed * @param {function(!DocumentFragment)} callback */ @@ -685,24 +685,24 @@ } var relatedNodes = null; var barrier = new CallbackBarrier(); - if (!event[WebInspector.TimelineUIUtils._previewElementSymbol]) { - var url = WebInspector.TimelineData.forEvent(event).url; + if (!event[Timeline.TimelineUIUtils._previewElementSymbol]) { + var url = TimelineModel.TimelineData.forEvent(event).url; if (url) { - WebInspector.DOMPresentationUtils.buildImagePreviewContents( + Components.DOMPresentationUtils.buildImagePreviewContents( target, url, false, barrier.createCallback(saveImage)); - } else if (WebInspector.TimelineData.forEvent(event).picture) { - WebInspector.TimelineUIUtils.buildPicturePreviewContent(event, target, barrier.createCallback(saveImage)); + } else if (TimelineModel.TimelineData.forEvent(event).picture) { + Timeline.TimelineUIUtils.buildPicturePreviewContent(event, target, barrier.createCallback(saveImage)); } } var nodeIdsToResolve = new Set(); - var timelineData = WebInspector.TimelineData.forEvent(event); + var timelineData = TimelineModel.TimelineData.forEvent(event); if (timelineData.backendNodeId) nodeIdsToResolve.add(timelineData.backendNodeId); - var invalidationTrackingEvents = WebInspector.InvalidationTracker.invalidationEventsFor(event); + var invalidationTrackingEvents = TimelineModel.InvalidationTracker.invalidationEventsFor(event); if (invalidationTrackingEvents) - WebInspector.TimelineUIUtils._collectInvalidationNodeIds(nodeIdsToResolve, invalidationTrackingEvents); + Timeline.TimelineUIUtils._collectInvalidationNodeIds(nodeIdsToResolve, invalidationTrackingEvents); if (nodeIdsToResolve.size) { - var domModel = WebInspector.DOMModel.fromTarget(target); + var domModel = SDK.DOMModel.fromTarget(target); if (domModel) domModel.pushNodesByBackendIdsToFrontend(nodeIdsToResolve, barrier.createCallback(setRelatedNodeMap)); } @@ -712,52 +712,52 @@ * @param {!Element=} element */ function saveImage(element) { - event[WebInspector.TimelineUIUtils._previewElementSymbol] = element || null; + event[Timeline.TimelineUIUtils._previewElementSymbol] = element || null; } /** - * @param {?Map<number, ?WebInspector.DOMNode>} nodeMap + * @param {?Map<number, ?SDK.DOMNode>} nodeMap */ function setRelatedNodeMap(nodeMap) { relatedNodes = nodeMap; } function callbackWrapper() { - callback(WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously( + callback(Timeline.TimelineUIUtils._buildTraceEventDetailsSynchronously( event, model, linkifier, detailed, relatedNodes)); } } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.Linkifier} linkifier + * @param {!SDK.TracingModel.Event} event + * @param {!TimelineModel.TimelineModel} model + * @param {!Components.Linkifier} linkifier * @param {boolean} detailed - * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap + * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap * @return {!DocumentFragment} */ static _buildTraceEventDetailsSynchronously(event, model, linkifier, detailed, relatedNodesMap) { - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; // This message may vary per event.name; var relatedNodeLabel; - var contentHelper = new WebInspector.TimelineDetailsContentHelper(model.targetByEvent(event), linkifier); + var contentHelper = new Timeline.TimelineDetailsContentHelper(model.targetByEvent(event), linkifier); contentHelper.addSection( - WebInspector.TimelineUIUtils.eventTitle(event), WebInspector.TimelineUIUtils.eventStyle(event).category); + Timeline.TimelineUIUtils.eventTitle(event), Timeline.TimelineUIUtils.eventStyle(event).category); var eventData = event.args['data']; - var timelineData = WebInspector.TimelineData.forEvent(event); + var timelineData = TimelineModel.TimelineData.forEvent(event); var initiator = timelineData.initiator(); if (timelineData.warning) contentHelper.appendWarningRow(event); if (event.name === recordTypes.JSFrame && eventData['deoptReason']) - contentHelper.appendWarningRow(event, WebInspector.TimelineModel.WarningType.V8Deopt); + contentHelper.appendWarningRow(event, TimelineModel.TimelineModel.WarningType.V8Deopt); if (detailed) { - contentHelper.appendTextRow(WebInspector.UIString('Self Time'), Number.millisToString(event.selfTime, true)); + contentHelper.appendTextRow(Common.UIString('Self Time'), Number.millisToString(event.selfTime, true)); contentHelper.appendTextRow( - WebInspector.UIString('Total Time'), Number.millisToString(event.duration || 0, true)); + Common.UIString('Total Time'), Number.millisToString(event.duration || 0, true)); } switch (event.name) { @@ -765,26 +765,26 @@ case recordTypes.MajorGC: case recordTypes.MinorGC: var delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter']; - contentHelper.appendTextRow(WebInspector.UIString('Collected'), Number.bytesToString(delta)); + contentHelper.appendTextRow(Common.UIString('Collected'), Number.bytesToString(delta)); break; case recordTypes.JSFrame: case recordTypes.FunctionCall: var detailsNode = - WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, model.targetByEvent(event), linkifier); + Timeline.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, model.targetByEvent(event), linkifier); if (detailsNode) - contentHelper.appendElementRow(WebInspector.UIString('Function'), detailsNode); + contentHelper.appendElementRow(Common.UIString('Function'), detailsNode); break; case recordTypes.TimerFire: case recordTypes.TimerInstall: case recordTypes.TimerRemove: - contentHelper.appendTextRow(WebInspector.UIString('Timer ID'), eventData['timerId']); + contentHelper.appendTextRow(Common.UIString('Timer ID'), eventData['timerId']); if (event.name === recordTypes.TimerInstall) { - contentHelper.appendTextRow(WebInspector.UIString('Timeout'), Number.millisToString(eventData['timeout'])); - contentHelper.appendTextRow(WebInspector.UIString('Repeats'), !eventData['singleShot']); + contentHelper.appendTextRow(Common.UIString('Timeout'), Number.millisToString(eventData['timeout'])); + contentHelper.appendTextRow(Common.UIString('Repeats'), !eventData['singleShot']); } break; case recordTypes.FireAnimationFrame: - contentHelper.appendTextRow(WebInspector.UIString('Callback ID'), eventData['id']); + contentHelper.appendTextRow(Common.UIString('Callback ID'), eventData['id']); break; case recordTypes.ResourceSendRequest: case recordTypes.ResourceReceiveResponse: @@ -792,73 +792,73 @@ case recordTypes.ResourceFinish: var url = timelineData.url; if (url) - contentHelper.appendElementRow(WebInspector.UIString('Resource'), WebInspector.linkifyResourceAsNode(url)); + contentHelper.appendElementRow(Common.UIString('Resource'), Components.linkifyResourceAsNode(url)); if (eventData['requestMethod']) - contentHelper.appendTextRow(WebInspector.UIString('Request Method'), eventData['requestMethod']); + contentHelper.appendTextRow(Common.UIString('Request Method'), eventData['requestMethod']); if (typeof eventData['statusCode'] === 'number') - contentHelper.appendTextRow(WebInspector.UIString('Status Code'), eventData['statusCode']); + contentHelper.appendTextRow(Common.UIString('Status Code'), eventData['statusCode']); if (eventData['mimeType']) - contentHelper.appendTextRow(WebInspector.UIString('MIME Type'), eventData['mimeType']); + contentHelper.appendTextRow(Common.UIString('MIME Type'), eventData['mimeType']); if ('priority' in eventData) { - var priority = WebInspector.uiLabelForPriority(eventData['priority']); - contentHelper.appendTextRow(WebInspector.UIString('Priority'), priority); + var priority = Components.uiLabelForPriority(eventData['priority']); + contentHelper.appendTextRow(Common.UIString('Priority'), priority); } if (eventData['encodedDataLength']) contentHelper.appendTextRow( - WebInspector.UIString('Encoded Data Length'), - WebInspector.UIString('%d Bytes', eventData['encodedDataLength'])); + Common.UIString('Encoded Data Length'), + Common.UIString('%d Bytes', eventData['encodedDataLength'])); break; case recordTypes.CompileScript: case recordTypes.EvaluateScript: var url = eventData && eventData['url']; if (url) contentHelper.appendLocationRow( - WebInspector.UIString('Script'), url, eventData['lineNumber'], eventData['columnNumber']); + Common.UIString('Script'), url, eventData['lineNumber'], eventData['columnNumber']); break; case recordTypes.Paint: var clip = eventData['clip']; contentHelper.appendTextRow( - WebInspector.UIString('Location'), WebInspector.UIString('(%d, %d)', clip[0], clip[1])); - var clipWidth = WebInspector.TimelineUIUtils.quadWidth(clip); - var clipHeight = WebInspector.TimelineUIUtils.quadHeight(clip); + Common.UIString('Location'), Common.UIString('(%d, %d)', clip[0], clip[1])); + var clipWidth = Timeline.TimelineUIUtils.quadWidth(clip); + var clipHeight = Timeline.TimelineUIUtils.quadHeight(clip); contentHelper.appendTextRow( - WebInspector.UIString('Dimensions'), WebInspector.UIString('%d × %d', clipWidth, clipHeight)); + Common.UIString('Dimensions'), Common.UIString('%d × %d', clipWidth, clipHeight)); // Fall-through intended. case recordTypes.PaintSetup: case recordTypes.Rasterize: case recordTypes.ScrollLayer: - relatedNodeLabel = WebInspector.UIString('Layer Root'); + relatedNodeLabel = Common.UIString('Layer Root'); break; case recordTypes.PaintImage: case recordTypes.DecodeLazyPixelRef: case recordTypes.DecodeImage: case recordTypes.ResizeImage: case recordTypes.DrawLazyPixelRef: - relatedNodeLabel = WebInspector.UIString('Owner Element'); + relatedNodeLabel = Common.UIString('Owner Element'); if (timelineData.url) contentHelper.appendElementRow( - WebInspector.UIString('Image URL'), WebInspector.linkifyResourceAsNode(timelineData.url)); + Common.UIString('Image URL'), Components.linkifyResourceAsNode(timelineData.url)); break; case recordTypes.ParseAuthorStyleSheet: var url = eventData['styleSheetUrl']; if (url) contentHelper.appendElementRow( - WebInspector.UIString('Stylesheet URL'), WebInspector.linkifyResourceAsNode(url)); + Common.UIString('Stylesheet URL'), Components.linkifyResourceAsNode(url)); break; case recordTypes.UpdateLayoutTree: // We don't want to see default details. case recordTypes.RecalculateStyles: - contentHelper.appendTextRow(WebInspector.UIString('Elements Affected'), event.args['elementCount']); + contentHelper.appendTextRow(Common.UIString('Elements Affected'), event.args['elementCount']); break; case recordTypes.Layout: var beginData = event.args['beginData']; contentHelper.appendTextRow( - WebInspector.UIString('Nodes That Need Layout'), - WebInspector.UIString('%s of %s', beginData['dirtyObjects'], beginData['totalObjects'])); - relatedNodeLabel = WebInspector.UIString('Layout root'); + Common.UIString('Nodes That Need Layout'), + Common.UIString('%s of %s', beginData['dirtyObjects'], beginData['totalObjects'])); + relatedNodeLabel = Common.UIString('Layout root'); break; case recordTypes.ConsoleTime: - contentHelper.appendTextRow(WebInspector.UIString('Message'), event.name); + contentHelper.appendTextRow(Common.UIString('Message'), event.name); break; case recordTypes.WebSocketCreate: case recordTypes.WebSocketSendHandshakeRequest: @@ -866,18 +866,18 @@ case recordTypes.WebSocketDestroy: var initiatorData = initiator ? initiator.args['data'] : eventData; if (typeof initiatorData['webSocketURL'] !== 'undefined') - contentHelper.appendTextRow(WebInspector.UIString('URL'), initiatorData['webSocketURL']); + contentHelper.appendTextRow(Common.UIString('URL'), initiatorData['webSocketURL']); if (typeof initiatorData['webSocketProtocol'] !== 'undefined') - contentHelper.appendTextRow(WebInspector.UIString('WebSocket Protocol'), initiatorData['webSocketProtocol']); + contentHelper.appendTextRow(Common.UIString('WebSocket Protocol'), initiatorData['webSocketProtocol']); if (typeof eventData['message'] !== 'undefined') - contentHelper.appendTextRow(WebInspector.UIString('Message'), eventData['message']); + contentHelper.appendTextRow(Common.UIString('Message'), eventData['message']); break; case recordTypes.EmbedderCallback: - contentHelper.appendTextRow(WebInspector.UIString('Callback Function'), eventData['callbackName']); + contentHelper.appendTextRow(Common.UIString('Callback Function'), eventData['callbackName']); break; case recordTypes.Animation: - if (event.phase === WebInspector.TracingModel.Phase.NestableAsyncInstant) - contentHelper.appendTextRow(WebInspector.UIString('State'), eventData['state']); + if (event.phase === SDK.TracingModel.Phase.NestableAsyncInstant) + contentHelper.appendTextRow(Common.UIString('State'), eventData['state']); break; case recordTypes.ParseHTML: var beginData = event.args['beginData']; @@ -885,56 +885,56 @@ var startLine = beginData['startLine'] - 1; var endLine = event.args['endData'] ? event.args['endData']['endLine'] - 1 : undefined; if (url) - contentHelper.appendLocationRange(WebInspector.UIString('Range'), url, startLine, endLine); + contentHelper.appendLocationRange(Common.UIString('Range'), url, startLine, endLine); break; case recordTypes.FireIdleCallback: contentHelper.appendTextRow( - WebInspector.UIString('Allotted Time'), Number.millisToString(eventData['allottedMilliseconds'])); - contentHelper.appendTextRow(WebInspector.UIString('Invoked by Timeout'), eventData['timedOut']); + Common.UIString('Allotted Time'), Number.millisToString(eventData['allottedMilliseconds'])); + contentHelper.appendTextRow(Common.UIString('Invoked by Timeout'), eventData['timedOut']); // Fall-through intended. case recordTypes.RequestIdleCallback: case recordTypes.CancelIdleCallback: - contentHelper.appendTextRow(WebInspector.UIString('Callback ID'), eventData['id']); + contentHelper.appendTextRow(Common.UIString('Callback ID'), eventData['id']); break; case recordTypes.EventDispatch: - contentHelper.appendTextRow(WebInspector.UIString('Type'), eventData['type']); + contentHelper.appendTextRow(Common.UIString('Type'), eventData['type']); break; default: var detailsNode = - WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, model.targetByEvent(event), linkifier); + Timeline.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, model.targetByEvent(event), linkifier); if (detailsNode) - contentHelper.appendElementRow(WebInspector.UIString('Details'), detailsNode); + contentHelper.appendElementRow(Common.UIString('Details'), detailsNode); break; } if (timelineData.timeWaitingForMainThread) contentHelper.appendTextRow( - WebInspector.UIString('Time Waiting for Main Thread'), + Common.UIString('Time Waiting for Main Thread'), Number.millisToString(timelineData.timeWaitingForMainThread, true)); var relatedNode = relatedNodesMap && relatedNodesMap.get(timelineData.backendNodeId); if (relatedNode) contentHelper.appendElementRow( - relatedNodeLabel || WebInspector.UIString('Related Node'), - WebInspector.DOMPresentationUtils.linkifyNodeReference(relatedNode)); + relatedNodeLabel || Common.UIString('Related Node'), + Components.DOMPresentationUtils.linkifyNodeReference(relatedNode)); - if (event[WebInspector.TimelineUIUtils._previewElementSymbol]) { - contentHelper.addSection(WebInspector.UIString('Preview')); - contentHelper.appendElementRow('', event[WebInspector.TimelineUIUtils._previewElementSymbol]); + if (event[Timeline.TimelineUIUtils._previewElementSymbol]) { + contentHelper.addSection(Common.UIString('Preview')); + contentHelper.appendElementRow('', event[Timeline.TimelineUIUtils._previewElementSymbol]); } - if (timelineData.stackTraceForSelfOrInitiator() || WebInspector.InvalidationTracker.invalidationEventsFor(event)) - WebInspector.TimelineUIUtils._generateCauses(event, model.targetByEvent(event), relatedNodesMap, contentHelper); + if (timelineData.stackTraceForSelfOrInitiator() || TimelineModel.InvalidationTracker.invalidationEventsFor(event)) + Timeline.TimelineUIUtils._generateCauses(event, model.targetByEvent(event), relatedNodesMap, contentHelper); var stats = {}; - var showPieChart = detailed && WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent(stats, model, event); + var showPieChart = detailed && Timeline.TimelineUIUtils._aggregatedStatsForTraceEvent(stats, model, event); if (showPieChart) { - contentHelper.addSection(WebInspector.UIString('Aggregated Time')); - var pieChart = WebInspector.TimelineUIUtils.generatePieChart( - stats, WebInspector.TimelineUIUtils.eventStyle(event).category, event.selfTime); + contentHelper.addSection(Common.UIString('Aggregated Time')); + var pieChart = Timeline.TimelineUIUtils.generatePieChart( + stats, Timeline.TimelineUIUtils.eventStyle(event).category, event.selfTime); contentHelper.appendElementRow('', pieChart); } @@ -942,7 +942,7 @@ } /** - * @param {!WebInspector.TimelineModel} model + * @param {!TimelineModel.TimelineModel} model * @param {number} startTime * @param {number} endTime * @return {!DocumentFragment} @@ -952,7 +952,7 @@ /** * @param {number} value - * @param {!WebInspector.TimelineModel.Record} task + * @param {!TimelineModel.TimelineModel.Record} task * @return {number} */ function compareEndTime(value, task) { @@ -966,17 +966,17 @@ break; if (task.startTime() > startTime && task.endTime() < endTime) { // cache stats for top-level entries that fit the range entirely. - var taskStats = task[WebInspector.TimelineUIUtils._aggregatedStatsKey]; + var taskStats = task[Timeline.TimelineUIUtils._aggregatedStatsKey]; if (!taskStats) { taskStats = {}; - WebInspector.TimelineUIUtils._collectAggregatedStatsForRecord(task, startTime, endTime, taskStats); - task[WebInspector.TimelineUIUtils._aggregatedStatsKey] = taskStats; + Timeline.TimelineUIUtils._collectAggregatedStatsForRecord(task, startTime, endTime, taskStats); + task[Timeline.TimelineUIUtils._aggregatedStatsKey] = taskStats; } for (var key in taskStats) aggregatedStats[key] = (aggregatedStats[key] || 0) + taskStats[key]; continue; } - WebInspector.TimelineUIUtils._collectAggregatedStatsForRecord(task, startTime, endTime, aggregatedStats); + Timeline.TimelineUIUtils._collectAggregatedStatsForRecord(task, startTime, endTime, aggregatedStats); } var aggregatedTotal = 0; @@ -987,16 +987,16 @@ var startOffset = startTime - model.minimumRecordTime(); var endOffset = endTime - model.minimumRecordTime(); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null); - contentHelper.addSection(WebInspector.UIString( + var contentHelper = new Timeline.TimelineDetailsContentHelper(null, null); + contentHelper.addSection(Common.UIString( 'Range: %s \u2013 %s', Number.millisToString(startOffset), Number.millisToString(endOffset))); - var pieChart = WebInspector.TimelineUIUtils.generatePieChart(aggregatedStats); + var pieChart = Timeline.TimelineUIUtils.generatePieChart(aggregatedStats); contentHelper.appendElementRow('', pieChart); return contentHelper.fragment; } /** - * @param {!WebInspector.TimelineModel.Record} record + * @param {!TimelineModel.TimelineModel.Record} record * @param {number} startTime * @param {number} endTime * @param {!Object} aggregatedStats @@ -1014,49 +1014,49 @@ if (!child.endTime() || child.endTime() < startTime || child.startTime() > endTime) continue; childrenTime += Math.min(endTime, child.endTime()) - Math.max(startTime, child.startTime()); - WebInspector.TimelineUIUtils._collectAggregatedStatsForRecord(child, startTime, endTime, aggregatedStats); + Timeline.TimelineUIUtils._collectAggregatedStatsForRecord(child, startTime, endTime, aggregatedStats); } - var categoryName = WebInspector.TimelineUIUtils.categoryForRecord(record).name; + var categoryName = Timeline.TimelineUIUtils.categoryForRecord(record).name; var ownTime = Math.min(endTime, record.endTime()) - Math.max(startTime, record.startTime()) - childrenTime; aggregatedStats[categoryName] = (aggregatedStats[categoryName] || 0) + ownTime; } /** - * @param {!WebInspector.TimelineModel.NetworkRequest} request - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.Linkifier} linkifier + * @param {!TimelineModel.TimelineModel.NetworkRequest} request + * @param {!TimelineModel.TimelineModel} model + * @param {!Components.Linkifier} linkifier * @return {!Promise<!DocumentFragment>} */ static buildNetworkRequestDetails(request, model, linkifier) { var target = model.targetByEvent(request.children[0]); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(target, linkifier); + var contentHelper = new Timeline.TimelineDetailsContentHelper(target, linkifier); var duration = request.endTime - (request.startTime || -Infinity); var items = []; if (request.url) - contentHelper.appendElementRow(WebInspector.UIString('URL'), WebInspector.linkifyURLAsNode(request.url)); + contentHelper.appendElementRow(Common.UIString('URL'), UI.linkifyURLAsNode(request.url)); if (isFinite(duration)) - contentHelper.appendTextRow(WebInspector.UIString('Duration'), Number.millisToString(duration, true)); + contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToString(duration, true)); if (request.requestMethod) - contentHelper.appendTextRow(WebInspector.UIString('Request Method'), request.requestMethod); + contentHelper.appendTextRow(Common.UIString('Request Method'), request.requestMethod); if (typeof request.priority === 'string') { - var priority = WebInspector.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePriority} */ (request.priority)); - contentHelper.appendTextRow(WebInspector.UIString('Priority'), priority); + var priority = Components.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePriority} */ (request.priority)); + contentHelper.appendTextRow(Common.UIString('Priority'), priority); } if (request.mimeType) - contentHelper.appendTextRow(WebInspector.UIString('Mime Type'), request.mimeType); + contentHelper.appendTextRow(Common.UIString('Mime Type'), request.mimeType); - var title = WebInspector.UIString('Initiator'); + var title = Common.UIString('Initiator'); var sendRequest = request.children[0]; - var topFrame = WebInspector.TimelineData.forEvent(sendRequest).topFrame(); + var topFrame = TimelineModel.TimelineData.forEvent(sendRequest).topFrame(); if (topFrame) { var link = linkifier.maybeLinkifyConsoleCallFrame(target, topFrame); if (link) contentHelper.appendElementRow(title, link); } else { - var initiator = WebInspector.TimelineData.forEvent(sendRequest).initiator(); + var initiator = TimelineModel.TimelineData.forEvent(sendRequest).initiator(); if (initiator) { - var initiatorURL = WebInspector.TimelineData.forEvent(initiator).url; + var initiatorURL = TimelineModel.TimelineData.forEvent(initiator).url; if (initiatorURL) { var link = linkifier.maybeLinkifyScriptLocation(target, null, initiatorURL, 0); if (link) @@ -1069,8 +1069,8 @@ * @param {function(?Element)} fulfill */ function action(fulfill) { - WebInspector.DOMPresentationUtils.buildImagePreviewContents( - /** @type {!WebInspector.Target} */ (target), request.url, false, saveImage); + Components.DOMPresentationUtils.buildImagePreviewContents( + /** @type {!SDK.Target} */ (target), request.url, false, saveImage); /** * @param {!Element=} element */ @@ -1090,7 +1090,7 @@ */ function appendPreview(element) { if (element) - contentHelper.appendElementRow(WebInspector.UIString('Preview'), request.previewElement); + contentHelper.appendElementRow(Common.UIString('Preview'), request.previewElement); return contentHelper.fragment; } return previewPromise.then(appendPreview); @@ -1105,69 +1105,69 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {?WebInspector.Target} target - * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap - * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper + * @param {!SDK.TracingModel.Event} event + * @param {?SDK.Target} target + * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap + * @param {!Timeline.TimelineDetailsContentHelper} contentHelper */ static _generateCauses(event, target, relatedNodesMap, contentHelper) { - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var callSiteStackLabel; var stackLabel; switch (event.name) { case recordTypes.TimerFire: - callSiteStackLabel = WebInspector.UIString('Timer Installed'); + callSiteStackLabel = Common.UIString('Timer Installed'); break; case recordTypes.FireAnimationFrame: - callSiteStackLabel = WebInspector.UIString('Animation Frame Requested'); + callSiteStackLabel = Common.UIString('Animation Frame Requested'); break; case recordTypes.FireIdleCallback: - callSiteStackLabel = WebInspector.UIString('Idle Callback Requested'); + callSiteStackLabel = Common.UIString('Idle Callback Requested'); break; case recordTypes.UpdateLayoutTree: case recordTypes.RecalculateStyles: - stackLabel = WebInspector.UIString('Recalculation Forced'); + stackLabel = Common.UIString('Recalculation Forced'); break; case recordTypes.Layout: - callSiteStackLabel = WebInspector.UIString('First Layout Invalidation'); - stackLabel = WebInspector.UIString('Layout Forced'); + callSiteStackLabel = Common.UIString('First Layout Invalidation'); + stackLabel = Common.UIString('Layout Forced'); break; } - var timelineData = WebInspector.TimelineData.forEvent(event); + var timelineData = TimelineModel.TimelineData.forEvent(event); // Direct cause. if (timelineData.stackTrace && timelineData.stackTrace.length) { - contentHelper.addSection(WebInspector.UIString('Call Stacks')); + contentHelper.addSection(Common.UIString('Call Stacks')); contentHelper.appendStackTrace( - stackLabel || WebInspector.UIString('Stack Trace'), - WebInspector.TimelineUIUtils._stackTraceFromCallFrames(timelineData.stackTrace)); + stackLabel || Common.UIString('Stack Trace'), + Timeline.TimelineUIUtils._stackTraceFromCallFrames(timelineData.stackTrace)); } - var initiator = WebInspector.TimelineData.forEvent(event).initiator(); + var initiator = TimelineModel.TimelineData.forEvent(event).initiator(); // Indirect causes. - if (WebInspector.InvalidationTracker.invalidationEventsFor(event) && target) { // Full invalidation tracking (experimental). - contentHelper.addSection(WebInspector.UIString('Invalidations')); - WebInspector.TimelineUIUtils._generateInvalidations(event, target, relatedNodesMap, contentHelper); + if (TimelineModel.InvalidationTracker.invalidationEventsFor(event) && target) { // Full invalidation tracking (experimental). + contentHelper.addSection(Common.UIString('Invalidations')); + Timeline.TimelineUIUtils._generateInvalidations(event, target, relatedNodesMap, contentHelper); } else if (initiator) { // Partial invalidation tracking. - var initiatorStackTrace = WebInspector.TimelineData.forEvent(initiator).stackTrace; + var initiatorStackTrace = TimelineModel.TimelineData.forEvent(initiator).stackTrace; if (initiatorStackTrace) { contentHelper.appendStackTrace( - callSiteStackLabel || WebInspector.UIString('First Invalidated'), - WebInspector.TimelineUIUtils._stackTraceFromCallFrames(initiatorStackTrace)); + callSiteStackLabel || Common.UIString('First Invalidated'), + Timeline.TimelineUIUtils._stackTraceFromCallFrames(initiatorStackTrace)); } } } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {!WebInspector.Target} target - * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap - * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper + * @param {!SDK.TracingModel.Event} event + * @param {!SDK.Target} target + * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap + * @param {!Timeline.TimelineDetailsContentHelper} contentHelper */ static _generateInvalidations(event, target, relatedNodesMap, contentHelper) { - var invalidationTrackingEvents = WebInspector.InvalidationTracker.invalidationEventsFor(event); + var invalidationTrackingEvents = TimelineModel.InvalidationTracker.invalidationEventsFor(event); var invalidations = {}; invalidationTrackingEvents.forEach(function(invalidation) { if (!invalidations[invalidation.type]) @@ -1177,29 +1177,29 @@ }); Object.keys(invalidations).forEach(function(type) { - WebInspector.TimelineUIUtils._generateInvalidationsForType( + Timeline.TimelineUIUtils._generateInvalidationsForType( type, target, invalidations[type], relatedNodesMap, contentHelper); }); } /** * @param {string} type - * @param {!WebInspector.Target} target - * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations - * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap - * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper + * @param {!SDK.Target} target + * @param {!Array.<!TimelineModel.InvalidationTrackingEvent>} invalidations + * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap + * @param {!Timeline.TimelineDetailsContentHelper} contentHelper */ static _generateInvalidationsForType(type, target, invalidations, relatedNodesMap, contentHelper) { var title; switch (type) { - case WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking: - title = WebInspector.UIString('Style Invalidations'); + case TimelineModel.TimelineModel.RecordType.StyleRecalcInvalidationTracking: + title = Common.UIString('Style Invalidations'); break; - case WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking: - title = WebInspector.UIString('Layout Invalidations'); + case TimelineModel.TimelineModel.RecordType.LayoutInvalidationTracking: + title = Common.UIString('Layout Invalidations'); break; default: - title = WebInspector.UIString('Other Invalidations'); + title = Common.UIString('Other Invalidations'); break; } @@ -1210,17 +1210,17 @@ var invalidationGroups = groupInvalidationsByCause(invalidations); invalidationGroups.forEach(function(group) { var groupElement = - new WebInspector.TimelineUIUtils.InvalidationsGroupElement(target, relatedNodesMap, contentHelper, group); + new Timeline.TimelineUIUtils.InvalidationsGroupElement(target, relatedNodesMap, contentHelper, group); invalidationsTreeOutline.appendChild(groupElement); }); contentHelper.appendElementRow(title, invalidationsTreeOutline.element, false, true); /** - * @param {!Array<!WebInspector.InvalidationTrackingEvent>} invalidations - * @return {!Array<!Array<!WebInspector.InvalidationTrackingEvent>>} + * @param {!Array<!TimelineModel.InvalidationTrackingEvent>} invalidations + * @return {!Array<!Array<!TimelineModel.InvalidationTrackingEvent>>} */ function groupInvalidationsByCause(invalidations) { - /** @type {!Map<string, !Array<!WebInspector.InvalidationTrackingEvent>>} */ + /** @type {!Map<string, !Array<!TimelineModel.InvalidationTrackingEvent>>} */ var causeToInvalidationMap = new Map(); for (var index = 0; index < invalidations.length; index++) { var invalidation = invalidations[index]; @@ -1248,7 +1248,7 @@ /** * @param {!Set<number>} nodeIds - * @param {!Array<!WebInspector.InvalidationTrackingEvent>} invalidations + * @param {!Array<!TimelineModel.InvalidationTrackingEvent>} invalidations */ static _collectInvalidationNodeIds(nodeIds, invalidations) { nodeIds.addAll(invalidations.map(invalidation => invalidation.nodeId).filter(id => id)); @@ -1256,15 +1256,15 @@ /** * @param {!Object} total - * @param {!WebInspector.TimelineModel} model - * @param {!WebInspector.TracingModel.Event} event + * @param {!TimelineModel.TimelineModel} model + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ static _aggregatedStatsForTraceEvent(total, model, event) { var events = model.inspectedTargetEvents(); /** * @param {number} startTime - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e * @return {number} */ function eventComparator(startTime, e) { @@ -1287,11 +1287,11 @@ continue; if (i > index) hasChildren = true; - var categoryName = WebInspector.TimelineUIUtils.eventStyle(nextEvent).category.name; + var categoryName = Timeline.TimelineUIUtils.eventStyle(nextEvent).category.name; total[categoryName] = (total[categoryName] || 0) + nextEvent.selfTime; } } - if (WebInspector.TracingModel.isAsyncPhase(event.phase)) { + if (SDK.TracingModel.isAsyncPhase(event.phase)) { if (event.endTime) { var aggregatedTotal = 0; for (var categoryName in total) @@ -1304,14 +1304,14 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @param {!WebInspector.Target} target + * @param {!SDK.TracingModel.Event} event + * @param {!SDK.Target} target * @param {function(!Element=)} callback */ static buildPicturePreviewContent(event, target, callback) { - new WebInspector.LayerPaintEvent(event, target).snapshotPromise().then(onSnapshotLoaded); + new TimelineModel.LayerPaintEvent(event, target).snapshotPromise().then(onSnapshotLoaded); /** - * @param {?WebInspector.SnapshotWithRect} snapshotWithRect + * @param {?SDK.SnapshotWithRect} snapshotWithRect */ function onSnapshotLoaded(snapshotWithRect) { if (!snapshotWithRect) { @@ -1335,19 +1335,19 @@ var img = container.createChild('img'); img.src = imageURL; var paintProfilerButton = container.createChild('a'); - paintProfilerButton.textContent = WebInspector.UIString('Paint Profiler'); + paintProfilerButton.textContent = Common.UIString('Paint Profiler'); container.addEventListener('click', showPaintProfiler, false); callback(container); } function showPaintProfiler() { - WebInspector.TimelinePanel.instance().select( - WebInspector.TimelineSelection.fromTraceEvent(event), WebInspector.TimelinePanel.DetailsTab.PaintProfiler); + Timeline.TimelinePanel.instance().select( + Timeline.TimelineSelection.fromTraceEvent(event), Timeline.TimelinePanel.DetailsTab.PaintProfiler); } } /** - * @param {!WebInspector.TimelineModel.RecordType} recordType + * @param {!TimelineModel.TimelineModel.RecordType} recordType * @param {?string} title * @param {number} position * @return {!Element} @@ -1355,7 +1355,7 @@ static createEventDivider(recordType, title, position) { var eventDivider = createElement('div'); eventDivider.className = 'resources-event-divider'; - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; if (recordType === recordTypes.MarkDOMContent) eventDivider.className += ' resources-blue-divider'; @@ -1377,7 +1377,7 @@ } /** - * @param {!WebInspector.TimelineModel.Record} record + * @param {!TimelineModel.TimelineModel.Record} record * @param {number} zeroTime * @param {number} position * @return {!Element} @@ -1385,15 +1385,15 @@ static createDividerForRecord(record, zeroTime, position) { var startTime = Number.millisToString(record.startTime() - zeroTime); var title = - WebInspector.UIString('%s at %s', WebInspector.TimelineUIUtils.eventTitle(record.traceEvent()), startTime); - return WebInspector.TimelineUIUtils.createEventDivider(record.type(), title, position); + Common.UIString('%s at %s', Timeline.TimelineUIUtils.eventTitle(record.traceEvent()), startTime); + return Timeline.TimelineUIUtils.createEventDivider(record.type(), title, position); } /** * @return {!Array.<string>} */ static _visibleTypes() { - var eventStyles = WebInspector.TimelineUIUtils._initEventStyles(); + var eventStyles = Timeline.TimelineUIUtils._initEventStyles(); var result = []; for (var name in eventStyles) { if (!eventStyles[name].hidden) @@ -1403,55 +1403,55 @@ } /** - * @return {!WebInspector.TimelineModel.Filter} + * @return {!TimelineModel.TimelineModel.Filter} */ static visibleEventsFilter() { - return new WebInspector.TimelineVisibleEventsFilter(WebInspector.TimelineUIUtils._visibleTypes()); + return new TimelineModel.TimelineVisibleEventsFilter(Timeline.TimelineUIUtils._visibleTypes()); } /** - * @return {!Object.<string, !WebInspector.TimelineCategory>} + * @return {!Object.<string, !Timeline.TimelineCategory>} */ static categories() { - if (WebInspector.TimelineUIUtils._categories) - return WebInspector.TimelineUIUtils._categories; - WebInspector.TimelineUIUtils._categories = { - loading: new WebInspector.TimelineCategory( - 'loading', WebInspector.UIString('Loading'), true, 'hsl(214, 67%, 74%)', 'hsl(214, 67%, 66%)'), - scripting: new WebInspector.TimelineCategory( - 'scripting', WebInspector.UIString('Scripting'), true, 'hsl(43, 83%, 72%)', 'hsl(43, 83%, 64%) '), - rendering: new WebInspector.TimelineCategory( - 'rendering', WebInspector.UIString('Rendering'), true, 'hsl(256, 67%, 76%)', 'hsl(256, 67%, 70%)'), - painting: new WebInspector.TimelineCategory( - 'painting', WebInspector.UIString('Painting'), true, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'), - gpu: new WebInspector.TimelineCategory( - 'gpu', WebInspector.UIString('GPU'), false, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'), - other: new WebInspector.TimelineCategory( - 'other', WebInspector.UIString('Other'), false, 'hsl(0, 0%, 87%)', 'hsl(0, 0%, 79%)'), - idle: new WebInspector.TimelineCategory( - 'idle', WebInspector.UIString('Idle'), false, 'hsl(0, 100%, 100%)', 'hsl(0, 100%, 100%)') + if (Timeline.TimelineUIUtils._categories) + return Timeline.TimelineUIUtils._categories; + Timeline.TimelineUIUtils._categories = { + loading: new Timeline.TimelineCategory( + 'loading', Common.UIString('Loading'), true, 'hsl(214, 67%, 74%)', 'hsl(214, 67%, 66%)'), + scripting: new Timeline.TimelineCategory( + 'scripting', Common.UIString('Scripting'), true, 'hsl(43, 83%, 72%)', 'hsl(43, 83%, 64%) '), + rendering: new Timeline.TimelineCategory( + 'rendering', Common.UIString('Rendering'), true, 'hsl(256, 67%, 76%)', 'hsl(256, 67%, 70%)'), + painting: new Timeline.TimelineCategory( + 'painting', Common.UIString('Painting'), true, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'), + gpu: new Timeline.TimelineCategory( + 'gpu', Common.UIString('GPU'), false, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'), + other: new Timeline.TimelineCategory( + 'other', Common.UIString('Other'), false, 'hsl(0, 0%, 87%)', 'hsl(0, 0%, 79%)'), + idle: new Timeline.TimelineCategory( + 'idle', Common.UIString('Idle'), false, 'hsl(0, 100%, 100%)', 'hsl(0, 100%, 100%)') }; - return WebInspector.TimelineUIUtils._categories; + return Timeline.TimelineUIUtils._categories; } /** - * @param {!WebInspector.TimelineModel.AsyncEventGroup} group + * @param {!TimelineModel.TimelineModel.AsyncEventGroup} group * @return {string} */ static titleForAsyncEventGroup(group) { - if (!WebInspector.TimelineUIUtils._titleForAsyncEventGroupMap) { - var groups = WebInspector.TimelineModel.AsyncEventGroup; - WebInspector.TimelineUIUtils._titleForAsyncEventGroupMap = new Map([ - [groups.animation, WebInspector.UIString('Animation')], [groups.console, WebInspector.UIString('Console')], - [groups.userTiming, WebInspector.UIString('User Timing')], [groups.input, WebInspector.UIString('Input')] + if (!Timeline.TimelineUIUtils._titleForAsyncEventGroupMap) { + var groups = TimelineModel.TimelineModel.AsyncEventGroup; + Timeline.TimelineUIUtils._titleForAsyncEventGroupMap = new Map([ + [groups.animation, Common.UIString('Animation')], [groups.console, Common.UIString('Console')], + [groups.userTiming, Common.UIString('User Timing')], [groups.input, Common.UIString('Input')] ]); } - return WebInspector.TimelineUIUtils._titleForAsyncEventGroupMap.get(group) || ''; + return Timeline.TimelineUIUtils._titleForAsyncEventGroupMap.get(group) || ''; } /** * @param {!Object} aggregatedStats - * @param {!WebInspector.TimelineCategory=} selfCategory + * @param {!Timeline.TimelineCategory=} selfCategory * @param {number=} selfTime * @return {!Element} */ @@ -1461,13 +1461,13 @@ total += aggregatedStats[categoryName]; var element = createElementWithClass('div', 'timeline-details-view-pie-chart-wrapper hbox'); - var pieChart = new WebInspector.PieChart(100); + var pieChart = new UI.PieChart(100); pieChart.element.classList.add('timeline-details-view-pie-chart'); pieChart.setTotal(total); var pieChartContainer = element.createChild('div', 'vbox'); pieChartContainer.appendChild(pieChart.element); pieChartContainer.createChild('div', 'timeline-details-view-pie-chart-total').textContent = - WebInspector.UIString('Total: %s', Number.millisToString(total, true)); + Common.UIString('Total: %s', Number.millisToString(total, true)); var footerElement = element.createChild('div', 'timeline-aggregated-info-legend'); /** @@ -1491,19 +1491,19 @@ if (selfCategory) { if (selfTime) appendLegendRow( - selfCategory.name, WebInspector.UIString('%s (self)', selfCategory.title), selfTime, selfCategory.color); + selfCategory.name, Common.UIString('%s (self)', selfCategory.title), selfTime, selfCategory.color); // Children of the same category. var categoryTime = aggregatedStats[selfCategory.name]; var value = categoryTime - selfTime; if (value > 0) appendLegendRow( - selfCategory.name, WebInspector.UIString('%s (children)', selfCategory.title), value, + selfCategory.name, Common.UIString('%s (children)', selfCategory.title), value, selfCategory.childColor); } // Add other categories. - for (var categoryName in WebInspector.TimelineUIUtils.categories()) { - var category = WebInspector.TimelineUIUtils.categories()[categoryName]; + for (var categoryName in Timeline.TimelineUIUtils.categories()) { + var category = Timeline.TimelineUIUtils.categories()[categoryName]; if (category === selfCategory) continue; appendLegendRow(category.name, category.title, aggregatedStats[category.name], category.childColor); @@ -1512,18 +1512,18 @@ } /** - * @param {!WebInspector.TimelineFrameModel} frameModel - * @param {!WebInspector.TimelineFrame} frame - * @param {?WebInspector.FilmStripModel.Frame} filmStripFrame + * @param {!TimelineModel.TimelineFrameModel} frameModel + * @param {!TimelineModel.TimelineFrame} frame + * @param {?Components.FilmStripModel.Frame} filmStripFrame * @return {!Element} */ static generateDetailsContentForFrame(frameModel, frame, filmStripFrame) { - var pieChart = WebInspector.TimelineUIUtils.generatePieChart(frame.timeByCategory); - var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null); - contentHelper.addSection(WebInspector.UIString('Frame')); + var pieChart = Timeline.TimelineUIUtils.generatePieChart(frame.timeByCategory); + var contentHelper = new Timeline.TimelineDetailsContentHelper(null, null); + contentHelper.addSection(Common.UIString('Frame')); - var duration = WebInspector.TimelineUIUtils.frameDuration(frame); - contentHelper.appendElementRow(WebInspector.UIString('Duration'), duration, frame.hasWarnings()); + var duration = Timeline.TimelineUIUtils.frameDuration(frame); + contentHelper.appendElementRow(Common.UIString('Duration'), duration, frame.hasWarnings()); if (filmStripFrame) { var filmStripPreview = createElementWithClass('img', 'timeline-filmstrip-preview'); filmStripFrame.imageDataPromise().then(onGotImageData.bind(null, filmStripPreview)); @@ -1531,13 +1531,13 @@ filmStripPreview.addEventListener('click', frameClicked.bind(null, filmStripFrame), false); } var durationInMillis = frame.endTime - frame.startTime; - contentHelper.appendTextRow(WebInspector.UIString('FPS'), Math.floor(1000 / durationInMillis)); - contentHelper.appendTextRow(WebInspector.UIString('CPU time'), Number.millisToString(frame.cpuTime, true)); + contentHelper.appendTextRow(Common.UIString('FPS'), Math.floor(1000 / durationInMillis)); + contentHelper.appendTextRow(Common.UIString('CPU time'), Number.millisToString(frame.cpuTime, true)); if (Runtime.experiments.isEnabled('layersPanel') && frame.layerTree) { contentHelper.appendElementRow( - WebInspector.UIString('Layer tree'), - WebInspector.Linkifier.linkifyUsingRevealer(frame.layerTree, WebInspector.UIString('show'))); + Common.UIString('Layer tree'), + Components.Linkifier.linkifyUsingRevealer(frame.layerTree, Common.UIString('show'))); } /** @@ -1550,30 +1550,30 @@ } /** - * @param {!WebInspector.FilmStripModel.Frame} filmStripFrame + * @param {!Components.FilmStripModel.Frame} filmStripFrame */ function frameClicked(filmStripFrame) { - new WebInspector.FilmStripView.Dialog(filmStripFrame, 0); + new Components.FilmStripView.Dialog(filmStripFrame, 0); } return contentHelper.fragment; } /** - * @param {!WebInspector.TimelineFrame} frame + * @param {!TimelineModel.TimelineFrame} frame * @return {!Element} */ static frameDuration(frame) { - var durationText = WebInspector.UIString( + var durationText = Common.UIString( '%s (at %s)', Number.millisToString(frame.endTime - frame.startTime, true), Number.millisToString(frame.startTimeOffset, true)); var element = createElement('span'); element.createTextChild(durationText); if (!frame.hasWarnings()) return element; - element.createTextChild(WebInspector.UIString('. Long frame times are an indication of ')); - element.appendChild(WebInspector.linkifyURLAsNode( - 'https://developers.google.com/web/fundamentals/performance/rendering/', WebInspector.UIString('jank'), + element.createTextChild(Common.UIString('. Long frame times are an indication of ')); + element.appendChild(UI.linkifyURLAsNode( + 'https://developers.google.com/web/fundamentals/performance/rendering/', Common.UIString('jank'), undefined, true)); element.createTextChild('.'); return element; @@ -1614,34 +1614,34 @@ } /** - * @return {!Array.<!WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor>} + * @return {!Array.<!Timeline.TimelineUIUtils.EventDispatchTypeDescriptor>} */ static eventDispatchDesciptors() { - if (WebInspector.TimelineUIUtils._eventDispatchDesciptors) - return WebInspector.TimelineUIUtils._eventDispatchDesciptors; + if (Timeline.TimelineUIUtils._eventDispatchDesciptors) + return Timeline.TimelineUIUtils._eventDispatchDesciptors; var lightOrange = 'hsl(40,100%,80%)'; var orange = 'hsl(40,100%,50%)'; var green = 'hsl(90,100%,40%)'; var purple = 'hsl(256,100%,75%)'; - WebInspector.TimelineUIUtils._eventDispatchDesciptors = [ - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor( + Timeline.TimelineUIUtils._eventDispatchDesciptors = [ + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor( 1, lightOrange, ['mousemove', 'mouseenter', 'mouseleave', 'mouseout', 'mouseover']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor( + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor( 1, lightOrange, ['pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor(2, green, ['wheel']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor( + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor(2, green, ['wheel']), + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']), + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor( 3, orange, ['touchstart', 'touchend', 'touchmove', 'touchcancel']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor( + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor( 3, orange, ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture']), - new WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']) + new Timeline.TimelineUIUtils.EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']) ]; - return WebInspector.TimelineUIUtils._eventDispatchDesciptors; + return Timeline.TimelineUIUtils._eventDispatchDesciptors; } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineMarkerStyle} + * @param {!SDK.TracingModel.Event} event + * @return {!Timeline.TimelineMarkerStyle} */ static markerStyleForEvent(event) { var red = 'rgb(255, 0, 0)'; @@ -1650,10 +1650,10 @@ var green = 'rgb(0, 130, 0)'; var tallMarkerDashStyle = [10, 5]; - var title = WebInspector.TimelineUIUtils.eventTitle(event); + var title = Timeline.TimelineUIUtils.eventTitle(event); - if (event.hasCategory(WebInspector.TimelineModel.Category.Console) || - event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) { + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) || + event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) { return { title: title, dashStyle: tallMarkerDashStyle, @@ -1663,7 +1663,7 @@ lowPriority: false, }; } - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var tall = false; var color = green; switch (event.name) { @@ -1694,11 +1694,11 @@ } /** - * @return {!WebInspector.TimelineMarkerStyle} + * @return {!Timeline.TimelineMarkerStyle} */ static markerStyleForFrame() { return { - title: WebInspector.UIString('Frame'), + title: Common.UIString('Frame'), color: 'rgba(100, 100, 100, 0.4)', lineWidth: 3, dashStyle: [3], @@ -1712,45 +1712,45 @@ * @return {string} */ static colorForURL(url) { - if (!WebInspector.TimelineUIUtils.colorForURL._colorGenerator) { - WebInspector.TimelineUIUtils.colorForURL._colorGenerator = - new WebInspector.FlameChart.ColorGenerator({min: 30, max: 330}, {min: 50, max: 80, count: 3}, 85); + if (!Timeline.TimelineUIUtils.colorForURL._colorGenerator) { + Timeline.TimelineUIUtils.colorForURL._colorGenerator = + new UI.FlameChart.ColorGenerator({min: 30, max: 330}, {min: 50, max: 80, count: 3}, 85); } - return WebInspector.TimelineUIUtils.colorForURL._colorGenerator.colorForID(url); + return Timeline.TimelineUIUtils.colorForURL._colorGenerator.colorForID(url); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {string=} warningType * @return {?Element} */ static eventWarning(event, warningType) { - var timelineData = WebInspector.TimelineData.forEvent(event); + var timelineData = TimelineModel.TimelineData.forEvent(event); var warning = warningType || timelineData.warning; if (!warning) return null; - var warnings = WebInspector.TimelineModel.WarningType; + var warnings = TimelineModel.TimelineModel.WarningType; var span = createElement('span'); var eventData = event.args['data']; switch (warning) { case warnings.ForcedStyle: case warnings.ForcedLayout: - span.appendChild(WebInspector.linkifyDocumentationURLAsNode( + span.appendChild(UI.linkifyDocumentationURLAsNode( '../../fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts', - WebInspector.UIString('Forced reflow'))); - span.createTextChild(WebInspector.UIString(' is a likely performance bottleneck.')); + Common.UIString('Forced reflow'))); + span.createTextChild(Common.UIString(' is a likely performance bottleneck.')); break; case warnings.IdleDeadlineExceeded: - span.textContent = WebInspector.UIString( + span.textContent = Common.UIString( 'Idle callback execution extended beyond deadline by ' + Number.millisToString(event.duration - eventData['allottedMilliseconds'], true)); break; case warnings.V8Deopt: - span.appendChild(WebInspector.linkifyURLAsNode( - 'https://github.com/GoogleChrome/devtools-docs/issues/53', WebInspector.UIString('Not optimized'), + span.appendChild(UI.linkifyURLAsNode( + 'https://github.com/GoogleChrome/devtools-docs/issues/53', Common.UIString('Not optimized'), undefined, true)); - span.createTextChild(WebInspector.UIString(': %s', eventData['deoptReason'])); + span.createTextChild(Common.UIString(': %s', eventData['deoptReason'])); break; default: console.assert(false, 'Unhandled TimelineModel.WarningType'); @@ -1759,7 +1759,7 @@ } /** - * @param {!WebInspector.TimelineModel.PageFrame} frame + * @param {!TimelineModel.TimelineModel.PageFrame} frame * @param {number=} trimAt */ static displayNameForFrame(frame, trimAt) { @@ -1773,10 +1773,10 @@ /** * @unrestricted */ -WebInspector.TimelineRecordStyle = class { +Timeline.TimelineRecordStyle = class { /** * @param {string} title - * @param {!WebInspector.TimelineCategory} category + * @param {!Timeline.TimelineCategory} category * @param {boolean=} hidden */ constructor(title, category, hidden) { @@ -1790,7 +1790,7 @@ /** * @enum {symbol} */ -WebInspector.TimelineUIUtils.NetworkCategory = { +Timeline.TimelineUIUtils.NetworkCategory = { HTML: Symbol('HTML'), Script: Symbol('Script'), Style: Symbol('Style'), @@ -1799,18 +1799,18 @@ }; -WebInspector.TimelineUIUtils._aggregatedStatsKey = Symbol('aggregatedStats'); +Timeline.TimelineUIUtils._aggregatedStatsKey = Symbol('aggregatedStats'); /** * @unrestricted */ -WebInspector.TimelineUIUtils.InvalidationsGroupElement = class extends TreeElement { +Timeline.TimelineUIUtils.InvalidationsGroupElement = class extends TreeElement { /** - * @param {!WebInspector.Target} target - * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap - * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper - * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations + * @param {!SDK.Target} target + * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap + * @param {!Timeline.TimelineDetailsContentHelper} contentHelper + * @param {!Array.<!TimelineModel.InvalidationTrackingEvent>} invalidations */ constructor(target, relatedNodesMap, contentHelper, invalidations) { super('', true); @@ -1826,7 +1826,7 @@ } /** - * @param {!WebInspector.Target} target + * @param {!SDK.Target} target * @return {!Element} */ _createTitle(target) { @@ -1836,16 +1836,16 @@ var title = createElement('span'); if (reason) - title.createTextChild(WebInspector.UIString('%s for ', reason)); + title.createTextChild(Common.UIString('%s for ', reason)); else - title.createTextChild(WebInspector.UIString('Unknown cause for ')); + title.createTextChild(Common.UIString('Unknown cause for ')); this._appendTruncatedNodeList(title, this._invalidations); if (topFrame && this._contentHelper.linkifier()) { - title.createTextChild(WebInspector.UIString('. ')); + title.createTextChild(Common.UIString('. ')); var stack = title.createChild('span', 'monospace'); - stack.createChild('span').textContent = WebInspector.TimelineUIUtils.frameDisplayName(topFrame); + stack.createChild('span').textContent = Timeline.TimelineUIUtils.frameDisplayName(topFrame); var link = this._contentHelper.linkifier().maybeLinkifyConsoleCallFrame(target, topFrame); if (link) { stack.createChild('span').textContent = ' @ '; @@ -1865,13 +1865,13 @@ var first = this._invalidations[0]; if (first.cause.stackTrace) { var stack = content.createChild('div'); - stack.createTextChild(WebInspector.UIString('Stack trace:')); + stack.createTextChild(Common.UIString('Stack trace:')); this._contentHelper.createChildStackTraceElement( - stack, WebInspector.TimelineUIUtils._stackTraceFromCallFrames(first.cause.stackTrace)); + stack, Timeline.TimelineUIUtils._stackTraceFromCallFrames(first.cause.stackTrace)); } content.createTextChild( - this._invalidations.length > 1 ? WebInspector.UIString('Nodes:') : WebInspector.UIString('Node:')); + this._invalidations.length > 1 ? Common.UIString('Nodes:') : Common.UIString('Node:')); var nodeList = content.createChild('div', 'node-list'); var firstNode = true; for (var i = 0; i < this._invalidations.length; i++) { @@ -1879,25 +1879,25 @@ var invalidationNode = this._createInvalidationNode(invalidation, true); if (invalidationNode) { if (!firstNode) - nodeList.createTextChild(WebInspector.UIString(', ')); + nodeList.createTextChild(Common.UIString(', ')); firstNode = false; nodeList.appendChild(invalidationNode); var extraData = invalidation.extraData ? ', ' + invalidation.extraData : ''; if (invalidation.changedId) - nodeList.createTextChild(WebInspector.UIString('(changed id to "%s"%s)', invalidation.changedId, extraData)); + nodeList.createTextChild(Common.UIString('(changed id to "%s"%s)', invalidation.changedId, extraData)); else if (invalidation.changedClass) nodeList.createTextChild( - WebInspector.UIString('(changed class to "%s"%s)', invalidation.changedClass, extraData)); + Common.UIString('(changed class to "%s"%s)', invalidation.changedClass, extraData)); else if (invalidation.changedAttribute) nodeList.createTextChild( - WebInspector.UIString('(changed attribute to "%s"%s)', invalidation.changedAttribute, extraData)); + Common.UIString('(changed attribute to "%s"%s)', invalidation.changedAttribute, extraData)); else if (invalidation.changedPseudo) nodeList.createTextChild( - WebInspector.UIString('(changed pesudo to "%s"%s)', invalidation.changedPseudo, extraData)); + Common.UIString('(changed pesudo to "%s"%s)', invalidation.changedPseudo, extraData)); else if (invalidation.selectorPart) - nodeList.createTextChild(WebInspector.UIString('(changed "%s"%s)', invalidation.selectorPart, extraData)); + nodeList.createTextChild(Common.UIString('(changed "%s"%s)', invalidation.selectorPart, extraData)); } } @@ -1908,7 +1908,7 @@ /** * @param {!Element} parentElement - * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations + * @param {!Array.<!TimelineModel.InvalidationTrackingEvent>} invalidations */ _appendTruncatedNodeList(parentElement, invalidations) { var invalidationNodes = []; @@ -1927,42 +1927,42 @@ parentElement.appendChild(invalidationNodes[0]); } else if (invalidationNodes.length === 2) { parentElement.appendChild(invalidationNodes[0]); - parentElement.createTextChild(WebInspector.UIString(' and ')); + parentElement.createTextChild(Common.UIString(' and ')); parentElement.appendChild(invalidationNodes[1]); } else if (invalidationNodes.length >= 3) { parentElement.appendChild(invalidationNodes[0]); - parentElement.createTextChild(WebInspector.UIString(', ')); + parentElement.createTextChild(Common.UIString(', ')); parentElement.appendChild(invalidationNodes[1]); - parentElement.createTextChild(WebInspector.UIString(', and %s others', invalidationNodes.length - 2)); + parentElement.createTextChild(Common.UIString(', and %s others', invalidationNodes.length - 2)); } } /** - * @param {!WebInspector.InvalidationTrackingEvent} invalidation + * @param {!TimelineModel.InvalidationTrackingEvent} invalidation * @param {boolean} showUnknownNodes */ _createInvalidationNode(invalidation, showUnknownNodes) { var node = (invalidation.nodeId && this._relatedNodesMap) ? this._relatedNodesMap.get(invalidation.nodeId) : null; if (node) - return WebInspector.DOMPresentationUtils.linkifyNodeReference(node); + return Components.DOMPresentationUtils.linkifyNodeReference(node); if (invalidation.nodeName) { var nodeSpan = createElement('span'); - nodeSpan.textContent = WebInspector.UIString('[ %s ]', invalidation.nodeName); + nodeSpan.textContent = Common.UIString('[ %s ]', invalidation.nodeName); return nodeSpan; } if (showUnknownNodes) { var nodeSpan = createElement('span'); - return nodeSpan.createTextChild(WebInspector.UIString('[ unknown node ]')); + return nodeSpan.createTextChild(Common.UIString('[ unknown node ]')); } } }; -WebInspector.TimelineUIUtils._previewElementSymbol = Symbol('previewElement'); +Timeline.TimelineUIUtils._previewElementSymbol = Symbol('previewElement'); /** * @unrestricted */ -WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor = class { +Timeline.TimelineUIUtils.EventDispatchTypeDescriptor = class { /** * @param {number} priority * @param {string} color @@ -1979,7 +1979,7 @@ /** * @unrestricted */ -WebInspector.TimelineCategory = class extends WebInspector.Object { +Timeline.TimelineCategory = class extends Common.Object { /** * @param {string} name * @param {string} title @@ -2009,12 +2009,12 @@ */ set hidden(hidden) { this._hidden = hidden; - this.dispatchEventToListeners(WebInspector.TimelineCategory.Events.VisibilityChanged, this); + this.dispatchEventToListeners(Timeline.TimelineCategory.Events.VisibilityChanged, this); } }; /** @enum {symbol} */ -WebInspector.TimelineCategory.Events = { +Timeline.TimelineCategory.Events = { VisibilityChanged: Symbol('VisibilityChanged') }; @@ -2028,19 +2028,19 @@ * lowPriority: boolean * }} */ -WebInspector.TimelineMarkerStyle; +Timeline.TimelineMarkerStyle; /** * @unrestricted */ -WebInspector.TimelinePopupContentHelper = class { +Timeline.TimelinePopupContentHelper = class { /** * @param {string} title */ constructor(title) { this._contentTable = createElement('table'); - var titleCell = this._createCell(WebInspector.UIString('%s - Details', title), 'timeline-details-title'); + var titleCell = this._createCell(Common.UIString('%s - Details', title), 'timeline-details-title'); titleCell.colSpan = 2; var titleRow = createElement('tr'); titleRow.appendChild(titleCell); @@ -2102,10 +2102,10 @@ /** * @unrestricted */ -WebInspector.TimelineDetailsContentHelper = class { +Timeline.TimelineDetailsContentHelper = class { /** - * @param {?WebInspector.Target} target - * @param {?WebInspector.Linkifier} linkifier + * @param {?SDK.Target} target + * @param {?Components.Linkifier} linkifier */ constructor(target, linkifier) { this.fragment = createDocumentFragment(); @@ -2120,7 +2120,7 @@ /** * @param {string} title - * @param {!WebInspector.TimelineCategory=} category + * @param {!Timeline.TimelineCategory=} category */ addSection(title, category) { if (!this._tableElement.hasChildNodes()) { @@ -2142,7 +2142,7 @@ } /** - * @return {?WebInspector.Linkifier} + * @return {?Components.Linkifier} */ linkifier() { return this._linkifier; @@ -2236,17 +2236,17 @@ var stackTraceElement = parentElement.createChild('div', 'timeline-details-view-row-value timeline-details-view-row-stack-trace'); var callFrameElem = - WebInspector.DOMPresentationUtils.buildStackTracePreviewContents(this._target, this._linkifier, stackTrace); + Components.DOMPresentationUtils.buildStackTracePreviewContents(this._target, this._linkifier, stackTrace); stackTraceElement.appendChild(callFrameElem); } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {string=} warningType */ appendWarningRow(event, warningType) { - var warning = WebInspector.TimelineUIUtils.eventWarning(event, warningType); + var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); if (warning) - this.appendElementRow(WebInspector.UIString('Warning'), warning, true); + this.appendElementRow(Common.UIString('Warning'), warning, true); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/module.json b/third_party/WebKit/Source/devtools/front_end/timeline/module.json index bd02543..08e93e3 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/module.json +++ b/third_party/WebKit/Source/devtools/front_end/timeline/module.json
@@ -6,7 +6,7 @@ "id": "timeline", "title": "Timeline", "order": 50, - "className": "WebInspector.TimelinePanel" + "className": "Timeline.TimelinePanel" }, { "type": "setting", @@ -17,9 +17,9 @@ "defaultValue": false }, { - "type": "@WebInspector.QueryParamHandler", + "type": "@Common.QueryParamHandler", "name": "loadTimelineFromURL", - "className": "WebInspector.LoadTimelineHandler" + "className": "Timeline.LoadTimelineHandler" }, { "type": "context-menu-item", @@ -32,13 +32,13 @@ "actionId": "timeline.save-to-file" }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "timeline.toggle-recording", "iconClass": "largeicon-start-recording", "toggledIconClass": "largeicon-stop-recording", "toggleWithRedColor": true, - "contextTypes": ["WebInspector.TimelinePanel"], - "className": "WebInspector.TimelinePanel.ActionDelegate", + "contextTypes": ["Timeline.TimelinePanel"], + "className": "Timeline.TimelinePanel.ActionDelegate", "options": [ { "value": true, "title": "Record" }, { "value": false, "title": "Stop" } @@ -55,11 +55,11 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Timeline", "actionId": "timeline.save-to-file", - "contextTypes": ["WebInspector.TimelinePanel"], - "className": "WebInspector.TimelinePanel.ActionDelegate", + "contextTypes": ["Timeline.TimelinePanel"], + "className": "Timeline.TimelinePanel.ActionDelegate", "title": "Save Timeline data\u2026", "bindings": [ { @@ -73,12 +73,12 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "category": "Timeline", "actionId": "timeline.load-from-file", - "contextTypes": ["WebInspector.TimelinePanel"], + "contextTypes": ["Timeline.TimelinePanel"], "order": "10", - "className": "WebInspector.TimelinePanel.ActionDelegate", + "className": "Timeline.TimelinePanel.ActionDelegate", "title": "Load Timeline data\u2026", "bindings": [ { @@ -92,10 +92,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "timeline.jump-to-previous-frame", - "contextTypes": ["WebInspector.TimelinePanel"], - "className": "WebInspector.TimelinePanel.ActionDelegate", + "contextTypes": ["Timeline.TimelinePanel"], + "className": "Timeline.TimelinePanel.ActionDelegate", "bindings": [ { "shortcut": "[" @@ -103,10 +103,10 @@ ] }, { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "timeline.jump-to-next-frame", - "contextTypes": ["WebInspector.TimelinePanel"], - "className": "WebInspector.TimelinePanel.ActionDelegate", + "contextTypes": ["Timeline.TimelinePanel"], + "className": "Timeline.TimelinePanel.ActionDelegate", "bindings": [ { "shortcut": "]"
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineFrameModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineFrameModel.js index 392e5af..6984610 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineFrameModel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineFrameModel.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.TimelineFrameModel = class { +TimelineModel.TimelineFrameModel = class { /** - * @param {function(!WebInspector.TracingModel.Event):string} categoryMapper + * @param {function(!SDK.TracingModel.Event):string} categoryMapper */ constructor(categoryMapper) { this._categoryMapper = categoryMapper; @@ -41,7 +41,7 @@ } /** - * @return {!Array.<!WebInspector.TimelineFrame>} + * @return {!Array.<!TimelineModel.TimelineFrame>} */ frames() { return this._frames; @@ -50,12 +50,12 @@ /** * @param {number} startTime * @param {number} endTime - * @return {!Array.<!WebInspector.TimelineFrame>} + * @return {!Array.<!TimelineModel.TimelineFrame>} */ filteredFrames(startTime, endTime) { /** * @param {number} value - * @param {!WebInspector.TimelineFrame} object + * @param {!TimelineModel.TimelineFrame} object * @return {number} */ function compareStartTime(value, object) { @@ -63,7 +63,7 @@ } /** * @param {number} value - * @param {!WebInspector.TimelineFrame} object + * @param {!TimelineModel.TimelineFrame} object * @return {number} */ function compareEndTime(value, object) { @@ -76,7 +76,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} rasterTask + * @param {!SDK.TracingModel.Event} rasterTask * @return {boolean} */ hasRasterTile(rasterTask) { @@ -91,8 +91,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} rasterTask - * @return Promise<?{rect: !Protocol.DOM.Rect, snapshot: !WebInspector.PaintProfilerSnapshot}>} + * @param {!SDK.TracingModel.Event} rasterTask + * @return Promise<?{rect: !Protocol.DOM.Rect, snapshot: !SDK.PaintProfilerSnapshot}>} */ rasterTilePromise(rasterTask) { if (!this._target) @@ -186,7 +186,7 @@ } /** - * @param {!WebInspector.TracingFrameLayerTree} layerTree + * @param {!TimelineModel.TracingFrameLayerTree} layerTree */ handleLayerTreeSnapshot(layerTree) { this._lastLayerTree = layerTree; @@ -207,11 +207,11 @@ _startFrame(startTime) { if (this._lastFrame) this._flushFrame(this._lastFrame, startTime); - this._lastFrame = new WebInspector.TimelineFrame(startTime, startTime - this._minimumRecordTime); + this._lastFrame = new TimelineModel.TimelineFrame(startTime, startTime - this._minimumRecordTime); } /** - * @param {!WebInspector.TimelineFrame} frame + * @param {!TimelineModel.TimelineFrame} frame * @param {number} endTime */ _flushFrame(frame, endTime) { @@ -236,8 +236,8 @@ /** * @param {!Array.<string>} types - * @param {!WebInspector.TimelineModel.Record} record - * @return {?WebInspector.TimelineModel.Record} record + * @param {!TimelineModel.TimelineModel.Record} record + * @return {?TimelineModel.TimelineModel.Record} record */ _findRecordRecursively(types, record) { if (types.indexOf(record.type()) >= 0) @@ -253,8 +253,8 @@ } /** - * @param {?WebInspector.Target} target - * @param {!Array.<!WebInspector.TracingModel.Event>} events + * @param {?SDK.Target} target + * @param {!Array.<!SDK.TracingModel.Event>} events * @param {string} sessionId */ addTraceEvents(target, events, sessionId) { @@ -269,10 +269,10 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addTraceEvent(event) { - var eventNames = WebInspector.TimelineModel.RecordType; + var eventNames = TimelineModel.TimelineModel.RecordType; if (event.name === eventNames.SetLayerTreeId) { var sessionId = event.args['sessionId'] || event.args['data']['sessionId']; @@ -281,24 +281,24 @@ } else if (event.name === eventNames.TracingStartedInPage) { this._mainThread = event.thread; } else if ( - event.phase === WebInspector.TracingModel.Phase.SnapshotObject && + event.phase === SDK.TracingModel.Phase.SnapshotObject && event.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === this._layerTreeId) { - var snapshot = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event); - this.handleLayerTreeSnapshot(new WebInspector.TracingFrameLayerTree(this._target, snapshot)); + var snapshot = /** @type {!SDK.TracingModel.ObjectSnapshot} */ (event); + this.handleLayerTreeSnapshot(new TimelineModel.TracingFrameLayerTree(this._target, snapshot)); } else { this._processCompositorEvents(event); if (event.thread === this._mainThread) this._addMainThreadTraceEvent(event); - else if (this._lastFrame && event.selfTime && !WebInspector.TracingModel.isTopLevelEvent(event)) + else if (this._lastFrame && event.selfTime && !SDK.TracingModel.isTopLevelEvent(event)) this._lastFrame._addTimeForCategory(this._categoryMapper(event), event.selfTime); } } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _processCompositorEvents(event) { - var eventNames = WebInspector.TimelineModel.RecordType; + var eventNames = TimelineModel.TimelineModel.RecordType; if (event.args['layerTreeId'] !== this._layerTreeId) return; @@ -317,20 +317,20 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addMainThreadTraceEvent(event) { - var eventNames = WebInspector.TimelineModel.RecordType; + var eventNames = TimelineModel.TimelineModel.RecordType; var timestamp = event.startTime; var selfTime = event.selfTime || 0; - if (WebInspector.TracingModel.isTopLevelEvent(event)) { + if (SDK.TracingModel.isTopLevelEvent(event)) { this._currentTaskTimeByCategory = {}; this._lastTaskBeginTime = event.startTime; } - if (!this._framePendingCommit && WebInspector.TimelineFrameModel._mainFrameMarkers.indexOf(event.name) >= 0) + if (!this._framePendingCommit && TimelineModel.TimelineFrameModel._mainFrameMarkers.indexOf(event.name) >= 0) this._framePendingCommit = - new WebInspector.PendingFrame(this._lastTaskBeginTime || event.startTime, this._currentTaskTimeByCategory); + new TimelineModel.PendingFrame(this._lastTaskBeginTime || event.startTime, this._currentTaskTimeByCategory); if (!this._framePendingCommit) { this._addTimeForCategory(this._currentTaskTimeByCategory, event); return; @@ -339,15 +339,15 @@ if (event.name === eventNames.BeginMainThreadFrame && event.args['data'] && event.args['data']['frameId']) this._framePendingCommit.mainFrameId = event.args['data']['frameId']; - if (event.name === eventNames.Paint && event.args['data']['layerId'] && WebInspector.TimelineData.forEvent(event).picture && this._target) - this._framePendingCommit.paints.push(new WebInspector.LayerPaintEvent(event, this._target)); + if (event.name === eventNames.Paint && event.args['data']['layerId'] && TimelineModel.TimelineData.forEvent(event).picture && this._target) + this._framePendingCommit.paints.push(new TimelineModel.LayerPaintEvent(event, this._target)); if (event.name === eventNames.CompositeLayers && event.args['layerTreeId'] === this._layerTreeId) this.handleCompositeLayers(); } /** * @param {!Object.<string, number>} timeByCategory - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _addTimeForCategory(timeByCategory, event) { if (!event.selfTime) @@ -357,29 +357,29 @@ } }; -WebInspector.TimelineFrameModel._mainFrameMarkers = [ - WebInspector.TimelineModel.RecordType.ScheduleStyleRecalculation, - WebInspector.TimelineModel.RecordType.InvalidateLayout, WebInspector.TimelineModel.RecordType.BeginMainThreadFrame, - WebInspector.TimelineModel.RecordType.ScrollLayer +TimelineModel.TimelineFrameModel._mainFrameMarkers = [ + TimelineModel.TimelineModel.RecordType.ScheduleStyleRecalculation, + TimelineModel.TimelineModel.RecordType.InvalidateLayout, TimelineModel.TimelineModel.RecordType.BeginMainThreadFrame, + TimelineModel.TimelineModel.RecordType.ScrollLayer ]; /** * @unrestricted */ -WebInspector.TracingFrameLayerTree = class { +TimelineModel.TracingFrameLayerTree = class { /** - * @param {!WebInspector.Target} target - * @param {!WebInspector.TracingModel.ObjectSnapshot} snapshot + * @param {!SDK.Target} target + * @param {!SDK.TracingModel.ObjectSnapshot} snapshot */ constructor(target, snapshot) { this._target = target; this._snapshot = snapshot; - /** @type {!Array<!WebInspector.LayerPaintEvent>|undefined} */ + /** @type {!Array<!TimelineModel.LayerPaintEvent>|undefined} */ this._paints; } /** - * @return {!Promise<?WebInspector.TracingLayerTree>} + * @return {!Promise<?TimelineModel.TracingLayerTree>} */ layerTreePromise() { return this._snapshot.objectPromise().then(result => { @@ -389,7 +389,7 @@ var tiles = result['active_tiles']; var rootLayer = result['active_tree']['root_layer']; var layers = result['active_tree']['layers']; - var layerTree = new WebInspector.TracingLayerTree(this._target); + var layerTree = new TimelineModel.TracingLayerTree(this._target); layerTree.setViewportSize(viewport); layerTree.setTiles(tiles); return new Promise( @@ -398,14 +398,14 @@ } /** - * @return {!Array<!WebInspector.LayerPaintEvent>} + * @return {!Array<!TimelineModel.LayerPaintEvent>} */ paints() { return this._paints || []; } /** - * @param {!Array<!WebInspector.LayerPaintEvent>} paints + * @param {!Array<!TimelineModel.LayerPaintEvent>} paints */ _setPaints(paints) { this._paints = paints; @@ -415,7 +415,7 @@ /** * @unrestricted */ -WebInspector.TimelineFrame = class { +TimelineModel.TimelineFrame = class { /** * @param {number} startTime * @param {number} startTimeOffset @@ -428,9 +428,9 @@ this.timeByCategory = {}; this.cpuTime = 0; this.idle = false; - /** @type {?WebInspector.TracingFrameLayerTree} */ + /** @type {?TimelineModel.TracingFrameLayerTree} */ this.layerTree = null; - /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ + /** @type {!Array.<!TimelineModel.LayerPaintEvent>} */ this._paints = []; /** @type {number|undefined} */ this._mainFrameId = undefined; @@ -453,7 +453,7 @@ } /** - * @param {?WebInspector.TracingFrameLayerTree} layerTree + * @param {?TimelineModel.TracingFrameLayerTree} layerTree */ _setLayerTree(layerTree) { this.layerTree = layerTree; @@ -480,10 +480,10 @@ /** * @unrestricted */ -WebInspector.LayerPaintEvent = class { +TimelineModel.LayerPaintEvent = class { /** - * @param {!WebInspector.TracingModel.Event} event - * @param {?WebInspector.Target} target + * @param {!SDK.TracingModel.Event} event + * @param {?SDK.Target} target */ constructor(event, target) { this._event = event; @@ -498,7 +498,7 @@ } /** - * @return {!WebInspector.TracingModel.Event} + * @return {!SDK.TracingModel.Event} */ event() { return this._event; @@ -508,7 +508,7 @@ * @return {!Promise<?{rect: !Array<number>, serializedPicture: string}>} */ picturePromise() { - var picture = WebInspector.TimelineData.forEvent(this._event).picture; + var picture = TimelineModel.TimelineData.forEvent(this._event).picture; return picture.objectPromise().then(result => { if (!result) return null; @@ -519,13 +519,13 @@ } /** - * @return !Promise<?{rect: !Array<number>, snapshot: !WebInspector.PaintProfilerSnapshot}>} + * @return !Promise<?{rect: !Array<number>, snapshot: !SDK.PaintProfilerSnapshot}>} */ snapshotPromise() { return this.picturePromise().then(picture => { if (!picture || !this._target) return null; - return WebInspector.PaintProfilerSnapshot.load(this._target, picture.serializedPicture) + return SDK.PaintProfilerSnapshot.load(this._target, picture.serializedPicture) .then(snapshot => snapshot ? {rect: picture.rect, snapshot: snapshot} : null); }); } @@ -534,7 +534,7 @@ /** * @unrestricted */ -WebInspector.PendingFrame = class { +TimelineModel.PendingFrame = class { /** * @param {number} triggerTime * @param {!Object.<string, number>} timeByCategory @@ -542,7 +542,7 @@ constructor(triggerTime, timeByCategory) { /** @type {!Object.<string, number>} */ this.timeByCategory = timeByCategory; - /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ + /** @type {!Array.<!TimelineModel.LayerPaintEvent>} */ this.paints = []; /** @type {number|undefined} */ this.mainFrameId = undefined;
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineIRModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineIRModel.js index 10c98ce3..3a70fcd 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineIRModel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineIRModel.js
@@ -4,26 +4,26 @@ /** * @unrestricted */ -WebInspector.TimelineIRModel = class { +TimelineModel.TimelineIRModel = class { constructor() { this.reset(); } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineIRModel.Phases} + * @param {!SDK.TracingModel.Event} event + * @return {!TimelineModel.TimelineIRModel.Phases} */ static phaseForEvent(event) { - return event[WebInspector.TimelineIRModel._eventIRPhase]; + return event[TimelineModel.TimelineIRModel._eventIRPhase]; } /** - * @param {?Array<!WebInspector.TracingModel.AsyncEvent>} inputLatencies - * @param {?Array<!WebInspector.TracingModel.AsyncEvent>} animations + * @param {?Array<!SDK.TracingModel.AsyncEvent>} inputLatencies + * @param {?Array<!SDK.TracingModel.AsyncEvent>} animations */ populate(inputLatencies, animations) { - var eventTypes = WebInspector.TimelineIRModel.InputEvents; - var phases = WebInspector.TimelineIRModel.Phases; + var eventTypes = TimelineModel.TimelineIRModel.InputEvents; + var phases = TimelineModel.TimelineIRModel.Phases; this.reset(); if (!inputLatencies) @@ -31,7 +31,7 @@ this._processInputLatencies(inputLatencies); if (animations) this._processAnimations(animations); - var range = new WebInspector.SegmentedRange(); + var range = new Common.SegmentedRange(); range.appendRange(this._drags); // Drags take lower precedence than animation, as we can't detect them reliably. range.appendRange(this._cssAnimations); range.appendRange(this._scrolls); @@ -40,12 +40,12 @@ } /** - * @param {!Array<!WebInspector.TracingModel.AsyncEvent>} events + * @param {!Array<!SDK.TracingModel.AsyncEvent>} events */ _processInputLatencies(events) { - var eventTypes = WebInspector.TimelineIRModel.InputEvents; - var phases = WebInspector.TimelineIRModel.Phases; - var thresholdsMs = WebInspector.TimelineIRModel._mergeThresholdsMs; + var eventTypes = TimelineModel.TimelineIRModel.InputEvents; + var phases = TimelineModel.TimelineIRModel.Phases; + var thresholdsMs = TimelineModel.TimelineIRModel._mergeThresholdsMs; var scrollStart; var flingStart; @@ -81,8 +81,8 @@ case eventTypes.FlingStart: if (flingStart) { - WebInspector.console.error( - WebInspector.UIString('Two flings at the same time? %s vs %s', flingStart.startTime, event.startTime)); + Common.console.error( + Common.UIString('Two flings at the same time? %s vs %s', flingStart.startTime, event.startTime)); break; } flingStart = event; @@ -115,12 +115,12 @@ // We do not produce any response segment for TouchStart -- there's either going to be one upon // TouchMove for drag, or one for GestureTap. if (touchStart) { - WebInspector.console.error( - WebInspector.UIString('Two touches at the same time? %s vs %s', touchStart.startTime, event.startTime)); + Common.console.error( + Common.UIString('Two touches at the same time? %s vs %s', touchStart.startTime, event.startTime)); break; } touchStart = event; - event.steps[0][WebInspector.TimelineIRModel._eventIRPhase] = phases.Response; + event.steps[0][TimelineModel.TimelineIRModel._eventIRPhase] = phases.Response; firstTouchMove = null; break; @@ -174,8 +174,8 @@ /** * @param {number} threshold - * @param {!WebInspector.TracingModel.AsyncEvent} first - * @param {!WebInspector.TracingModel.AsyncEvent} second + * @param {!SDK.TracingModel.AsyncEvent} first + * @param {!SDK.TracingModel.AsyncEvent} second * @return {boolean} */ function canMerge(threshold, first, second) { @@ -184,63 +184,63 @@ } /** - * @param {!Array<!WebInspector.TracingModel.AsyncEvent>} events + * @param {!Array<!SDK.TracingModel.AsyncEvent>} events */ _processAnimations(events) { for (var i = 0; i < events.length; ++i) - this._cssAnimations.append(this._segmentForEvent(events[i], WebInspector.TimelineIRModel.Phases.Animation)); + this._cssAnimations.append(this._segmentForEvent(events[i], TimelineModel.TimelineIRModel.Phases.Animation)); } /** - * @param {!WebInspector.TracingModel.AsyncEvent} event - * @param {!WebInspector.TimelineIRModel.Phases} phase - * @return {!WebInspector.Segment} + * @param {!SDK.TracingModel.AsyncEvent} event + * @param {!TimelineModel.TimelineIRModel.Phases} phase + * @return {!Common.Segment} */ _segmentForEvent(event, phase) { this._setPhaseForEvent(event, phase); - return new WebInspector.Segment(event.startTime, event.endTime, phase); + return new Common.Segment(event.startTime, event.endTime, phase); } /** - * @param {!WebInspector.TracingModel.AsyncEvent} startEvent - * @param {!WebInspector.TracingModel.AsyncEvent} endEvent - * @param {!WebInspector.TimelineIRModel.Phases} phase - * @return {!WebInspector.Segment} + * @param {!SDK.TracingModel.AsyncEvent} startEvent + * @param {!SDK.TracingModel.AsyncEvent} endEvent + * @param {!TimelineModel.TimelineIRModel.Phases} phase + * @return {!Common.Segment} */ _segmentForEventRange(startEvent, endEvent, phase) { this._setPhaseForEvent(startEvent, phase); this._setPhaseForEvent(endEvent, phase); - return new WebInspector.Segment(startEvent.startTime, endEvent.endTime, phase); + return new Common.Segment(startEvent.startTime, endEvent.endTime, phase); } /** - * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent - * @param {!WebInspector.TimelineIRModel.Phases} phase + * @param {!SDK.TracingModel.AsyncEvent} asyncEvent + * @param {!TimelineModel.TimelineIRModel.Phases} phase */ _setPhaseForEvent(asyncEvent, phase) { - asyncEvent.steps[0][WebInspector.TimelineIRModel._eventIRPhase] = phase; + asyncEvent.steps[0][TimelineModel.TimelineIRModel._eventIRPhase] = phase; } /** - * @return {!Array<!WebInspector.Segment>} + * @return {!Array<!Common.Segment>} */ interactionRecords() { return this._segments; } reset() { - var thresholdsMs = WebInspector.TimelineIRModel._mergeThresholdsMs; + var thresholdsMs = TimelineModel.TimelineIRModel._mergeThresholdsMs; this._segments = []; - this._drags = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.mouse)); - this._cssAnimations = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.animation)); - this._responses = new WebInspector.SegmentedRange(merge.bind(null, 0)); - this._scrolls = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.animation)); + this._drags = new Common.SegmentedRange(merge.bind(null, thresholdsMs.mouse)); + this._cssAnimations = new Common.SegmentedRange(merge.bind(null, thresholdsMs.animation)); + this._responses = new Common.SegmentedRange(merge.bind(null, 0)); + this._scrolls = new Common.SegmentedRange(merge.bind(null, thresholdsMs.animation)); /** * @param {number} threshold - * @param {!WebInspector.Segment} first - * @param {!WebInspector.Segment} second + * @param {!Common.Segment} first + * @param {!Common.Segment} second */ function merge(threshold, first, second) { return first.end + threshold >= second.begin && first.data === second.data ? first : null; @@ -249,24 +249,24 @@ /** * @param {string} eventName - * @return {?WebInspector.TimelineIRModel.InputEvents} + * @return {?TimelineModel.TimelineIRModel.InputEvents} */ _inputEventType(eventName) { var prefix = 'InputLatency::'; if (!eventName.startsWith(prefix)) { - if (eventName === WebInspector.TimelineIRModel.InputEvents.ImplSideFling) - return /** @type {!WebInspector.TimelineIRModel.InputEvents} */ (eventName); + if (eventName === TimelineModel.TimelineIRModel.InputEvents.ImplSideFling) + return /** @type {!TimelineModel.TimelineIRModel.InputEvents} */ (eventName); console.error('Unrecognized input latency event: ' + eventName); return null; } - return /** @type {!WebInspector.TimelineIRModel.InputEvents} */ (eventName.substr(prefix.length)); + return /** @type {!TimelineModel.TimelineIRModel.InputEvents} */ (eventName.substr(prefix.length)); } }; /** * @enum {string} */ -WebInspector.TimelineIRModel.Phases = { +TimelineModel.TimelineIRModel.Phases = { Idle: 'Idle', Response: 'Response', Scroll: 'Scroll', @@ -279,13 +279,13 @@ /** * @enum {string} */ -WebInspector.TimelineIRModel.InputEvents = { +TimelineModel.TimelineIRModel.InputEvents = { Char: 'Char', Click: 'GestureClick', ContextMenu: 'ContextMenu', FlingCancel: 'GestureFlingCancel', FlingStart: 'GestureFlingStart', - ImplSideFling: WebInspector.TimelineModel.RecordType.ImplSideFling, + ImplSideFling: TimelineModel.TimelineModel.RecordType.ImplSideFling, KeyDown: 'KeyDown', KeyDownRaw: 'RawKeyDown', KeyUp: 'KeyUp', @@ -311,9 +311,9 @@ TouchStart: 'TouchStart' }; -WebInspector.TimelineIRModel._mergeThresholdsMs = { +TimelineModel.TimelineIRModel._mergeThresholdsMs = { animation: 1, mouse: 40, }; -WebInspector.TimelineIRModel._eventIRPhase = Symbol('eventIRPhase'); +TimelineModel.TimelineIRModel._eventIRPhase = Symbol('eventIRPhase');
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineJSProfile.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineJSProfile.js index 9e0ee3ef..0d0b916 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineJSProfile.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineJSProfile.js
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -WebInspector.TimelineJSProfileProcessor = class { +TimelineModel.TimelineJSProfileProcessor = class { /** - * @param {!WebInspector.CPUProfileDataModel} jsProfileModel - * @param {!WebInspector.TracingModel.Thread} thread - * @return {!Array<!WebInspector.TracingModel.Event>} + * @param {!SDK.CPUProfileDataModel} jsProfileModel + * @param {!SDK.TracingModel.Thread} thread + * @return {!Array<!SDK.TracingModel.Event>} */ static generateTracingEventsFromCpuProfile(jsProfileModel, thread) { var idleNode = jsProfileModel.idleNode; @@ -33,9 +33,9 @@ for (var j = 0; node.parent; node = node.parent) callFrames[j++] = /** @type {!Protocol.Runtime.CallFrame} */ (node); } - var jsSampleEvent = new WebInspector.TracingModel.Event( - WebInspector.TracingModel.DevToolsTimelineEventCategory, WebInspector.TimelineModel.RecordType.JSSample, - WebInspector.TracingModel.Phase.Instant, timestamps[i], thread); + var jsSampleEvent = new SDK.TracingModel.Event( + SDK.TracingModel.DevToolsTimelineEventCategory, TimelineModel.TimelineModel.RecordType.JSSample, + SDK.TracingModel.Phase.Instant, timestamps[i], thread); jsSampleEvent.args['data'] = {stackTrace: callFrames}; jsEvents.push(jsSampleEvent); } @@ -43,8 +43,8 @@ } /** - * @param {!Array<!WebInspector.TracingModel.Event>} events - * @return {!Array<!WebInspector.TracingModel.Event>} + * @param {!Array<!SDK.TracingModel.Event>} events + * @return {!Array<!SDK.TracingModel.Event>} */ static generateJSFrameEvents(events) { /** @@ -57,14 +57,14 @@ } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e * @return {boolean} */ function isJSInvocationEvent(e) { switch (e.name) { - case WebInspector.TimelineModel.RecordType.RunMicrotasks: - case WebInspector.TimelineModel.RecordType.FunctionCall: - case WebInspector.TimelineModel.RecordType.EvaluateScript: + case TimelineModel.TimelineModel.RecordType.RunMicrotasks: + case TimelineModel.TimelineModel.RecordType.FunctionCall: + case TimelineModel.TimelineModel.RecordType.EvaluateScript: return true; } return false; @@ -76,10 +76,10 @@ var ordinal = 0; const showAllEvents = Runtime.experiments.isEnabled('timelineShowAllEvents'); const showRuntimeCallStats = Runtime.experiments.isEnabled('timelineV8RuntimeCallStats'); - const showNativeFunctions = WebInspector.moduleSetting('showNativeFunctionsInJSProfile').get(); + const showNativeFunctions = Common.moduleSetting('showNativeFunctionsInJSProfile').get(); /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onStartEvent(e) { e.ordinal = ++ordinal; @@ -89,8 +89,8 @@ } /** - * @param {!WebInspector.TracingModel.Event} e - * @param {?WebInspector.TracingModel.Event} parent + * @param {!SDK.TracingModel.Event} e + * @param {?SDK.TracingModel.Event} parent */ function onInstantEvent(e, parent) { e.ordinal = ++ordinal; @@ -99,7 +99,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onEndEvent(e) { truncateJSStack(lockedJsStackDepth.pop(), e.endTime); @@ -131,7 +131,7 @@ * @return {boolean} */ function showNativeName(name) { - return showRuntimeCallStats && !!WebInspector.TimelineJSProfileProcessor.nativeGroup(name); + return showRuntimeCallStats && !!TimelineModel.TimelineJSProfileProcessor.nativeGroup(name); } /** @@ -147,7 +147,7 @@ const isNativeFrame = url && url.startsWith('native '); if (!showNativeFunctions && isNativeFrame) continue; - if (WebInspector.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame) && !showNativeName(frame.functionName)) + if (TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame) && !showNativeName(frame.functionName)) continue; if (isPreviousFrameNative && isNativeFrame) continue; @@ -158,10 +158,10 @@ } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function extractStackTrace(e) { - const recordTypes = WebInspector.TimelineModel.RecordType; + const recordTypes = TimelineModel.TimelineModel.RecordType; /** @type {!Array<!Protocol.Runtime.CallFrame>} */ const callFrames = e.name === recordTypes.JSSample ? e.args['data']['stackTrace'].slice().reverse() @@ -180,9 +180,9 @@ truncateJSStack(i, e.startTime); for (; i < callFrames.length; ++i) { const frame = callFrames[i]; - const jsFrameEvent = new WebInspector.TracingModel.Event( - WebInspector.TracingModel.DevToolsTimelineEventCategory, recordTypes.JSFrame, - WebInspector.TracingModel.Phase.Complete, e.startTime, e.thread); + const jsFrameEvent = new SDK.TracingModel.Event( + SDK.TracingModel.DevToolsTimelineEventCategory, recordTypes.JSFrame, + SDK.TracingModel.Phase.Complete, e.startTime, e.thread); jsFrameEvent.ordinal = e.ordinal; jsFrameEvent.addArgs({data: frame}); jsFrameEvent.setEndTime(endTime); @@ -191,9 +191,9 @@ } } - const firstTopLevelEvent = events.find(WebInspector.TracingModel.isTopLevelEvent); + const firstTopLevelEvent = events.find(SDK.TracingModel.isTopLevelEvent); if (firstTopLevelEvent) - WebInspector.TimelineModel.forEachEvent( + TimelineModel.TimelineModel.forEachEvent( events, onStartEvent, onEndEvent, onInstantEvent, firstTopLevelEvent.startTime); return jsFrameEvents; } @@ -208,12 +208,12 @@ /** * @param {string} nativeName - * @return {?WebInspector.TimelineJSProfileProcessor.NativeGroups} + * @return {?TimelineModel.TimelineJSProfileProcessor.NativeGroups} */ static nativeGroup(nativeName) { - var map = WebInspector.TimelineJSProfileProcessor.nativeGroup._map; + var map = TimelineModel.TimelineJSProfileProcessor.nativeGroup._map; if (!map) { - const nativeGroups = WebInspector.TimelineJSProfileProcessor.NativeGroups; + const nativeGroups = TimelineModel.TimelineJSProfileProcessor.NativeGroups; map = new Map([ ['Compile', nativeGroups.Compile], ['CompileCode', nativeGroups.Compile], @@ -230,15 +230,15 @@ ['RecompileSynchronous', nativeGroups.Compile], ['ParseLazy', nativeGroups.Parse] ]); - /** @type {!Map<string, !WebInspector.TimelineJSProfileProcessor.NativeGroups>} */ - WebInspector.TimelineJSProfileProcessor.nativeGroup._map = map; + /** @type {!Map<string, !TimelineModel.TimelineJSProfileProcessor.NativeGroups>} */ + TimelineModel.TimelineJSProfileProcessor.nativeGroup._map = map; } return map.get(nativeName) || null; } }; /** @enum {string} */ -WebInspector.TimelineJSProfileProcessor.NativeGroups = { +TimelineModel.TimelineJSProfileProcessor.NativeGroups = { 'Compile': 'Compile', 'Parse': 'Parse' };
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js index e5ab90b..7bd738a 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.TimelineModel = class { +TimelineModel.TimelineModel = class { /** - * @param {!WebInspector.TimelineModel.Filter} eventFilter + * @param {!TimelineModel.TimelineModel.Filter} eventFilter */ constructor(eventFilter) { this._eventFilter = eventFilter; @@ -41,10 +41,10 @@ } /** - * @param {!Array.<!WebInspector.TracingModel.Event>} events - * @param {function(!WebInspector.TracingModel.Event)} onStartEvent - * @param {function(!WebInspector.TracingModel.Event)} onEndEvent - * @param {function(!WebInspector.TracingModel.Event,?WebInspector.TracingModel.Event)|undefined=} onInstantEvent + * @param {!Array.<!SDK.TracingModel.Event>} events + * @param {function(!SDK.TracingModel.Event)} onStartEvent + * @param {function(!SDK.TracingModel.Event)} onEndEvent + * @param {function(!SDK.TracingModel.Event,?SDK.TracingModel.Event)|undefined=} onInstantEvent * @param {number=} startTime * @param {number=} endTime */ @@ -58,7 +58,7 @@ continue; if (e.startTime >= endTime) break; - if (WebInspector.TracingModel.isAsyncPhase(e.phase) || WebInspector.TracingModel.isFlowPhase(e.phase)) + if (SDK.TracingModel.isAsyncPhase(e.phase) || SDK.TracingModel.isFlowPhase(e.phase)) continue; while (stack.length && stack.peekLast().endTime <= e.startTime) onEndEvent(stack.pop()); @@ -74,21 +74,21 @@ } /** - * @return {!WebInspector.TimelineModel.RecordType} + * @return {!TimelineModel.TimelineModel.RecordType} */ static _eventType(event) { - if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) - return WebInspector.TimelineModel.RecordType.ConsoleTime; - if (event.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) - return WebInspector.TimelineModel.RecordType.UserTiming; - if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) - return WebInspector.TimelineModel.RecordType.LatencyInfo; - return /** @type !WebInspector.TimelineModel.RecordType */ (event.name); + if (event.hasCategory(TimelineModel.TimelineModel.Category.Console)) + return TimelineModel.TimelineModel.RecordType.ConsoleTime; + if (event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) + return TimelineModel.TimelineModel.RecordType.UserTiming; + if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) + return TimelineModel.TimelineModel.RecordType.LatencyInfo; + return /** @type !TimelineModel.TimelineModel.RecordType */ (event.name); } /** - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters - * @param {!WebInspector.TracingModel.Event} event + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ static isVisible(filters, event) { @@ -100,11 +100,11 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ static isMarkerEvent(event) { - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; switch (event.name) { case recordTypes.TimeStamp: case recordTypes.MarkFirstPaint: @@ -118,7 +118,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ static eventFrameId(event) { @@ -132,13 +132,13 @@ /** * @deprecated Test use only! - * @param {?function(!WebInspector.TimelineModel.Record)|?function(!WebInspector.TimelineModel.Record,number)} preOrderCallback - * @param {function(!WebInspector.TimelineModel.Record)|function(!WebInspector.TimelineModel.Record,number)=} postOrderCallback + * @param {?function(!TimelineModel.TimelineModel.Record)|?function(!TimelineModel.TimelineModel.Record,number)} preOrderCallback + * @param {function(!TimelineModel.TimelineModel.Record)|function(!TimelineModel.TimelineModel.Record,number)=} postOrderCallback * @return {boolean} */ forAllRecords(preOrderCallback, postOrderCallback) { /** - * @param {!Array.<!WebInspector.TimelineModel.Record>} records + * @param {!Array.<!TimelineModel.TimelineModel.Record>} records * @param {number} depth * @return {boolean} */ @@ -158,18 +158,18 @@ } /** - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters - * @param {function(!WebInspector.TimelineModel.Record)|function(!WebInspector.TimelineModel.Record,number)} callback + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters + * @param {function(!TimelineModel.TimelineModel.Record)|function(!TimelineModel.TimelineModel.Record,number)} callback */ forAllFilteredRecords(filters, callback) { /** - * @param {!WebInspector.TimelineModel.Record} record + * @param {!TimelineModel.TimelineModel.Record} record * @param {number} depth - * @this {WebInspector.TimelineModel} + * @this {TimelineModel.TimelineModel} * @return {boolean} */ function processRecord(record, depth) { - var visible = WebInspector.TimelineModel.isVisible(filters, record.traceEvent()); + var visible = TimelineModel.TimelineModel.isVisible(filters, record.traceEvent()); if (visible && callback(record, depth)) return true; @@ -185,14 +185,14 @@ } /** - * @return {!Array.<!WebInspector.TimelineModel.Record>} + * @return {!Array.<!TimelineModel.TimelineModel.Record>} */ records() { return this._records; } /** - * @return {!Array<!WebInspector.CPUProfileDataModel>} + * @return {!Array<!SDK.CPUProfileDataModel>} */ cpuProfiles() { return this._cpuProfiles; @@ -206,18 +206,18 @@ } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {?WebInspector.Target} + * @param {!SDK.TracingModel.Event} event + * @return {?SDK.Target} */ targetByEvent(event) { // FIXME: Consider returning null for loaded traces. var workerId = this._workerIdByThread.get(event.thread); - var mainTarget = WebInspector.targetManager.mainTarget(); + var mainTarget = SDK.targetManager.mainTarget(); return workerId ? mainTarget.subTargetsManager.targetForId(workerId) : mainTarget; } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel * @param {boolean=} produceTraceStartedInPage */ setEvents(tracingModel, produceTraceStartedInPage) { @@ -242,7 +242,7 @@ var endTime = i + 1 < length ? metadataEvents.page[i + 1].startTime : Infinity; this._currentPage = metaEvent.args['data'] && metaEvent.args['data']['page']; for (var thread of process.sortedThreads()) { - if (thread.name() === WebInspector.TimelineModel.WorkerThreadName) { + if (thread.name() === TimelineModel.TimelineModel.WorkerThreadName) { var workerMetaEvent = metadataEvents.workers.find(e => e.args['data']['workerThreadId'] === thread.id()); if (!workerMetaEvent) continue; @@ -255,7 +255,7 @@ startTime = endTime; } } - this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compareStartTime); + this._inspectedTargetEvents.sort(SDK.TracingModel.Event.compareStartTime); this._processBrowserEvents(tracingModel); this._buildTimelineRecords(); @@ -265,9 +265,9 @@ } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel * @param {boolean} produceTraceStartedInPage - * @return {!WebInspector.TimelineModel.MetadataEvents} + * @return {!TimelineModel.TimelineModel.MetadataEvents} */ _processMetadataEvents(tracingModel, produceTraceStartedInPage) { var metadataEvents = tracingModel.devToolsMetadataEvents(); @@ -275,13 +275,13 @@ var pageDevToolsMetadataEvents = []; var workersDevToolsMetadataEvents = []; for (var event of metadataEvents) { - if (event.name === WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage) { + if (event.name === TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage) { pageDevToolsMetadataEvents.push(event); var frames = ((event.args['data'] && event.args['data']['frames']) || []); frames.forEach(payload => this._addPageFrame(event, payload)); - } else if (event.name === WebInspector.TimelineModel.DevToolsMetadataEvent.TracingSessionIdForWorker) { + } else if (event.name === TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingSessionIdForWorker) { workersDevToolsMetadataEvents.push(event); - } else if (event.name === WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInBrowser) { + } else if (event.name === TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingStartedInBrowser) { console.assert(!this._mainFrameNodeId, 'Multiple sessions in trace'); this._mainFrameNodeId = event.args['frameTreeNodeId']; } @@ -290,7 +290,7 @@ // The trace is probably coming not from DevTools. Make a mock Metadata event. var pageMetaEvent = produceTraceStartedInPage ? this._makeMockPageMetadataEvent(tracingModel) : null; if (!pageMetaEvent) { - console.error(WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage + ' event not found.'); + console.error(TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage + ' event not found.'); return {page: [], workers: []}; } pageDevToolsMetadataEvents.push(pageMetaEvent); @@ -301,7 +301,7 @@ var mismatchingIds = new Set(); /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ function checkSessionId(event) { @@ -316,23 +316,23 @@ return false; } var result = { - page: pageDevToolsMetadataEvents.filter(checkSessionId).sort(WebInspector.TracingModel.Event.compareStartTime), + page: pageDevToolsMetadataEvents.filter(checkSessionId).sort(SDK.TracingModel.Event.compareStartTime), workers: - workersDevToolsMetadataEvents.filter(checkSessionId).sort(WebInspector.TracingModel.Event.compareStartTime) + workersDevToolsMetadataEvents.filter(checkSessionId).sort(SDK.TracingModel.Event.compareStartTime) }; if (mismatchingIds.size) - WebInspector.console.error( + Common.console.error( 'Timeline recording was started in more than one page simultaneously. Session id mismatch: ' + this._sessionId + ' and ' + mismatchingIds.valuesArray() + '.'); return result; } /** - * @param {!WebInspector.TracingModel} tracingModel - * @return {?WebInspector.TracingModel.Event} + * @param {!SDK.TracingModel} tracingModel + * @return {?SDK.TracingModel.Event} */ _makeMockPageMetadataEvent(tracingModel) { - var rendererMainThreadName = WebInspector.TimelineModel.RendererMainThreadName; + var rendererMainThreadName = TimelineModel.TimelineModel.RendererMainThreadName; // FIXME: pick up the first renderer process for now. var process = tracingModel.sortedProcesses().filter(function(p) { return p.threadByName(rendererMainThreadName); @@ -340,9 +340,9 @@ var thread = process && process.threadByName(rendererMainThreadName); if (!thread) return null; - var pageMetaEvent = new WebInspector.TracingModel.Event( - WebInspector.TracingModel.DevToolsMetadataEventCategory, - WebInspector.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage, WebInspector.TracingModel.Phase.Metadata, + var pageMetaEvent = new SDK.TracingModel.Event( + SDK.TracingModel.DevToolsMetadataEventCategory, + TimelineModel.TimelineModel.DevToolsMetadataEvent.TracingStartedInPage, SDK.TracingModel.Phase.Metadata, tracingModel.minimumRecordTime(), thread); pageMetaEvent.addArgs({'data': {'sessionId': 'mockSessionId'}}); return pageMetaEvent; @@ -353,38 +353,38 @@ return; // First Paint is actually a DrawFrame that happened after first CompositeLayers following last CommitLoadEvent. - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var i = this._inspectedTargetEvents.lowerBound( - this._firstCompositeLayers, WebInspector.TracingModel.Event.compareStartTime); + this._firstCompositeLayers, SDK.TracingModel.Event.compareStartTime); for (; i < this._inspectedTargetEvents.length && this._inspectedTargetEvents[i].name !== recordTypes.DrawFrame; ++i) { } if (i >= this._inspectedTargetEvents.length) return; var drawFrameEvent = this._inspectedTargetEvents[i]; - var firstPaintEvent = new WebInspector.TracingModel.Event( - drawFrameEvent.categoriesString, recordTypes.MarkFirstPaint, WebInspector.TracingModel.Phase.Instant, + var firstPaintEvent = new SDK.TracingModel.Event( + drawFrameEvent.categoriesString, recordTypes.MarkFirstPaint, SDK.TracingModel.Phase.Instant, drawFrameEvent.startTime, drawFrameEvent.thread); this._mainThreadEvents.splice( - this._mainThreadEvents.lowerBound(firstPaintEvent, WebInspector.TracingModel.Event.compareStartTime), 0, + this._mainThreadEvents.lowerBound(firstPaintEvent, SDK.TracingModel.Event.compareStartTime), 0, firstPaintEvent); - var firstPaintRecord = new WebInspector.TimelineModel.Record(firstPaintEvent); + var firstPaintRecord = new TimelineModel.TimelineModel.Record(firstPaintEvent); this._eventDividerRecords.splice( - this._eventDividerRecords.lowerBound(firstPaintRecord, WebInspector.TimelineModel.Record._compareStartTime), 0, + this._eventDividerRecords.lowerBound(firstPaintRecord, TimelineModel.TimelineModel.Record._compareStartTime), 0, firstPaintRecord); } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel */ _processBrowserEvents(tracingModel) { - var browserMain = WebInspector.TracingModel.browserMainThread(tracingModel); + var browserMain = SDK.TracingModel.browserMainThread(tracingModel); if (!browserMain) return; // Disregard regular events, we don't need them yet, but still process to get proper metadata. browserMain.events().forEach(this._processBrowserEvent, this); - /** @type {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ + /** @type {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} */ var asyncEventsByGroup = new Map(); this._processAsyncEvents(asyncEventsByGroup, browserMain.asyncEvents()); this._mergeAsyncEvents(this._mainThreadAsyncEventsByGroup, asyncEventsByGroup); @@ -394,37 +394,37 @@ var topLevelRecords = this._buildTimelineRecordsForThread(this.mainThreadEvents()); for (var i = 0; i < topLevelRecords.length; i++) { var record = topLevelRecords[i]; - if (WebInspector.TracingModel.isTopLevelEvent(record.traceEvent())) + if (SDK.TracingModel.isTopLevelEvent(record.traceEvent())) this._mainThreadTasks.push(record); } /** - * @param {!WebInspector.TimelineModel.VirtualThread} virtualThread - * @this {!WebInspector.TimelineModel} + * @param {!TimelineModel.TimelineModel.VirtualThread} virtualThread + * @this {!TimelineModel.TimelineModel} */ function processVirtualThreadEvents(virtualThread) { var threadRecords = this._buildTimelineRecordsForThread(virtualThread.events); topLevelRecords = - topLevelRecords.mergeOrdered(threadRecords, WebInspector.TimelineModel.Record._compareStartTime); + topLevelRecords.mergeOrdered(threadRecords, TimelineModel.TimelineModel.Record._compareStartTime); } this.virtualThreads().forEach(processVirtualThreadEvents.bind(this)); this._records = topLevelRecords; } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel */ _buildGPUEvents(tracingModel) { var thread = tracingModel.threadByName('GPU Process', 'CrGpuMain'); if (!thread) return; - var gpuEventName = WebInspector.TimelineModel.RecordType.GPUTask; + var gpuEventName = TimelineModel.TimelineModel.RecordType.GPUTask; this._gpuEvents = thread.events().filter(event => event.name === gpuEventName); } /** - * @param {!Array.<!WebInspector.TracingModel.Event>} threadEvents - * @return {!Array.<!WebInspector.TimelineModel.Record>} + * @param {!Array.<!SDK.TracingModel.Event>} threadEvents + * @return {!Array.<!TimelineModel.TimelineModel.Record>} */ _buildTimelineRecordsForThread(threadEvents) { var recordStack = []; @@ -434,18 +434,18 @@ var event = threadEvents[i]; for (var top = recordStack.peekLast(); top && top._event.endTime <= event.startTime; top = recordStack.peekLast()) recordStack.pop(); - if (event.phase === WebInspector.TracingModel.Phase.AsyncEnd || - event.phase === WebInspector.TracingModel.Phase.NestableAsyncEnd) + if (event.phase === SDK.TracingModel.Phase.AsyncEnd || + event.phase === SDK.TracingModel.Phase.NestableAsyncEnd) continue; var parentRecord = recordStack.peekLast(); // Maintain the back-end logic of old timeline, skip console.time() / console.timeEnd() that are not properly nested. - if (WebInspector.TracingModel.isAsyncBeginPhase(event.phase) && parentRecord && + if (SDK.TracingModel.isAsyncBeginPhase(event.phase) && parentRecord && event.endTime > parentRecord._event.endTime) continue; - var record = new WebInspector.TimelineModel.Record(event); - if (WebInspector.TimelineModel.isMarkerEvent(event)) + var record = new TimelineModel.TimelineModel.Record(event); + if (TimelineModel.TimelineModel.isMarkerEvent(event)) this._eventDividerRecords.push(record); - if (!this._eventFilter.accept(event) && !WebInspector.TracingModel.isTopLevelEvent(event)) + if (!this._eventFilter.accept(event) && !SDK.TracingModel.isTopLevelEvent(event)) continue; if (parentRecord) parentRecord._addChild(record); @@ -459,8 +459,8 @@ } _resetProcessingState() { - this._asyncEventTracker = new WebInspector.TimelineAsyncEventTracker(); - this._invalidationTracker = new WebInspector.InvalidationTracker(); + this._asyncEventTracker = new TimelineModel.TimelineAsyncEventTracker(); + this._invalidationTracker = new TimelineModel.InvalidationTracker(); this._layoutInvalidate = {}; this._lastScheduleStyleRecalculation = {}; this._paintImageEventByPixelRefId = {}; @@ -476,9 +476,9 @@ } /** - * @param {!WebInspector.TracingModel} tracingModel - * @param {!WebInspector.TracingModel.Thread} thread - * @return {?WebInspector.CPUProfileDataModel} + * @param {!SDK.TracingModel} tracingModel + * @param {!SDK.TracingModel.Thread} thread + * @return {?SDK.CPUProfileDataModel} */ _extractCpuProfile(tracingModel, thread) { var events = thread.events(); @@ -486,18 +486,18 @@ // Check for legacy CpuProfile event format first. var cpuProfileEvent = events.peekLast(); - if (cpuProfileEvent && cpuProfileEvent.name === WebInspector.TimelineModel.RecordType.CpuProfile) { + if (cpuProfileEvent && cpuProfileEvent.name === TimelineModel.TimelineModel.RecordType.CpuProfile) { var eventData = cpuProfileEvent.args['data']; cpuProfile = /** @type {?Protocol.Profiler.Profile} */ (eventData && eventData['cpuProfile']); } if (!cpuProfile) { - cpuProfileEvent = events.find(e => e.name === WebInspector.TimelineModel.RecordType.Profile); + cpuProfileEvent = events.find(e => e.name === TimelineModel.TimelineModel.RecordType.Profile); if (!cpuProfileEvent) return null; var profileGroup = tracingModel.profileGroup(cpuProfileEvent.id); if (!profileGroup) { - WebInspector.console.error('Invalid CPU profile format.'); + Common.console.error('Invalid CPU profile format.'); return null; } cpuProfile = /** @type {!Protocol.Profiler.Profile} */ ( @@ -513,7 +513,7 @@ cpuProfile.samples.pushAll(nodesAndSamples['samples'] || []); cpuProfile.timeDeltas.pushAll(eventData['timeDeltas'] || []); if (cpuProfile.samples.length !== cpuProfile.timeDeltas.length) { - WebInspector.console.error('Failed to parse CPU profile.'); + Common.console.error('Failed to parse CPU profile.'); return null; } } @@ -522,41 +522,41 @@ } try { - var jsProfileModel = new WebInspector.CPUProfileDataModel(cpuProfile); + var jsProfileModel = new SDK.CPUProfileDataModel(cpuProfile); this._cpuProfiles.push(jsProfileModel); return jsProfileModel; } catch (e) { - WebInspector.console.error('Failed to parse CPU profile.'); + Common.console.error('Failed to parse CPU profile.'); } return null; } /** - * @param {!WebInspector.TracingModel} tracingModel - * @param {!WebInspector.TracingModel.Thread} thread - * @return {!Array<!WebInspector.TracingModel.Event>} + * @param {!SDK.TracingModel} tracingModel + * @param {!SDK.TracingModel.Thread} thread + * @return {!Array<!SDK.TracingModel.Event>} */ _injectJSFrameEvents(tracingModel, thread) { var jsProfileModel = this._extractCpuProfile(tracingModel, thread); var events = thread.events(); var jsSamples = jsProfileModel ? - WebInspector.TimelineJSProfileProcessor.generateTracingEventsFromCpuProfile(jsProfileModel, thread) : + TimelineModel.TimelineJSProfileProcessor.generateTracingEventsFromCpuProfile(jsProfileModel, thread) : null; if (jsSamples && jsSamples.length) - events = events.mergeOrdered(jsSamples, WebInspector.TracingModel.Event.orderedCompareStartTime); - if (jsSamples || events.some(e => e.name === WebInspector.TimelineModel.RecordType.JSSample)) { - var jsFrameEvents = WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents(events); + events = events.mergeOrdered(jsSamples, SDK.TracingModel.Event.orderedCompareStartTime); + if (jsSamples || events.some(e => e.name === TimelineModel.TimelineModel.RecordType.JSSample)) { + var jsFrameEvents = TimelineModel.TimelineJSProfileProcessor.generateJSFrameEvents(events); if (jsFrameEvents && jsFrameEvents.length) - events = jsFrameEvents.mergeOrdered(events, WebInspector.TracingModel.Event.orderedCompareStartTime); + events = jsFrameEvents.mergeOrdered(events, SDK.TracingModel.Event.orderedCompareStartTime); } return events; } /** - * @param {!WebInspector.TracingModel} tracingModel + * @param {!SDK.TracingModel} tracingModel * @param {number} startTime * @param {number} endTime - * @param {!WebInspector.TracingModel.Thread} thread + * @param {!SDK.TracingModel.Thread} thread * @param {boolean} isMainThread */ _processThreadEvents(tracingModel, startTime, endTime, thread, isMainThread) { @@ -570,7 +570,7 @@ threadEvents = this._mainThreadEvents; threadAsyncEventsByGroup = this._mainThreadAsyncEventsByGroup; } else { - var virtualThread = new WebInspector.TimelineModel.VirtualThread(thread.name()); + var virtualThread = new TimelineModel.TimelineModel.VirtualThread(thread.name()); this._virtualThreads.push(virtualThread); threadEvents = virtualThread.events; threadAsyncEventsByGroup = virtualThread.asyncEventsByGroup; @@ -586,11 +586,11 @@ if (!this._processEvent(event)) continue; if (groupByFrame) { - var frameId = WebInspector.TimelineData.forEvent(event).frameId; + var frameId = TimelineModel.TimelineData.forEvent(event).frameId; var pageFrame = frameId && this._pageFrames.get(frameId); var isMainFrame = !frameId || !pageFrame || !pageFrame.parent; if (isMainFrame) - frameId = WebInspector.TimelineModel.PageFrame.mainFrameId; + frameId = TimelineModel.TimelineModel.PageFrame.mainFrameId; var frameEvents = this._eventsByFrame.get(frameId); if (!frameEvents) { frameEvents = []; @@ -610,8 +610,8 @@ } /** - * @param {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} asyncEventsByGroup - * @param {!Array<!WebInspector.TracingModel.AsyncEvent>} asyncEvents + * @param {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} asyncEventsByGroup + * @param {!Array<!SDK.TracingModel.AsyncEvent>} asyncEvents * @param {number=} startTime * @param {number=} endTime */ @@ -636,7 +636,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ _processEvent(event) { @@ -644,13 +644,13 @@ while (eventStack.length && eventStack.peekLast().endTime <= event.startTime) eventStack.pop(); - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; if (this._currentScriptEvent && event.startTime > this._currentScriptEvent.endTime) this._currentScriptEvent = null; var eventData = event.args['data'] || event.args['beginData'] || {}; - var timelineData = WebInspector.TimelineData.forEvent(event); + var timelineData = TimelineModel.TimelineData.forEvent(event); if (eventData['stackTrace']) timelineData.stackTrace = eventData['stackTrace']; if (timelineData.stackTrace && event.name !== recordTypes.JSSample) { @@ -661,10 +661,10 @@ --timelineData.stackTrace[i].columnNumber; } } - var pageFrameId = WebInspector.TimelineModel.eventFrameId(event); + var pageFrameId = TimelineModel.TimelineModel.eventFrameId(event); if (!pageFrameId && eventStack.length) - pageFrameId = WebInspector.TimelineData.forEvent(eventStack.peekLast()).frameId; - timelineData.frameId = pageFrameId || WebInspector.TimelineModel.PageFrame.mainFrameId; + pageFrameId = TimelineModel.TimelineData.forEvent(eventStack.peekLast()).frameId; + timelineData.frameId = pageFrameId || TimelineModel.TimelineModel.PageFrame.mainFrameId; this._asyncEventTracker.processEvent(event); switch (event.name) { case recordTypes.ResourceSendRequest: @@ -684,7 +684,7 @@ timelineData.setInitiator(this._lastScheduleStyleRecalculation[event.args['beginData']['frame']]); this._lastRecalculateStylesEvent = event; if (this._currentScriptEvent) - timelineData.warning = WebInspector.TimelineModel.WarningType.ForcedStyle; + timelineData.warning = TimelineModel.TimelineModel.WarningType.ForcedStyle; break; case recordTypes.ScheduleStyleInvalidationTracking: @@ -694,7 +694,7 @@ case recordTypes.LayerInvalidationTracking: case recordTypes.PaintInvalidationTracking: case recordTypes.ScrollInvalidationTracking: - this._invalidationTracker.addInvalidation(new WebInspector.InvalidationTrackingEvent(event)); + this._invalidationTracker.addInvalidation(new TimelineModel.InvalidationTrackingEvent(event)); break; case recordTypes.InvalidateLayout: @@ -704,7 +704,7 @@ var frameId = eventData['frame']; if (!this._layoutInvalidate[frameId] && this._lastRecalculateStylesEvent && this._lastRecalculateStylesEvent.endTime > event.startTime) - layoutInitator = WebInspector.TimelineData.forEvent(this._lastRecalculateStylesEvent).initiator(); + layoutInitator = TimelineModel.TimelineData.forEvent(this._lastRecalculateStylesEvent).initiator(); this._layoutInvalidate[frameId] = layoutInitator; break; @@ -717,7 +717,7 @@ timelineData.backendNodeId = event.args['endData']['rootNode']; this._layoutInvalidate[frameId] = null; if (this._currentScriptEvent) - timelineData.warning = WebInspector.TimelineModel.WarningType.ForcedLayout; + timelineData.warning = TimelineModel.TimelineModel.WarningType.ForcedLayout; break; case recordTypes.FunctionCall: @@ -762,7 +762,7 @@ break; var paintEvent = this._lastPaintForLayer[layerUpdateEvent.args['layerId']]; if (paintEvent) - WebInspector.TimelineData.forEvent(paintEvent).picture = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event); + TimelineModel.TimelineData.forEvent(paintEvent).picture = /** @type {!SDK.TracingModel.ObjectSnapshot} */ (event); break; case recordTypes.ScrollLayer: @@ -784,7 +784,7 @@ } if (!paintImageEvent) break; - var paintImageData = WebInspector.TimelineData.forEvent(paintImageEvent); + var paintImageData = TimelineModel.TimelineData.forEvent(paintImageEvent); timelineData.backendNodeId = paintImageData.backendNodeId; timelineData.url = paintImageData.url; break; @@ -794,7 +794,7 @@ if (!paintImageEvent) break; this._paintImageEventByPixelRefId[event.args['LazyPixelRef']] = paintImageEvent; - var paintImageData = WebInspector.TimelineData.forEvent(paintImageEvent); + var paintImageData = TimelineModel.TimelineData.forEvent(paintImageEvent); timelineData.backendNodeId = paintImageData.backendNodeId; timelineData.url = paintImageData.url; break; @@ -807,7 +807,7 @@ break; case recordTypes.CommitLoad: - var frameId = WebInspector.TimelineModel.eventFrameId(event); + var frameId = TimelineModel.TimelineModel.eventFrameId(event); var pageFrame = this._pageFrames.get(frameId); if (pageFrame) pageFrame.update(eventData.name || '', eventData.url || ''); @@ -829,11 +829,11 @@ case recordTypes.FireIdleCallback: if (event.duration > eventData['allottedMilliseconds']) { - timelineData.warning = WebInspector.TimelineModel.WarningType.IdleDeadlineExceeded; + timelineData.warning = TimelineModel.TimelineModel.WarningType.IdleDeadlineExceeded; } break; } - if (WebInspector.TracingModel.isAsyncPhase(event.phase)) + if (SDK.TracingModel.isAsyncPhase(event.phase)) return true; var duration = event.duration; if (!duration) @@ -856,10 +856,10 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ _processBrowserEvent(event) { - if (event.name !== WebInspector.TimelineModel.RecordType.LatencyInfoFlow) + if (event.name !== TimelineModel.TimelineModel.RecordType.LatencyInfoFlow) return; var frameId = event.args['frameTreeNodeId']; if (typeof frameId === 'number' && frameId === this._mainFrameNodeId) @@ -867,34 +867,34 @@ } /** - * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent - * @return {?WebInspector.TimelineModel.AsyncEventGroup} + * @param {!SDK.TracingModel.AsyncEvent} asyncEvent + * @return {?TimelineModel.TimelineModel.AsyncEventGroup} */ _processAsyncEvent(asyncEvent) { - var groups = WebInspector.TimelineModel.AsyncEventGroup; - if (asyncEvent.hasCategory(WebInspector.TimelineModel.Category.Console)) + var groups = TimelineModel.TimelineModel.AsyncEventGroup; + if (asyncEvent.hasCategory(TimelineModel.TimelineModel.Category.Console)) return groups.console; - if (asyncEvent.hasCategory(WebInspector.TimelineModel.Category.UserTiming)) + if (asyncEvent.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) return groups.userTiming; - if (asyncEvent.name === WebInspector.TimelineModel.RecordType.Animation) + if (asyncEvent.name === TimelineModel.TimelineModel.RecordType.Animation) return groups.animation; - if (asyncEvent.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo) || - asyncEvent.name === WebInspector.TimelineModel.RecordType.ImplSideFling) { + if (asyncEvent.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo) || + asyncEvent.name === TimelineModel.TimelineModel.RecordType.ImplSideFling) { var lastStep = asyncEvent.steps.peekLast(); // FIXME: fix event termination on the back-end instead. - if (lastStep.phase !== WebInspector.TracingModel.Phase.AsyncEnd) + if (lastStep.phase !== SDK.TracingModel.Phase.AsyncEnd) return null; var data = lastStep.args['data']; asyncEvent.causedFrame = !!(data && data['INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT']); - if (asyncEvent.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) { + if (asyncEvent.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) { if (!this._knownInputEvents.has(lastStep.id)) return null; - if (asyncEvent.name === WebInspector.TimelineModel.RecordType.InputLatencyMouseMove && !asyncEvent.causedFrame) + if (asyncEvent.name === TimelineModel.TimelineModel.RecordType.InputLatencyMouseMove && !asyncEvent.causedFrame) return null; var rendererMain = data['INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT']; if (rendererMain) { var time = rendererMain['time'] / 1000; - WebInspector.TimelineData.forEvent(asyncEvent.steps[0]).timeWaitingForMainThread = time - asyncEvent.steps[0].startTime; + TimelineModel.TimelineData.forEvent(asyncEvent.steps[0]).timeWaitingForMainThread = time - asyncEvent.steps[0].startTime; } } return groups.input; @@ -904,7 +904,7 @@ /** * @param {string} name - * @return {?WebInspector.TracingModel.Event} + * @return {?SDK.TracingModel.Event} */ _findAncestorEvent(name) { for (var i = this._eventStack.length - 1; i >= 0; --i) { @@ -916,24 +916,24 @@ } /** - * @param {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} target - * @param {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} source + * @param {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} target + * @param {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} source */ _mergeAsyncEvents(target, source) { for (var group of source.keys()) { var events = target.get(group) || []; - events = events.mergeOrdered(source.get(group) || [], WebInspector.TracingModel.Event.compareStartAndEndTime); + events = events.mergeOrdered(source.get(group) || [], SDK.TracingModel.Event.compareStartAndEndTime); target.set(group, events); } } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {!Object} payload */ _addPageFrame(event, payload) { var processId = event.thread.process().id(); - var pageFrame = new WebInspector.TimelineModel.PageFrame(this.targetByEvent(event), processId, payload); + var pageFrame = new TimelineModel.TimelineModel.PageFrame(this.targetByEvent(event), processId, payload); this._pageFrames.set(pageFrame.id, pageFrame); var parent = payload['parent'] && this._pageFrames.get(`${processId}.${payload['parent']}`); if (parent) @@ -942,31 +942,31 @@ reset() { this._virtualThreads = []; - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this._mainThreadEvents = []; - /** @type {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ + /** @type {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} */ this._mainThreadAsyncEventsByGroup = new Map(); - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this._inspectedTargetEvents = []; - /** @type {!Array<!WebInspector.TimelineModel.Record>} */ + /** @type {!Array<!TimelineModel.TimelineModel.Record>} */ this._records = []; - /** @type {!Array<!WebInspector.TimelineModel.Record>} */ + /** @type {!Array<!TimelineModel.TimelineModel.Record>} */ this._mainThreadTasks = []; - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this._gpuEvents = []; - /** @type {!Array<!WebInspector.TimelineModel.Record>} */ + /** @type {!Array<!TimelineModel.TimelineModel.Record>} */ this._eventDividerRecords = []; /** @type {?string} */ this._sessionId = null; /** @type {?number} */ this._mainFrameNodeId = null; - /** @type {!Array<!WebInspector.CPUProfileDataModel>} */ + /** @type {!Array<!SDK.CPUProfileDataModel>} */ this._cpuProfiles = []; - /** @type {!WeakMap<!WebInspector.TracingModel.Thread, string>} */ + /** @type {!WeakMap<!SDK.TracingModel.Thread, string>} */ this._workerIdByThread = new WeakMap(); - /** @type {!Map<string, !WebInspector.TimelineModel.PageFrame>} */ + /** @type {!Map<string, !TimelineModel.TimelineModel.PageFrame>} */ this._pageFrames = new Map(); - /** @type {!Map<string, !Array<!WebInspector.TracingModel.Event>>} */ + /** @type {!Map<string, !Array<!SDK.TracingModel.Event>>} */ this._eventsByFrame = new Map(); this._minimumRecordTime = 0; @@ -988,35 +988,35 @@ } /** - * @return {!Array<!WebInspector.TracingModel.Event>} + * @return {!Array<!SDK.TracingModel.Event>} */ inspectedTargetEvents() { return this._inspectedTargetEvents; } /** - * @return {!Array<!WebInspector.TracingModel.Event>} + * @return {!Array<!SDK.TracingModel.Event>} */ mainThreadEvents() { return this._mainThreadEvents; } /** - * @param {!Array<!WebInspector.TracingModel.Event>} events + * @param {!Array<!SDK.TracingModel.Event>} events */ _setMainThreadEvents(events) { this._mainThreadEvents = events; } /** - * @return {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array.<!WebInspector.TracingModel.AsyncEvent>>} + * @return {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array.<!SDK.TracingModel.AsyncEvent>>} */ mainThreadAsyncEvents() { return this._mainThreadAsyncEventsByGroup; } /** - * @return {!Array<!WebInspector.TimelineModel.VirtualThread>} + * @return {!Array<!TimelineModel.TimelineModel.VirtualThread>} */ virtualThreads() { return this._virtualThreads; @@ -1030,28 +1030,28 @@ } /** - * @return {!Array.<!WebInspector.TimelineModel.Record>} + * @return {!Array.<!TimelineModel.TimelineModel.Record>} */ mainThreadTasks() { return this._mainThreadTasks; } /** - * @return {!Array<!WebInspector.TracingModel.Event>} + * @return {!Array<!SDK.TracingModel.Event>} */ gpuEvents() { return this._gpuEvents; } /** - * @return {!Array.<!WebInspector.TimelineModel.Record>} + * @return {!Array.<!TimelineModel.TimelineModel.Record>} */ eventDividerRecords() { return this._eventDividerRecords; } /** - * @return {!Array<!WebInspector.TimelineModel.PageFrame>} + * @return {!Array<!TimelineModel.TimelineModel.PageFrame>} */ rootFrames() { return Array.from(this._pageFrames.values()).filter(frame => !frame.parent); @@ -1059,7 +1059,7 @@ /** * @param {string} frameId - * @return {?WebInspector.TimelineModel.PageFrame} + * @return {?TimelineModel.TimelineModel.PageFrame} */ pageFrameById(frameId) { return frameId ? this._pageFrames.get(frameId) || null : null; @@ -1067,23 +1067,23 @@ /** * @param {string} frameId - * @return {!Array<!WebInspector.TracingModel.Event>} + * @return {!Array<!SDK.TracingModel.Event>} */ eventsForFrame(frameId) { return this._eventsByFrame.get(frameId) || []; } /** - * @return {!Array<!WebInspector.TimelineModel.NetworkRequest>} + * @return {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ networkRequests() { - /** @type {!Map<string,!WebInspector.TimelineModel.NetworkRequest>} */ + /** @type {!Map<string,!TimelineModel.TimelineModel.NetworkRequest>} */ var requests = new Map(); - /** @type {!Array<!WebInspector.TimelineModel.NetworkRequest>} */ + /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ var requestsList = []; - /** @type {!Array<!WebInspector.TimelineModel.NetworkRequest>} */ + /** @type {!Array<!TimelineModel.TimelineModel.NetworkRequest>} */ var zeroStartRequestsList = []; - var types = WebInspector.TimelineModel.RecordType; + var types = TimelineModel.TimelineModel.RecordType; var resourceTypes = new Set( [types.ResourceSendRequest, types.ResourceReceiveResponse, types.ResourceReceivedData, types.ResourceFinish]); var events = this.mainThreadEvents(); @@ -1096,7 +1096,7 @@ if (request) { request.addEvent(e); } else { - request = new WebInspector.TimelineModel.NetworkRequest(e); + request = new TimelineModel.TimelineModel.NetworkRequest(e); requests.set(id, request); if (request.startTime) requestsList.push(request); @@ -1111,7 +1111,7 @@ /** * @enum {string} */ -WebInspector.TimelineModel.RecordType = { +TimelineModel.TimelineModel.RecordType = { Task: 'Task', Program: 'Program', EventDispatch: 'EventDispatch', @@ -1235,7 +1235,7 @@ Profile: 'Profile' }; -WebInspector.TimelineModel.Category = { +TimelineModel.TimelineModel.Category = { Console: 'blink.console', UserTiming: 'blink.user_timing', LatencyInfo: 'latencyInfo' @@ -1244,21 +1244,21 @@ /** * @enum {string} */ -WebInspector.TimelineModel.WarningType = { +TimelineModel.TimelineModel.WarningType = { ForcedStyle: 'ForcedStyle', ForcedLayout: 'ForcedLayout', IdleDeadlineExceeded: 'IdleDeadlineExceeded', V8Deopt: 'V8Deopt' }; -WebInspector.TimelineModel.MainThreadName = 'main'; -WebInspector.TimelineModel.WorkerThreadName = 'DedicatedWorker Thread'; -WebInspector.TimelineModel.RendererMainThreadName = 'CrRendererMain'; +TimelineModel.TimelineModel.MainThreadName = 'main'; +TimelineModel.TimelineModel.WorkerThreadName = 'DedicatedWorker Thread'; +TimelineModel.TimelineModel.RendererMainThreadName = 'CrRendererMain'; /** * @enum {symbol} */ -WebInspector.TimelineModel.AsyncEventGroup = { +TimelineModel.TimelineModel.AsyncEventGroup = { animation: Symbol('animation'), console: Symbol('console'), userTiming: Symbol('userTiming'), @@ -1266,7 +1266,7 @@ }; -WebInspector.TimelineModel.DevToolsMetadataEvent = { +TimelineModel.TimelineModel.DevToolsMetadataEvent = { TracingStartedInBrowser: 'TracingStartedInBrowser', TracingStartedInPage: 'TracingStartedInPage', TracingSessionIdForWorker: 'TracingSessionIdForWorker', @@ -1275,15 +1275,15 @@ /** * @unrestricted */ -WebInspector.TimelineModel.VirtualThread = class { +TimelineModel.TimelineModel.VirtualThread = class { /** * @param {string} name */ constructor(name) { this.name = name; - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this.events = []; - /** @type {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ + /** @type {!Map<!TimelineModel.TimelineModel.AsyncEventGroup, !Array<!SDK.TracingModel.AsyncEvent>>} */ this.asyncEventsByGroup = new Map(); } @@ -1291,16 +1291,16 @@ * @return {boolean} */ isWorker() { - return this.name === WebInspector.TimelineModel.WorkerThreadName; + return this.name === TimelineModel.TimelineModel.WorkerThreadName; } }; /** * @unrestricted */ -WebInspector.TimelineModel.Record = class { +TimelineModel.TimelineModel.Record = class { /** - * @param {!WebInspector.TracingModel.Event} traceEvent + * @param {!SDK.TracingModel.Event} traceEvent */ constructor(traceEvent) { this._event = traceEvent; @@ -1308,8 +1308,8 @@ } /** - * @param {!WebInspector.TimelineModel.Record} a - * @param {!WebInspector.TimelineModel.Record} b + * @param {!TimelineModel.TimelineModel.Record} a + * @param {!TimelineModel.TimelineModel.Record} b * @return {number} */ static _compareStartTime(a, b) { @@ -1318,18 +1318,18 @@ } /** - * @return {?WebInspector.Target} + * @return {?SDK.Target} */ target() { var threadName = this._event.thread.name(); // FIXME: correctly specify target - return threadName === WebInspector.TimelineModel.RendererMainThreadName ? - WebInspector.targetManager.targets()[0] || null : + return threadName === TimelineModel.TimelineModel.RendererMainThreadName ? + SDK.targetManager.targets()[0] || null : null; } /** - * @return {!Array.<!WebInspector.TimelineModel.Record>} + * @return {!Array.<!TimelineModel.TimelineModel.Record>} */ children() { return this._children; @@ -1353,27 +1353,27 @@ * @return {string} */ thread() { - if (this._event.thread.name() === WebInspector.TimelineModel.RendererMainThreadName) - return WebInspector.TimelineModel.MainThreadName; + if (this._event.thread.name() === TimelineModel.TimelineModel.RendererMainThreadName) + return TimelineModel.TimelineModel.MainThreadName; return this._event.thread.name(); } /** - * @return {!WebInspector.TimelineModel.RecordType} + * @return {!TimelineModel.TimelineModel.RecordType} */ type() { - return WebInspector.TimelineModel._eventType(this._event); + return TimelineModel.TimelineModel._eventType(this._event); } /** - * @return {!WebInspector.TracingModel.Event} + * @return {!SDK.TracingModel.Event} */ traceEvent() { return this._event; } /** - * @param {!WebInspector.TimelineModel.Record} child + * @param {!TimelineModel.TimelineModel.Record} child */ _addChild(child) { this._children.push(child); @@ -1382,13 +1382,13 @@ }; -/** @typedef {!{page: !Array<!WebInspector.TracingModel.Event>, workers: !Array<!WebInspector.TracingModel.Event>}} */ -WebInspector.TimelineModel.MetadataEvents; +/** @typedef {!{page: !Array<!SDK.TracingModel.Event>, workers: !Array<!SDK.TracingModel.Event>}} */ +TimelineModel.TimelineModel.MetadataEvents; -WebInspector.TimelineModel.PageFrame = class { +TimelineModel.TimelineModel.PageFrame = class { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target * @param {number} pid * @param {!Object} payload */ @@ -1398,10 +1398,10 @@ this.name = payload['name']; this.processId = pid; this.children = []; - /** @type {?WebInspector.TimelineModel.PageFrame} */ + /** @type {?TimelineModel.TimelineModel.PageFrame} */ this.parent = null; this.id = `${this.processId}.${this.frameId}`; - this.ownerNode = target && payload['nodeId'] ? new WebInspector.DeferredDOMNode(target, payload['nodeId']) : null; + this.ownerNode = target && payload['nodeId'] ? new SDK.DeferredDOMNode(target, payload['nodeId']) : null; } /** @@ -1414,7 +1414,7 @@ } /** - * @param {!WebInspector.TimelineModel.PageFrame} child + * @param {!TimelineModel.TimelineModel.PageFrame} child */ addChild(child) { this.children.push(child); @@ -1422,20 +1422,20 @@ } }; -WebInspector.TimelineModel.PageFrame.mainFrameId = ''; +TimelineModel.TimelineModel.PageFrame.mainFrameId = ''; /** * @unrestricted */ -WebInspector.TimelineModel.NetworkRequest = class { +TimelineModel.TimelineModel.NetworkRequest = class { /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ constructor(event) { - this.startTime = event.name === WebInspector.TimelineModel.RecordType.ResourceSendRequest ? event.startTime : 0; + this.startTime = event.name === TimelineModel.TimelineModel.RecordType.ResourceSendRequest ? event.startTime : 0; this.endTime = Infinity; - /** @type {!Array<!WebInspector.TracingModel.Event>} */ + /** @type {!Array<!SDK.TracingModel.Event>} */ this.children = []; /** @type {?Object} */ this.timing; @@ -1449,11 +1449,11 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ addEvent(event) { this.children.push(event); - var recordType = WebInspector.TimelineModel.RecordType; + var recordType = TimelineModel.TimelineModel.RecordType; this.startTime = Math.min(this.startTime, event.startTime); var eventData = event.args['data']; if (eventData['mimeType']) @@ -1476,9 +1476,9 @@ } }; -WebInspector.TimelineModel.Filter = class { +TimelineModel.TimelineModel.Filter = class { /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { @@ -1486,7 +1486,7 @@ } }; -WebInspector.TimelineVisibleEventsFilter = class extends WebInspector.TimelineModel.Filter { +TimelineModel.TimelineVisibleEventsFilter = class extends TimelineModel.TimelineModel.Filter { /** * @param {!Array.<string>} visibleTypes */ @@ -1497,15 +1497,15 @@ /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { - return this._visibleTypes.has(WebInspector.TimelineModel._eventType(event)); + return this._visibleTypes.has(TimelineModel.TimelineModel._eventType(event)); } }; -WebInspector.ExclusiveNameFilter = class extends WebInspector.TimelineModel.Filter { +TimelineModel.ExclusiveNameFilter = class extends TimelineModel.TimelineModel.Filter { /** * @param {!Array<string>} excludeNames */ @@ -1516,7 +1516,7 @@ /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { @@ -1524,34 +1524,34 @@ } }; -WebInspector.ExcludeTopLevelFilter = class extends WebInspector.TimelineModel.Filter { +TimelineModel.ExcludeTopLevelFilter = class extends TimelineModel.TimelineModel.Filter { constructor() { super(); } /** * @override - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {boolean} */ accept(event) { - return !WebInspector.TracingModel.isTopLevelEvent(event); + return !SDK.TracingModel.isTopLevelEvent(event); } }; /** * @unrestricted */ -WebInspector.InvalidationTrackingEvent = class { +TimelineModel.InvalidationTrackingEvent = class { /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ constructor(event) { /** @type {string} */ this.type = event.name; /** @type {number} */ this.startTime = event.startTime; - /** @type {!WebInspector.TracingModel.Event} */ + /** @type {!SDK.TracingModel.Event} */ this._tracingEvent = event; var eventData = event.args['data']; @@ -1582,39 +1582,39 @@ this.extraData = eventData['extraData']; /** @type {?Array.<!Object.<string, number>>} */ this.invalidationList = eventData['invalidationList']; - /** @type {!WebInspector.InvalidationCause} */ + /** @type {!TimelineModel.InvalidationCause} */ this.cause = {reason: eventData['reason'], stackTrace: eventData['stackTrace']}; // FIXME: Move this to TimelineUIUtils.js. if (!this.cause.reason && this.cause.stackTrace && - this.type === WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking) + this.type === TimelineModel.TimelineModel.RecordType.LayoutInvalidationTracking) this.cause.reason = 'Layout forced'; } }; /** @typedef {{reason: string, stackTrace: ?Array<!Protocol.Runtime.CallFrame>}} */ -WebInspector.InvalidationCause; +TimelineModel.InvalidationCause; -WebInspector.InvalidationTracker = class { +TimelineModel.InvalidationTracker = class { constructor() { - /** @type {?WebInspector.TracingModel.Event} */ + /** @type {?SDK.TracingModel.Event} */ this._lastRecalcStyle = null; - /** @type {?WebInspector.TracingModel.Event} */ + /** @type {?SDK.TracingModel.Event} */ this._lastPaintWithLayer = null; this._didPaint = false; this._initializePerFrameState(); } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {?Array<!WebInspector.InvalidationTrackingEvent>} + * @param {!SDK.TracingModel.Event} event + * @return {?Array<!TimelineModel.InvalidationTrackingEvent>} */ static invalidationEventsFor(event) { - return event[WebInspector.InvalidationTracker._invalidationTrackingEventsSymbol] || null; + return event[TimelineModel.InvalidationTracker._invalidationTrackingEventsSymbol] || null; } /** - * @param {!WebInspector.InvalidationTrackingEvent} invalidation + * @param {!TimelineModel.InvalidationTrackingEvent} invalidation */ addInvalidation(invalidation) { this._startNewFrameIfNeeded(); @@ -1628,7 +1628,7 @@ // PaintInvalidationTracking events provide a paintId and a nodeId which // we can use to update the paintId for all other invalidation tracking // events. - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; if (invalidation.type === recordTypes.PaintInvalidationTracking && invalidation.nodeId) { var invalidations = this._invalidationsByNodeId[invalidation.nodeId] || []; for (var i = 0; i < invalidations.length; ++i) @@ -1674,27 +1674,27 @@ } /** - * @param {!WebInspector.TracingModel.Event} recalcStyleEvent + * @param {!SDK.TracingModel.Event} recalcStyleEvent */ didRecalcStyle(recalcStyleEvent) { this._lastRecalcStyle = recalcStyleEvent; var types = [ - WebInspector.TimelineModel.RecordType.ScheduleStyleInvalidationTracking, - WebInspector.TimelineModel.RecordType.StyleInvalidatorInvalidationTracking, - WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking + TimelineModel.TimelineModel.RecordType.ScheduleStyleInvalidationTracking, + TimelineModel.TimelineModel.RecordType.StyleInvalidatorInvalidationTracking, + TimelineModel.TimelineModel.RecordType.StyleRecalcInvalidationTracking ]; for (var invalidation of this._invalidationsOfTypes(types)) this._associateWithLastRecalcStyleEvent(invalidation); } /** - * @param {!WebInspector.InvalidationTrackingEvent} invalidation + * @param {!TimelineModel.InvalidationTrackingEvent} invalidation */ _associateWithLastRecalcStyleEvent(invalidation) { if (invalidation.linkedRecalcStyleEvent) return; - var recordTypes = WebInspector.TimelineModel.RecordType; + var recordTypes = TimelineModel.TimelineModel.RecordType; var recalcStyleFrameId = this._lastRecalcStyle.args['beginData']['frame']; if (invalidation.type === recordTypes.StyleInvalidatorInvalidationTracking) { // Instead of calling _addInvalidationToEvent directly, we create synthetic @@ -1711,9 +1711,9 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {number} frameId - * @param {!WebInspector.InvalidationTrackingEvent} styleInvalidatorInvalidation + * @param {!TimelineModel.InvalidationTrackingEvent} styleInvalidatorInvalidation */ _addSyntheticStyleRecalcInvalidations(event, frameId, styleInvalidatorInvalidation) { if (!styleInvalidatorInvalidation.invalidationList) { @@ -1733,7 +1733,7 @@ for (var j = 0; j < nodeInvalidations.length; j++) { var invalidation = nodeInvalidations[j]; if (invalidation.frame !== frameId || invalidation.invalidationSet !== setId || - invalidation.type !== WebInspector.TimelineModel.RecordType.ScheduleStyleInvalidationTracking) + invalidation.type !== TimelineModel.TimelineModel.RecordType.ScheduleStyleInvalidationTracking) continue; lastScheduleStyleRecalculation = invalidation; } @@ -1747,12 +1747,12 @@ } /** - * @param {!WebInspector.TracingModel.Event} baseEvent - * @param {!WebInspector.InvalidationTrackingEvent} styleInvalidatorInvalidation + * @param {!SDK.TracingModel.Event} baseEvent + * @param {!TimelineModel.InvalidationTrackingEvent} styleInvalidatorInvalidation */ _addSyntheticStyleRecalcInvalidation(baseEvent, styleInvalidatorInvalidation) { - var invalidation = new WebInspector.InvalidationTrackingEvent(baseEvent); - invalidation.type = WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking; + var invalidation = new TimelineModel.InvalidationTrackingEvent(baseEvent); + invalidation.type = TimelineModel.TimelineModel.RecordType.StyleRecalcInvalidationTracking; if (styleInvalidatorInvalidation.cause.reason) invalidation.cause.reason = styleInvalidatorInvalidation.cause.reason; if (styleInvalidatorInvalidation.selectorPart) @@ -1764,12 +1764,12 @@ } /** - * @param {!WebInspector.TracingModel.Event} layoutEvent + * @param {!SDK.TracingModel.Event} layoutEvent */ didLayout(layoutEvent) { var layoutFrameId = layoutEvent.args['beginData']['frame']; for (var invalidation of this._invalidationsOfTypes( - [WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking])) { + [TimelineModel.TimelineModel.RecordType.LayoutInvalidationTracking])) { if (invalidation.linkedLayoutEvent) continue; this._addInvalidationToEvent(layoutEvent, layoutFrameId, invalidation); @@ -1778,7 +1778,7 @@ } /** - * @param {!WebInspector.TracingModel.Event} paintEvent + * @param {!SDK.TracingModel.Event} paintEvent */ didPaint(paintEvent) { this._didPaint = true; @@ -1796,10 +1796,10 @@ var effectivePaintId = this._lastPaintWithLayer.args['data']['nodeId']; var paintFrameId = paintEvent.args['data']['frame']; var types = [ - WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking, - WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking, - WebInspector.TimelineModel.RecordType.PaintInvalidationTracking, - WebInspector.TimelineModel.RecordType.ScrollInvalidationTracking + TimelineModel.TimelineModel.RecordType.StyleRecalcInvalidationTracking, + TimelineModel.TimelineModel.RecordType.LayoutInvalidationTracking, + TimelineModel.TimelineModel.RecordType.PaintInvalidationTracking, + TimelineModel.TimelineModel.RecordType.ScrollInvalidationTracking ]; for (var invalidation of this._invalidationsOfTypes(types)) { if (invalidation.paintId === effectivePaintId) @@ -1808,22 +1808,22 @@ } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @param {number} eventFrameId - * @param {!WebInspector.InvalidationTrackingEvent} invalidation + * @param {!TimelineModel.InvalidationTrackingEvent} invalidation */ _addInvalidationToEvent(event, eventFrameId, invalidation) { if (eventFrameId !== invalidation.frame) return; - if (!event[WebInspector.InvalidationTracker._invalidationTrackingEventsSymbol]) - event[WebInspector.InvalidationTracker._invalidationTrackingEventsSymbol] = [invalidation]; + if (!event[TimelineModel.InvalidationTracker._invalidationTrackingEventsSymbol]) + event[TimelineModel.InvalidationTracker._invalidationTrackingEventsSymbol] = [invalidation]; else - event[WebInspector.InvalidationTracker._invalidationTrackingEventsSymbol].push(invalidation); + event[TimelineModel.InvalidationTracker._invalidationTrackingEventsSymbol].push(invalidation); } /** * @param {!Array.<string>=} types - * @return {!Iterator.<!WebInspector.InvalidationTrackingEvent>} + * @return {!Iterator.<!TimelineModel.InvalidationTrackingEvent>} */ _invalidationsOfTypes(types) { var invalidations = this._invalidations; @@ -1847,9 +1847,9 @@ } _initializePerFrameState() { - /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEvent>>} */ + /** @type {!Object.<string, !Array.<!TimelineModel.InvalidationTrackingEvent>>} */ this._invalidations = {}; - /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEvent>>} */ + /** @type {!Object.<number, !Array.<!TimelineModel.InvalidationTrackingEvent>>} */ this._invalidationsByNodeId = {}; this._lastRecalcStyle = null; @@ -1858,25 +1858,25 @@ } }; -WebInspector.InvalidationTracker._invalidationTrackingEventsSymbol = Symbol('invalidationTrackingEvents'); +TimelineModel.InvalidationTracker._invalidationTrackingEventsSymbol = Symbol('invalidationTrackingEvents'); /** * @unrestricted */ -WebInspector.TimelineAsyncEventTracker = class { +TimelineModel.TimelineAsyncEventTracker = class { constructor() { - WebInspector.TimelineAsyncEventTracker._initialize(); - /** @type {!Map<!WebInspector.TimelineModel.RecordType, !Map<string, !WebInspector.TracingModel.Event>>} */ + TimelineModel.TimelineAsyncEventTracker._initialize(); + /** @type {!Map<!TimelineModel.TimelineModel.RecordType, !Map<string, !SDK.TracingModel.Event>>} */ this._initiatorByType = new Map(); - for (var initiator of WebInspector.TimelineAsyncEventTracker._asyncEvents.keys()) + for (var initiator of TimelineModel.TimelineAsyncEventTracker._asyncEvents.keys()) this._initiatorByType.set(initiator, new Map()); } static _initialize() { - if (WebInspector.TimelineAsyncEventTracker._asyncEvents) + if (TimelineModel.TimelineAsyncEventTracker._asyncEvents) return; var events = new Map(); - var type = WebInspector.TimelineModel.RecordType; + var type = TimelineModel.TimelineModel.RecordType; events.set(type.TimerInstall, {causes: [type.TimerFire], joinBy: 'timerId'}); events.set( @@ -1889,42 +1889,42 @@ joinBy: 'identifier' }); - WebInspector.TimelineAsyncEventTracker._asyncEvents = events; - /** @type {!Map<!WebInspector.TimelineModel.RecordType, !WebInspector.TimelineModel.RecordType>} */ - WebInspector.TimelineAsyncEventTracker._typeToInitiator = new Map(); + TimelineModel.TimelineAsyncEventTracker._asyncEvents = events; + /** @type {!Map<!TimelineModel.TimelineModel.RecordType, !TimelineModel.TimelineModel.RecordType>} */ + TimelineModel.TimelineAsyncEventTracker._typeToInitiator = new Map(); for (var entry of events) { var types = entry[1].causes; for (type of types) - WebInspector.TimelineAsyncEventTracker._typeToInitiator.set(type, entry[0]); + TimelineModel.TimelineAsyncEventTracker._typeToInitiator.set(type, entry[0]); } } /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event */ processEvent(event) { - var initiatorType = WebInspector.TimelineAsyncEventTracker._typeToInitiator.get( - /** @type {!WebInspector.TimelineModel.RecordType} */ (event.name)); + var initiatorType = TimelineModel.TimelineAsyncEventTracker._typeToInitiator.get( + /** @type {!TimelineModel.TimelineModel.RecordType} */ (event.name)); var isInitiator = !initiatorType; if (!initiatorType) - initiatorType = /** @type {!WebInspector.TimelineModel.RecordType} */ (event.name); - var initiatorInfo = WebInspector.TimelineAsyncEventTracker._asyncEvents.get(initiatorType); + initiatorType = /** @type {!TimelineModel.TimelineModel.RecordType} */ (event.name); + var initiatorInfo = TimelineModel.TimelineAsyncEventTracker._asyncEvents.get(initiatorType); if (!initiatorInfo) return; var id = event.args['data'][initiatorInfo.joinBy]; if (!id) return; - /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ + /** @type {!Map<string, !SDK.TracingModel.Event>|undefined} */ var initiatorMap = this._initiatorByType.get(initiatorType); if (isInitiator) initiatorMap.set(id, event); else - WebInspector.TimelineData.forEvent(event).setInitiator(initiatorMap.get(id) || null); + TimelineModel.TimelineData.forEvent(event).setInitiator(initiatorMap.get(id) || null); } }; -WebInspector.TimelineData = class { +TimelineModel.TimelineData = class { constructor() { /** @type {?string} */ this.warning = null; @@ -1936,9 +1936,9 @@ this.backendNodeId = 0; /** @type {?Array<!Protocol.Runtime.CallFrame>} */ this.stackTrace = null; - /** @type {?WebInspector.TracingModel.ObjectSnapshot} */ + /** @type {?SDK.TracingModel.ObjectSnapshot} */ this.picture = null; - /** @type {?WebInspector.TracingModel.Event} */ + /** @type {?SDK.TracingModel.Event} */ this._initiator = null; this.frameId = ''; /** @type {number|undefined} */ @@ -1946,19 +1946,19 @@ } /** - * @param {!WebInspector.TracingModel.Event} initiator + * @param {!SDK.TracingModel.Event} initiator */ setInitiator(initiator) { this._initiator = initiator; if (!initiator || this.url) return; - var initiatorURL = WebInspector.TimelineData.forEvent(initiator).url; + var initiatorURL = TimelineModel.TimelineData.forEvent(initiator).url; if (initiatorURL) this.url = initiatorURL; } /** - * @return {?WebInspector.TracingModel.Event} + * @return {?SDK.TracingModel.Event} */ initiator() { return this._initiator; @@ -1976,21 +1976,21 @@ * @return {?Array<!Protocol.Runtime.CallFrame>} */ stackTraceForSelfOrInitiator() { - return this.stackTrace || (this._initiator && WebInspector.TimelineData.forEvent(this._initiator).stackTrace); + return this.stackTrace || (this._initiator && TimelineModel.TimelineData.forEvent(this._initiator).stackTrace); } /** - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineData} + * @param {!SDK.TracingModel.Event} event + * @return {!TimelineModel.TimelineData} */ static forEvent(event) { - var data = event[WebInspector.TimelineData._symbol]; + var data = event[TimelineModel.TimelineData._symbol]; if (!data) { - data = new WebInspector.TimelineData(); - event[WebInspector.TimelineData._symbol] = data; + data = new TimelineModel.TimelineData(); + event[TimelineModel.TimelineData._symbol] = data; } return data; } }; -WebInspector.TimelineData._symbol = Symbol('timelineData'); +TimelineModel.TimelineData._symbol = Symbol('timelineData');
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js index c05d882..073f7aa1 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -WebInspector.TimelineProfileTree = {}; +TimelineModel.TimelineProfileTree = {}; /** * @unrestricted */ -WebInspector.TimelineProfileTree.Node = class { +TimelineModel.TimelineProfileTree.Node = class { constructor() { /** @type {number} */ this.totalTime; @@ -15,11 +15,11 @@ this.selfTime; /** @type {string} */ this.id; - /** @type {!WebInspector.TracingModel.Event} */ + /** @type {!SDK.TracingModel.Event} */ this.event; - /** @type {?Map<string|symbol,!WebInspector.TimelineProfileTree.Node>} */ + /** @type {?Map<string|symbol,!TimelineModel.TimelineProfileTree.Node>} */ this.children; - /** @type {?WebInspector.TimelineProfileTree.Node} */ + /** @type {?TimelineModel.TimelineProfileTree.Node} */ this.parent; /** @type {string} */ @@ -36,41 +36,41 @@ }; /** - * @param {!Array<!WebInspector.TracingModel.Event>} events - * @param {!Array<!WebInspector.TimelineModel.Filter>} filters + * @param {!Array<!SDK.TracingModel.Event>} events + * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters * @param {number} startTime * @param {number} endTime - * @param {function(!WebInspector.TracingModel.Event):string=} eventGroupIdCallback - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {function(!SDK.TracingModel.Event):string=} eventGroupIdCallback + * @return {!TimelineModel.TimelineProfileTree.Node} */ -WebInspector.TimelineProfileTree.buildTopDown = function(events, filters, startTime, endTime, eventGroupIdCallback) { +TimelineModel.TimelineProfileTree.buildTopDown = function(events, filters, startTime, endTime, eventGroupIdCallback) { // Temporarily deposit a big enough value that exceeds the max recording time. var /** @const */ initialTime = 1e7; - var root = new WebInspector.TimelineProfileTree.Node(); + var root = new TimelineModel.TimelineProfileTree.Node(); root.totalTime = initialTime; root.selfTime = initialTime; - root.children = /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ (new Map()); + root.children = /** @type {!Map<string, !TimelineModel.TimelineProfileTree.Node>} */ (new Map()); var parent = root; /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onStartEvent(e) { - if (!WebInspector.TimelineModel.isVisible(filters, e)) + if (!TimelineModel.TimelineModel.isVisible(filters, e)) return; var time = e.endTime ? Math.min(endTime, e.endTime) - Math.max(startTime, e.startTime) : 0; var groupId = eventGroupIdCallback ? eventGroupIdCallback(e) : Symbol('uniqueGroupId'); - var id = eventGroupIdCallback ? WebInspector.TimelineProfileTree._eventId(e) : Symbol('uniqueEventId'); + var id = eventGroupIdCallback ? TimelineModel.TimelineProfileTree._eventId(e) : Symbol('uniqueEventId'); if (typeof groupId === 'string' && typeof id === 'string') id += '/' + groupId; if (!parent.children) - parent.children = /** @type {!Map<string,!WebInspector.TimelineProfileTree.Node>} */ (new Map()); + parent.children = /** @type {!Map<string,!TimelineModel.TimelineProfileTree.Node>} */ (new Map()); var node = parent.children.get(id); if (node) { node.selfTime += time; node.totalTime += time; } else { - node = new WebInspector.TimelineProfileTree.Node(); + node = new TimelineModel.TimelineProfileTree.Node(); node.totalTime = time; node.selfTime = time; node.parent = parent; @@ -89,31 +89,31 @@ } /** - * @param {!WebInspector.TracingModel.Event} e + * @param {!SDK.TracingModel.Event} e */ function onEndEvent(e) { - if (!WebInspector.TimelineModel.isVisible(filters, e)) + if (!TimelineModel.TimelineModel.isVisible(filters, e)) return; parent = parent.parent; } var instantEventCallback = eventGroupIdCallback ? undefined : onStartEvent; // Ignore instant events when aggregating. - WebInspector.TimelineModel.forEachEvent(events, onStartEvent, onEndEvent, instantEventCallback, startTime, endTime); + TimelineModel.TimelineModel.forEachEvent(events, onStartEvent, onEndEvent, instantEventCallback, startTime, endTime); root.totalTime -= root.selfTime; root.selfTime = 0; return root; }; /** - * @param {!WebInspector.TimelineProfileTree.Node} topDownTree - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {!TimelineModel.TimelineProfileTree.Node} topDownTree + * @return {!TimelineModel.TimelineProfileTree.Node} */ -WebInspector.TimelineProfileTree.buildBottomUp = function(topDownTree) { - var buRoot = new WebInspector.TimelineProfileTree.Node(); - var aggregator = new WebInspector.TimelineAggregator(); +TimelineModel.TimelineProfileTree.buildBottomUp = function(topDownTree) { + var buRoot = new TimelineModel.TimelineProfileTree.Node(); + var aggregator = new TimelineModel.TimelineAggregator(); buRoot.selfTime = 0; buRoot.totalTime = 0; - /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ + /** @type {!Map<string, !TimelineModel.TimelineProfileTree.Node>} */ buRoot.children = new Map(); var nodesOnStack = /** @type {!Set<string>} */ (new Set()); if (topDownTree.children) @@ -121,7 +121,7 @@ buRoot.totalTime = topDownTree.totalTime; /** - * @param {!WebInspector.TimelineProfileTree.Node} tdNode + * @param {!TimelineModel.TimelineProfileTree.Node} tdNode */ function processNode(tdNode) { var buParent = typeof tdNode._groupId === 'string' ? aggregator.groupNodeForId(tdNode._groupId, tdNode.event) : buRoot; @@ -140,8 +140,8 @@ } /** - * @param {!WebInspector.TimelineProfileTree.Node} tdNode - * @param {!WebInspector.TimelineProfileTree.Node} buParent + * @param {!TimelineModel.TimelineProfileTree.Node} tdNode + * @param {!TimelineModel.TimelineProfileTree.Node} buParent */ function appendNode(tdNode, buParent) { var selfTime = tdNode.selfTime; @@ -150,11 +150,11 @@ buParent.totalTime += selfTime; while (tdNode.parent) { if (!buParent.children) - buParent.children = /** @type {!Map<string,!WebInspector.TimelineProfileTree.Node>} */ (new Map()); + buParent.children = /** @type {!Map<string,!TimelineModel.TimelineProfileTree.Node>} */ (new Map()); var id = tdNode.id; var buNode = buParent.children.get(id); if (!buNode) { - buNode = new WebInspector.TimelineProfileTree.Node(); + buNode = new TimelineModel.TimelineProfileTree.Node(); buNode.selfTime = selfTime; buNode.totalTime = totalTime; buNode.event = tdNode.event; @@ -182,14 +182,14 @@ }; /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {?string} */ -WebInspector.TimelineProfileTree.eventURL = function(event) { +TimelineModel.TimelineProfileTree.eventURL = function(event) { var data = event.args['data'] || event.args['beginData']; if (data && data['url']) return data['url']; - var frame = WebInspector.TimelineProfileTree.eventStackFrame(event); + var frame = TimelineModel.TimelineProfileTree.eventStackFrame(event); while (frame) { var url = frame['url']; if (url) @@ -200,27 +200,27 @@ }; /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {?Protocol.Runtime.CallFrame} */ -WebInspector.TimelineProfileTree.eventStackFrame = function(event) { - if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) +TimelineModel.TimelineProfileTree.eventStackFrame = function(event) { + if (event.name === TimelineModel.TimelineModel.RecordType.JSFrame) return /** @type {?Protocol.Runtime.CallFrame} */ (event.args['data'] || null); - return WebInspector.TimelineData.forEvent(event).topFrame(); + return TimelineModel.TimelineData.forEvent(event).topFrame(); }; /** - * @param {!WebInspector.TracingModel.Event} event + * @param {!SDK.TracingModel.Event} event * @return {string} */ -WebInspector.TimelineProfileTree._eventId = function(event) { - if (event.name !== WebInspector.TimelineModel.RecordType.JSFrame) +TimelineModel.TimelineProfileTree._eventId = function(event) { + if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame) return event.name; const frame = event.args['data']; const location = frame['scriptId'] || frame['url'] || ''; const functionName = frame['functionName']; - const name = WebInspector.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame) - ? WebInspector.TimelineJSProfileProcessor.nativeGroup(functionName) || functionName + const name = TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame) + ? TimelineModel.TimelineJSProfileProcessor.nativeGroup(functionName) || functionName : functionName; return `f:${name}@${location}`; }; @@ -228,15 +228,15 @@ /** * @unrestricted */ -WebInspector.TimelineAggregator = class { +TimelineModel.TimelineAggregator = class { constructor() { - /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ + /** @type {!Map<string, !TimelineModel.TimelineProfileTree.Node>} */ this._groupNodes = new Map(); } /** - * @param {!WebInspector.TimelineProfileTree.Node} root - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {!TimelineModel.TimelineProfileTree.Node} root + * @return {!TimelineModel.TimelineProfileTree.Node} */ performGrouping(root) { for (var node of root.children.values()) { @@ -253,8 +253,8 @@ /** * @param {string} groupId - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {!SDK.TracingModel.Event} event + * @return {!TimelineModel.TimelineProfileTree.Node} */ groupNodeForId(groupId, event) { var node = this._groupNodes.get(groupId); @@ -263,11 +263,11 @@ /** * @param {string} id - * @param {!WebInspector.TracingModel.Event} event - * @return {!WebInspector.TimelineProfileTree.Node} + * @param {!SDK.TracingModel.Event} event + * @return {!TimelineModel.TimelineProfileTree.Node} */ _buildGroupNode(id, event) { - var groupNode = new WebInspector.TimelineProfileTree.Node(); + var groupNode = new TimelineModel.TimelineProfileTree.Node(); groupNode.id = id; groupNode.selfTime = 0; groupNode.totalTime = 0; @@ -279,4 +279,4 @@ } }; -WebInspector.TimelineAggregator._groupNodeFlag = Symbol('groupNode'); +TimelineModel.TimelineAggregator._groupNodeFlag = Symbol('groupNode');
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js index 90197fdb..9fdc0add 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. /** @typedef {!{ bounds: {height: number, width: number}, - children: Array.<!WebInspector.TracingLayerPayload>, + children: Array.<!TimelineModel.TracingLayerPayload>, layer_id: number, position: Array.<number>, scroll_offset: Array.<number>, @@ -15,7 +15,7 @@ compositing_reasons: Array.<string> }} */ -WebInspector.TracingLayerPayload; +TimelineModel.TracingLayerPayload; /** @typedef {!{ id: string, @@ -24,32 +24,25 @@ content_rect: !Array.<number> }} */ -WebInspector.TracingLayerTile; - -/** @typedef {!{ - rect: !Protocol.DOM.Rect, - snapshot: !WebInspector.PaintProfilerSnapshot - }} -*/ -WebInspector.SnapshotWithRect; +TimelineModel.TracingLayerTile; /** * @unrestricted */ -WebInspector.TracingLayerTree = class extends WebInspector.LayerTreeBase { +TimelineModel.TracingLayerTree = class extends SDK.LayerTreeBase { /** - * @param {?WebInspector.Target} target + * @param {?SDK.Target} target */ constructor(target) { super(target); - /** @type {!Map.<string, !WebInspector.TracingLayerTile>} */ + /** @type {!Map.<string, !TimelineModel.TracingLayerTile>} */ this._tileById = new Map(); } /** - * @param {?WebInspector.TracingLayerPayload} root - * @param {?Array<!WebInspector.TracingLayerPayload>} layers - * @param {!Array<!WebInspector.LayerPaintEvent>} paints + * @param {?TimelineModel.TracingLayerPayload} root + * @param {?Array<!TimelineModel.TracingLayerPayload>} layers + * @param {!Array<!TimelineModel.LayerPaintEvent>} paints * @param {function()} callback */ setLayers(root, layers, paints, callback) { @@ -65,7 +58,7 @@ this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this)); /** - * @this {WebInspector.TracingLayerTree} + * @this {TimelineModel.TracingLayerTree} */ function onBackendNodeIdsResolved() { var oldLayersById = this._layersById; @@ -89,7 +82,7 @@ } /** - * @param {!Array.<!WebInspector.TracingLayerTile>} tiles + * @param {!Array.<!TimelineModel.TracingLayerTile>} tiles */ setTiles(tiles) { this._tileById = new Map(); @@ -99,24 +92,24 @@ /** * @param {string} tileId - * @return {!Promise<?WebInspector.SnapshotWithRect>} + * @return {!Promise<?SDK.SnapshotWithRect>} */ pictureForRasterTile(tileId) { var tile = this._tileById.get('cc::Tile/' + tileId); if (!tile) { - WebInspector.console.error(`Tile ${tileId} is missing`); - return /** @type {!Promise<?WebInspector.SnapshotWithRect>} */ (Promise.resolve(null)); + Common.console.error(`Tile ${tileId} is missing`); + return /** @type {!Promise<?SDK.SnapshotWithRect>} */ (Promise.resolve(null)); } var layer = this.layerById(tile.layer_id); if (!layer) { - WebInspector.console.error(`Layer ${tile.layer_id} for tile ${tileId} is not found`); - return /** @type {!Promise<?WebInspector.SnapshotWithRect>} */ (Promise.resolve(null)); + Common.console.error(`Layer ${tile.layer_id} for tile ${tileId} is not found`); + return /** @type {!Promise<?SDK.SnapshotWithRect>} */ (Promise.resolve(null)); } return layer._pictureForRect(tile.content_rect); } /** - * @param {!Array<!WebInspector.LayerPaintEvent>} paints + * @param {!Array<!TimelineModel.LayerPaintEvent>} paints */ _setPaints(paints) { for (var i = 0; i < paints.length; ++i) { @@ -127,16 +120,16 @@ } /** - * @param {!Object<(string|number), !WebInspector.Layer>} oldLayersById - * @param {!WebInspector.TracingLayerPayload} payload - * @return {!WebInspector.TracingLayer} + * @param {!Object<(string|number), !SDK.Layer>} oldLayersById + * @param {!TimelineModel.TracingLayerPayload} payload + * @return {!TimelineModel.TracingLayer} */ _innerSetLayers(oldLayersById, payload) { - var layer = /** @type {?WebInspector.TracingLayer} */ (oldLayersById[payload.layer_id]); + var layer = /** @type {?TimelineModel.TracingLayer} */ (oldLayersById[payload.layer_id]); if (layer) layer._reset(payload); else - layer = new WebInspector.TracingLayer(this.target(), payload); + layer = new TimelineModel.TracingLayer(this.target(), payload); this._layersById[payload.layer_id] = layer; if (payload.owner_node) layer._setNode(this._backendNodeIdToNode.get(payload.owner_node) || null); @@ -150,7 +143,7 @@ /** * @param {!Set<number>} nodeIdsToResolve * @param {!Object} seenNodeIds - * @param {!WebInspector.TracingLayerPayload} payload + * @param {!TimelineModel.TracingLayerPayload} payload */ _extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload) { var backendNodeId = payload.owner_node; @@ -162,13 +155,13 @@ }; /** - * @implements {WebInspector.Layer} + * @implements {SDK.Layer} * @unrestricted */ -WebInspector.TracingLayer = class { +TimelineModel.TracingLayer = class { /** - * @param {!WebInspector.TracingLayerPayload} payload - * @param {?WebInspector.Target} target + * @param {!TimelineModel.TracingLayerPayload} payload + * @param {?SDK.Target} target */ constructor(target, payload) { this._target = target; @@ -176,10 +169,10 @@ } /** - * @param {!WebInspector.TracingLayerPayload} payload + * @param {!TimelineModel.TracingLayerPayload} payload */ _reset(payload) { - /** @type {?WebInspector.DOMNode} */ + /** @type {?SDK.DOMNode} */ this._node = null; this._layerId = String(payload.layer_id); this._offsetX = payload.position[0]; @@ -215,7 +208,7 @@ /** * @override - * @return {?WebInspector.Layer} + * @return {?SDK.Layer} */ parent() { return this._parent; @@ -231,7 +224,7 @@ /** * @override - * @return {!Array.<!WebInspector.Layer>} + * @return {!Array.<!SDK.Layer>} */ children() { return this._children; @@ -239,7 +232,7 @@ /** * @override - * @param {!WebInspector.Layer} child + * @param {!SDK.Layer} child */ addChild(child) { if (child._parent) @@ -250,7 +243,7 @@ } /** - * @param {?WebInspector.DOMNode} node + * @param {?SDK.DOMNode} node */ _setNode(node) { this._node = node; @@ -258,7 +251,7 @@ /** * @override - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ node() { return this._node; @@ -266,7 +259,7 @@ /** * @override - * @return {?WebInspector.DOMNode} + * @return {?SDK.DOMNode} */ nodeForSelfOrAncestor() { for (var layer = this; layer; layer = layer._parent) { @@ -374,7 +367,7 @@ /** * @override - * @return {!Array<!Promise<?WebInspector.SnapshotWithRect>>} + * @return {!Array<!Promise<?SDK.SnapshotWithRect>>} */ snapshots() { return this._paints.map(paint => paint.snapshotPromise().then(snapshot => { @@ -387,7 +380,7 @@ /** * @param {!Array<number>} targetRect - * @return {!Promise<?WebInspector.SnapshotWithRect>} + * @return {!Promise<?SDK.SnapshotWithRect>} */ _pictureForRect(targetRect) { return Promise.all(this._paints.map(paint => paint.picturePromise())).then(pictures => { @@ -400,7 +393,7 @@ var y0 = fragments.reduce((min, item) => Math.min(min, item.y), Infinity); // Rect is in layer content coordinates, make it relative to picture by offsetting to the top left corner. var rect = {x: targetRect[0] - x0, y: targetRect[1] - y0, width: targetRect[2], height: targetRect[3]}; - return WebInspector.PaintProfilerSnapshot.loadFromFragments(this._target, fragments) + return SDK.PaintProfilerSnapshot.loadFromFragments(this._target, fragments) .then(snapshot => snapshot ? {rect: rect, snapshot: snapshot} : null); }); @@ -437,26 +430,26 @@ } /** - * @param {!WebInspector.TracingLayerPayload} payload + * @param {!TimelineModel.TracingLayerPayload} payload */ _createScrollRects(payload) { this._scrollRects = []; if (payload.non_fast_scrollable_region) this._scrollRects.push(this._scrollRectsFromParams( - payload.non_fast_scrollable_region, WebInspector.Layer.ScrollRectType.NonFastScrollable.name)); + payload.non_fast_scrollable_region, SDK.Layer.ScrollRectType.NonFastScrollable.name)); if (payload.touch_event_handler_region) this._scrollRects.push(this._scrollRectsFromParams( - payload.touch_event_handler_region, WebInspector.Layer.ScrollRectType.TouchEventHandler.name)); + payload.touch_event_handler_region, SDK.Layer.ScrollRectType.TouchEventHandler.name)); if (payload.wheel_event_handler_region) this._scrollRects.push(this._scrollRectsFromParams( - payload.wheel_event_handler_region, WebInspector.Layer.ScrollRectType.WheelEventHandler.name)); + payload.wheel_event_handler_region, SDK.Layer.ScrollRectType.WheelEventHandler.name)); if (payload.scroll_event_handler_region) this._scrollRects.push(this._scrollRectsFromParams( - payload.scroll_event_handler_region, WebInspector.Layer.ScrollRectType.RepaintsOnScroll.name)); + payload.scroll_event_handler_region, SDK.Layer.ScrollRectType.RepaintsOnScroll.name)); } /** - * @param {!WebInspector.LayerPaintEvent} paint + * @param {!TimelineModel.LayerPaintEvent} paint */ _addPaintEvent(paint) { this._paints.push(paint);
diff --git a/third_party/WebKit/Source/devtools/front_end/toolbox_bootstrap/Toolbox.js b/third_party/WebKit/Source/devtools/front_end/toolbox_bootstrap/Toolbox.js index 55ec4c4..b94daf7 100644 --- a/third_party/WebKit/Source/devtools/front_end/toolbox_bootstrap/Toolbox.js +++ b/third_party/WebKit/Source/devtools/front_end/toolbox_bootstrap/Toolbox.js
@@ -8,7 +8,7 @@ function toolboxLoaded() { if (!window.opener) return; - var app = window.opener.WebInspector['AdvancedApp']['_instance'](); + var app = window.opener['Emulation']['AdvancedApp']['_instance'](); app['toolboxLoaded'](document); }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ActionRegistry.js b/third_party/WebKit/Source/devtools/front_end/ui/ActionRegistry.js index 4e445c6..7f04384 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ActionRegistry.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ActionRegistry.js
@@ -4,39 +4,39 @@ /** * @unrestricted */ -WebInspector.ActionRegistry = class { +UI.ActionRegistry = class { constructor() { - /** @type {!Map.<string, !WebInspector.Action>} */ + /** @type {!Map.<string, !UI.Action>} */ this._actionsById = new Map(); this._registerActions(); } _registerActions() { - self.runtime.extensions(WebInspector.ActionDelegate).forEach(registerExtension, this); + self.runtime.extensions(UI.ActionDelegate).forEach(registerExtension, this); /** * @param {!Runtime.Extension} extension - * @this {WebInspector.ActionRegistry} + * @this {UI.ActionRegistry} */ function registerExtension(extension) { var actionId = extension.descriptor()['actionId']; console.assert(actionId); console.assert(!this._actionsById.get(actionId)); - this._actionsById.set(actionId, new WebInspector.Action(extension)); + this._actionsById.set(actionId, new UI.Action(extension)); } } /** - * @return {!Array.<!WebInspector.Action>} + * @return {!Array.<!UI.Action>} */ availableActions() { - return this.applicableActions(this._actionsById.keysArray(), WebInspector.context); + return this.applicableActions(this._actionsById.keysArray(), UI.context); } /** * @param {!Array.<string>} actionIds - * @param {!WebInspector.Context} context - * @return {!Array.<!WebInspector.Action>} + * @param {!UI.Context} context + * @return {!Array.<!UI.Action>} */ applicableActions(actionIds, context) { var extensions = []; @@ -49,17 +49,17 @@ /** * @param {!Runtime.Extension} extension - * @return {!WebInspector.Action} - * @this {WebInspector.ActionRegistry} + * @return {!UI.Action} + * @this {UI.ActionRegistry} */ function extensionToAction(extension) { - return /** @type {!WebInspector.Action} */ (this.action(extension.descriptor()['actionId'])); + return /** @type {!UI.Action} */ (this.action(extension.descriptor()['actionId'])); } } /** * @param {string} actionId - * @return {?WebInspector.Action} + * @return {?UI.Action} */ action(actionId) { return this._actionsById.get(actionId) || null; @@ -69,7 +69,7 @@ /** * @unrestricted */ -WebInspector.Action = class extends WebInspector.Object { +UI.Action = class extends Common.Object { /** * @param {!Runtime.Extension} extension */ @@ -96,12 +96,12 @@ /** * @param {!Object} actionDelegate * @return {boolean} - * @this {WebInspector.Action} + * @this {UI.Action} */ function handleAction(actionDelegate) { var actionId = this._extension.descriptor()['actionId']; - var delegate = /** @type {!WebInspector.ActionDelegate} */ (actionDelegate); - return delegate.handleAction(WebInspector.context, actionId); + var delegate = /** @type {!UI.ActionDelegate} */ (actionDelegate); + return delegate.handleAction(UI.context, actionId); } } @@ -134,7 +134,7 @@ return; this._enabled = enabled; - this.dispatchEventToListeners(WebInspector.Action.Events.Enabled, enabled); + this.dispatchEventToListeners(UI.Action.Events.Enabled, enabled); } /** @@ -188,12 +188,12 @@ return; this._toggled = toggled; - this.dispatchEventToListeners(WebInspector.Action.Events.Toggled, toggled); + this.dispatchEventToListeners(UI.Action.Events.Toggled, toggled); } }; /** @enum {symbol} */ -WebInspector.Action.Events = { +UI.Action.Events = { Enabled: Symbol('Enabled'), Toggled: Symbol('Toggled') }; @@ -201,16 +201,16 @@ /** * @interface */ -WebInspector.ActionDelegate = function() {}; +UI.ActionDelegate = function() {}; -WebInspector.ActionDelegate.prototype = { +UI.ActionDelegate.prototype = { /** - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction: function(context, actionId) {} }; -/** @type {!WebInspector.ActionRegistry} */ -WebInspector.actionRegistry; +/** @type {!UI.ActionRegistry} */ +UI.actionRegistry;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/BezierEditor.js b/third_party/WebKit/Source/devtools/front_end/ui/BezierEditor.js index b9c5a48..18e6359 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/BezierEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/BezierEditor.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.BezierEditor = class extends WebInspector.VBox { +UI.BezierEditor = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('ui/bezierEditor.css'); @@ -21,17 +21,17 @@ // Presets UI this._presetsContainer = this._outerContainer.createChild('div', 'bezier-presets'); - this._presetUI = new WebInspector.BezierUI(40, 40, 0, 2, false); + this._presetUI = new UI.BezierUI(40, 40, 0, 2, false); this._presetCategories = []; - for (var i = 0; i < WebInspector.BezierEditor.Presets.length; i++) { - this._presetCategories[i] = this._createCategory(WebInspector.BezierEditor.Presets[i]); + for (var i = 0; i < UI.BezierEditor.Presets.length; i++) { + this._presetCategories[i] = this._createCategory(UI.BezierEditor.Presets[i]); this._presetsContainer.appendChild(this._presetCategories[i].icon); } // Curve UI - this._curveUI = new WebInspector.BezierUI(150, 250, 50, 7, true); + this._curveUI = new UI.BezierUI(150, 250, 50, 7, true); this._curve = this._outerContainer.createSVGChild('svg', 'bezier-curve'); - WebInspector.installDragHandle( + UI.installDragHandle( this._curve, this._dragStart.bind(this), this._dragMove.bind(this), this._dragEnd.bind(this), 'default'); this._header = this.contentElement.createChild('div', 'bezier-header'); @@ -43,7 +43,7 @@ } /** - * @param {?WebInspector.Geometry.CubicBezier} bezier + * @param {?Common.Geometry.CubicBezier} bezier */ setBezier(bezier) { if (!bezier) @@ -53,7 +53,7 @@ } /** - * @return {!WebInspector.Geometry.CubicBezier} + * @return {!Common.Geometry.CubicBezier} */ bezier() { return this._bezier; @@ -80,13 +80,13 @@ _onchange() { this._updateUI(); - this.dispatchEventToListeners(WebInspector.BezierEditor.Events.BezierChanged, this._bezier.asCSSText()); + this.dispatchEventToListeners(UI.BezierEditor.Events.BezierChanged, this._bezier.asCSSText()); } _updateUI() { var labelText = this._selectedCategory ? this._selectedCategory.presets[this._selectedCategory.presetIndex].name : this._bezier.asCSSText().replace(/\s(-\d\.\d)/g, '$1'); - this._label.textContent = WebInspector.UIString(labelText); + this._label.textContent = Common.UIString(labelText); this._curveUI.drawCurve(this._bezier, this._curve); this._previewOnion.removeChildren(); } @@ -96,9 +96,9 @@ * @return {boolean} */ _dragStart(event) { - this._mouseDownPosition = new WebInspector.Geometry.Point(event.x, event.y); + this._mouseDownPosition = new Common.Geometry.Point(event.x, event.y); var ui = this._curveUI; - this._controlPosition = new WebInspector.Geometry.Point( + this._controlPosition = new Common.Geometry.Point( Number.constrain((event.offsetX - ui.radius) / ui.curveWidth(), 0, 1), (ui.curveHeight() + ui.marginTop + ui.radius - event.offsetY) / ui.curveHeight()); @@ -121,7 +121,7 @@ _updateControlPosition(mouseX, mouseY) { var deltaX = (mouseX - this._mouseDownPosition.x) / this._curveUI.curveWidth(); var deltaY = (mouseY - this._mouseDownPosition.y) / this._curveUI.curveHeight(); - var newPosition = new WebInspector.Geometry.Point( + var newPosition = new Common.Geometry.Point( Number.constrain(this._controlPosition.x + deltaX, 0, 1), this._controlPosition.y - deltaY); this._bezier.controlPoints[this._selectedPoint] = newPosition; } @@ -145,13 +145,13 @@ /** * @param {!Array<{name: string, value: string}>} presetGroup - * @return {!WebInspector.BezierEditor.PresetCategory} + * @return {!UI.BezierEditor.PresetCategory} */ _createCategory(presetGroup) { var presetElement = createElementWithClass('div', 'bezier-preset-category'); var iconElement = presetElement.createSVGChild('svg', 'bezier-preset monospace'); var category = {presets: presetGroup, presetIndex: 0, icon: presetElement}; - this._presetUI.drawCurve(WebInspector.Geometry.CubicBezier.parse(category.presets[0].value), iconElement); + this._presetUI.drawCurve(Common.Geometry.CubicBezier.parse(category.presets[0].value), iconElement); iconElement.addEventListener('click', this._presetCategorySelected.bind(this, category)); return category; } @@ -179,7 +179,7 @@ } /** - * @param {!WebInspector.BezierEditor.PresetCategory} category + * @param {!UI.BezierEditor.PresetCategory} category * @param {!Event=} event */ _presetCategorySelected(category, event) { @@ -189,7 +189,7 @@ this._header.classList.add('bezier-header-active'); this._selectedCategory = category; this._selectedCategory.icon.classList.add('bezier-preset-selected'); - this.setBezier(WebInspector.Geometry.CubicBezier.parse(category.presets[category.presetIndex].value)); + this.setBezier(Common.Geometry.CubicBezier.parse(category.presets[category.presetIndex].value)); this._onchange(); this._startPreviewAnimation(); if (event) @@ -206,7 +206,7 @@ var length = this._selectedCategory.presets.length; this._selectedCategory.presetIndex = (this._selectedCategory.presetIndex + (intensify ? 1 : -1) + length) % length; - this.setBezier(WebInspector.Geometry.CubicBezier.parse( + this.setBezier(Common.Geometry.CubicBezier.parse( this._selectedCategory.presets[this._selectedCategory.presetIndex].value)); this._onchange(); this._startPreviewAnimation(); @@ -238,11 +238,11 @@ }; /** @enum {symbol} */ -WebInspector.BezierEditor.Events = { +UI.BezierEditor.Events = { BezierChanged: Symbol('BezierChanged') }; -WebInspector.BezierEditor.Presets = [ +UI.BezierEditor.Presets = [ [ {name: 'ease-in-out', value: 'ease-in-out'}, {name: 'In Out · Sine', value: 'cubic-bezier(0.45, 0.05, 0.55, 0.95)'}, {name: 'In Out · Quadratic', value: 'cubic-bezier(0.46, 0.03, 0.52, 0.96)'}, @@ -267,4 +267,4 @@ ]; /** @typedef {{presets: !Array.<{name: string, value: string}>, icon: !Element, presetIndex: number}} */ -WebInspector.BezierEditor.PresetCategory; +UI.BezierEditor.PresetCategory;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/BezierUI.js b/third_party/WebKit/Source/devtools/front_end/ui/BezierUI.js index 28a1d496..7eafd70 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/BezierUI.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/BezierUI.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.BezierUI = class { +UI.BezierUI = class { /** * @param {number} width * @param {number} height @@ -21,12 +21,12 @@ } /** - * @param {!WebInspector.Geometry.CubicBezier} bezier + * @param {!Common.Geometry.CubicBezier} bezier * @param {!Element} path * @param {number} width */ static drawVelocityChart(bezier, path, width) { - var height = WebInspector.BezierUI.Height; + var height = UI.BezierUI.Height; var pathBuilder = ['M', 0, height]; /** @const */ var sampleSize = 1 / 40; @@ -89,7 +89,7 @@ } /** - * @param {?WebInspector.Geometry.CubicBezier} bezier + * @param {?Common.Geometry.CubicBezier} bezier * @param {!Element} svg */ drawCurve(bezier, svg) { @@ -107,13 +107,13 @@ var curve = group.createSVGChild('path', 'bezier-path'); var curvePoints = [ - new WebInspector.Geometry.Point( + new Common.Geometry.Point( bezier.controlPoints[0].x * width + this.radius, (1 - bezier.controlPoints[0].y) * height + this.radius + this.marginTop), - new WebInspector.Geometry.Point( + new Common.Geometry.Point( bezier.controlPoints[1].x * width + this.radius, (1 - bezier.controlPoints[1].y) * height + this.radius + this.marginTop), - new WebInspector.Geometry.Point(width + this.radius, this.marginTop + this.radius) + new Common.Geometry.Point(width + this.radius, this.marginTop + this.radius) ]; curve.setAttribute( 'd', 'M' + this.radius + ',' + (height + this.radius + this.marginTop) + ' C' + curvePoints.join(' ')); @@ -125,4 +125,4 @@ } }; -WebInspector.BezierUI.Height = 26; +UI.BezierUI.Height = 26;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/CSSShadowEditor.js b/third_party/WebKit/Source/devtools/front_end/ui/CSSShadowEditor.js index d0f625f..f9c61315 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/CSSShadowEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/CSSShadowEditor.js
@@ -4,42 +4,42 @@ /** * @unrestricted */ -WebInspector.CSSShadowEditor = class extends WebInspector.VBox { +UI.CSSShadowEditor = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('ui/cssShadowEditor.css'); this.contentElement.tabIndex = 0; this._typeField = this.contentElement.createChild('div', 'shadow-editor-field'); - this._typeField.createChild('label', 'shadow-editor-label').textContent = WebInspector.UIString('Type'); + this._typeField.createChild('label', 'shadow-editor-label').textContent = Common.UIString('Type'); this._outsetButton = this._typeField.createChild('button', 'shadow-editor-button-left'); - this._outsetButton.textContent = WebInspector.UIString('Outset'); + this._outsetButton.textContent = Common.UIString('Outset'); this._outsetButton.addEventListener('click', this._onButtonClick.bind(this), false); this._insetButton = this._typeField.createChild('button', 'shadow-editor-button-right'); - this._insetButton.textContent = WebInspector.UIString('Inset'); + this._insetButton.textContent = Common.UIString('Inset'); this._insetButton.addEventListener('click', this._onButtonClick.bind(this), false); var xField = this.contentElement.createChild('div', 'shadow-editor-field'); - this._xInput = this._createTextInput(xField, WebInspector.UIString('X offset')); + this._xInput = this._createTextInput(xField, Common.UIString('X offset')); var yField = this.contentElement.createChild('div', 'shadow-editor-field'); - this._yInput = this._createTextInput(yField, WebInspector.UIString('Y offset')); + this._yInput = this._createTextInput(yField, Common.UIString('Y offset')); this._xySlider = xField.createChild('canvas', 'shadow-editor-2D-slider'); - this._xySlider.width = WebInspector.CSSShadowEditor.canvasSize; - this._xySlider.height = WebInspector.CSSShadowEditor.canvasSize; + this._xySlider.width = UI.CSSShadowEditor.canvasSize; + this._xySlider.height = UI.CSSShadowEditor.canvasSize; this._xySlider.tabIndex = -1; - this._halfCanvasSize = WebInspector.CSSShadowEditor.canvasSize / 2; - this._innerCanvasSize = this._halfCanvasSize - WebInspector.CSSShadowEditor.sliderThumbRadius; - WebInspector.installDragHandle( + this._halfCanvasSize = UI.CSSShadowEditor.canvasSize / 2; + this._innerCanvasSize = this._halfCanvasSize - UI.CSSShadowEditor.sliderThumbRadius; + UI.installDragHandle( this._xySlider, this._dragStart.bind(this), this._dragMove.bind(this), null, 'default'); this._xySlider.addEventListener('keydown', this._onCanvasArrowKey.bind(this), false); this._xySlider.addEventListener('blur', this._onCanvasBlur.bind(this), false); var blurField = this.contentElement.createChild('div', 'shadow-editor-blur-field'); - this._blurInput = this._createTextInput(blurField, WebInspector.UIString('Blur')); + this._blurInput = this._createTextInput(blurField, Common.UIString('Blur')); this._blurSlider = this._createSlider(blurField); this._spreadField = this.contentElement.createChild('div', 'shadow-editor-field'); - this._spreadInput = this._createTextInput(this._spreadField, WebInspector.UIString('Spread')); + this._spreadInput = this._createTextInput(this._spreadField, Common.UIString('Spread')); this._spreadSlider = this._createSlider(this._spreadField); } @@ -67,7 +67,7 @@ * @return {!Element} */ _createSlider(field) { - var slider = createSliderLabel(0, WebInspector.CSSShadowEditor.maxRange, -1); + var slider = createSliderLabel(0, UI.CSSShadowEditor.maxRange, -1); slider.addEventListener('input', this._onSliderInput.bind(this), false); field.appendChild(slider); return slider; @@ -81,7 +81,7 @@ } /** - * @param {!WebInspector.CSSShadowModel} model + * @param {!Common.CSSShadowModel} model */ setModel(model) { this._model = model; @@ -119,9 +119,9 @@ context.strokeStyle = 'rgba(210, 210, 210, 0.8)'; context.beginPath(); context.moveTo(this._halfCanvasSize, 0); - context.lineTo(this._halfCanvasSize, WebInspector.CSSShadowEditor.canvasSize); + context.lineTo(this._halfCanvasSize, UI.CSSShadowEditor.canvasSize); context.moveTo(0, this._halfCanvasSize); - context.lineTo(WebInspector.CSSShadowEditor.canvasSize, this._halfCanvasSize); + context.lineTo(UI.CSSShadowEditor.canvasSize, this._halfCanvasSize); context.stroke(); context.restore(); @@ -139,12 +139,12 @@ if (drawFocus) { context.beginPath(); context.fillStyle = 'rgba(66, 133, 244, 0.4)'; - context.arc(thumbPoint.x, thumbPoint.y, WebInspector.CSSShadowEditor.sliderThumbRadius + 2, 0, 2 * Math.PI); + context.arc(thumbPoint.x, thumbPoint.y, UI.CSSShadowEditor.sliderThumbRadius + 2, 0, 2 * Math.PI); context.fill(); } context.beginPath(); context.fillStyle = '#4285F4'; - context.arc(thumbPoint.x, thumbPoint.y, WebInspector.CSSShadowEditor.sliderThumbRadius, 0, 2 * Math.PI); + context.arc(thumbPoint.x, thumbPoint.y, UI.CSSShadowEditor.sliderThumbRadius, 0, 2 * Math.PI); context.fill(); context.restore(); } @@ -158,17 +158,17 @@ return; this._model.setInset(insetClicked); this._updateButtons(); - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } /** * @param {!Event} event */ _handleValueModification(event) { - var modifiedValue = WebInspector.createReplacementString(event.currentTarget.value, event, customNumberHandler); + var modifiedValue = UI.createReplacementString(event.currentTarget.value, event, customNumberHandler); if (!modifiedValue) return; - var length = WebInspector.CSSLength.parse(modifiedValue); + var length = Common.CSSLength.parse(modifiedValue); if (!length) return; if (event.currentTarget === this._blurInput && length.amount < 0) @@ -187,7 +187,7 @@ */ function customNumberHandler(prefix, number, suffix) { if (!suffix.length) - suffix = WebInspector.CSSShadowEditor.defaultUnit; + suffix = UI.CSSShadowEditor.defaultUnit; return prefix + number + suffix; } } @@ -198,7 +198,7 @@ _onTextInput(event) { this._changedElement = event.currentTarget; this._changedElement.classList.remove('invalid'); - var length = WebInspector.CSSLength.parse(event.currentTarget.value); + var length = Common.CSSLength.parse(event.currentTarget.value); if (!length || event.currentTarget === this._blurInput && length.amount < 0) return; if (event.currentTarget === this._xInput) { @@ -214,16 +214,16 @@ this._model.setSpreadRadius(length); this._spreadSlider.value = length.amount; } - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } _onTextBlur() { if (!this._changedElement) return; - var length = !this._changedElement.value.trim() ? WebInspector.CSSLength.zero() : - WebInspector.CSSLength.parse(this._changedElement.value); + var length = !this._changedElement.value.trim() ? Common.CSSLength.zero() : + Common.CSSLength.parse(this._changedElement.value); if (!length) - length = WebInspector.CSSLength.parse(this._changedElement.value + WebInspector.CSSShadowEditor.defaultUnit); + length = Common.CSSLength.parse(this._changedElement.value + UI.CSSShadowEditor.defaultUnit); if (!length) { this._changedElement.classList.add('invalid'); this._changedElement = null; @@ -239,7 +239,7 @@ this._updateCanvas(false); } else if (this._changedElement === this._blurInput) { if (length.amount < 0) - length = WebInspector.CSSLength.zero(); + length = Common.CSSLength.zero(); this._model.setBlurRadius(length); this._blurInput.value = length.asCSSText(); this._blurSlider.value = length.amount; @@ -249,7 +249,7 @@ this._spreadSlider.value = length.amount; } this._changedElement = null; - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } /** @@ -257,17 +257,17 @@ */ _onSliderInput(event) { if (event.currentTarget === this._blurSlider) { - this._model.setBlurRadius(new WebInspector.CSSLength( - this._blurSlider.value, this._model.blurRadius().unit || WebInspector.CSSShadowEditor.defaultUnit)); + this._model.setBlurRadius(new Common.CSSLength( + this._blurSlider.value, this._model.blurRadius().unit || UI.CSSShadowEditor.defaultUnit)); this._blurInput.value = this._model.blurRadius().asCSSText(); this._blurInput.classList.remove('invalid'); } else if (event.currentTarget === this._spreadSlider) { - this._model.setSpreadRadius(new WebInspector.CSSLength( - this._spreadSlider.value, this._model.spreadRadius().unit || WebInspector.CSSShadowEditor.defaultUnit)); + this._model.setSpreadRadius(new Common.CSSLength( + this._spreadSlider.value, this._model.spreadRadius().unit || UI.CSSShadowEditor.defaultUnit)); this._spreadInput.value = this._model.spreadRadius().asCSSText(); this._spreadInput.classList.remove('invalid'); } - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } /** @@ -277,12 +277,12 @@ _dragStart(event) { this._xySlider.focus(); this._updateCanvas(true); - this._canvasOrigin = new WebInspector.Geometry.Point( + this._canvasOrigin = new Common.Geometry.Point( this._xySlider.totalOffsetLeft() + this._halfCanvasSize, this._xySlider.totalOffsetTop() + this._halfCanvasSize); - var clickedPoint = new WebInspector.Geometry.Point(event.x - this._canvasOrigin.x, event.y - this._canvasOrigin.y); + var clickedPoint = new Common.Geometry.Point(event.x - this._canvasOrigin.x, event.y - this._canvasOrigin.y); var thumbPoint = this._sliderThumbPosition(); - if (clickedPoint.distanceTo(thumbPoint) >= WebInspector.CSSShadowEditor.sliderThumbRadius) + if (clickedPoint.distanceTo(thumbPoint) >= UI.CSSShadowEditor.sliderThumbRadius) this._dragMove(event); return true; } @@ -291,32 +291,32 @@ * @param {!MouseEvent} event */ _dragMove(event) { - var point = new WebInspector.Geometry.Point(event.x - this._canvasOrigin.x, event.y - this._canvasOrigin.y); + var point = new Common.Geometry.Point(event.x - this._canvasOrigin.x, event.y - this._canvasOrigin.y); if (event.shiftKey) point = this._snapToClosestDirection(point); var constrainedPoint = this._constrainPoint(point, this._innerCanvasSize); - var newX = Math.round((constrainedPoint.x / this._innerCanvasSize) * WebInspector.CSSShadowEditor.maxRange); - var newY = Math.round((constrainedPoint.y / this._innerCanvasSize) * WebInspector.CSSShadowEditor.maxRange); + var newX = Math.round((constrainedPoint.x / this._innerCanvasSize) * UI.CSSShadowEditor.maxRange); + var newY = Math.round((constrainedPoint.y / this._innerCanvasSize) * UI.CSSShadowEditor.maxRange); if (event.shiftKey) { this._model.setOffsetX( - new WebInspector.CSSLength(newX, this._model.offsetX().unit || WebInspector.CSSShadowEditor.defaultUnit)); + new Common.CSSLength(newX, this._model.offsetX().unit || UI.CSSShadowEditor.defaultUnit)); this._model.setOffsetY( - new WebInspector.CSSLength(newY, this._model.offsetY().unit || WebInspector.CSSShadowEditor.defaultUnit)); + new Common.CSSLength(newY, this._model.offsetY().unit || UI.CSSShadowEditor.defaultUnit)); } else { if (!event.altKey) this._model.setOffsetX( - new WebInspector.CSSLength(newX, this._model.offsetX().unit || WebInspector.CSSShadowEditor.defaultUnit)); - if (!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) + new Common.CSSLength(newX, this._model.offsetX().unit || UI.CSSShadowEditor.defaultUnit)); + if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(event)) this._model.setOffsetY( - new WebInspector.CSSLength(newY, this._model.offsetY().unit || WebInspector.CSSShadowEditor.defaultUnit)); + new Common.CSSLength(newY, this._model.offsetY().unit || UI.CSSShadowEditor.defaultUnit)); } this._xInput.value = this._model.offsetX().asCSSText(); this._yInput.value = this._model.offsetY().asCSSText(); this._xInput.classList.remove('invalid'); this._yInput.classList.remove('invalid'); this._updateCanvas(true); - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } _onCanvasBlur() { @@ -345,53 +345,53 @@ if (shiftX) { var offsetX = this._model.offsetX(); var newAmount = Number.constrain( - offsetX.amount + shiftX, -WebInspector.CSSShadowEditor.maxRange, WebInspector.CSSShadowEditor.maxRange); + offsetX.amount + shiftX, -UI.CSSShadowEditor.maxRange, UI.CSSShadowEditor.maxRange); if (newAmount === offsetX.amount) return; this._model.setOffsetX( - new WebInspector.CSSLength(newAmount, offsetX.unit || WebInspector.CSSShadowEditor.defaultUnit)); + new Common.CSSLength(newAmount, offsetX.unit || UI.CSSShadowEditor.defaultUnit)); this._xInput.value = this._model.offsetX().asCSSText(); this._xInput.classList.remove('invalid'); } if (shiftY) { var offsetY = this._model.offsetY(); var newAmount = Number.constrain( - offsetY.amount + shiftY, -WebInspector.CSSShadowEditor.maxRange, WebInspector.CSSShadowEditor.maxRange); + offsetY.amount + shiftY, -UI.CSSShadowEditor.maxRange, UI.CSSShadowEditor.maxRange); if (newAmount === offsetY.amount) return; this._model.setOffsetY( - new WebInspector.CSSLength(newAmount, offsetY.unit || WebInspector.CSSShadowEditor.defaultUnit)); + new Common.CSSLength(newAmount, offsetY.unit || UI.CSSShadowEditor.defaultUnit)); this._yInput.value = this._model.offsetY().asCSSText(); this._yInput.classList.remove('invalid'); } this._updateCanvas(true); - this.dispatchEventToListeners(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._model); + this.dispatchEventToListeners(UI.CSSShadowEditor.Events.ShadowChanged, this._model); } /** - * @param {!WebInspector.Geometry.Point} point + * @param {!Common.Geometry.Point} point * @param {number} max - * @return {!WebInspector.Geometry.Point} + * @return {!Common.Geometry.Point} */ _constrainPoint(point, max) { if (Math.abs(point.x) <= max && Math.abs(point.y) <= max) - return new WebInspector.Geometry.Point(point.x, point.y); + return new Common.Geometry.Point(point.x, point.y); return point.scale(max / Math.max(Math.abs(point.x), Math.abs(point.y))); } /** - * @param {!WebInspector.Geometry.Point} point - * @return {!WebInspector.Geometry.Point} + * @param {!Common.Geometry.Point} point + * @return {!Common.Geometry.Point} */ _snapToClosestDirection(point) { var minDistance = Number.MAX_VALUE; var closestPoint = point; var directions = [ - new WebInspector.Geometry.Point(0, -1), // North - new WebInspector.Geometry.Point(1, -1), // Northeast - new WebInspector.Geometry.Point(1, 0), // East - new WebInspector.Geometry.Point(1, 1) // Southeast + new Common.Geometry.Point(0, -1), // North + new Common.Geometry.Point(1, -1), // Northeast + new Common.Geometry.Point(1, 0), // East + new Common.Geometry.Point(1, 1) // Southeast ]; for (var direction of directions) { @@ -407,25 +407,25 @@ } /** - * @return {!WebInspector.Geometry.Point} + * @return {!Common.Geometry.Point} */ _sliderThumbPosition() { - var x = (this._model.offsetX().amount / WebInspector.CSSShadowEditor.maxRange) * this._innerCanvasSize; - var y = (this._model.offsetY().amount / WebInspector.CSSShadowEditor.maxRange) * this._innerCanvasSize; - return this._constrainPoint(new WebInspector.Geometry.Point(x, y), this._innerCanvasSize); + var x = (this._model.offsetX().amount / UI.CSSShadowEditor.maxRange) * this._innerCanvasSize; + var y = (this._model.offsetY().amount / UI.CSSShadowEditor.maxRange) * this._innerCanvasSize; + return this._constrainPoint(new Common.Geometry.Point(x, y), this._innerCanvasSize); } }; /** @enum {symbol} */ -WebInspector.CSSShadowEditor.Events = { +UI.CSSShadowEditor.Events = { ShadowChanged: Symbol('ShadowChanged') }; /** @type {number} */ -WebInspector.CSSShadowEditor.maxRange = 20; +UI.CSSShadowEditor.maxRange = 20; /** @type {string} */ -WebInspector.CSSShadowEditor.defaultUnit = 'px'; +UI.CSSShadowEditor.defaultUnit = 'px'; /** @type {number} */ -WebInspector.CSSShadowEditor.sliderThumbRadius = 6; +UI.CSSShadowEditor.sliderThumbRadius = 6; /** @type {number} */ -WebInspector.CSSShadowEditor.canvasSize = 88; +UI.CSSShadowEditor.canvasSize = 88;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js index 97fbd9e..45ef36e 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ColorSwatch.js
@@ -4,24 +4,24 @@ /** * @unrestricted */ -WebInspector.ColorSwatch = class extends HTMLSpanElement { +UI.ColorSwatch = class extends HTMLSpanElement { constructor() { super(); } /** - * @return {!WebInspector.ColorSwatch} + * @return {!UI.ColorSwatch} */ static create() { - if (!WebInspector.ColorSwatch._constructor) - WebInspector.ColorSwatch._constructor = - registerCustomElement('span', 'color-swatch', WebInspector.ColorSwatch.prototype); + if (!UI.ColorSwatch._constructor) + UI.ColorSwatch._constructor = + registerCustomElement('span', 'color-swatch', UI.ColorSwatch.prototype); - return /** @type {!WebInspector.ColorSwatch} */ (new WebInspector.ColorSwatch._constructor()); + return /** @type {!UI.ColorSwatch} */ (new UI.ColorSwatch._constructor()); } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color * @param {string} curFormat */ static _nextColorFormat(color, curFormat) { @@ -32,7 +32,7 @@ // * nickname (if the color has a nickname) // * shorthex (if has short hex) // * hex - var cf = WebInspector.Color.Format; + var cf = Common.Color.Format; switch (curFormat) { case cf.Original: @@ -69,14 +69,14 @@ } /** - * @return {!WebInspector.Color} color + * @return {!Common.Color} color */ color() { return this._color; } /** - * @param {!WebInspector.Color} color + * @param {!Common.Color} color */ setColor(color) { this._color = color; @@ -94,14 +94,14 @@ } /** - * @return {!WebInspector.Color.Format} + * @return {!Common.Color.Format} */ format() { return this._format; } /** - * @param {!WebInspector.Color.Format} format + * @param {!Common.Color.Format} format */ setFormat(format) { this._format = format; @@ -110,7 +110,7 @@ toggleNextFormat() { do { - this._format = WebInspector.ColorSwatch._nextColorFormat(this._color, this._format); + this._format = UI.ColorSwatch._nextColorFormat(this._color, this._format); var currentValue = this._color.asString(this._format); } while (currentValue === this._colorValueElement.textContent); this._colorValueElement.textContent = currentValue; @@ -127,10 +127,10 @@ * @override */ createdCallback() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/colorSwatch.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/colorSwatch.css'); this._iconElement = root.createChild('span', 'color-swatch'); - this._iconElement.title = WebInspector.UIString('Shift-click to change color format'); + this._iconElement.title = Common.UIString('Shift-click to change color format'); this._swatchInner = this._iconElement.createChild('span', 'color-swatch-inner'); this._swatchInner.addEventListener('dblclick', (e) => e.consume(), false); this._swatchInner.addEventListener('mousedown', (e) => e.consume(), false); @@ -155,20 +155,20 @@ /** * @unrestricted */ -WebInspector.BezierSwatch = class extends HTMLSpanElement { +UI.BezierSwatch = class extends HTMLSpanElement { constructor() { super(); } /** - * @return {!WebInspector.BezierSwatch} + * @return {!UI.BezierSwatch} */ static create() { - if (!WebInspector.BezierSwatch._constructor) - WebInspector.BezierSwatch._constructor = - registerCustomElement('span', 'bezier-swatch', WebInspector.BezierSwatch.prototype); + if (!UI.BezierSwatch._constructor) + UI.BezierSwatch._constructor = + registerCustomElement('span', 'bezier-swatch', UI.BezierSwatch.prototype); - return /** @type {!WebInspector.BezierSwatch} */ (new WebInspector.BezierSwatch._constructor()); + return /** @type {!UI.BezierSwatch} */ (new UI.BezierSwatch._constructor()); } /** @@ -203,8 +203,8 @@ * @override */ createdCallback() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/bezierSwatch.css'); - this._iconElement = WebInspector.Icon.create('smallicon-bezier', 'bezier-swatch-icon'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/bezierSwatch.css'); + this._iconElement = UI.Icon.create('smallicon-bezier', 'bezier-swatch-icon'); root.appendChild(this._iconElement); this._textElement = this.createChild('span'); root.createChild('content'); @@ -215,41 +215,41 @@ /** * @unrestricted */ -WebInspector.CSSShadowSwatch = class extends HTMLSpanElement { +UI.CSSShadowSwatch = class extends HTMLSpanElement { constructor() { super(); } /** - * @return {!WebInspector.CSSShadowSwatch} + * @return {!UI.CSSShadowSwatch} */ static create() { - if (!WebInspector.CSSShadowSwatch._constructor) - WebInspector.CSSShadowSwatch._constructor = - registerCustomElement('span', 'css-shadow-swatch', WebInspector.CSSShadowSwatch.prototype); + if (!UI.CSSShadowSwatch._constructor) + UI.CSSShadowSwatch._constructor = + registerCustomElement('span', 'css-shadow-swatch', UI.CSSShadowSwatch.prototype); - return /** @type {!WebInspector.CSSShadowSwatch} */ (new WebInspector.CSSShadowSwatch._constructor()); + return /** @type {!UI.CSSShadowSwatch} */ (new UI.CSSShadowSwatch._constructor()); } /** - * @return {!WebInspector.CSSShadowModel} cssShadowModel + * @return {!Common.CSSShadowModel} cssShadowModel */ model() { return this._model; } /** - * @param {!WebInspector.CSSShadowModel} model + * @param {!Common.CSSShadowModel} model */ setCSSShadow(model) { this._model = model; this._contentElement.removeChildren(); - var results = WebInspector.TextUtils.splitStringByRegexes(model.asCSSText(), [/inset/g, WebInspector.Color.Regex]); + var results = Common.TextUtils.splitStringByRegexes(model.asCSSText(), [/inset/g, Common.Color.Regex]); for (var i = 0; i < results.length; i++) { var result = results[i]; if (result.regexIndex === 1) { if (!this._colorSwatch) - this._colorSwatch = WebInspector.ColorSwatch.create(); + this._colorSwatch = UI.ColorSwatch.create(); this._colorSwatch.setColor(model.color()); this._contentElement.appendChild(this._colorSwatch); } else { @@ -273,7 +273,7 @@ } /** - * @return {?WebInspector.ColorSwatch} + * @return {?UI.ColorSwatch} */ colorSwatch() { return this._colorSwatch; @@ -283,8 +283,8 @@ * @override */ createdCallback() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/cssShadowSwatch.css'); - this._iconElement = WebInspector.Icon.create('smallicon-shadow', 'shadow-swatch-icon'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/cssShadowSwatch.css'); + this._iconElement = UI.Icon.create('smallicon-shadow', 'shadow-swatch-icon'); root.appendChild(this._iconElement); root.createChild('content'); this._contentElement = this.createChild('span');
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Context.js b/third_party/WebKit/Source/devtools/front_end/ui/Context.js index 5b6196a2..7be8c1d 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Context.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Context.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.Context = class { +UI.Context = class { constructor() { this._flavors = new Map(); this._eventDispatchers = new Map(); @@ -33,42 +33,42 @@ * @template T */ _dispatchFlavorChange(flavorType, flavorValue) { - for (var extension of self.runtime.extensions(WebInspector.ContextFlavorListener)) { + for (var extension of self.runtime.extensions(UI.ContextFlavorListener)) { if (extension.hasContextType(flavorType)) extension.instance().then( - instance => /** @type {!WebInspector.ContextFlavorListener} */ (instance).flavorChanged(flavorValue)); + instance => /** @type {!UI.ContextFlavorListener} */ (instance).flavorChanged(flavorValue)); } var dispatcher = this._eventDispatchers.get(flavorType); if (!dispatcher) return; - dispatcher.dispatchEventToListeners(WebInspector.Context.Events.FlavorChanged, flavorValue); + dispatcher.dispatchEventToListeners(UI.Context.Events.FlavorChanged, flavorValue); } /** * @param {function(new:Object, ...)} flavorType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ addFlavorChangeListener(flavorType, listener, thisObject) { var dispatcher = this._eventDispatchers.get(flavorType); if (!dispatcher) { - dispatcher = new WebInspector.Object(); + dispatcher = new Common.Object(); this._eventDispatchers.set(flavorType, dispatcher); } - dispatcher.addEventListener(WebInspector.Context.Events.FlavorChanged, listener, thisObject); + dispatcher.addEventListener(UI.Context.Events.FlavorChanged, listener, thisObject); } /** * @param {function(new:Object, ...)} flavorType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject */ removeFlavorChangeListener(flavorType, listener, thisObject) { var dispatcher = this._eventDispatchers.get(flavorType); if (!dispatcher) return; - dispatcher.removeEventListener(WebInspector.Context.Events.FlavorChanged, listener, thisObject); - if (!dispatcher.hasEventListeners(WebInspector.Context.Events.FlavorChanged)) + dispatcher.removeEventListener(UI.Context.Events.FlavorChanged, listener, thisObject); + if (!dispatcher.hasEventListeners(UI.Context.Events.FlavorChanged)) this._eventDispatchers.remove(flavorType); } @@ -106,20 +106,20 @@ }; /** @enum {symbol} */ -WebInspector.Context.Events = { +UI.Context.Events = { FlavorChanged: Symbol('FlavorChanged') }; /** * @interface */ -WebInspector.ContextFlavorListener = function() {}; +UI.ContextFlavorListener = function() {}; -WebInspector.ContextFlavorListener.prototype = { +UI.ContextFlavorListener.prototype = { /** * @param {?Object} object */ flavorChanged: function(object) {} }; -WebInspector.context = new WebInspector.Context(); +UI.context = new UI.Context();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js index eba6a26..b91fdc6 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.ContextMenuItem = class { +UI.ContextMenuItem = class { /** - * @param {?WebInspector.ContextMenu} topLevelMenu + * @param {?UI.ContextMenu} topLevelMenu * @param {string} type * @param {string=} label * @param {boolean=} disabled @@ -108,15 +108,15 @@ /** * @unrestricted */ -WebInspector.ContextSubMenuItem = class extends WebInspector.ContextMenuItem { +UI.ContextSubMenuItem = class extends UI.ContextMenuItem { /** - * @param {?WebInspector.ContextMenu} topLevelMenu + * @param {?UI.ContextMenu} topLevelMenu * @param {string=} label * @param {boolean=} disabled */ constructor(topLevelMenu, label, disabled) { super(topLevelMenu, 'subMenu', label, disabled); - /** @type {!Array.<!WebInspector.ContextMenuItem>} */ + /** @type {!Array.<!UI.ContextMenuItem>} */ this._items = []; } @@ -124,10 +124,10 @@ * @param {string} label * @param {function(?)} handler * @param {boolean=} disabled - * @return {!WebInspector.ContextMenuItem} + * @return {!UI.ContextMenuItem} */ appendItem(label, handler, disabled) { - var item = new WebInspector.ContextMenuItem(this._contextMenu, 'item', label, disabled); + var item = new UI.ContextMenuItem(this._contextMenu, 'item', label, disabled); this._pushItem(item); this._contextMenu._setHandler(item.id(), handler); return item; @@ -135,10 +135,10 @@ /** * @param {!Element} element - * @return {!WebInspector.ContextMenuItem} + * @return {!UI.ContextMenuItem} */ appendCustomItem(element) { - var item = new WebInspector.ContextMenuItem(this._contextMenu, 'item', '<custom>'); + var item = new UI.ContextMenuItem(this._contextMenu, 'item', '<custom>'); item._customElement = element; this._pushItem(item); return item; @@ -147,14 +147,14 @@ /** * @param {string} actionId * @param {string=} label - * @return {!WebInspector.ContextMenuItem} + * @return {!UI.ContextMenuItem} */ appendAction(actionId, label) { - var action = WebInspector.actionRegistry.action(actionId); + var action = UI.actionRegistry.action(actionId); if (!label) label = action.title(); var result = this.appendItem(label, action.execute.bind(action)); - var shortcut = WebInspector.shortcutRegistry.shortcutTitleForAction(actionId); + var shortcut = UI.shortcutRegistry.shortcutTitleForAction(actionId); if (shortcut) result.setShortcut(shortcut); return result; @@ -164,10 +164,10 @@ * @param {string} label * @param {boolean=} disabled * @param {string=} subMenuId - * @return {!WebInspector.ContextSubMenuItem} + * @return {!UI.ContextSubMenuItem} */ appendSubMenuItem(label, disabled, subMenuId) { - var item = new WebInspector.ContextSubMenuItem(this._contextMenu, label, disabled); + var item = new UI.ContextSubMenuItem(this._contextMenu, label, disabled); if (subMenuId) this._contextMenu._namedSubMenus.set(subMenuId, item); this._pushItem(item); @@ -179,10 +179,10 @@ * @param {function()} handler * @param {boolean=} checked * @param {boolean=} disabled - * @return {!WebInspector.ContextMenuItem} + * @return {!UI.ContextMenuItem} */ appendCheckboxItem(label, handler, checked, disabled) { - var item = new WebInspector.ContextMenuItem(this._contextMenu, 'checkbox', label, disabled, checked); + var item = new UI.ContextMenuItem(this._contextMenu, 'checkbox', label, disabled, checked); this._pushItem(item); this._contextMenu._setHandler(item.id(), handler); return item; @@ -194,11 +194,11 @@ } /** - * @param {!WebInspector.ContextMenuItem} item + * @param {!UI.ContextMenuItem} item */ _pushItem(item) { if (this._pendingSeparator) { - this._items.push(new WebInspector.ContextMenuItem(this._contextMenu, 'separator')); + this._items.push(new UI.ContextMenuItem(this._contextMenu, 'separator')); delete this._pendingSeparator; } this._items.push(item); @@ -227,7 +227,7 @@ */ appendItemsAtLocation(location) { /** - * @param {!WebInspector.ContextSubMenuItem} menu + * @param {!UI.ContextSubMenuItem} menu * @param {!Runtime.Extension} extension */ function appendExtension(menu, extension) { @@ -276,7 +276,7 @@ /** * @unrestricted */ -WebInspector.ContextMenu = class extends WebInspector.ContextSubMenuItem { +UI.ContextMenu = class extends UI.ContextSubMenuItem { /** * @param {!Event} event * @param {boolean=} useSoftMenu @@ -286,7 +286,7 @@ constructor(event, useSoftMenu, x, y) { super(null, ''); this._contextMenu = this; - /** @type {!Array.<!Promise.<!Array.<!WebInspector.ContextMenu.Provider>>>} */ + /** @type {!Array.<!Promise.<!Array.<!UI.ContextMenu.Provider>>>} */ this._pendingPromises = []; /** @type {!Array<!Object>} */ this._pendingTargets = []; @@ -296,17 +296,17 @@ this._y = y === undefined ? event.y : y; this._handlers = {}; this._id = 0; - /** @type {!Map<string, !WebInspector.ContextSubMenuItem>} */ + /** @type {!Map<string, !UI.ContextSubMenuItem>} */ this._namedSubMenus = new Map(); } static initialize() { InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SetUseSoftMenu, setUseSoftMenu); /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ function setUseSoftMenu(event) { - WebInspector.ContextMenu._useSoftMenu = /** @type {boolean} */ (event.data); + UI.ContextMenu._useSoftMenu = /** @type {boolean} */ (event.data); } } @@ -320,7 +320,7 @@ * @param {!Event} event */ function handler(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); contextMenu.appendApplicableItems(/** @type {!Object} */ (event.deepElementFromPoint())); contextMenu.show(); } @@ -342,23 +342,23 @@ show() { Promise.all(this._pendingPromises).then(populate.bind(this)).then(this._innerShow.bind(this)); - WebInspector.ContextMenu._pendingMenu = this; + UI.ContextMenu._pendingMenu = this; /** - * @param {!Array.<!Array.<!WebInspector.ContextMenu.Provider>>} appendCallResults - * @this {WebInspector.ContextMenu} + * @param {!Array.<!Array.<!UI.ContextMenu.Provider>>} appendCallResults + * @this {UI.ContextMenu} */ function populate(appendCallResults) { - if (WebInspector.ContextMenu._pendingMenu !== this) + if (UI.ContextMenu._pendingMenu !== this) return; - delete WebInspector.ContextMenu._pendingMenu; + delete UI.ContextMenu._pendingMenu; for (var i = 0; i < appendCallResults.length; ++i) { var providers = appendCallResults[i]; var target = this._pendingTargets[i]; for (var j = 0; j < providers.length; ++j) { - var provider = /** @type {!WebInspector.ContextMenu.Provider} */ (providers[j]); + var provider = /** @type {!UI.ContextMenu.Provider} */ (providers[j]); this.appendSeparator(); provider.appendApplicableItems(this._event, this, target); this.appendSeparator(); @@ -385,15 +385,15 @@ var menuObject = this._buildDescriptors(); - WebInspector._contextMenu = this; - if (this._useSoftMenu || WebInspector.ContextMenu._useSoftMenu || InspectorFrontendHost.isHostedMode()) { - this._softMenu = new WebInspector.SoftContextMenu(menuObject, this._itemSelected.bind(this)); + UI._contextMenu = this; + if (this._useSoftMenu || UI.ContextMenu._useSoftMenu || InspectorFrontendHost.isHostedMode()) { + this._softMenu = new UI.SoftContextMenu(menuObject, this._itemSelected.bind(this)); this._softMenu.show(this._event.target.ownerDocument, this._x, this._y); } else { InspectorFrontendHost.showContextMenuAtPoint(this._x, this._y, menuObject, this._event.target.ownerDocument); /** - * @this {WebInspector.ContextMenu} + * @this {UI.ContextMenu} */ function listenToEvents() { InspectorFrontendHost.events.addEventListener( @@ -428,7 +428,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onItemSelected(event) { this._itemSelected(/** @type {string} */ (event.data)); @@ -454,13 +454,13 @@ * @param {!Object} target */ appendApplicableItems(target) { - this._pendingPromises.push(self.runtime.allInstances(WebInspector.ContextMenu.Provider, target)); + this._pendingPromises.push(self.runtime.allInstances(UI.ContextMenu.Provider, target)); this._pendingTargets.push(target); } /** * @param {string} name - * @return {?WebInspector.ContextSubMenuItem} + * @return {?UI.ContextSubMenuItem} */ namedSubMenu(name) { return this._namedSubMenus.get(name) || null; @@ -471,12 +471,12 @@ /** * @interface */ -WebInspector.ContextMenu.Provider = function() {}; +UI.ContextMenu.Provider = function() {}; -WebInspector.ContextMenu.Provider.prototype = { +UI.ContextMenu.Provider.prototype = { /** * @param {!Event} event - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu * @param {!Object} target */ appendApplicableItems: function(event, contextMenu, target) {}
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/DOMSyntaxHighlighter.js b/third_party/WebKit/Source/devtools/front_end/ui/DOMSyntaxHighlighter.js index 5fafc9b..f09a3e91 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/DOMSyntaxHighlighter.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/DOMSyntaxHighlighter.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.DOMSyntaxHighlighter = class { +UI.DOMSyntaxHighlighter = class { /** * @param {string} mimeType * @param {boolean} stripExtraWhitespace @@ -64,11 +64,11 @@ var plainTextStart; var line; - return self.runtime.extension(WebInspector.TokenizerFactory).instance().then(processTokens.bind(this)); + return self.runtime.extension(Common.TokenizerFactory).instance().then(processTokens.bind(this)); /** - * @param {!WebInspector.TokenizerFactory} tokenizerFactory - * @this {WebInspector.DOMSyntaxHighlighter} + * @param {!Common.TokenizerFactory} tokenizerFactory + * @this {UI.DOMSyntaxHighlighter} */ function processTokens(tokenizerFactory) { node.removeChildren(); @@ -91,7 +91,7 @@ * @param {?string} tokenType * @param {number} column * @param {number} newColumn - * @this {WebInspector.DOMSyntaxHighlighter} + * @this {UI.DOMSyntaxHighlighter} */ function processToken(token, tokenType, column, newColumn) { if (!tokenType)
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js index 6b3254f8..43150d5b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.Dialog = class extends WebInspector.Widget { +UI.Dialog = class extends UI.Widget { constructor() { super(true); this.markAsRoot(); @@ -52,49 +52,49 @@ * @return {boolean} */ static hasInstance() { - return !!WebInspector.Dialog._instance; + return !!UI.Dialog._instance; } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ static setModalHostView(view) { - WebInspector.Dialog._modalHostView = view; + UI.Dialog._modalHostView = view; } /** * FIXME: make utility method in Dialog, so clients use it instead of this getter. * Method should be like Dialog.showModalElement(position params, reposition callback). - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ static modalHostView() { - return WebInspector.Dialog._modalHostView; + return UI.Dialog._modalHostView; } static modalHostRepositioned() { - if (WebInspector.Dialog._instance) - WebInspector.Dialog._instance._position(); + if (UI.Dialog._instance) + UI.Dialog._instance._position(); } /** * @override */ show() { - if (WebInspector.Dialog._instance) - WebInspector.Dialog._instance.detach(); - WebInspector.Dialog._instance = this; + if (UI.Dialog._instance) + UI.Dialog._instance.detach(); + UI.Dialog._instance = this; - var document = /** @type {!Document} */ (WebInspector.Dialog._modalHostView.element.ownerDocument); + var document = /** @type {!Document} */ (UI.Dialog._modalHostView.element.ownerDocument); this._disableTabIndexOnElements(document); - this._glassPane = new WebInspector.GlassPane(document, this._dimmed); + this._glassPane = new UI.GlassPane(document, this._dimmed); this._glassPane.element.addEventListener('click', this._onGlassPaneClick.bind(this), false); this.element.ownerDocument.body.addEventListener('keydown', this._keyDownBound, false); super.show(this._glassPane.element); this._position(); - this._focusRestorer = new WebInspector.WidgetFocusRestorer(this); + this._focusRestorer = new UI.WidgetFocusRestorer(this); } /** @@ -111,7 +111,7 @@ this._restoreTabIndexOnElements(); - delete WebInspector.Dialog._instance; + delete UI.Dialog._instance; } addCloseButton() { @@ -195,7 +195,7 @@ } _position() { - var container = WebInspector.Dialog._modalHostView.element; + var container = UI.Dialog._modalHostView.element; var width = container.offsetWidth - 10; var height = container.offsetHeight - 10; @@ -235,7 +235,7 @@ * @param {!Event} event */ _onKeyDown(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code) { + if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) { event.consume(true); this.detach(); } @@ -244,7 +244,7 @@ /** @type {?Element} */ -WebInspector.Dialog._previousFocusedElement = null; +UI.Dialog._previousFocusedElement = null; -/** @type {?WebInspector.Widget} */ -WebInspector.Dialog._modalHostView = null; +/** @type {?UI.Widget} */ +UI.Dialog._modalHostView = null;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js index d4bb15b..9ee2469 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
@@ -4,13 +4,13 @@ /** * @unrestricted */ -WebInspector.DropDownMenu = class extends WebInspector.Object { +UI.DropDownMenu = class extends Common.Object { /** * @param {!Element} element */ constructor(element) { super(); - /** @type {!Array.<!WebInspector.DropDownMenu.Item>} */ + /** @type {!Array.<!UI.DropDownMenu.Item>} */ this._items = []; element.addEventListener('mousedown', this._onMouseDown.bind(this)); @@ -22,7 +22,7 @@ _onMouseDown(event) { if (event.which !== 1) return; - var menu = new WebInspector.ContextMenu(event); + var menu = new UI.ContextMenu(event); for (var item of this._items) menu.appendCheckboxItem(item.title, this._itemHandler.bind(this, item.id), item.id === this._selectedItemId); menu.show(); @@ -32,7 +32,7 @@ * @param {string} id */ _itemHandler(id) { - this.dispatchEventToListeners(WebInspector.DropDownMenu.Events.ItemSelected, id); + this.dispatchEventToListeners(UI.DropDownMenu.Events.ItemSelected, id); } /** @@ -57,9 +57,9 @@ }; /** @typedef {{id: string, title: string}} */ -WebInspector.DropDownMenu.Item; +UI.DropDownMenu.Item; /** @enum {symbol} */ -WebInspector.DropDownMenu.Events = { +UI.DropDownMenu.Events = { ItemSelected: Symbol('ItemSelected') };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/DropTarget.js b/third_party/WebKit/Source/devtools/front_end/ui/DropTarget.js index c6b914d..4c5b61b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/DropTarget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/DropTarget.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.DropTarget = class { +UI.DropTarget = class { /** * @param {!Element} element * @param {!Array.<string>} transferTypes @@ -59,7 +59,7 @@ if (this._dragMaskElement) return; this._dragMaskElement = this._element.createChild('div', ''); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(this._dragMaskElement, 'ui/dropTarget.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(this._dragMaskElement, 'ui/dropTarget.css'); shadowRoot.createChild('div', 'drop-target-message').textContent = this._messageText; this._dragMaskElement.addEventListener('drop', this._onDrop.bind(this), true); this._dragMaskElement.addEventListener('dragleave', this._onDragLeave.bind(this), true); @@ -89,7 +89,7 @@ } }; -WebInspector.DropTarget.Types = { +UI.DropTarget.Types = { Files: 'Files', URIList: 'text/uri-list' };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js index 15dab92c..94bde926 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.EmptyWidget = class extends WebInspector.VBox { +UI.EmptyWidget = class extends UI.VBox { constructor(text) { super(); this.registerRequiredCSS('ui/emptyWidget.css');
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js index 4fbec7ed..162b64e 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.FilterBar = class extends WebInspector.HBox { +UI.FilterBar = class extends UI.HBox { /** * @param {string} name * @param {boolean=} visibleByDefault @@ -43,29 +43,29 @@ this._enabled = true; this.element.classList.add('filter-bar'); - this._filterButton = new WebInspector.ToolbarToggle(WebInspector.UIString('Filter'), 'largeicon-filter'); + this._filterButton = new UI.ToolbarToggle(Common.UIString('Filter'), 'largeicon-filter'); this._filterButton.addEventListener('click', this._handleFilterButtonClick, this); this._filters = []; - this._stateSetting = WebInspector.settings.createSetting('filterBar-' + name + '-toggled', !!visibleByDefault); + this._stateSetting = Common.settings.createSetting('filterBar-' + name + '-toggled', !!visibleByDefault); this._setState(this._stateSetting.get()); } /** - * @return {!WebInspector.ToolbarButton} + * @return {!UI.ToolbarButton} */ filterButton() { return this._filterButton; } /** - * @param {!WebInspector.FilterUI} filter + * @param {!UI.FilterUI} filter */ addFilter(filter) { this._filters.push(filter); this.element.appendChild(filter.element()); - filter.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._filterChanged, this); + filter.addEventListener(UI.FilterUI.Events.FilterChanged, this._filterChanged, this); this._updateFilterButton(); } @@ -88,7 +88,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _filterChanged(event) { this._updateFilterButton(); @@ -99,8 +99,8 @@ this.element.classList.toggle('hidden', !visible); if (visible) { for (var i = 0; i < this._filters.length; ++i) { - if (this._filters[i] instanceof WebInspector.TextFilterUI) { - var textFilterUI = /** @type {!WebInspector.TextFilterUI} */ (this._filters[i]); + if (this._filters[i] instanceof UI.TextFilterUI) { + var textFilterUI = /** @type {!UI.TextFilterUI} */ (this._filters[i]); textFilterUI.focus(); } } @@ -122,7 +122,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _handleFilterButtonClick(event) { this._setState(!this._filtersShown); @@ -141,7 +141,7 @@ this._updateFilterButton(); this._updateFilterBar(); - this.dispatchEventToListeners(WebInspector.FilterBar.Events.Toggled); + this.dispatchEventToListeners(UI.FilterBar.Events.Toggled); } clear() { @@ -151,29 +151,29 @@ } }; -WebInspector.FilterBar.FilterBarState = { +UI.FilterBar.FilterBarState = { Inactive: 'inactive', Active: 'active', Shown: 'on' }; /** @enum {symbol} */ -WebInspector.FilterBar.Events = { +UI.FilterBar.Events = { Toggled: Symbol('Toggled') }; /** * @interface - * @extends {WebInspector.EventTarget} + * @extends {Common.EventTarget} */ -WebInspector.FilterUI = function() {}; +UI.FilterUI = function() {}; /** @enum {symbol} */ -WebInspector.FilterUI.Events = { +UI.FilterUI.Events = { FilterChanged: Symbol('FilterChanged') }; -WebInspector.FilterUI.prototype = { +UI.FilterUI.prototype = { /** * @return {boolean} */ @@ -186,11 +186,11 @@ }; /** - * @implements {WebInspector.FilterUI} - * @implements {WebInspector.SuggestBoxDelegate} + * @implements {UI.FilterUI} + * @implements {UI.SuggestBoxDelegate} * @unrestricted */ -WebInspector.TextFilterUI = class extends WebInspector.Object { +UI.TextFilterUI = class extends Common.Object { /** * @param {boolean=} supportRegex */ @@ -204,21 +204,21 @@ this._filterInputElement = /** @type {!HTMLInputElement} */ (this._filterElement.createChild('input', 'filter-input-field')); - this._filterInputElement.placeholder = WebInspector.UIString('Filter'); + this._filterInputElement.placeholder = Common.UIString('Filter'); this._filterInputElement.id = 'filter-input-field'; this._filterInputElement.addEventListener('input', this._onInput.bind(this), false); this._filterInputElement.addEventListener('change', this._onChange.bind(this), false); this._filterInputElement.addEventListener('keydown', this._onInputKeyDown.bind(this), true); this._filterInputElement.addEventListener('blur', this._onBlur.bind(this), true); - /** @type {?WebInspector.TextFilterUI.SuggestionBuilder} */ + /** @type {?UI.TextFilterUI.SuggestionBuilder} */ this._suggestionBuilder = null; - this._suggestBox = new WebInspector.SuggestBox(this); + this._suggestBox = new UI.SuggestBox(this); if (this._supportRegex) { this._filterElement.classList.add('supports-regex'); - var label = createCheckboxLabel(WebInspector.UIString('Regex')); + var label = createCheckboxLabel(Common.UIString('Regex')); this._regexCheckBox = label.checkboxElement; this._regexCheckBox.id = 'text-filter-regex'; this._regexCheckBox.addEventListener('change', this._onInput.bind(this), false); @@ -308,7 +308,7 @@ } /** - * @param {?WebInspector.TextFilterUI.SuggestionBuilder} suggestionBuilder + * @param {?UI.TextFilterUI.SuggestionBuilder} suggestionBuilder */ setSuggestionBuilder(suggestionBuilder) { this._cancelSuggestion(); @@ -365,7 +365,7 @@ } _dispatchFilterChanged() { - this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged, null); + this.dispatchEventToListeners(UI.FilterUI.Events.FilterChanged, null); } /** @@ -416,9 +416,9 @@ /** * @interface */ -WebInspector.TextFilterUI.SuggestionBuilder = function() {}; +UI.TextFilterUI.SuggestionBuilder = function() {}; -WebInspector.TextFilterUI.SuggestionBuilder.prototype = { +UI.TextFilterUI.SuggestionBuilder.prototype = { /** * @param {!HTMLInputElement} input * @return {?Array.<string>} @@ -439,24 +439,24 @@ }; /** - * @implements {WebInspector.FilterUI} + * @implements {UI.FilterUI} * @unrestricted */ -WebInspector.NamedBitSetFilterUI = class extends WebInspector.Object { +UI.NamedBitSetFilterUI = class extends Common.Object { /** - * @param {!Array.<!WebInspector.NamedBitSetFilterUI.Item>} items - * @param {!WebInspector.Setting=} setting + * @param {!Array.<!UI.NamedBitSetFilterUI.Item>} items + * @param {!Common.Setting=} setting */ constructor(items, setting) { super(); this._filtersElement = createElementWithClass('div', 'filter-bitset-filter'); - this._filtersElement.title = WebInspector.UIString( + this._filtersElement.title = Common.UIString( '%sClick to select multiple types', - WebInspector.KeyboardShortcut.shortcutToString('', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)); + UI.KeyboardShortcut.shortcutToString('', UI.KeyboardShortcut.Modifiers.CtrlOrMeta)); this._allowedTypes = {}; this._typeFilterElements = {}; - this._addBit(WebInspector.NamedBitSetFilterUI.ALL_TYPES, WebInspector.UIString('All')); + this._addBit(UI.NamedBitSetFilterUI.ALL_TYPES, Common.UIString('All')); this._filtersElement.createChild('div', 'filter-bitset-filter-divider'); for (var i = 0; i < items.length; ++i) @@ -467,12 +467,12 @@ setting.addChangeListener(this._settingChanged.bind(this)); this._settingChanged(); } else { - this._toggleTypeFilter(WebInspector.NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */); + this._toggleTypeFilter(UI.NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */); } } reset() { - this._toggleTypeFilter(WebInspector.NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */); + this._toggleTypeFilter(UI.NamedBitSetFilterUI.ALL_TYPES, false /* allowMultiSelect */); } /** @@ -480,7 +480,7 @@ * @return {boolean} */ isActive() { - return !this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]; + return !this._allowedTypes[UI.NamedBitSetFilterUI.ALL_TYPES]; } /** @@ -496,7 +496,7 @@ * @return {boolean} */ accept(typeName) { - return !!this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES] || !!this._allowedTypes[typeName]; + return !!this._allowedTypes[UI.NamedBitSetFilterUI.ALL_TYPES] || !!this._allowedTypes[typeName]; } _settingChanged() { @@ -511,13 +511,13 @@ _update() { if ((Object.keys(this._allowedTypes).length === 0) || - this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]) { + this._allowedTypes[UI.NamedBitSetFilterUI.ALL_TYPES]) { this._allowedTypes = {}; - this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES] = true; + this._allowedTypes[UI.NamedBitSetFilterUI.ALL_TYPES] = true; } for (var typeName in this._typeFilterElements) this._typeFilterElements[typeName].classList.toggle('selected', this._allowedTypes[typeName]); - this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged, null); + this.dispatchEventToListeners(UI.FilterUI.Events.FilterChanged, null); } /** @@ -540,7 +540,7 @@ */ _onTypeFilterClicked(e) { var toggle; - if (WebInspector.isMac()) + if (Host.isMac()) toggle = e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey; else toggle = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey; @@ -552,8 +552,8 @@ * @param {boolean} allowMultiSelect */ _toggleTypeFilter(typeName, allowMultiSelect) { - if (allowMultiSelect && typeName !== WebInspector.NamedBitSetFilterUI.ALL_TYPES) - this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES] = false; + if (allowMultiSelect && typeName !== UI.NamedBitSetFilterUI.ALL_TYPES) + this._allowedTypes[UI.NamedBitSetFilterUI.ALL_TYPES] = false; else this._allowedTypes = {}; @@ -567,15 +567,15 @@ }; /** @typedef {{name: string, label: string, title: (string|undefined)}} */ -WebInspector.NamedBitSetFilterUI.Item; +UI.NamedBitSetFilterUI.Item; -WebInspector.NamedBitSetFilterUI.ALL_TYPES = 'all'; +UI.NamedBitSetFilterUI.ALL_TYPES = 'all'; /** - * @implements {WebInspector.FilterUI} + * @implements {UI.FilterUI} * @unrestricted */ -WebInspector.ComboBoxFilterUI = class extends WebInspector.Object { +UI.ComboBoxFilterUI = class extends Common.Object { /** * @param {!Array.<!{value: *, label: string, title: string}>} options */ @@ -585,7 +585,7 @@ this._filterElement.className = 'filter-combobox-filter'; this._options = options; - this._filterComboBox = new WebInspector.ToolbarComboBox(this._filterChanged.bind(this)); + this._filterComboBox = new UI.ToolbarComboBox(this._filterChanged.bind(this)); for (var i = 0; i < options.length; ++i) { var filterOption = options[i]; var option = createElement('option'); @@ -641,20 +641,20 @@ _filterChanged(event) { var option = this._options[this._filterComboBox.selectedIndex()]; this._filterComboBox.element.title = option.title; - this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged, null); + this.dispatchEventToListeners(UI.FilterUI.Events.FilterChanged, null); } }; /** - * @implements {WebInspector.FilterUI} + * @implements {UI.FilterUI} * @unrestricted */ -WebInspector.CheckboxFilterUI = class extends WebInspector.Object { +UI.CheckboxFilterUI = class extends Common.Object { /** * @param {string} className * @param {string} title * @param {boolean=} activeWhenChecked - * @param {!WebInspector.Setting=} setting + * @param {!Common.Setting=} setting */ constructor(className, title, activeWhenChecked, setting) { super(); @@ -664,7 +664,7 @@ this._filterElement.appendChild(this._label); this._checkboxElement = this._label.checkboxElement; if (setting) - WebInspector.SettingsUI.bindCheckbox(this._checkboxElement, setting); + UI.SettingsUI.bindCheckbox(this._checkboxElement, setting); else this._checkboxElement.checked = true; this._checkboxElement.addEventListener('change', this._fireUpdated.bind(this), false); @@ -708,7 +708,7 @@ } _fireUpdated() { - this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged, null); + this.dispatchEventToListeners(UI.FilterUI.Events.FilterChanged, null); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ForwardedInputEventHandler.js b/third_party/WebKit/Source/devtools/front_end/ui/ForwardedInputEventHandler.js index 23bee65..ff6e89f 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ForwardedInputEventHandler.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ForwardedInputEventHandler.js
@@ -4,14 +4,14 @@ /** * @unrestricted */ -WebInspector.ForwardedInputEventHandler = class { +UI.ForwardedInputEventHandler = class { constructor() { InspectorFrontendHost.events.addEventListener( InspectorFrontendHostAPI.Events.KeyEventUnhandled, this._onKeyEventUnhandled, this); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onKeyEventUnhandled(event) { var data = event.data; @@ -23,12 +23,12 @@ if (type !== 'keydown') return; - WebInspector.context.setFlavor( - WebInspector.ShortcutRegistry.ForwardedShortcut, WebInspector.ShortcutRegistry.ForwardedShortcut.instance); - WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.makeKey(keyCode, modifiers), key); - WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut, null); + UI.context.setFlavor( + UI.ShortcutRegistry.ForwardedShortcut, UI.ShortcutRegistry.ForwardedShortcut.instance); + UI.shortcutRegistry.handleKey(UI.KeyboardShortcut.makeKey(keyCode, modifiers), key); + UI.context.setFlavor(UI.ShortcutRegistry.ForwardedShortcut, null); } }; -/** @type {!WebInspector.ForwardedInputEventHandler} */ -WebInspector.forwardedEventHandler = new WebInspector.ForwardedInputEventHandler(); +/** @type {!UI.ForwardedInputEventHandler} */ +UI.forwardedEventHandler = new UI.ForwardedInputEventHandler();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/HistoryInput.js b/third_party/WebKit/Source/devtools/front_end/ui/HistoryInput.js index d4ef3300..bdf69f61 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/HistoryInput.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/HistoryInput.js
@@ -4,20 +4,20 @@ /** * @unrestricted */ -WebInspector.HistoryInput = class extends HTMLInputElement { +UI.HistoryInput = class extends HTMLInputElement { constructor() { super(); } /** - * @return {!WebInspector.HistoryInput} + * @return {!UI.HistoryInput} */ static create() { - if (!WebInspector.HistoryInput._constructor) - WebInspector.HistoryInput._constructor = - registerCustomElement('input', 'history-input', WebInspector.HistoryInput.prototype); + if (!UI.HistoryInput._constructor) + UI.HistoryInput._constructor = + registerCustomElement('input', 'history-input', UI.HistoryInput.prototype); - return /** @type {!WebInspector.HistoryInput} */ (new WebInspector.HistoryInput._constructor()); + return /** @type {!UI.HistoryInput} */ (new UI.HistoryInput._constructor()); } /** @@ -42,17 +42,17 @@ * @param {!Event} event */ _onKeyDown(event) { - if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Up.code) { + if (event.keyCode === UI.KeyboardShortcut.Keys.Up.code) { this._historyPosition = Math.max(this._historyPosition - 1, 0); this.value = this._history[this._historyPosition]; this.dispatchEvent(new Event('input', {'bubbles': true, 'cancelable': true})); event.consume(true); - } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Down.code) { + } else if (event.keyCode === UI.KeyboardShortcut.Keys.Down.code) { this._historyPosition = Math.min(this._historyPosition + 1, this._history.length - 1); this.value = this._history[this._historyPosition]; this.dispatchEvent(new Event('input', {'bubbles': true, 'cancelable': true})); event.consume(true); - } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { + } else if (event.keyCode === UI.KeyboardShortcut.Keys.Enter.code) { this._saveToHistory(); } }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Icon.js b/third_party/WebKit/Source/devtools/front_end/ui/Icon.js index a1692fc7..f284af0 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Icon.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Icon.js
@@ -6,7 +6,7 @@ * @constructor * @extends {HTMLSpanElement} */ -WebInspector.Icon = class extends HTMLSpanElement { +UI.Icon = class extends HTMLSpanElement { constructor() { super(); throw new Error('icon must be created via factory method.'); @@ -15,13 +15,13 @@ /** * @param {string=} iconType * @param {string=} className - * @return {!WebInspector.Icon} + * @return {!UI.Icon} */ static create(iconType, className) { - if (!WebInspector.Icon._constructor) - WebInspector.Icon._constructor = registerCustomElement('span', 'ui-icon', WebInspector.Icon.prototype); + if (!UI.Icon._constructor) + UI.Icon._constructor = registerCustomElement('span', 'ui-icon', UI.Icon.prototype); - var icon = /** @type {!WebInspector.Icon} */ (new WebInspector.Icon._constructor()); + var icon = /** @type {!UI.Icon} */ (new UI.Icon._constructor()); if (className) icon.className = className; if (iconType) @@ -33,7 +33,7 @@ * @override */ createdCallback() { - /** @type {?WebInspector.Icon.Descriptor} */ + /** @type {?UI.Icon.Descriptor} */ this._descriptor = null; /** @type {string} */ this._iconType = ''; @@ -53,7 +53,7 @@ this._iconType = ''; this._descriptor = null; } - var descriptor = WebInspector.Icon.Descriptors[iconType] || null; + var descriptor = UI.Icon.Descriptors[iconType] || null; if (descriptor) { this._iconType = iconType; this._descriptor = descriptor; @@ -92,10 +92,10 @@ }; /** @typedef {{x: number, y: number, width: number, height: number, spritesheet: string, isMask: (boolean|undefined)}} */ -WebInspector.Icon.Descriptor; +UI.Icon.Descriptor; -/** @enum {!WebInspector.Icon.Descriptor} */ -WebInspector.Icon.Descriptors = { +/** @enum {!UI.Icon.Descriptor} */ +UI.Icon.Descriptors = { 'smallicon-error': {x: -20, y: 0, width: 10, height: 10, spritesheet: 'smallicons'}, 'smallicon-revoked-error': {x: -40, y: 0, width: 10, height: 10, spritesheet: 'smallicons'}, 'smallicon-warning': {x: -60, y: 0, width: 10, height: 10, spritesheet: 'smallicons'},
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Infobar.js b/third_party/WebKit/Source/devtools/front_end/ui/Infobar.js index 6d743704..08d703ac 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Infobar.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Infobar.js
@@ -4,15 +4,15 @@ /** * @unrestricted */ -WebInspector.Infobar = class { +UI.Infobar = class { /** - * @param {!WebInspector.Infobar.Type} type + * @param {!UI.Infobar.Type} type * @param {string} text - * @param {!WebInspector.Setting=} disableSetting + * @param {!Common.Setting=} disableSetting */ constructor(type, text, disableSetting) { this.element = createElementWithClass('div', 'flex-none'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/infobar.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/infobar.css'); this._contentElement = this._shadowRoot.createChild('div', 'infobar infobar-' + type); this._mainRow = this._contentElement.createChild('div', 'infobar-main-row'); @@ -23,13 +23,13 @@ this._toggleElement = this._mainRow.createChild('div', 'infobar-toggle hidden'); this._toggleElement.addEventListener('click', this._onToggleDetails.bind(this), false); - this._toggleElement.textContent = WebInspector.UIString('more'); + this._toggleElement.textContent = Common.UIString('more'); - /** @type {?WebInspector.Setting} */ + /** @type {?Common.Setting} */ this._disableSetting = disableSetting || null; if (disableSetting) { var disableButton = this._mainRow.createChild('div', 'infobar-toggle'); - disableButton.textContent = WebInspector.UIString('never show'); + disableButton.textContent = Common.UIString('never show'); disableButton.addEventListener('click', this._onDisable.bind(this), false); } @@ -41,15 +41,15 @@ } /** - * @param {!WebInspector.Infobar.Type} type + * @param {!UI.Infobar.Type} type * @param {string} text - * @param {!WebInspector.Setting=} disableSetting - * @return {?WebInspector.Infobar} + * @param {!Common.Setting=} disableSetting + * @return {?UI.Infobar} */ static create(type, text, disableSetting) { if (disableSetting && disableSetting.get()) return null; - return new WebInspector.Infobar(type, text, disableSetting); + return new UI.Infobar(type, text, disableSetting); } dispose() { @@ -75,7 +75,7 @@ } /** - * @param {!WebInspector.Widget} parentView + * @param {!UI.Widget} parentView */ setParentView(parentView) { this._parentView = parentView; @@ -112,7 +112,7 @@ /** @enum {string} */ -WebInspector.Infobar.Type = { +UI.Infobar.Type = { Warning: 'warning', Info: 'info' };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js b/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js index 3f92510..56deeaa 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/InplaceEditor.js
@@ -4,32 +4,32 @@ /** * @unrestricted */ -WebInspector.InplaceEditor = class { +UI.InplaceEditor = class { /** * @param {!Element} element - * @param {!WebInspector.InplaceEditor.Config=} config - * @return {?WebInspector.InplaceEditor.Controller} + * @param {!UI.InplaceEditor.Config=} config + * @return {?UI.InplaceEditor.Controller} */ static startEditing(element, config) { - if (!WebInspector.InplaceEditor._defaultInstance) - WebInspector.InplaceEditor._defaultInstance = new WebInspector.InplaceEditor(); - return WebInspector.InplaceEditor._defaultInstance.startEditing(element, config); + if (!UI.InplaceEditor._defaultInstance) + UI.InplaceEditor._defaultInstance = new UI.InplaceEditor(); + return UI.InplaceEditor._defaultInstance.startEditing(element, config); } /** * @param {!Element} element - * @param {!WebInspector.InplaceEditor.Config=} config - * @return {!Promise.<!WebInspector.InplaceEditor.Controller>} + * @param {!UI.InplaceEditor.Config=} config + * @return {!Promise.<!UI.InplaceEditor.Controller>} */ static startMultilineEditing(element, config) { - return self.runtime.extension(WebInspector.InplaceEditor).instance().then(startEditing); + return self.runtime.extension(UI.InplaceEditor).instance().then(startEditing); /** * @param {!Object} inplaceEditor - * @return {!WebInspector.InplaceEditor.Controller|!Promise.<!WebInspector.InplaceEditor.Controller>} + * @return {!UI.InplaceEditor.Controller|!Promise.<!UI.InplaceEditor.Controller>} */ function startEditing(inplaceEditor) { - var controller = /** @type {!WebInspector.InplaceEditor} */ (inplaceEditor).startEditing(element, config); + var controller = /** @type {!UI.InplaceEditor} */ (inplaceEditor).startEditing(element, config); if (!controller) return Promise.reject(new Error('Editing is already in progress')); return controller; @@ -54,7 +54,7 @@ var oldTabIndex = element.getAttribute('tabIndex'); if (typeof oldTabIndex !== 'number' || oldTabIndex < 0) element.tabIndex = 0; - this._focusRestorer = new WebInspector.ElementFocusRestorer(element); + this._focusRestorer = new UI.ElementFocusRestorer(element); editingContext.oldTabIndex = oldTabIndex; } @@ -83,14 +83,14 @@ /** * @param {!Element} element - * @param {!WebInspector.InplaceEditor.Config=} config - * @return {?WebInspector.InplaceEditor.Controller} + * @param {!UI.InplaceEditor.Config=} config + * @return {?UI.InplaceEditor.Controller} */ startEditing(element, config) { - if (!WebInspector.markBeingEdited(element, true)) + if (!UI.markBeingEdited(element, true)) return null; - config = config || new WebInspector.InplaceEditor.Config(function() {}, function() {}); + config = config || new UI.InplaceEditor.Config(function() {}, function() {}); var editingContext = {element: element, config: config}; var committedCallback = config.commitHandler; var cancelledCallback = config.cancelHandler; @@ -122,7 +122,7 @@ } function cleanUpAfterEditing() { - WebInspector.markBeingEdited(element, false); + UI.markBeingEdited(element, false); element.removeEventListener('blur', blurEventListener, isMultiline); element.removeEventListener('keydown', keyDownEventListener, true); @@ -153,11 +153,11 @@ * @return {string} */ function defaultFinishHandler(event) { - var isMetaOrCtrl = WebInspector.isMac() ? event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey : + var isMetaOrCtrl = Host.isMac() ? event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey : event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey; if (isEnterKey(event) && (event.isMetaOrCtrlForTest || !isMultiline || isMetaOrCtrl)) return 'commit'; - else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') + else if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code || event.key === 'Escape') return 'cancel'; else if (!isMultiline && event.key === 'Tab') return 'move-' + (event.shiftKey ? 'backward' : 'forward'); @@ -210,14 +210,14 @@ /** * @typedef {{cancel: function(), commit: function(), setWidth: function(number)}} */ -WebInspector.InplaceEditor.Controller; +UI.InplaceEditor.Controller; /** * @template T * @unrestricted */ -WebInspector.InplaceEditor.Config = class { +UI.InplaceEditor.Config = class { /** * @param {function(!Element,string,string,T,string)} commitHandler * @param {function(!Element,T)} cancelHandler
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js index f671fc3..63c7c84 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
@@ -28,17 +28,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ViewLocationResolver} + * @implements {UI.ViewLocationResolver} * @unrestricted */ -WebInspector.InspectorView = class extends WebInspector.VBox { +UI.InspectorView = class extends UI.VBox { constructor() { super(); - WebInspector.Dialog.setModalHostView(this); + UI.Dialog.setModalHostView(this); this.setMinimumSize(240, 72); // DevTools sidebar is a vertical split of panels tabbed pane and a drawer. - this._drawerSplitWidget = new WebInspector.SplitWidget(false, true, 'Inspector.drawerSplitViewState', 200, 200); + this._drawerSplitWidget = new UI.SplitWidget(false, true, 'Inspector.drawerSplitViewState', 200, 200); this._drawerSplitWidget.hideSidebar(); this._drawerSplitWidget.hideDefaultResizer(); this._drawerSplitWidget.enableShowModeSaving(); @@ -46,24 +46,24 @@ // Create drawer tabbed pane. this._drawerTabbedLocation = - WebInspector.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true); + UI.viewManager.createTabbedLocation(this._showDrawer.bind(this, false), 'drawer-view', true); this._drawerTabbedLocation.enableMoreTabsButton(); this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane(); this._drawerTabbedPane.setMinimumSize(0, 27); var closeDrawerButton = - new WebInspector.ToolbarButton(WebInspector.UIString('Close drawer'), 'largeicon-delete'); + new UI.ToolbarButton(Common.UIString('Close drawer'), 'largeicon-delete'); closeDrawerButton.addEventListener('click', this._closeDrawer.bind(this)); this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton); this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement()); this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane); // Create main area tabbed pane. - this._tabbedLocation = WebInspector.viewManager.createTabbedLocation( + this._tabbedLocation = UI.viewManager.createTabbedLocation( InspectorFrontendHost.bringToFront.bind(InspectorFrontendHost), 'panel', true, true); this._tabbedPane = this._tabbedLocation.tabbedPane(); this._tabbedPane.registerRequiredCSS('ui/inspectorViewTabbedPane.css'); this._tabbedPane.setTabSlider(true); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabSelected, this); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); if (InspectorFrontendHost.isUnderTest()) this._tabbedPane.setAutoSelectFirstItemOnShow(false); @@ -73,8 +73,8 @@ InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ShowPanel, showPanel.bind(this)); /** - * @this {WebInspector.InspectorView} - * @param {!WebInspector.Event} event + * @this {UI.InspectorView} + * @param {!Common.Event} event */ function showPanel(event) { var panelName = /** @type {string} */ (event.data); @@ -83,10 +83,10 @@ } /** - * @return {!WebInspector.InspectorView} + * @return {!UI.InspectorView} */ static instance() { - return /** @type {!WebInspector.InspectorView} */ (self.runtime.sharedInstance(WebInspector.InspectorView)); + return /** @type {!UI.InspectorView} */ (self.runtime.sharedInstance(UI.InspectorView)); } /** @@ -106,7 +106,7 @@ /** * @override * @param {string} locationName - * @return {?WebInspector.ViewLocation} + * @return {?UI.ViewLocation} */ resolveLocation(locationName) { return this._drawerTabbedLocation; @@ -118,7 +118,7 @@ } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view */ addPanel(view) { this._tabbedLocation.appendView(view); @@ -134,10 +134,10 @@ /** * @param {string} panelName - * @return {!Promise.<!WebInspector.Panel>} + * @return {!Promise.<!UI.Panel>} */ panel(panelName) { - return /** @type {!Promise.<!WebInspector.Panel>} */ (WebInspector.viewManager.view(panelName).widget()); + return /** @type {!Promise.<!UI.Panel>} */ (UI.viewManager.view(panelName).widget()); } /** @@ -160,10 +160,10 @@ /** * @param {string} panelName - * @return {!Promise.<?WebInspector.Panel>} + * @return {!Promise.<?UI.Panel>} */ showPanel(panelName) { - return WebInspector.viewManager.showView(panelName); + return UI.viewManager.showView(panelName); } /** @@ -176,11 +176,11 @@ } /** - * @return {!WebInspector.Panel} + * @return {!UI.Panel} */ currentPanelDeprecated() { - return /** @type {!WebInspector.Panel} */ ( - WebInspector.viewManager.materializedWidget(this._tabbedPane.selectedTabId || '')); + return /** @type {!UI.Panel} */ ( + UI.viewManager.materializedWidget(this._tabbedPane.selectedTabId || '')); } /** @@ -191,7 +191,7 @@ return; this._drawerSplitWidget.showBoth(); if (focus) - this._focusRestorer = new WebInspector.WidgetFocusRestorer(this._drawerTabbedPane); + this._focusRestorer = new UI.WidgetFocusRestorer(this._drawerTabbedPane); else this._focusRestorer = null; } @@ -227,12 +227,12 @@ } _keyDown(event) { - if (!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) + if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(event)) return; var keyboardEvent = /** @type {!KeyboardEvent} */ (event); // Ctrl/Cmd + 1-9 should show corresponding panel. - var panelShortcutEnabled = WebInspector.moduleSetting('shortcutPanelSwitch').get(); + var panelShortcutEnabled = Common.moduleSetting('shortcutPanelSwitch').get(); if (panelShortcutEnabled && !event.shiftKey && !event.altKey) { var panelIndex = -1; if (event.keyCode > 0x30 && event.keyCode < 0x3A) @@ -244,7 +244,7 @@ if (panelIndex !== -1) { var panelName = this._tabbedPane.allTabs()[panelIndex]; if (panelName) { - if (!WebInspector.Dialog.hasInstance() && !this._currentPanelLocked) + if (!UI.Dialog.hasInstance() && !this._currentPanelLocked) this.showPanel(panelName); event.consume(true); } @@ -256,7 +256,7 @@ * @override */ onResize() { - WebInspector.Dialog.modalHostRepositioned(); + UI.Dialog.modalHostRepositioned(); } /** @@ -271,15 +271,15 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabSelected(event) { var tabId = /** @type {string} */ (event.data['tabId']); - WebInspector.userMetrics.panelShown(tabId); + Host.userMetrics.panelShown(tabId); } /** - * @param {!WebInspector.SplitWidget} splitWidget + * @param {!UI.SplitWidget} splitWidget */ setOwnerSplit(splitWidget) { this._ownerSplitWidget = splitWidget; @@ -298,26 +298,26 @@ /** - * @type {!WebInspector.InspectorView} + * @type {!UI.InspectorView} */ -WebInspector.inspectorView; +UI.inspectorView; /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.InspectorView.DrawerToggleActionDelegate = class { +UI.InspectorView.DrawerToggleActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - if (WebInspector.inspectorView.drawerVisible()) - WebInspector.inspectorView._closeDrawer(); + if (UI.inspectorView.drawerVisible()) + UI.inspectorView._closeDrawer(); else - WebInspector.inspectorView._showDrawer(true); + UI.inspectorView._showDrawer(true); return true; } };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/KeyboardShortcut.js b/third_party/WebKit/Source/devtools/front_end/ui/KeyboardShortcut.js index 806e877..7bdd7fa98 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/KeyboardShortcut.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/KeyboardShortcut.js
@@ -30,7 +30,7 @@ /** * @unrestricted */ -WebInspector.KeyboardShortcut = class { +UI.KeyboardShortcut = class { /** * Creates a number encoding keyCode in the lower 8 bits and modifiers mask in the higher 8 bits. * It is useful for matching pressed keys. @@ -42,8 +42,8 @@ static makeKey(keyCode, modifiers) { if (typeof keyCode === 'string') keyCode = keyCode.charCodeAt(0) - (/^[a-z]/.test(keyCode) ? 32 : 0); - modifiers = modifiers || WebInspector.KeyboardShortcut.Modifiers.None; - return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers); + modifiers = modifiers || UI.KeyboardShortcut.Modifiers.None; + return UI.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers); } /** @@ -51,19 +51,19 @@ * @return {number} */ static makeKeyFromEvent(keyboardEvent) { - var modifiers = WebInspector.KeyboardShortcut.Modifiers.None; + var modifiers = UI.KeyboardShortcut.Modifiers.None; if (keyboardEvent.shiftKey) - modifiers |= WebInspector.KeyboardShortcut.Modifiers.Shift; + modifiers |= UI.KeyboardShortcut.Modifiers.Shift; if (keyboardEvent.ctrlKey) - modifiers |= WebInspector.KeyboardShortcut.Modifiers.Ctrl; + modifiers |= UI.KeyboardShortcut.Modifiers.Ctrl; if (keyboardEvent.altKey) - modifiers |= WebInspector.KeyboardShortcut.Modifiers.Alt; + modifiers |= UI.KeyboardShortcut.Modifiers.Alt; if (keyboardEvent.metaKey) - modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta; + modifiers |= UI.KeyboardShortcut.Modifiers.Meta; // Use either a real or a synthetic keyCode (for events originating from extensions). var keyCode = keyboardEvent.keyCode || keyboardEvent['__keyCode']; - return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers); + return UI.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode, modifiers); } /** @@ -72,8 +72,8 @@ */ static makeKeyFromEventIgnoringModifiers(keyboardEvent) { var keyCode = keyboardEvent.keyCode || keyboardEvent['__keyCode']; - return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers( - keyCode, WebInspector.KeyboardShortcut.Modifiers.None); + return UI.KeyboardShortcut._makeKeyFromCodeAndModifiers( + keyCode, UI.KeyboardShortcut.Modifiers.None); } /** @@ -81,7 +81,7 @@ * @return {boolean} */ static eventHasCtrlOrMeta(event) { - return WebInspector.isMac() ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey; + return Host.isMac() ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey; } /** @@ -93,28 +93,28 @@ } /** - * @param {string|!WebInspector.KeyboardShortcut.Key} key + * @param {string|!UI.KeyboardShortcut.Key} key * @param {number=} modifiers - * @return {!WebInspector.KeyboardShortcut.Descriptor} + * @return {!UI.KeyboardShortcut.Descriptor} */ static makeDescriptor(key, modifiers) { return { - key: WebInspector.KeyboardShortcut.makeKey(typeof key === 'string' ? key : key.code, modifiers), - name: WebInspector.KeyboardShortcut.shortcutToString(key, modifiers) + key: UI.KeyboardShortcut.makeKey(typeof key === 'string' ? key : key.code, modifiers), + name: UI.KeyboardShortcut.shortcutToString(key, modifiers) }; } /** * @param {string} shortcut - * @return {?WebInspector.KeyboardShortcut.Descriptor} + * @return {?UI.KeyboardShortcut.Descriptor} */ static makeDescriptorFromBindingShortcut(shortcut) { var parts = shortcut.split(/\+(?!$)/); var modifiers = 0; var keyString; for (var i = 0; i < parts.length; ++i) { - if (typeof WebInspector.KeyboardShortcut.Modifiers[parts[i]] !== 'undefined') { - modifiers |= WebInspector.KeyboardShortcut.Modifiers[parts[i]]; + if (typeof UI.KeyboardShortcut.Modifiers[parts[i]] !== 'undefined') { + modifiers |= UI.KeyboardShortcut.Modifiers[parts[i]]; continue; } console.assert( @@ -126,23 +126,23 @@ if (!keyString) return null; - var key = WebInspector.KeyboardShortcut.Keys[keyString] || WebInspector.KeyboardShortcut.KeyBindings[keyString]; + var key = UI.KeyboardShortcut.Keys[keyString] || UI.KeyboardShortcut.KeyBindings[keyString]; if (key && key.shiftKey) - modifiers |= WebInspector.KeyboardShortcut.Modifiers.Shift; - return WebInspector.KeyboardShortcut.makeDescriptor(key ? key : keyString, modifiers); + modifiers |= UI.KeyboardShortcut.Modifiers.Shift; + return UI.KeyboardShortcut.makeDescriptor(key ? key : keyString, modifiers); } /** - * @param {string|!WebInspector.KeyboardShortcut.Key} key + * @param {string|!UI.KeyboardShortcut.Key} key * @param {number=} modifiers * @return {string} */ static shortcutToString(key, modifiers) { - return WebInspector.KeyboardShortcut._modifiersToString(modifiers) + WebInspector.KeyboardShortcut._keyName(key); + return UI.KeyboardShortcut._modifiersToString(modifiers) + UI.KeyboardShortcut._keyName(key); } /** - * @param {string|!WebInspector.KeyboardShortcut.Key} key + * @param {string|!UI.KeyboardShortcut.Key} key * @return {string} */ static _keyName(key) { @@ -150,7 +150,7 @@ return key.toUpperCase(); if (typeof key.name === 'string') return key.name; - return key.name[WebInspector.platform()] || key.name.other || ''; + return key.name[Host.platform()] || key.name.other || ''; } /** @@ -175,8 +175,8 @@ * @return {string} */ static _modifiersToString(modifiers) { - var isMac = WebInspector.isMac(); - var m = WebInspector.KeyboardShortcut.Modifiers; + var isMac = Host.isMac(); + var m = UI.KeyboardShortcut.Modifiers; var modifierNames = new Map([ [m.Ctrl, isMac ? 'Ctrl\u2004' : 'Ctrl\u200A+\u200A'], [m.Alt, isMac ? '\u2325\u2004' : 'Alt\u200A+\u200A'], [m.Shift, isMac ? '\u21e7\u2004' : 'Shift\u200A+\u200A'], [m.Meta, isMac ? '\u2318\u2004' : 'Win\u200A+\u200A'] @@ -197,7 +197,7 @@ * Constants for encoding modifier key set as a bit mask. * @see #_makeKeyFromCodeAndModifiers */ -WebInspector.KeyboardShortcut.Modifiers = { +UI.KeyboardShortcut.Modifiers = { None: 0, // Constant for empty modifiers set. Shift: 1, Ctrl: 2, @@ -205,19 +205,19 @@ Meta: 8, // Command key on Mac, Win key on other platforms. get CtrlOrMeta() { // "default" command/ctrl key for platform, Command on Mac, Ctrl on other platforms - return WebInspector.isMac() ? this.Meta : this.Ctrl; + return Host.isMac() ? this.Meta : this.Ctrl; }, get ShiftOrOption() { // Option on Mac, Shift on other platforms - return WebInspector.isMac() ? this.Alt : this.Shift; + return Host.isMac() ? this.Alt : this.Shift; } }; /** @typedef {!{code: number, name: (string|!Object.<string, string>)}} */ -WebInspector.KeyboardShortcut.Key; +UI.KeyboardShortcut.Key; -/** @type {!Object.<string, !WebInspector.KeyboardShortcut.Key>} */ -WebInspector.KeyboardShortcut.Keys = { +/** @type {!Object.<string, !UI.KeyboardShortcut.Key>} */ +UI.KeyboardShortcut.Keys = { Backspace: {code: 8, name: '\u21a4'}, Tab: {code: 9, name: {mac: '\u21e5', other: 'Tab'}}, Enter: {code: 13, name: {mac: '\u21a9', other: 'Enter'}}, @@ -269,26 +269,26 @@ SingleQuote: {code: 222, name: '\''}, get CtrlOrMeta() { // "default" command/ctrl key for platform, Command on Mac, Ctrl on other platforms - return WebInspector.isMac() ? this.Meta : this.Ctrl; + return Host.isMac() ? this.Meta : this.Ctrl; }, }; -WebInspector.KeyboardShortcut.KeyBindings = {}; +UI.KeyboardShortcut.KeyBindings = {}; (function() { - for (var key in WebInspector.KeyboardShortcut.Keys) { - var descriptor = WebInspector.KeyboardShortcut.Keys[key]; + for (var key in UI.KeyboardShortcut.Keys) { + var descriptor = UI.KeyboardShortcut.Keys[key]; if (typeof descriptor === 'object' && descriptor['code']) { var name = typeof descriptor['name'] === 'string' ? descriptor['name'] : key; - WebInspector.KeyboardShortcut.KeyBindings[name] = descriptor; + UI.KeyboardShortcut.KeyBindings[name] = descriptor; } } })(); /** @typedef {!{key: number, name: string}} */ -WebInspector.KeyboardShortcut.Descriptor; +UI.KeyboardShortcut.Descriptor; -WebInspector.KeyboardShortcut.SelectAll = - WebInspector.KeyboardShortcut.makeKey('a', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); +UI.KeyboardShortcut.SelectAll = + UI.KeyboardShortcut.makeKey('a', UI.KeyboardShortcut.Modifiers.CtrlOrMeta);
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js index c77cd36..47e1e3a 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.ListWidget = class extends WebInspector.VBox { +UI.ListWidget = class extends UI.VBox { /** - * @param {!WebInspector.ListWidget.Delegate} delegate + * @param {!UI.ListWidget.Delegate} delegate */ constructor(delegate) { super(true); @@ -15,7 +15,7 @@ this._list = this.contentElement.createChild('div', 'list'); - /** @type {?WebInspector.ListWidget.Editor} */ + /** @type {?UI.ListWidget.Editor} */ this._editor = null; /** @type {*|null} */ this._editItem = null; @@ -118,18 +118,18 @@ var buttons = controls.createChild('div', 'controls-buttons'); var editButton = buttons.createChild('div', 'edit-button'); - editButton.title = WebInspector.UIString('Edit'); + editButton.title = Common.UIString('Edit'); editButton.addEventListener('click', onEditClicked.bind(this), false); var removeButton = buttons.createChild('div', 'remove-button'); - removeButton.title = WebInspector.UIString('Remove'); + removeButton.title = Common.UIString('Remove'); removeButton.addEventListener('click', onRemoveClicked.bind(this), false); return controls; /** * @param {!Event} event - * @this {WebInspector.ListWidget} + * @this {UI.ListWidget} */ function onEditClicked(event) { event.consume(); @@ -140,7 +140,7 @@ /** * @param {!Event} event - * @this {WebInspector.ListWidget} + * @this {UI.ListWidget} */ function onRemoveClicked(event) { event.consume(); @@ -189,14 +189,14 @@ this._updatePlaceholder(); this._list.insertBefore(this._editor.element, insertionPoint); this._editor.beginEdit( - item, index, element ? WebInspector.UIString('Save') : WebInspector.UIString('Add'), + item, index, element ? Common.UIString('Save') : Common.UIString('Add'), this._commitEditing.bind(this), this._stopEditing.bind(this)); } _commitEditing() { var editItem = this._editItem; var isNew = !this._editElement; - var editor = /** @type {!WebInspector.ListWidget.Editor} */ (this._editor); + var editor = /** @type {!UI.ListWidget.Editor} */ (this._editor); this._stopEditing(); this._delegate.commitEdit(editItem, editor, isNew); } @@ -218,9 +218,9 @@ /** * @interface */ -WebInspector.ListWidget.Delegate = function() {}; +UI.ListWidget.Delegate = function() {}; -WebInspector.ListWidget.Delegate.prototype = { +UI.ListWidget.Delegate.prototype = { /** * @param {*} item * @param {boolean} editable @@ -236,13 +236,13 @@ /** * @param {*} item - * @return {!WebInspector.ListWidget.Editor} + * @return {!UI.ListWidget.Editor} */ beginEdit: function(item) {}, /** * @param {*} item - * @param {!WebInspector.ListWidget.Editor} editor + * @param {!UI.ListWidget.Editor} editor * @param {boolean} isNew */ commitEdit: function(item, editor, isNew) {} @@ -251,7 +251,7 @@ /** * @unrestricted */ -WebInspector.ListWidget.Editor = class { +UI.ListWidget.Editor = class { constructor() { this.element = createElementWithClass('div', 'editor-container'); this.element.addEventListener('keydown', onKeyDown.bind(null, isEscKey, this._cancelClicked.bind(this)), false); @@ -262,7 +262,7 @@ var buttonsRow = this.element.createChild('div', 'editor-buttons'); this._commitButton = createTextButton('', this._commitClicked.bind(this)); buttonsRow.appendChild(this._commitButton); - this._cancelButton = createTextButton(WebInspector.UIString('Cancel'), this._cancelClicked.bind(this)); + this._cancelButton = createTextButton(Common.UIString('Cancel'), this._cancelClicked.bind(this)); this._cancelButton.addEventListener( 'keydown', onKeyDown.bind(null, isEnterKey, this._cancelClicked.bind(this)), false); buttonsRow.appendChild(this._cancelButton);
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Panel.js b/third_party/WebKit/Source/devtools/front_end/ui/Panel.js index 86af224..3214010 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Panel.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Panel.js
@@ -26,12 +26,12 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // For testing. -WebInspector.panels = []; +UI.panels = []; /** * @unrestricted */ -WebInspector.Panel = class extends WebInspector.VBox { +UI.Panel = class extends UI.VBox { constructor(name) { super(); @@ -41,7 +41,7 @@ this._panelName = name; // For testing. - WebInspector.panels[name] = this; + UI.panels[name] = this; this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); } @@ -51,7 +51,7 @@ } /** - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ searchableView() { return null; @@ -69,14 +69,14 @@ * @param {!KeyboardEvent} event */ handleShortcut(event) { - var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); + var shortcutKey = UI.KeyboardShortcut.makeKeyFromEvent(event); var handler = this._shortcuts[shortcutKey]; if (handler && handler(event)) event.handled = true; } /** - * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys + * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} keys * @param {function(!Event=):boolean} handler */ registerShortcuts(keys, handler) { @@ -85,7 +85,7 @@ } /** - * @param {!WebInspector.Infobar} infobar + * @param {!UI.Infobar} infobar */ showInfobar(infobar) { infobar.setCloseCallback(this._onInfobarClosed.bind(this, infobar)); @@ -98,7 +98,7 @@ } /** - * @param {!WebInspector.Infobar} infobar + * @param {!UI.Infobar} infobar */ _onInfobarClosed(infobar) { infobar.element.remove(); @@ -107,12 +107,12 @@ }; // Should by in sync with style declarations. -WebInspector.Panel.counterRightMargin = 25; +UI.Panel.counterRightMargin = 25; /** * @unrestricted */ -WebInspector.PanelWithSidebar = class extends WebInspector.Panel { +UI.PanelWithSidebar = class extends UI.Panel { /** * @param {string} name * @param {number=} defaultWidth @@ -121,13 +121,13 @@ super(name); this._panelSplitWidget = - new WebInspector.SplitWidget(true, false, this._panelName + 'PanelSplitViewState', defaultWidth || 200); + new UI.SplitWidget(true, false, this._panelName + 'PanelSplitViewState', defaultWidth || 200); this._panelSplitWidget.show(this.element); - this._mainWidget = new WebInspector.VBox(); + this._mainWidget = new UI.VBox(); this._panelSplitWidget.setMainWidget(this._mainWidget); - this._sidebarWidget = new WebInspector.VBox(); + this._sidebarWidget = new UI.VBox(); this._sidebarWidget.setMinimumSize(100, 25); this._panelSplitWidget.setSidebarWidget(this._sidebarWidget); @@ -149,7 +149,7 @@ } /** - * @return {!WebInspector.SplitWidget} + * @return {!UI.SplitWidget} */ splitWidget() { return this._panelSplitWidget;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js index 6c552e3..7d27e2a 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
@@ -31,14 +31,14 @@ /** * @unrestricted */ -WebInspector.Popover = class extends WebInspector.Widget { +UI.Popover = class extends UI.Widget { /** - * @param {!WebInspector.PopoverHelper=} popoverHelper + * @param {!UI.PopoverHelper=} popoverHelper */ constructor(popoverHelper) { super(); this.markAsRoot(); - this.element.className = WebInspector.Popover._classNamePrefix; // Override + this.element.className = UI.Popover._classNamePrefix; // Override this._containerElement = createElementWithClass('div', 'fill popover-container'); this._popupArrowElement = this.element.createChild('div', 'arrow'); @@ -53,14 +53,14 @@ * @param {!Element|!AnchorBox} anchor * @param {?number=} preferredWidth * @param {?number=} preferredHeight - * @param {?WebInspector.Popover.Orientation=} arrowDirection + * @param {?UI.Popover.Orientation=} arrowDirection */ showForAnchor(element, anchor, preferredWidth, preferredHeight, arrowDirection) { this._innerShow(null, element, anchor, preferredWidth, preferredHeight, arrowDirection); } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {!Element|!AnchorBox} anchor * @param {?number=} preferredWidth * @param {?number=} preferredHeight @@ -70,12 +70,12 @@ } /** - * @param {?WebInspector.Widget} view + * @param {?UI.Widget} view * @param {!Element} contentElement * @param {!Element|!AnchorBox} anchor * @param {?number=} preferredWidth * @param {?number=} preferredHeight - * @param {?WebInspector.Popover.Orientation=} arrowDirection + * @param {?UI.Popover.Orientation=} arrowDirection */ _innerShow(view, contentElement, anchor, preferredWidth, preferredHeight, arrowDirection) { if (this._disposed) @@ -83,15 +83,15 @@ this._contentElement = contentElement; // This should not happen, but we hide previous popup to be on the safe side. - if (WebInspector.Popover._popover) - WebInspector.Popover._popover.hide(); - WebInspector.Popover._popover = this; + if (UI.Popover._popover) + UI.Popover._popover.hide(); + UI.Popover._popover = this; var document = anchor instanceof Element ? anchor.ownerDocument : contentElement.ownerDocument; var window = document.defaultView; // Temporarily attach in order to measure preferred dimensions. - var preferredSize = view ? view.measurePreferredSize() : WebInspector.measurePreferredSize(this._contentElement); + var preferredSize = view ? view.measurePreferredSize() : UI.measurePreferredSize(this._contentElement); this._preferredWidth = preferredWidth || preferredSize.width; this._preferredHeight = preferredHeight || preferredSize.height; @@ -117,7 +117,7 @@ this._containerElement.ownerDocument.defaultView.removeEventListener('resize', this._hideBound, false); this.detach(); this._containerElement.remove(); - delete WebInspector.Popover._popover; + delete UI.Popover._popover; } get disposed() { @@ -150,7 +150,7 @@ * @param {!Element|!AnchorBox} anchorElement * @param {number=} preferredWidth * @param {number=} preferredHeight - * @param {?WebInspector.Popover.Orientation=} arrowDirection + * @param {?UI.Popover.Orientation=} arrowDirection */ positionElement(anchorElement, preferredWidth, preferredHeight, arrowDirection) { const borderWidth = this._hasNoPadding ? 0 : 8; @@ -165,7 +165,7 @@ // Skinny tooltips are not pretty, their arrow location is not nice. preferredWidth = Math.max(preferredWidth, 50); // Position relative to main DevTools element. - const container = WebInspector.Dialog.modalHostView().element; + const container = UI.Dialog.modalHostView().element; const totalWidth = container.offsetWidth; const totalHeight = container.offsetHeight; @@ -178,10 +178,10 @@ var roomBelow = totalHeight - anchorBox.y - anchorBox.height; this._popupArrowElement.hidden = false; - if ((roomAbove > roomBelow) || (arrowDirection === WebInspector.Popover.Orientation.Bottom)) { + if ((roomAbove > roomBelow) || (arrowDirection === UI.Popover.Orientation.Bottom)) { // Positioning above the anchor. if ((anchorBox.y > newElementPosition.height + arrowHeight + borderRadius) || - (arrowDirection === WebInspector.Popover.Orientation.Bottom)) + (arrowDirection === UI.Popover.Orientation.Bottom)) newElementPosition.y = anchorBox.y - newElementPosition.height - arrowHeight; else { this._popupArrowElement.hidden = true; @@ -192,12 +192,12 @@ newElementPosition.height = preferredHeight; } } - verticalAlignment = WebInspector.Popover.Orientation.Bottom; + verticalAlignment = UI.Popover.Orientation.Bottom; } else { // Positioning below the anchor. newElementPosition.y = anchorBox.y + anchorBox.height + arrowHeight; if ((newElementPosition.y + newElementPosition.height + borderRadius >= totalHeight) && - (arrowDirection !== WebInspector.Popover.Orientation.Top)) { + (arrowDirection !== UI.Popover.Orientation.Top)) { this._popupArrowElement.hidden = true; newElementPosition.height = totalHeight - borderRadius - newElementPosition.y; if (this._hasFixedHeight && newElementPosition.height < preferredHeight) { @@ -206,7 +206,7 @@ } } // Align arrow. - verticalAlignment = WebInspector.Popover.Orientation.Top; + verticalAlignment = UI.Popover.Orientation.Top; } var horizontalAlignment; @@ -228,7 +228,7 @@ newElementPosition.width = totalWidth - borderRadius * 2; newElementPosition.height += scrollerWidth; horizontalAlignment = 'left'; - if (verticalAlignment === WebInspector.Popover.Orientation.Bottom) + if (verticalAlignment === UI.Popover.Orientation.Bottom) newElementPosition.y -= scrollerWidth; // Position arrow accurately. this._popupArrowElement.style.left = @@ -236,19 +236,19 @@ } this.element.className = - WebInspector.Popover._classNamePrefix + ' ' + verticalAlignment + '-' + horizontalAlignment + '-arrow'; + UI.Popover._classNamePrefix + ' ' + verticalAlignment + '-' + horizontalAlignment + '-arrow'; this.element.positionAt(newElementPosition.x, newElementPosition.y - borderWidth, container); this.element.style.width = newElementPosition.width + borderWidth * 2 + 'px'; this.element.style.height = newElementPosition.height + borderWidth * 2 + 'px'; } }; -WebInspector.Popover._classNamePrefix = 'popover'; +UI.Popover._classNamePrefix = 'popover'; /** * @unrestricted */ -WebInspector.PopoverHelper = class { +UI.PopoverHelper = class { /** * @param {!Element} panelElement * @param {boolean=} disableOnClick @@ -263,7 +263,7 @@ /** * @param {function(!Element, !Event):(!Element|!AnchorBox|undefined)} getAnchor - * @param {function(!Element, !WebInspector.Popover):undefined} showPopover + * @param {function(!Element, !UI.Popover):undefined} showPopover * @param {function()=} onHide */ initializeCallbacks(getAnchor, showPopover, onHide) { @@ -335,7 +335,7 @@ return; /** - * @this {WebInspector.PopoverHelper} + * @this {UI.PopoverHelper} */ function doHide() { this._hidePopover(); @@ -390,7 +390,7 @@ delete this._hoverTimer; this._hoverElement = element; this._hidePopover(); - this._popover = new WebInspector.Popover(this); + this._popover = new UI.Popover(this); this._showPopover(element, this._popover); } @@ -407,7 +407,7 @@ }; /** @enum {string} */ -WebInspector.Popover.Orientation = { +UI.Popover.Orientation = { Top: 'top', Bottom: 'bottom' };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js b/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js index e3fcce8..2c8bb284 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ProgressIndicator.js
@@ -28,13 +28,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.Progress} + * @implements {Common.Progress} * @unrestricted */ -WebInspector.ProgressIndicator = class { +UI.ProgressIndicator = class { constructor() { this.element = createElementWithClass('div', 'progress-indicator'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/progressIndicator.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/progressIndicator.css'); this._contentElement = this._shadowRoot.createChild('div', 'progress-indicator-shadow-container'); this._labelElement = this._contentElement.createChild('div', 'title');
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ReportView.js b/third_party/WebKit/Source/devtools/front_end/ui/ReportView.js index 033e033a..f042f28 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ReportView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ReportView.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ReportView = class extends WebInspector.VBox { +UI.ReportView = class extends UI.VBox { /** * @param {string} title */ @@ -42,14 +42,14 @@ this._url = url; this._urlElement.removeChildren(); if (url) - this._urlElement.appendChild(WebInspector.linkifyURLAsNode(url)); + this._urlElement.appendChild(UI.linkifyURLAsNode(url)); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ createToolbar() { - var toolbar = new WebInspector.Toolbar(''); + var toolbar = new UI.Toolbar(''); this._headerElement.appendChild(toolbar.element); return toolbar; } @@ -57,10 +57,10 @@ /** * @param {string} title * @param {string=} className - * @return {!WebInspector.ReportView.Section} + * @return {!UI.ReportView.Section} */ appendSection(title, className) { - var section = new WebInspector.ReportView.Section(title, className); + var section = new UI.ReportView.Section(title, className); section.show(this._sectionList); return section; } @@ -73,7 +73,7 @@ /** * @unrestricted */ -WebInspector.ReportView.Section = class extends WebInspector.VBox { +UI.ReportView.Section = class extends UI.VBox { /** * @param {string} title * @param {string=} className @@ -100,10 +100,10 @@ } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ createToolbar() { - var toolbar = new WebInspector.Toolbar(''); + var toolbar = new UI.Toolbar(''); this._headerElement.appendChild(toolbar.element); return toolbar; }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ResizerWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ResizerWidget.js index 2a33f78..3e2ce38 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ResizerWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ResizerWidget.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ResizerWidget = class extends WebInspector.Object { +UI.ResizerWidget = class extends Common.Object { constructor() { super(); @@ -96,7 +96,7 @@ // Only handle drags of the nodes specified. if (this._elements.indexOf(event.target) === -1) return false; - WebInspector.elementDragStart( + UI.elementDragStart( /** @type {!Element} */ (event.target), this._dragStart.bind(this), this._drag.bind(this), this._dragEnd.bind(this), this.cursor(), event); } @@ -120,7 +120,7 @@ */ sendDragStart(x, y) { this.dispatchEventToListeners( - WebInspector.ResizerWidget.Events.ResizeStart, {startX: x, currentX: x, startY: y, currentY: y}); + UI.ResizerWidget.Events.ResizeStart, {startX: x, currentX: x, startY: y, currentY: y}); } /** @@ -147,7 +147,7 @@ */ sendDragMove(startX, currentX, startY, currentY, shiftKey) { this.dispatchEventToListeners( - WebInspector.ResizerWidget.Events.ResizeUpdate, + UI.ResizerWidget.Events.ResizeUpdate, {startX: startX, currentX: currentX, startY: startY, currentY: currentY, shiftKey: shiftKey}); } @@ -155,14 +155,14 @@ * @param {!MouseEvent} event */ _dragEnd(event) { - this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeEnd); + this.dispatchEventToListeners(UI.ResizerWidget.Events.ResizeEnd); delete this._startX; delete this._startY; } }; /** @enum {symbol} */ -WebInspector.ResizerWidget.Events = { +UI.ResizerWidget.Events = { ResizeStart: Symbol('ResizeStart'), ResizeUpdate: Symbol('ResizeUpdate'), ResizeEnd: Symbol('ResizeEnd') @@ -171,7 +171,7 @@ /** * @unrestricted */ -WebInspector.SimpleResizerWidget = class extends WebInspector.ResizerWidget { +UI.SimpleResizerWidget = class extends UI.ResizerWidget { constructor() { super(); this._isVertical = true; @@ -209,7 +209,7 @@ sendDragStart(x, y) { var position = this._isVertical ? y : x; this.dispatchEventToListeners( - WebInspector.ResizerWidget.Events.ResizeStart, {startPosition: position, currentPosition: position}); + UI.ResizerWidget.Events.ResizeStart, {startPosition: position, currentPosition: position}); } /** @@ -223,11 +223,11 @@ sendDragMove(startX, currentX, startY, currentY, shiftKey) { if (this._isVertical) this.dispatchEventToListeners( - WebInspector.ResizerWidget.Events.ResizeUpdate, + UI.ResizerWidget.Events.ResizeUpdate, {startPosition: startY, currentPosition: currentY, shiftKey: shiftKey}); else this.dispatchEventToListeners( - WebInspector.ResizerWidget.Events.ResizeUpdate, + UI.ResizerWidget.Events.ResizeUpdate, {startPosition: startX, currentPosition: currentX, shiftKey: shiftKey}); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/RootView.js b/third_party/WebKit/Source/devtools/front_end/ui/RootView.js index 15f2b86..65148585 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/RootView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/RootView.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.RootView = class extends WebInspector.VBox { +UI.RootView = class extends UI.VBox { constructor() { super(); this.markAsRoot(); @@ -29,7 +29,7 @@ doResize() { if (this._window) { var size = this.constraints().minimum; - var zoom = WebInspector.zoomManager.zoomFactor(); + var zoom = UI.zoomManager.zoomFactor(); var right = Math.min(0, this._window.innerWidth - size.width / zoom); this.element.style.marginRight = right + 'px'; var bottom = Math.min(0, this._window.innerHeight - size.height / zoom);
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SearchableView.js b/third_party/WebKit/Source/devtools/front_end/ui/SearchableView.js index bd4b7821..94ce46b0 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SearchableView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SearchableView.js
@@ -32,34 +32,34 @@ /** * @unrestricted */ -WebInspector.SearchableView = class extends WebInspector.VBox { +UI.SearchableView = class extends UI.VBox { /** - * @param {!WebInspector.Searchable} searchable + * @param {!UI.Searchable} searchable * @param {string=} settingName */ constructor(searchable, settingName) { super(true); this.registerRequiredCSS('ui/searchableView.css'); - this.element[WebInspector.SearchableView._symbol] = this; + this.element[UI.SearchableView._symbol] = this; this._searchProvider = searchable; - this._setting = settingName ? WebInspector.settings.createSetting(settingName, {}) : null; + this._setting = settingName ? Common.settings.createSetting(settingName, {}) : null; this.contentElement.createChild('content'); this._footerElementContainer = this.contentElement.createChild('div', 'search-bar hidden'); this._footerElementContainer.style.order = 100; - var toolbar = new WebInspector.Toolbar('search-toolbar', this._footerElementContainer); + var toolbar = new UI.Toolbar('search-toolbar', this._footerElementContainer); if (this._searchProvider.supportsCaseSensitiveSearch()) { - this._caseSensitiveButton = new WebInspector.ToolbarToggle(WebInspector.UIString('Case sensitive'), ''); + this._caseSensitiveButton = new UI.ToolbarToggle(Common.UIString('Case sensitive'), ''); this._caseSensitiveButton.setText('Aa'); this._caseSensitiveButton.addEventListener('click', this._toggleCaseSensitiveSearch, this); toolbar.appendToolbarItem(this._caseSensitiveButton); } if (this._searchProvider.supportsRegexSearch()) { - this._regexButton = new WebInspector.ToolbarToggle(WebInspector.UIString('Regex'), ''); + this._regexButton = new UI.ToolbarToggle(Common.UIString('Regex'), ''); this._regexButton.setText('.*'); this._regexButton.addEventListener('click', this._toggleRegexSearch, this); toolbar.appendToolbarItem(this._regexButton); @@ -75,12 +75,12 @@ var searchControlElementColumn = this._firstRowElement.createChild('td'); this._searchControlElement = searchControlElementColumn.createChild('span', 'toolbar-search-control'); - this._searchInputElement = WebInspector.HistoryInput.create(); + this._searchInputElement = UI.HistoryInput.create(); this._searchInputElement.classList.add('search-replace'); this._searchControlElement.appendChild(this._searchInputElement); this._searchInputElement.id = 'search-input-field'; - this._searchInputElement.placeholder = WebInspector.UIString('Find'); + this._searchInputElement.placeholder = Common.UIString('Find'); this._matchesElement = this._searchControlElement.createChild('label', 'search-results-matches'); this._matchesElement.setAttribute('for', 'search-input-field'); @@ -90,12 +90,12 @@ this._searchNavigationPrevElement = this._searchNavigationElement.createChild('div', 'toolbar-search-navigation toolbar-search-navigation-prev'); this._searchNavigationPrevElement.addEventListener('click', this._onPrevButtonSearch.bind(this), false); - this._searchNavigationPrevElement.title = WebInspector.UIString('Search Previous'); + this._searchNavigationPrevElement.title = Common.UIString('Search Previous'); this._searchNavigationNextElement = this._searchNavigationElement.createChild('div', 'toolbar-search-navigation toolbar-search-navigation-next'); this._searchNavigationNextElement.addEventListener('click', this._onNextButtonSearch.bind(this), false); - this._searchNavigationNextElement.title = WebInspector.UIString('Search Next'); + this._searchNavigationNextElement.title = Common.UIString('Search Next'); this._searchInputElement.addEventListener('keydown', this._onSearchKeyDown.bind(this), true); this._searchInputElement.addEventListener('input', this._onInput.bind(this), false); @@ -103,17 +103,17 @@ this._replaceInputElement = this._secondRowElement.createChild('td').createChild('input', 'search-replace toolbar-replace-control'); this._replaceInputElement.addEventListener('keydown', this._onReplaceKeyDown.bind(this), true); - this._replaceInputElement.placeholder = WebInspector.UIString('Replace'); + this._replaceInputElement.placeholder = Common.UIString('Replace'); // Column 2 this._findButtonElement = this._firstRowElement.createChild('td').createChild('button', 'search-action-button hidden'); - this._findButtonElement.textContent = WebInspector.UIString('Find'); + this._findButtonElement.textContent = Common.UIString('Find'); this._findButtonElement.tabIndex = -1; this._findButtonElement.addEventListener('click', this._onFindClick.bind(this), false); this._replaceButtonElement = this._secondRowElement.createChild('td').createChild('button', 'search-action-button'); - this._replaceButtonElement.textContent = WebInspector.UIString('Replace'); + this._replaceButtonElement.textContent = Common.UIString('Replace'); this._replaceButtonElement.disabled = true; this._replaceButtonElement.tabIndex = -1; this._replaceButtonElement.addEventListener('click', this._replace.bind(this), false); @@ -121,21 +121,21 @@ // Column 3 this._prevButtonElement = this._firstRowElement.createChild('td').createChild('button', 'search-action-button hidden'); - this._prevButtonElement.textContent = WebInspector.UIString('Previous'); + this._prevButtonElement.textContent = Common.UIString('Previous'); this._prevButtonElement.tabIndex = -1; this._prevButtonElement.addEventListener('click', this._onPreviousClick.bind(this), false); this._replaceAllButtonElement = this._secondRowElement.createChild('td').createChild('button', 'search-action-button'); - this._replaceAllButtonElement.textContent = WebInspector.UIString('Replace All'); + this._replaceAllButtonElement.textContent = Common.UIString('Replace All'); this._replaceAllButtonElement.addEventListener('click', this._replaceAll.bind(this), false); // Column 4 this._replaceElement = this._firstRowElement.createChild('td').createChild('span'); - this._replaceLabelElement = createCheckboxLabel(WebInspector.UIString('Replace')); + this._replaceLabelElement = createCheckboxLabel(Common.UIString('Replace')); this._replaceCheckboxElement = this._replaceLabelElement.checkboxElement; - this._uniqueId = ++WebInspector.SearchableView._lastUniqueId; + this._uniqueId = ++UI.SearchableView._lastUniqueId; var replaceCheckboxId = 'search-replace-trigger' + this._uniqueId; this._replaceCheckboxElement.id = replaceCheckboxId; this._replaceCheckboxElement.addEventListener('change', this._updateSecondRowVisibility.bind(this), false); @@ -144,7 +144,7 @@ // Column 5 var cancelButtonElement = this._firstRowElement.createChild('td').createChild('button', 'search-action-button'); - cancelButtonElement.textContent = WebInspector.UIString('Cancel'); + cancelButtonElement.textContent = Common.UIString('Cancel'); cancelButtonElement.tabIndex = -1; cancelButtonElement.addEventListener('click', this.closeSearch.bind(this), false); this._minimalSearchQuerySize = 3; @@ -154,12 +154,12 @@ /** * @param {?Element} element - * @return {?WebInspector.SearchableView} + * @return {?UI.SearchableView} */ static fromElement(element) { var view = null; while (element && !view) { - view = element[WebInspector.SearchableView._symbol]; + view = element[UI.SearchableView._symbol]; element = element.parentElementOrShadowHost(); } return view; @@ -329,11 +329,11 @@ if (!this._currentQuery) this._matchesElement.textContent = ''; else if (matches === 0 || currentMatchIndex >= 0) - this._matchesElement.textContent = WebInspector.UIString('%d of %d', currentMatchIndex + 1, matches); + this._matchesElement.textContent = Common.UIString('%d of %d', currentMatchIndex + 1, matches); else if (matches === 1) - this._matchesElement.textContent = WebInspector.UIString('1 match'); + this._matchesElement.textContent = Common.UIString('1 match'); else - this._matchesElement.textContent = WebInspector.UIString('%d matches', matches); + this._matchesElement.textContent = Common.UIString('%d matches', matches); this._updateSearchNavigationButtonState(matches > 0); } @@ -464,13 +464,13 @@ } /** - * @return {!WebInspector.SearchableView.SearchConfig} + * @return {!UI.SearchableView.SearchConfig} */ _currentSearchConfig() { var query = this._searchInputElement.value; var caseSensitive = this._caseSensitiveButton ? this._caseSensitiveButton.toggled() : false; var isRegex = this._regexButton ? this._regexButton.toggled() : false; - return new WebInspector.SearchableView.SearchConfig(query, caseSensitive, isRegex); + return new UI.SearchableView.SearchConfig(query, caseSensitive, isRegex); } _updateSecondRowVisibility() { @@ -491,7 +491,7 @@ _replace() { var searchConfig = this._currentSearchConfig(); - /** @type {!WebInspector.Replaceable} */ (this._searchProvider) + /** @type {!UI.Replaceable} */ (this._searchProvider) .replaceSelectionWith(searchConfig, this._replaceInputElement.value); delete this._currentQuery; this._performSearch(true, true); @@ -499,7 +499,7 @@ _replaceAll() { var searchConfig = this._currentSearchConfig(); - /** @type {!WebInspector.Replaceable} */ (this._searchProvider) + /** @type {!UI.Replaceable} */ (this._searchProvider) .replaceAllWith(searchConfig, this._replaceInputElement.value); } @@ -521,21 +521,21 @@ } }; -WebInspector.SearchableView._lastUniqueId = 0; +UI.SearchableView._lastUniqueId = 0; -WebInspector.SearchableView._symbol = Symbol('searchableView'); +UI.SearchableView._symbol = Symbol('searchableView'); /** * @interface */ -WebInspector.Searchable = function() {}; +UI.Searchable = function() {}; -WebInspector.Searchable.prototype = { +UI.Searchable.prototype = { searchCanceled: function() {}, /** - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {boolean} shouldJump * @param {boolean=} jumpBackwards */ @@ -559,17 +559,17 @@ /** * @interface */ -WebInspector.Replaceable = function() {}; +UI.Replaceable = function() {}; -WebInspector.Replaceable.prototype = { +UI.Replaceable.prototype = { /** - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceSelectionWith: function(searchConfig, replacement) {}, /** - * @param {!WebInspector.SearchableView.SearchConfig} searchConfig + * @param {!UI.SearchableView.SearchConfig} searchConfig * @param {string} replacement */ replaceAllWith: function(searchConfig, replacement) {} @@ -578,7 +578,7 @@ /** * @unrestricted */ -WebInspector.SearchableView.SearchConfig = class { +UI.SearchableView.SearchConfig = class { /** * @param {string} query * @param {boolean} caseSensitive
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js b/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js index 775b9c6c..eed5044d 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SettingsUI.js
@@ -27,23 +27,23 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.SettingsUI = {}; +UI.SettingsUI = {}; /** * @param {string} name - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting * @param {boolean=} omitParagraphElement * @param {string=} tooltip * @return {!Element} */ -WebInspector.SettingsUI.createSettingCheckbox = function(name, setting, omitParagraphElement, tooltip) { +UI.SettingsUI.createSettingCheckbox = function(name, setting, omitParagraphElement, tooltip) { var label = createCheckboxLabel(name); if (tooltip) label.title = tooltip; var input = label.checkboxElement; input.name = name; - WebInspector.SettingsUI.bindCheckbox(input, setting); + UI.SettingsUI.bindCheckbox(input, setting); if (omitParagraphElement) return label; @@ -55,9 +55,9 @@ /** * @param {!Element} input - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting */ -WebInspector.SettingsUI.bindCheckbox = function(input, setting) { +UI.SettingsUI.bindCheckbox = function(input, setting) { function settingChanged() { if (input.checked !== setting.get()) input.checked = setting.get(); @@ -77,7 +77,7 @@ * @param {!Element} element * @return {!Element} */ -WebInspector.SettingsUI.createCustomSetting = function(name, element) { +UI.SettingsUI.createCustomSetting = function(name, element) { var p = createElement('p'); var fieldsetElement = p.createChild('fieldset'); fieldsetElement.createChild('label').textContent = name; @@ -86,10 +86,10 @@ }; /** - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting * @return {!Element} */ -WebInspector.SettingsUI.createSettingFieldset = function(setting) { +UI.SettingsUI.createSettingFieldset = function(setting) { var fieldset = createElement('fieldset'); fieldset.disabled = !setting.get(); setting.addChangeListener(settingChanged); @@ -103,9 +103,9 @@ /** * @interface */ -WebInspector.SettingUI = function() {}; +UI.SettingUI = function() {}; -WebInspector.SettingUI.prototype = { +UI.SettingUI.prototype = { /** * @return {?Element} */
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ShortcutRegistry.js b/third_party/WebKit/Source/devtools/front_end/ui/ShortcutRegistry.js index 162097e..ff4b272 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ShortcutRegistry.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ShortcutRegistry.js
@@ -4,26 +4,26 @@ /** * @unrestricted */ -WebInspector.ShortcutRegistry = class { +UI.ShortcutRegistry = class { /** - * @param {!WebInspector.ActionRegistry} actionRegistry + * @param {!UI.ActionRegistry} actionRegistry * @param {!Document} document */ constructor(actionRegistry, document) { this._actionRegistry = actionRegistry; /** @type {!Multimap.<string, string>} */ this._defaultKeyToActions = new Multimap(); - /** @type {!Multimap.<string, !WebInspector.KeyboardShortcut.Descriptor>} */ + /** @type {!Multimap.<string, !UI.KeyboardShortcut.Descriptor>} */ this._defaultActionToShortcut = new Multimap(); this._registerBindings(document); } /** * @param {number} key - * @return {!Array.<!WebInspector.Action>} + * @return {!Array.<!UI.Action>} */ _applicableActions(key) { - return this._actionRegistry.applicableActions(this._defaultActionsForKey(key).valuesArray(), WebInspector.context); + return this._actionRegistry.applicableActions(this._defaultActionsForKey(key).valuesArray(), UI.context); } /** @@ -36,7 +36,7 @@ /** * @param {string} actionId - * @return {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} + * @return {!Array.<!UI.KeyboardShortcut.Descriptor>} */ shortcutDescriptorsForAction(actionId) { return this._defaultActionToShortcut.get(actionId).valuesArray(); @@ -70,7 +70,7 @@ * @param {!KeyboardEvent} event */ handleShortcut(event) { - this.handleKey(WebInspector.KeyboardShortcut.makeKeyFromEvent(event), event.key, event); + this.handleKey(UI.KeyboardShortcut.makeKeyFromEvent(event), event.key, event); } /** @@ -83,7 +83,7 @@ var actions = this._applicableActions(key); if (!actions.length) return; - if (WebInspector.Dialog.hasInstance()) { + if (UI.Dialog.hasInstance()) { if (event && !isPossiblyInputKey()) event.consume(true); return; @@ -99,7 +99,7 @@ /** * @param {boolean} handled - * @this {WebInspector.ShortcutRegistry} + * @this {UI.ShortcutRegistry} */ function processNextAction(handled) { delete this._pendingActionTimer; @@ -114,15 +114,15 @@ * @return {boolean} */ function isPossiblyInputKey() { - if (!event || !WebInspector.isEditing() || /^F\d+|Control|Shift|Alt|Meta|Escape|Win|U\+001B$/.test(domKey)) + if (!event || !UI.isEditing() || /^F\d+|Control|Shift|Alt|Meta|Escape|Win|U\+001B$/.test(domKey)) return false; if (!keyModifiers) return true; - var modifiers = WebInspector.KeyboardShortcut.Modifiers; + var modifiers = UI.KeyboardShortcut.Modifiers; if ((keyModifiers & (modifiers.Ctrl | modifiers.Alt)) === (modifiers.Ctrl | modifiers.Alt)) - return WebInspector.isWin(); + return Host.isWin(); return !hasModifier(modifiers.Ctrl) && !hasModifier(modifiers.Alt) && !hasModifier(modifiers.Meta); } @@ -141,7 +141,7 @@ * @param {string} shortcut */ registerShortcut(actionId, shortcut) { - var descriptor = WebInspector.KeyboardShortcut.makeDescriptorFromBindingShortcut(shortcut); + var descriptor = UI.KeyboardShortcut.makeDescriptorFromBindingShortcut(shortcut); if (!descriptor) return; this._defaultActionToShortcut.set(actionId, descriptor); @@ -160,12 +160,12 @@ */ _registerBindings(document) { document.addEventListener('input', this.dismissPendingShortcutAction.bind(this), true); - var extensions = self.runtime.extensions(WebInspector.ActionDelegate); + var extensions = self.runtime.extensions(UI.ActionDelegate); extensions.forEach(registerExtension, this); /** * @param {!Runtime.Extension} extension - * @this {WebInspector.ShortcutRegistry} + * @this {UI.ShortcutRegistry} */ function registerExtension(extension) { var descriptor = extension.descriptor(); @@ -187,7 +187,7 @@ return true; var platforms = platformsString.split(','); var isMatch = false; - var currentPlatform = WebInspector.platform(); + var currentPlatform = Host.platform(); for (var i = 0; !isMatch && i < platforms.length; ++i) isMatch = platforms[i] === currentPlatform; return isMatch; @@ -198,9 +198,9 @@ /** * @unrestricted */ -WebInspector.ShortcutRegistry.ForwardedShortcut = class {}; +UI.ShortcutRegistry.ForwardedShortcut = class {}; -WebInspector.ShortcutRegistry.ForwardedShortcut.instance = new WebInspector.ShortcutRegistry.ForwardedShortcut(); +UI.ShortcutRegistry.ForwardedShortcut.instance = new UI.ShortcutRegistry.ForwardedShortcut(); -/** @type {!WebInspector.ShortcutRegistry} */ -WebInspector.shortcutRegistry; +/** @type {!UI.ShortcutRegistry} */ +UI.shortcutRegistry;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js index c3a3580..0704bba2 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
@@ -26,11 +26,11 @@ /** * @unrestricted */ -WebInspector.SoftContextMenu = class { +UI.SoftContextMenu = class { /** * @param {!Array.<!InspectorFrontendHostAPI.ContextMenuDescriptor>} items * @param {function(string)} itemSelectedCallback - * @param {!WebInspector.SoftContextMenu=} parentMenu + * @param {!UI.SoftContextMenu=} parentMenu */ constructor(items, itemSelectedCallback, parentMenu) { this._items = items; @@ -54,7 +54,7 @@ // Create context menu. this.element = createElementWithClass('div', 'soft-context-menu'); - var root = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/softContextMenu.css'); + var root = UI.createShadowRootWithCoreStyles(this.element, 'ui/softContextMenu.css'); this._contextMenuElement = root.createChild('div'); this.element.style.top = y + 'px'; var subMenuOverlap = 3; @@ -85,7 +85,7 @@ if (document.body.offsetWidth < this.element.offsetLeft + this.element.offsetWidth) { this.element.style.left = Math.max( - WebInspector.Dialog.modalHostView().element.totalOffsetLeft(), this._parentMenu ? + UI.Dialog.modalHostView().element.totalOffsetLeft(), this._parentMenu ? this._parentMenu.element.offsetLeft - this.element.offsetWidth + subMenuOverlap : document.body.offsetWidth - this.element.offsetWidth) + 'px'; @@ -94,13 +94,13 @@ // Move submenus upwards if it does not fit. if (this._parentMenu && document.body.offsetHeight < this.element.offsetTop + this.element.offsetHeight) { y = Math.max( - WebInspector.Dialog.modalHostView().element.totalOffsetTop(), + UI.Dialog.modalHostView().element.totalOffsetTop(), document.body.offsetHeight - this.element.offsetHeight); this.element.style.top = y + 'px'; } - var maxHeight = WebInspector.Dialog.modalHostView().element.offsetHeight; - maxHeight -= y - WebInspector.Dialog.modalHostView().element.totalOffsetTop(); + var maxHeight = UI.Dialog.modalHostView().element.offsetHeight; + maxHeight -= y - UI.Dialog.modalHostView().element.totalOffsetTop(); this.element.style.maxHeight = maxHeight + 'px'; this._focus(); @@ -220,7 +220,7 @@ if (this._subMenu) return; - this._subMenu = new WebInspector.SoftContextMenu(menuItemElement._subItems, this._itemSelectedCallback, this); + this._subMenu = new UI.SoftContextMenu(menuItemElement._subItems, this._itemSelectedCallback, this); var topPadding = 4; this._subMenu.show( this._document, menuItemElement.totalOffsetLeft() + menuItemElement.offsetWidth,
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js index 879947c..a8c0668 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SplitWidget.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -WebInspector.SplitWidget = class extends WebInspector.Widget { +UI.SplitWidget = class extends UI.Widget { /** * @param {boolean} isVertical * @param {boolean} secondIsSidebar @@ -52,21 +52,21 @@ this._sidebarElement.createChild('content').select = '.insertion-point-sidebar'; this._resizerElement = this.contentElement.createChild('div', 'shadow-split-widget-resizer'); - this._resizerWidget = new WebInspector.SimpleResizerWidget(); + this._resizerWidget = new UI.SimpleResizerWidget(); this._resizerWidget.setEnabled(true); - this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeStart, this._onResizeStart, this); - this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeUpdate, this._onResizeUpdate, this); - this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeEnd, this._onResizeEnd, this); + this._resizerWidget.addEventListener(UI.ResizerWidget.Events.ResizeStart, this._onResizeStart, this); + this._resizerWidget.addEventListener(UI.ResizerWidget.Events.ResizeUpdate, this._onResizeUpdate, this); + this._resizerWidget.addEventListener(UI.ResizerWidget.Events.ResizeEnd, this._onResizeEnd, this); this._defaultSidebarWidth = defaultSidebarWidth || 200; this._defaultSidebarHeight = defaultSidebarHeight || this._defaultSidebarWidth; this._constraintsInDip = !!constraintsInDip; - this._setting = settingName ? WebInspector.settings.createSetting(settingName, {}) : null; + this._setting = settingName ? Common.settings.createSetting(settingName, {}) : null; this.setSecondIsSidebar(secondIsSidebar); this._innerSetVertical(isVertical); - this._showMode = WebInspector.SplitWidget.ShowMode.Both; + this._showMode = UI.SplitWidget.ShowMode.Both; // Should be called after isVertical has the right value. this.installResizer(this._resizerElement); @@ -128,7 +128,7 @@ } /** - * @param {!WebInspector.Widget} widget + * @param {!UI.Widget} widget */ setMainWidget(widget) { if (this._mainWidget === widget) @@ -141,8 +141,8 @@ widget.element.classList.add('insertion-point-main'); widget.element.classList.remove('insertion-point-sidebar'); widget.attach(this); - if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain || - this._showMode === WebInspector.SplitWidget.ShowMode.Both) + if (this._showMode === UI.SplitWidget.ShowMode.OnlyMain || + this._showMode === UI.SplitWidget.ShowMode.Both) widget.showWidget(this.element); this.setDefaultFocusedChild(widget); } @@ -150,7 +150,7 @@ } /** - * @param {!WebInspector.Widget} widget + * @param {!UI.Widget} widget */ setSidebarWidget(widget) { if (this._sidebarWidget === widget) @@ -163,22 +163,22 @@ widget.element.classList.add('insertion-point-sidebar'); widget.element.classList.remove('insertion-point-main'); widget.attach(this); - if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar || - this._showMode === WebInspector.SplitWidget.ShowMode.Both) + if (this._showMode === UI.SplitWidget.ShowMode.OnlySidebar || + this._showMode === UI.SplitWidget.ShowMode.Both) widget.showWidget(this.element); } this.resumeInvalidations(); } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ mainWidget() { return this._mainWidget; } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ sidebarWidget() { return this._sidebarWidget; @@ -186,7 +186,7 @@ /** * @override - * @param {!WebInspector.Widget} widget + * @param {!UI.Widget} widget */ childWasDetached(widget) { if (this._mainWidget === widget) @@ -226,7 +226,7 @@ * @return {?string} */ sidebarSide() { - if (this._showMode !== WebInspector.SplitWidget.ShowMode.Both) + if (this._showMode !== UI.SplitWidget.ShowMode.Both) return null; return this._isVertical ? (this._secondIsSidebar ? 'right' : 'left') : (this._secondIsSidebar ? 'bottom' : 'top'); } @@ -243,7 +243,7 @@ */ hideMain(animate) { this._showOnly(this._sidebarWidget, this._mainWidget, this._sidebarElement, this._mainElement, animate); - this._updateShowMode(WebInspector.SplitWidget.ShowMode.OnlySidebar); + this._updateShowMode(UI.SplitWidget.ShowMode.OnlySidebar); } /** @@ -251,7 +251,7 @@ */ hideSidebar(animate) { this._showOnly(this._mainWidget, this._sidebarWidget, this._mainElement, this._sidebarElement, animate); - this._updateShowMode(WebInspector.SplitWidget.ShowMode.OnlyMain); + this._updateShowMode(UI.SplitWidget.ShowMode.OnlyMain); } /** @@ -270,8 +270,8 @@ } /** - * @param {!WebInspector.Widget} sideToShow - * @param {!WebInspector.Widget} sideToHide + * @param {!UI.Widget} sideToShow + * @param {!UI.Widget} sideToHide * @param {!Element} shadowToShow * @param {!Element} shadowToHide * @param {boolean=} animate @@ -280,7 +280,7 @@ this._cancelAnimation(); /** - * @this {WebInspector.SplitWidget} + * @this {UI.SplitWidget} */ function callback() { if (sideToShow) { @@ -334,7 +334,7 @@ * @param {boolean=} animate */ showBoth(animate) { - if (this._showMode === WebInspector.SplitWidget.ShowMode.Both) + if (this._showMode === UI.SplitWidget.ShowMode.Both) animate = false; this._cancelAnimation(); @@ -354,7 +354,7 @@ this.setSecondIsSidebar(this._secondIsSidebar); this._sidebarSizeDIP = -1; - this._updateShowMode(WebInspector.SplitWidget.ShowMode.Both); + this._updateShowMode(UI.SplitWidget.ShowMode.Both); this._updateLayout(animate); } @@ -376,7 +376,7 @@ * @param {number} size */ setSidebarSize(size) { - var sizeDIP = WebInspector.zoomManager.cssToDIP(size); + var sizeDIP = UI.zoomManager.cssToDIP(size); this._savedSidebarSizeDIP = sizeDIP; this._saveSetting(); this._innerSetSidebarSizeDIP(sizeDIP, false, true); @@ -387,7 +387,7 @@ */ sidebarSize() { var sizeDIP = Math.max(0, this._sidebarSizeDIP); - return WebInspector.zoomManager.dipToCSS(sizeDIP); + return UI.zoomManager.dipToCSS(sizeDIP); } /** @@ -400,7 +400,7 @@ this._totalSizeOtherDimensionCSS = this._isVertical ? this.contentElement.offsetHeight : this.contentElement.offsetWidth; } - return WebInspector.zoomManager.cssToDIP(this._totalSizeCSS); + return UI.zoomManager.cssToDIP(this._totalSizeCSS); } /** @@ -410,7 +410,7 @@ this._showMode = showMode; this._saveShowModeToSettings(); this._updateShowHideSidebarButton(); - this.dispatchEventToListeners(WebInspector.SplitWidget.Events.ShowModeChanged, showMode); + this.dispatchEventToListeners(UI.SplitWidget.Events.ShowModeChanged, showMode); this.invalidateConstraints(); } @@ -420,7 +420,7 @@ * @param {boolean=} userAction */ _innerSetSidebarSizeDIP(sizeDIP, animate, userAction) { - if (this._showMode !== WebInspector.SplitWidget.ShowMode.Both || !this.isShowing()) + if (this._showMode !== UI.SplitWidget.ShowMode.Both || !this.isShowing()) return; sizeDIP = this._applyConstraints(sizeDIP, userAction); @@ -436,7 +436,7 @@ this._removeAllLayoutProperties(); // this._totalSizeDIP is available below since we successfully applied constraints. - var roundSizeCSS = Math.round(WebInspector.zoomManager.dipToCSS(sizeDIP)); + var roundSizeCSS = Math.round(UI.zoomManager.dipToCSS(sizeDIP)); var sidebarSizeValue = roundSizeCSS + 'px'; var mainSizeValue = (this._totalSizeCSS - roundSizeCSS) + 'px'; this._sidebarElement.style.flexBasis = sidebarSizeValue; @@ -482,7 +482,7 @@ } else { // No need to recalculate this._sidebarSizeDIP and this._totalSizeDIP again. this.doResize(); - this.dispatchEventToListeners(WebInspector.SplitWidget.Events.SidebarSizeChanged, this.sidebarSize()); + this.dispatchEventToListeners(UI.SplitWidget.Events.SidebarSizeChanged, this.sidebarSize()); } } @@ -500,8 +500,8 @@ else animatedMarginPropertyName = this._secondIsSidebar ? 'margin-bottom' : 'margin-top'; - var marginFrom = reverse ? '0' : '-' + WebInspector.zoomManager.dipToCSS(this._sidebarSizeDIP) + 'px'; - var marginTo = reverse ? '-' + WebInspector.zoomManager.dipToCSS(this._sidebarSizeDIP) + 'px' : '0'; + var marginFrom = reverse ? '0' : '-' + UI.zoomManager.dipToCSS(this._sidebarSizeDIP) + 'px'; + var marginTo = reverse ? '-' + UI.zoomManager.dipToCSS(this._sidebarSizeDIP) + 'px' : '0'; // This order of things is important. // 1. Resize main element early and force layout. @@ -521,7 +521,7 @@ var boundAnimationFrame; var startTime; /** - * @this {WebInspector.SplitWidget} + * @this {UI.SplitWidget} */ function animationFrame() { delete this._animationFrameHandle; @@ -539,7 +539,7 @@ this._cancelAnimation(); if (this._mainWidget) this._mainWidget.doResize(); - this.dispatchEventToListeners(WebInspector.SplitWidget.Events.SidebarSizeChanged, this.sidebarSize()); + this.dispatchEventToListeners(UI.SplitWidget.Events.SidebarSizeChanged, this.sidebarSize()); return; } this._animationFrameHandle = this.contentElement.window().requestAnimationFrame(boundAnimationFrame); @@ -572,19 +572,19 @@ */ _applyConstraints(sidebarSize, userAction) { var totalSize = this._totalSizeDIP(); - var zoomFactor = this._constraintsInDip ? 1 : WebInspector.zoomManager.zoomFactor(); + var zoomFactor = this._constraintsInDip ? 1 : UI.zoomManager.zoomFactor(); var constraints = this._sidebarWidget ? this._sidebarWidget.constraints() : new Constraints(); var minSidebarSize = this.isVertical() ? constraints.minimum.width : constraints.minimum.height; if (!minSidebarSize) - minSidebarSize = WebInspector.SplitWidget.MinPadding; + minSidebarSize = UI.SplitWidget.MinPadding; minSidebarSize *= zoomFactor; if (this._sidebarMinimized) sidebarSize = minSidebarSize; var preferredSidebarSize = this.isVertical() ? constraints.preferred.width : constraints.preferred.height; if (!preferredSidebarSize) - preferredSidebarSize = WebInspector.SplitWidget.MinPadding; + preferredSidebarSize = UI.SplitWidget.MinPadding; preferredSidebarSize *= zoomFactor; // Allow sidebar to be less than preferred by explicit user action. if (sidebarSize < preferredSidebarSize) @@ -594,12 +594,12 @@ constraints = this._mainWidget ? this._mainWidget.constraints() : new Constraints(); var minMainSize = this.isVertical() ? constraints.minimum.width : constraints.minimum.height; if (!minMainSize) - minMainSize = WebInspector.SplitWidget.MinPadding; + minMainSize = UI.SplitWidget.MinPadding; minMainSize *= zoomFactor; var preferredMainSize = this.isVertical() ? constraints.preferred.width : constraints.preferred.height; if (!preferredMainSize) - preferredMainSize = WebInspector.SplitWidget.MinPadding; + preferredMainSize = UI.SplitWidget.MinPadding; preferredMainSize *= zoomFactor; var savedMainSize = this.isVertical() ? this._savedVerticalMainSize : this._savedHorizontalMainSize; if (typeof savedMainSize !== 'undefined') @@ -629,15 +629,15 @@ */ wasShown() { this._forceUpdateLayout(); - WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); + UI.zoomManager.addEventListener(UI.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); } /** * @override */ willHide() { - WebInspector.zoomManager.removeEventListener( - WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); + UI.zoomManager.removeEventListener( + UI.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this); } /** @@ -659,14 +659,14 @@ * @return {!Constraints} */ calculateConstraints() { - if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain) + if (this._showMode === UI.SplitWidget.ShowMode.OnlyMain) return this._mainWidget ? this._mainWidget.constraints() : new Constraints(); - if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar) + if (this._showMode === UI.SplitWidget.ShowMode.OnlySidebar) return this._sidebarWidget ? this._sidebarWidget.constraints() : new Constraints(); var mainConstraints = this._mainWidget ? this._mainWidget.constraints() : new Constraints(); var sidebarConstraints = this._sidebarWidget ? this._sidebarWidget.constraints() : new Constraints(); - var min = WebInspector.SplitWidget.MinPadding; + var min = UI.SplitWidget.MinPadding; if (this._isVertical) { mainConstraints = mainConstraints.widthToMax(min).addWidth(1); // 1 for splitter sidebarConstraints = sidebarConstraints.widthToMax(min); @@ -679,18 +679,18 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeStart(event) { this._resizeStartSizeDIP = this._sidebarSizeDIP; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeUpdate(event) { var offset = event.data.currentPosition - event.data.startPosition; - var offsetDIP = WebInspector.zoomManager.cssToDIP(offset); + var offsetDIP = UI.zoomManager.cssToDIP(offset); var newSizeDIP = this._secondIsSidebar ? this._resizeStartSizeDIP - offsetDIP : this._resizeStartSizeDIP + offsetDIP; var constrainedSizeDIP = this._applyConstraints(newSizeDIP, true); @@ -704,7 +704,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onResizeEnd(event) { delete this._resizeStartSizeDIP; @@ -748,7 +748,7 @@ } /** - * @return {?WebInspector.SplitWidget.SettingForOrientation} + * @return {?UI.SplitWidget.SettingForOrientation} */ _settingForOrientation() { var state = this._setting ? this._setting.get() : {}; @@ -780,13 +780,13 @@ this._showMode = this._savedShowMode; switch (this._savedShowMode) { - case WebInspector.SplitWidget.ShowMode.Both: + case UI.SplitWidget.ShowMode.Both: this.showBoth(); break; - case WebInspector.SplitWidget.ShowMode.OnlyMain: + case UI.SplitWidget.ShowMode.OnlyMain: this.hideSidebar(); break; - case WebInspector.SplitWidget.ShowMode.OnlySidebar: + case UI.SplitWidget.ShowMode.OnlySidebar: this.hideMain(); break; } @@ -821,7 +821,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onZoomChanged(event) { this._forceUpdateLayout(); @@ -829,20 +829,20 @@ /** * @param {string} title - * @return {!WebInspector.ToolbarButton} + * @return {!UI.ToolbarButton} */ createShowHideSidebarButton(title) { - this._showHideSidebarButtonTitle = WebInspector.UIString(title); - this._showHideSidebarButton = new WebInspector.ToolbarButton('', ''); + this._showHideSidebarButtonTitle = Common.UIString(title); + this._showHideSidebarButton = new UI.ToolbarButton('', ''); this._showHideSidebarButton.addEventListener('click', buttonClicked.bind(this)); this._updateShowHideSidebarButton(); /** - * @param {!WebInspector.Event} event - * @this {WebInspector.SplitWidget} + * @param {!Common.Event} event + * @this {UI.SplitWidget} */ function buttonClicked(event) { - if (this._showMode !== WebInspector.SplitWidget.ShowMode.Both) + if (this._showMode !== UI.SplitWidget.ShowMode.Both) this.showBoth(true); else this.hideSidebar(true); @@ -854,7 +854,7 @@ _updateShowHideSidebarButton() { if (!this._showHideSidebarButton) return; - var sidebarHidden = this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain; + var sidebarHidden = this._showMode === UI.SplitWidget.ShowMode.OnlyMain; var glyph = ''; if (sidebarHidden) { glyph = this.isVertical() ? @@ -867,24 +867,24 @@ } this._showHideSidebarButton.setGlyph(glyph); this._showHideSidebarButton.setTitle( - sidebarHidden ? WebInspector.UIString('Show %s', this._showHideSidebarButtonTitle) : - WebInspector.UIString('Hide %s', this._showHideSidebarButtonTitle)); + sidebarHidden ? Common.UIString('Show %s', this._showHideSidebarButtonTitle) : + Common.UIString('Hide %s', this._showHideSidebarButtonTitle)); } }; /** @typedef {{showMode: string, size: number}} */ -WebInspector.SplitWidget.SettingForOrientation; +UI.SplitWidget.SettingForOrientation; -WebInspector.SplitWidget.ShowMode = { +UI.SplitWidget.ShowMode = { Both: 'Both', OnlyMain: 'OnlyMain', OnlySidebar: 'OnlySidebar' }; /** @enum {symbol} */ -WebInspector.SplitWidget.Events = { +UI.SplitWidget.Events = { SidebarSizeChanged: Symbol('SidebarSizeChanged'), ShowModeChanged: Symbol('ShowModeChanged') }; -WebInspector.SplitWidget.MinPadding = 20; +UI.SplitWidget.MinPadding = 20;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/StackView.js b/third_party/WebKit/Source/devtools/front_end/ui/StackView.js index 6d87bf1..55ba9da 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/StackView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/StackView.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -WebInspector.StackView = class extends WebInspector.VBox { +UI.StackView = class extends UI.VBox { /** * @param {boolean} isVertical */ @@ -40,14 +40,14 @@ } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {string=} sidebarSizeSettingName * @param {number=} defaultSidebarWidth * @param {number=} defaultSidebarHeight - * @return {?WebInspector.SplitWidget} + * @return {?UI.SplitWidget} */ appendView(view, sidebarSizeSettingName, defaultSidebarWidth, defaultSidebarHeight) { - var splitWidget = new WebInspector.SplitWidget( + var splitWidget = new UI.SplitWidget( this._isVertical, true, sidebarSizeSettingName, defaultSidebarWidth, defaultSidebarHeight); splitWidget.setMainWidget(view); splitWidget.hideSidebar();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/StaticViewportControl.js b/third_party/WebKit/Source/devtools/front_end/ui/StaticViewportControl.js index 7e5a36e..cc339687 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/StaticViewportControl.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/StaticViewportControl.js
@@ -4,9 +4,9 @@ /** * @unrestricted */ -WebInspector.StaticViewportControl = class { +UI.StaticViewportControl = class { /** - * @param {!WebInspector.StaticViewportControl.Provider} provider + * @param {!UI.StaticViewportControl.Provider} provider */ constructor(provider) { this.element = createElement('div'); @@ -19,7 +19,7 @@ this._provider = provider; this.element.addEventListener('scroll', this._update.bind(this), false); this._itemCount = 0; - this._indexSymbol = Symbol('WebInspector.StaticViewportControl._indexSymbol'); + this._indexSymbol = Symbol('UI.StaticViewportControl._indexSymbol'); } refresh() { @@ -141,9 +141,9 @@ /** * @interface */ -WebInspector.StaticViewportControl.Provider = function() {}; +UI.StaticViewportControl.Provider = function() {}; -WebInspector.StaticViewportControl.Provider.prototype = { +UI.StaticViewportControl.Provider.prototype = { /** * @param {number} index * @return {number}
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js index 6ff3ce3..39c256e 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.SuggestBoxDelegate = function() {}; +UI.SuggestBoxDelegate = function() {}; -WebInspector.SuggestBoxDelegate.prototype = { +UI.SuggestBoxDelegate.prototype = { /** * @param {string} suggestion * @param {boolean=} isIntermediateSuggestion @@ -46,12 +46,12 @@ }; /** - * @implements {WebInspector.StaticViewportControl.Provider} + * @implements {UI.StaticViewportControl.Provider} * @unrestricted */ -WebInspector.SuggestBox = class { +UI.SuggestBox = class { /** - * @param {!WebInspector.SuggestBoxDelegate} suggestBoxDelegate + * @param {!UI.SuggestBoxDelegate} suggestBoxDelegate * @param {number=} maxItemsHeight * @param {boolean=} captureEnter */ @@ -63,7 +63,7 @@ this._maxItemsHeight = maxItemsHeight; this._maybeHideBound = this._maybeHide.bind(this); this._container = createElementWithClass('div', 'suggest-box-container'); - this._viewport = new WebInspector.StaticViewportControl(this); + this._viewport = new UI.StaticViewportControl(this); this._element = this._viewport.element; this._element.classList.add('suggest-box'); this._container.appendChild(this._element); @@ -81,7 +81,7 @@ this._viewportWidth = '100vw'; this._hasVerticalScroll = false; this._userEnteredText = ''; - /** @type {!WebInspector.SuggestBox.Suggestions} */ + /** @type {!UI.SuggestBox.Suggestions} */ this._items = []; } @@ -110,7 +110,7 @@ this._lastAnchorBox = anchorBox; // Position relative to main DevTools element. - var container = WebInspector.Dialog.modalHostView().element; + var container = UI.Dialog.modalHostView().element; anchorBox = anchorBox.relativeToElement(container); var totalHeight = container.offsetHeight; var aboveHeight = anchorBox.y; @@ -144,7 +144,7 @@ maxIndex = i; } var element = /** @type {!Element} */ (this.itemElement(maxIndex)); - this._element.style.width = WebInspector.measurePreferredSize(element, this._element).width + 'px'; + this._element.style.width = UI.measurePreferredSize(element, this._element).width + 'px'; } /** @@ -172,7 +172,7 @@ return; this._bodyElement = document.body; this._bodyElement.addEventListener('mousedown', this._maybeHideBound, true); - this._overlay = new WebInspector.SuggestBox.Overlay(); + this._overlay = new UI.SuggestBox.Overlay(); this._overlay.setContentElement(this._container); var measuringElement = this._createItemElement('1', '12'); this._viewport.element.appendChild(measuringElement); @@ -292,7 +292,7 @@ } /** - * @param {!WebInspector.SuggestBox.Suggestions} items + * @param {!UI.SuggestBox.Suggestions} items * @param {string} userEnteredText * @param {function(number): !Promise<{detail:string, description:string}>=} asyncDetails */ @@ -354,7 +354,7 @@ /** * @param {?{detail: string, description: string}} details - * @this {WebInspector.SuggestBox} + * @this {UI.SuggestBox} */ function showDetails(details) { if (elem === this._selectedElement) @@ -363,7 +363,7 @@ } /** - * @param {!WebInspector.SuggestBox.Suggestions} completions + * @param {!UI.SuggestBox.Suggestions} completions * @param {boolean} canShowForSingleItem * @param {string} userEnteredText * @return {boolean} @@ -393,7 +393,7 @@ /** * @param {!AnchorBox} anchorBox - * @param {!WebInspector.SuggestBox.Suggestions} completions + * @param {!UI.SuggestBox.Suggestions} completions * @param {number} selectedIndex * @param {boolean} canShowForSingleItem * @param {string} userEnteredText @@ -514,19 +514,19 @@ /** * @typedef {!Array.<{title: string, className: (string|undefined)}>} */ -WebInspector.SuggestBox.Suggestions; +UI.SuggestBox.Suggestions; /** * @unrestricted */ -WebInspector.SuggestBox.Overlay = class { +UI.SuggestBox.Overlay = class { /** * // FIXME: make SuggestBox work for multiple documents. * @suppressGlobalPropertiesCheck */ constructor() { this.element = createElementWithClass('div', 'suggest-box-overlay'); - var root = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/suggestBox.css'); + var root = UI.createShadowRootWithCoreStyles(this.element, 'ui/suggestBox.css'); this._leftSpacerElement = root.createChild('div', 'suggest-box-left-spacer'); this._horizontalElement = root.createChild('div', 'suggest-box-horizontal'); this._topSpacerElement = this._horizontalElement.createChild('div', 'suggest-box-top-spacer'); @@ -566,7 +566,7 @@ } _resize() { - var container = WebInspector.Dialog.modalHostView().element; + var container = UI.Dialog.modalHostView().element; var containerBox = container.boxInWindow(container.ownerDocument.defaultView); this.element.style.left = containerBox.x + 'px';
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js index 24cc48044..9ce5442 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SwatchPopoverHelper.js
@@ -4,10 +4,10 @@ /** * @unrestricted */ -WebInspector.SwatchPopoverHelper = class extends WebInspector.Object { +UI.SwatchPopoverHelper = class extends Common.Object { constructor() { super(); - this._popover = new WebInspector.Popover(); + this._popover = new UI.Popover(); this._popover.setCanShrink(false); this._popover.setNoPadding(true); this._popover.element.addEventListener('mousedown', (e) => e.consume(), false); @@ -35,7 +35,7 @@ } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {!Element} anchorElement * @param {function(boolean)=} hiddenCallback */ @@ -66,7 +66,7 @@ this._popover.showView(this._view, this._anchorElement); this._view.contentElement.addEventListener('focusout', this._boundFocusOut, false); if (!this._focusRestorer) - this._focusRestorer = new WebInspector.WidgetFocusRestorer(this._view); + this._focusRestorer = new UI.WidgetFocusRestorer(this._view); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js index e864ae0..6d74108 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.TabbedPane = class extends WebInspector.VBox { +UI.TabbedPane = class extends UI.VBox { constructor() { super(true); this.registerRequiredCSS('ui/tabbedPane.css'); @@ -40,24 +40,24 @@ this.contentElement.tabIndex = -1; this._headerElement = this.contentElement.createChild('div', 'tabbed-pane-header'); this._headerContentsElement = this._headerElement.createChild('div', 'tabbed-pane-header-contents'); - this._headerContentsElement.setAttribute('aria-label', WebInspector.UIString('Panels')); + this._headerContentsElement.setAttribute('aria-label', Common.UIString('Panels')); this._tabSlider = createElementWithClass('div', 'tabbed-pane-tab-slider'); this._tabsElement = this._headerContentsElement.createChild('div', 'tabbed-pane-header-tabs'); this._tabsElement.setAttribute('role', 'tablist'); this._contentElement = this.contentElement.createChild('div', 'tabbed-pane-content'); this._contentElement.setAttribute('role', 'tabpanel'); this._contentElement.createChild('content'); - /** @type {!Array.<!WebInspector.TabbedPaneTab>} */ + /** @type {!Array.<!UI.TabbedPaneTab>} */ this._tabs = []; - /** @type {!Array.<!WebInspector.TabbedPaneTab>} */ + /** @type {!Array.<!UI.TabbedPaneTab>} */ this._tabsHistory = []; - /** @type {!Object.<string, !WebInspector.TabbedPaneTab>} */ + /** @type {!Object.<string, !UI.TabbedPaneTab>} */ this._tabsById = {}; this._currentTabLocked = false; this._autoSelectFirstItemOnShow = true; this._dropDownButton = this._createDropDownButton(); - WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._zoomChanged, this); + UI.zoomManager.addEventListener(UI.ZoomManager.Events.ZoomChanged, this._zoomChanged, this); } /** @@ -76,7 +76,7 @@ } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ get visibleView() { return this._currentTab ? this._currentTab.view : null; @@ -98,7 +98,7 @@ } /** - * @return {!Array.<!WebInspector.Widget>} + * @return {!Array.<!UI.Widget>} */ tabViews() { return this._tabs.map(tab => tab.view); @@ -106,7 +106,7 @@ /** * @param {string} tabId - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ tabView(tabId) { return this._tabsById[tabId] ? this._tabsById[tabId].view : null; @@ -169,7 +169,7 @@ } /** - * @param {!WebInspector.TabbedPaneTabDelegate} delegate + * @param {!UI.TabbedPaneTabDelegate} delegate */ setTabDelegate(delegate) { var tabs = this._tabs.slice(); @@ -181,7 +181,7 @@ /** * @param {string} id * @param {string} tabTitle - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {string=} tabTooltip * @param {boolean=} userGesture * @param {boolean=} isCloseable @@ -189,7 +189,7 @@ */ appendTab(id, tabTitle, view, tabTooltip, userGesture, isCloseable, index) { isCloseable = typeof isCloseable === 'boolean' ? isCloseable : this._closeableTabs; - var tab = new WebInspector.TabbedPaneTab(this, id, tabTitle, isCloseable, view, tabTooltip); + var tab = new UI.TabbedPaneTab(this, id, tabTitle, isCloseable, view, tabTooltip); tab.setDelegate(this._delegate); this._tabsById[id] = tab; if (index !== undefined) @@ -248,7 +248,7 @@ tab.view.detach(); var eventData = {tabId: id, view: tab.view, isUserGesture: userGesture}; - this.dispatchEventToListeners(WebInspector.TabbedPane.Events.TabClosed, eventData); + this.dispatchEventToListeners(UI.TabbedPane.Events.TabClosed, eventData); return true; } @@ -330,7 +330,7 @@ this.focus(); var eventData = {tabId: id, view: tab.view, isUserGesture: userGesture}; - this.dispatchEventToListeners(WebInspector.TabbedPane.Events.TabSelected, eventData); + this.dispatchEventToListeners(UI.TabbedPane.Events.TabSelected, eventData); return true; } @@ -378,7 +378,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _zoomChanged(event) { for (var i = 0; i < this._tabs.length; ++i) @@ -404,7 +404,7 @@ /** * @param {string} id - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ changeTabView(id, view) { var tab = this._tabsById[id]; @@ -473,7 +473,7 @@ } _updateTabElements() { - WebInspector.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElements); + UI.invokeOnceAfterBatchUpdate(this, this._innerUpdateTabElements); } /** @@ -509,7 +509,7 @@ /** * @param {number} index - * @param {!WebInspector.TabbedPaneTab} tab + * @param {!UI.TabbedPaneTab} tab */ _showTabElement(index, tab) { if (index >= this._tabsElement.children.length) @@ -520,7 +520,7 @@ } /** - * @param {!WebInspector.TabbedPaneTab} tab + * @param {!UI.TabbedPaneTab} tab */ _hideTabElement(tab) { this._tabsElement.removeChild(tab.tabElement); @@ -530,15 +530,15 @@ _createDropDownButton() { var dropDownContainer = createElementWithClass('div', 'tabbed-pane-header-tabs-drop-down-container'); dropDownContainer.createChild('div', 'glyph'); - this._dropDownMenu = new WebInspector.DropDownMenu(dropDownContainer); + this._dropDownMenu = new UI.DropDownMenu(dropDownContainer); this._dropDownMenu.addEventListener( - WebInspector.DropDownMenu.Events.ItemSelected, this._dropDownMenuItemSelected, this); + UI.DropDownMenu.Events.ItemSelected, this._dropDownMenuItemSelected, this); return dropDownContainer; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _dropDownMenuItemSelected(event) { var tabId = /** @type {string} */ (event.data); @@ -699,8 +699,8 @@ } /** - * @param {!Array.<!WebInspector.TabbedPaneTab>} tabsOrdered - * @param {!Array.<!WebInspector.TabbedPaneTab>} tabsHistory + * @param {!Array.<!UI.TabbedPaneTab>} tabsOrdered + * @param {!Array.<!UI.TabbedPaneTab>} tabsHistory * @param {number} totalWidth * @param {number} measuredDropDownButtonWidth * @return {!Array.<number>} @@ -742,7 +742,7 @@ } /** - * @param {!WebInspector.TabbedPaneTab} tab + * @param {!UI.TabbedPaneTab} tab */ _showTab(tab) { tab.tabElement.classList.add('selected'); @@ -767,7 +767,7 @@ } /** - * @param {!WebInspector.TabbedPaneTab} tab + * @param {!UI.TabbedPaneTab} tab */ _hideTab(tab) { tab.tabElement.classList.remove('selected'); @@ -784,7 +784,7 @@ } /** - * @param {!WebInspector.TabbedPaneTab} tab + * @param {!UI.TabbedPaneTab} tab * @param {number} index */ _insertBefore(tab, index) { @@ -794,26 +794,26 @@ if (oldIndex < index) --index; this._tabs.splice(index, 0, tab); - this.dispatchEventToListeners(WebInspector.TabbedPane.Events.TabOrderChanged, this._tabs); + this.dispatchEventToListeners(UI.TabbedPane.Events.TabOrderChanged, this._tabs); } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ leftToolbar() { if (!this._leftToolbar) { - this._leftToolbar = new WebInspector.Toolbar('tabbed-pane-left-toolbar'); + this._leftToolbar = new UI.Toolbar('tabbed-pane-left-toolbar'); this._headerElement.insertBefore(this._leftToolbar.element, this._headerElement.firstChild); } return this._leftToolbar; } /** - * @return {!WebInspector.Toolbar} + * @return {!UI.Toolbar} */ rightToolbar() { if (!this._rightToolbar) { - this._rightToolbar = new WebInspector.Toolbar('tabbed-pane-right-toolbar'); + this._rightToolbar = new UI.Toolbar('tabbed-pane-right-toolbar'); this._headerElement.appendChild(this._rightToolbar.element); } return this._rightToolbar; @@ -834,7 +834,7 @@ }; /** @enum {symbol} */ -WebInspector.TabbedPane.Events = { +UI.TabbedPane.Events = { TabSelected: Symbol('TabSelected'), TabClosed: Symbol('TabClosed'), TabOrderChanged: Symbol('TabOrderChanged') @@ -843,13 +843,13 @@ /** * @unrestricted */ -WebInspector.TabbedPaneTab = class { +UI.TabbedPaneTab = class { /** - * @param {!WebInspector.TabbedPane} tabbedPane + * @param {!UI.TabbedPane} tabbedPane * @param {string} id * @param {string} title * @param {boolean} closeable - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view * @param {string=} tooltip */ constructor(tabbedPane, id, title, closeable, view, tooltip) { @@ -929,14 +929,14 @@ } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ get view() { return this._view; } /** - * @param {!WebInspector.Widget} view + * @param {!UI.Widget} view */ set view(view) { this._view = view; @@ -984,7 +984,7 @@ } /** - * @param {!WebInspector.TabbedPaneTabDelegate} delegate + * @param {!UI.TabbedPaneTabDelegate} delegate */ setDelegate(delegate) { this._delegate = delegate; @@ -1040,7 +1040,7 @@ tabElement.addEventListener('contextmenu', this._tabContextMenu.bind(this), false); if (this._tabbedPane._allowTabReorder) - WebInspector.installDragHandle( + UI.installDragHandle( tabElement, this._startTabDragging.bind(this), this._tabDragging.bind(this), this._endTabDragging.bind(this), '-webkit-grabbing', 'pointer', 200); } @@ -1093,39 +1093,39 @@ _tabContextMenu(event) { /** - * @this {WebInspector.TabbedPaneTab} + * @this {UI.TabbedPaneTab} */ function close() { this._closeTabs([this.id]); } /** - * @this {WebInspector.TabbedPaneTab} + * @this {UI.TabbedPaneTab} */ function closeOthers() { this._closeTabs(this._tabbedPane.otherTabs(this.id)); } /** - * @this {WebInspector.TabbedPaneTab} + * @this {UI.TabbedPaneTab} */ function closeAll() { this._closeTabs(this._tabbedPane.allTabs()); } /** - * @this {WebInspector.TabbedPaneTab} + * @this {UI.TabbedPaneTab} */ function closeToTheRight() { this._closeTabs(this._tabbedPane._tabsToTheRight(this.id)); } - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); if (this._closeable) { - contextMenu.appendItem(WebInspector.UIString.capitalize('Close'), close.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Close ^others'), closeOthers.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Close ^tabs to the ^right'), closeToTheRight.bind(this)); - contextMenu.appendItem(WebInspector.UIString.capitalize('Close ^all'), closeAll.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Close'), close.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Close ^others'), closeOthers.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Close ^tabs to the ^right'), closeToTheRight.bind(this)); + contextMenu.appendItem(Common.UIString.capitalize('Close ^all'), closeAll.bind(this)); } if (this._delegate) this._delegate.onContextMenu(this.id, contextMenu); @@ -1200,18 +1200,18 @@ /** * @interface */ -WebInspector.TabbedPaneTabDelegate = function() {}; +UI.TabbedPaneTabDelegate = function() {}; -WebInspector.TabbedPaneTabDelegate.prototype = { +UI.TabbedPaneTabDelegate.prototype = { /** - * @param {!WebInspector.TabbedPane} tabbedPane + * @param {!UI.TabbedPane} tabbedPane * @param {!Array.<string>} ids */ closeTabs: function(tabbedPane, ids) {}, /** * @param {string} tabId - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ onContextMenu: function(tabId, contextMenu) {} };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextEditor.js b/third_party/WebKit/Source/devtools/front_end/ui/TextEditor.js index ec7e8ee..8b8e0529 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/TextEditor.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/TextEditor.js
@@ -4,12 +4,12 @@ /** * @interface */ -WebInspector.TextEditorFactory = function() {}; +UI.TextEditorFactory = function() {}; -WebInspector.TextEditorFactory.prototype = { +UI.TextEditorFactory.prototype = { /** - * @param {!WebInspector.TextEditor.Options} options - * @return {!WebInspector.TextEditor} + * @param {!UI.TextEditor.Options} options + * @return {!UI.TextEditor} */ createEditor: function(options) {} }; @@ -17,32 +17,32 @@ /** * @interface */ -WebInspector.TextEditor = function() {}; +UI.TextEditor = function() {}; -WebInspector.TextEditor.prototype = { +UI.TextEditor.prototype = { /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ widget: function() {}, /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ fullRange: function() {}, /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ selection: function() {}, /** - * @param {!WebInspector.TextRange} selection + * @param {!Common.TextRange} selection */ setSelection: function(selection) {}, /** - * @param {!WebInspector.TextRange=} textRange + * @param {!Common.TextRange=} textRange * @return {string} */ text: function(textRange) {}, @@ -66,7 +66,7 @@ addKeyDownHandler: function(handler) {}, /** - * @param {?WebInspector.AutocompleteConfig} config + * @param {?UI.AutocompleteConfig} config */ configureAutocomplete: function(config) {}, @@ -75,21 +75,21 @@ /** * @typedef {{ - * bracketMatchingSetting: (!WebInspector.Setting|undefined), + * bracketMatchingSetting: (!Common.Setting|undefined), * lineNumbers: boolean, * lineWrapping: boolean, * mimeType: (string|undefined), * autoHeight: (boolean|undefined) * }} */ -WebInspector.TextEditor.Options; +UI.TextEditor.Options; /** * @typedef {{ - * substituteRangeCallback: ((function(number, number):?WebInspector.TextRange)|undefined), - * suggestionsCallback: ((function(!WebInspector.TextRange, !WebInspector.TextRange, boolean=, string=):?Promise.<!WebInspector.SuggestBox.Suggestions>)|undefined), + * substituteRangeCallback: ((function(number, number):?Common.TextRange)|undefined), + * suggestionsCallback: ((function(!Common.TextRange, !Common.TextRange, boolean=, string=):?Promise.<!UI.SuggestBox.Suggestions>)|undefined), * isWordChar: ((function(string):boolean)|undefined), * captureEnter: (boolean|undefined) * }} */ -WebInspector.AutocompleteConfig; +UI.AutocompleteConfig;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js index 7ed2595..85efa3d8 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -27,10 +27,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.SuggestBoxDelegate} + * @implements {UI.SuggestBoxDelegate} * @unrestricted */ -WebInspector.TextPrompt = class extends WebInspector.Object { +UI.TextPrompt = class extends Common.Object { constructor() { super(); /** @@ -38,7 +38,7 @@ */ this._proxyElement; this._proxyElementDisplay = 'inline-block'; - this._autocompletionTimeout = WebInspector.TextPrompt.DefaultAutocompletionTimeout; + this._autocompletionTimeout = UI.TextPrompt.DefaultAutocompletionTimeout; this._title = ''; this._queryRange = null; this._previousText = ''; @@ -115,7 +115,7 @@ this._boundOnMouseWheel = this.onMouseWheel.bind(this); this._boundClearAutocomplete = this.clearAutocomplete.bind(this); this._proxyElement = element.ownerDocument.createElement('span'); - var shadowRoot = WebInspector.createShadowRootWithCoreStyles(this._proxyElement, 'ui/textPrompt.css'); + var shadowRoot = UI.createShadowRootWithCoreStyles(this._proxyElement, 'ui/textPrompt.css'); this._contentElement = shadowRoot.createChild('div'); this._contentElement.createChild('content'); this._proxyElement.style.display = this._proxyElementDisplay; @@ -130,7 +130,7 @@ this._element.ownerDocument.defaultView.addEventListener('resize', this._boundClearAutocomplete, false); if (this._suggestBoxEnabled) - this._suggestBox = new WebInspector.SuggestBox(this, 20, true); + this._suggestBox = new UI.SuggestBox(this, 20, true); if (this._title) this._proxyElement.title = this._title; @@ -230,7 +230,7 @@ this._oldTabIndex = this._element.tabIndex; if (this._element.tabIndex < 0) this._element.tabIndex = 0; - this._focusRestorer = new WebInspector.ElementFocusRestorer(this._element); + this._focusRestorer = new UI.ElementFocusRestorer(this._element); if (!this.text()) this.autoCompleteSoon(); } @@ -427,7 +427,7 @@ /** * @param {string} query - * @return {!WebInspector.SuggestBox.Suggestions} + * @return {!UI.SuggestBox.Suggestions} */ additionalCompletions(query) { return []; @@ -491,7 +491,7 @@ var beforeRange = this._createRange(); beforeRange.setStart(this._element, 0); beforeRange.setEnd(fullWordRange.startContainer, fullWordRange.startOffset); - this._queryRange = new WebInspector.TextRange( + this._queryRange = new Common.TextRange( 0, beforeRange.toString().length, 0, beforeRange.toString().length + fullWordRange.toString().length); if (selectedIndex === -1) @@ -510,7 +510,7 @@ this._currentSuggestion = suggestion; this._refreshGhostText(); if (isIntermediateSuggestion) - this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemApplied); + this.dispatchEventToListeners(UI.TextPrompt.Events.ItemApplied); } /** @@ -533,7 +533,7 @@ this._queryRange.startColumn + this._currentSuggestion.length); this.clearAutocomplete(); - this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemAccepted); + this.dispatchEventToListeners(UI.TextPrompt.Events.ItemAccepted); return true; } @@ -638,10 +638,10 @@ } }; -WebInspector.TextPrompt.DefaultAutocompletionTimeout = 250; +UI.TextPrompt.DefaultAutocompletionTimeout = 250; /** @enum {symbol} */ -WebInspector.TextPrompt.Events = { +UI.TextPrompt.Events = { ItemApplied: Symbol('text-prompt-item-applied'), ItemAccepted: Symbol('text-prompt-item-accepted') };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js index 26becf5..6caf67cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js
@@ -4,13 +4,13 @@ /** * @unrestricted */ -WebInspector.ThrottledWidget = class extends WebInspector.VBox { +UI.ThrottledWidget = class extends UI.VBox { /** * @param {boolean=} isWebComponent */ constructor(isWebComponent) { super(isWebComponent); - this._updateThrottler = new WebInspector.Throttler(100); + this._updateThrottler = new Common.Throttler(100); this._updateWhenVisible = false; } @@ -29,7 +29,7 @@ this._updateThrottler.schedule(innerUpdate.bind(this)); /** - * @this {WebInspector.ThrottledWidget} + * @this {UI.ThrottledWidget} * @return {!Promise<?>} */ function innerUpdate() {
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js index 4c9ea96..f419b84b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -31,38 +31,38 @@ /** * @unrestricted */ -WebInspector.Toolbar = class { +UI.Toolbar = class { /** * @param {string} className * @param {!Element=} parentElement */ constructor(className, parentElement) { - /** @type {!Array.<!WebInspector.ToolbarItem>} */ + /** @type {!Array.<!UI.ToolbarItem>} */ this._items = []; this._reverse = false; this.element = parentElement ? parentElement.createChild('div') : createElement('div'); this.element.className = className; this.element.classList.add('toolbar'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/toolbar.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/toolbar.css'); this._contentElement = this._shadowRoot.createChild('div', 'toolbar-shadow'); this._insertionPoint = this._contentElement.createChild('content'); } /** - * @param {!WebInspector.Action} action - * @param {!Array<!WebInspector.ToolbarButton>=} toggledOptions - * @param {!Array<!WebInspector.ToolbarButton>=} untoggledOptions - * @return {!WebInspector.ToolbarItem} + * @param {!UI.Action} action + * @param {!Array<!UI.ToolbarButton>=} toggledOptions + * @param {!Array<!UI.ToolbarButton>=} untoggledOptions + * @return {!UI.ToolbarItem} */ static createActionButton(action, toggledOptions, untoggledOptions) { - var button = new WebInspector.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); + var button = new UI.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); button.setToggleWithRedColor(action.toggleWithRedColor()); button.addEventListener('click', action.execute, action); - action.addEventListener(WebInspector.Action.Events.Enabled, enabledChanged); - action.addEventListener(WebInspector.Action.Events.Toggled, toggled); - /** @type {?WebInspector.LongClickController} */ + action.addEventListener(UI.Action.Events.Enabled, enabledChanged); + action.addEventListener(UI.Action.Events.Toggled, toggled); + /** @type {?UI.LongClickController} */ var longClickController = null; - /** @type {?Array<!WebInspector.ToolbarButton>} */ + /** @type {?Array<!UI.ToolbarButton>} */ var longClickButtons = null; /** @type {?Element} */ var longClickGlyph = null; @@ -70,7 +70,7 @@ return button; /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ function enabledChanged(event) { button.setEnabled(/** @type {boolean} */ (event.data)); @@ -79,7 +79,7 @@ function toggled() { button.setToggled(action.toggled()); if (action.title()) - WebInspector.Tooltip.install(button.element, action.title(), action.id()); + UI.Tooltip.install(button.element, action.title(), action.id()); updateOptions(); } @@ -88,8 +88,8 @@ if (buttons && buttons.length) { if (!longClickController) { - longClickController = new WebInspector.LongClickController(button.element, showOptions); - longClickGlyph = WebInspector.Icon.create('largeicon-longclick-triangle', 'long-click-glyph'); + longClickController = new UI.LongClickController(button.element, showOptions); + longClickGlyph = UI.Icon.create('largeicon-longclick-triangle', 'long-click-glyph'); button.element.appendChild(longClickGlyph); longClickButtons = buttons; } @@ -106,11 +106,11 @@ function showOptions() { var buttons = longClickButtons.slice(); - var mainButtonClone = new WebInspector.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); + var mainButtonClone = new UI.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); mainButtonClone.addEventListener('click', clicked); /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ function clicked(event) { button._clicked(/** @type {!Event} */ (event.data)); @@ -122,8 +122,8 @@ var document = button.element.ownerDocument; document.documentElement.addEventListener('mouseup', mouseUp, false); - var optionsGlassPane = new WebInspector.GlassPane(document); - var optionsBar = new WebInspector.Toolbar('fill', optionsGlassPane.element); + var optionsGlassPane = new UI.GlassPane(document); + var optionsBar = new UI.Toolbar('fill', optionsGlassPane.element); optionsBar._contentElement.classList.add('floating'); const buttonHeight = 26; @@ -182,11 +182,11 @@ /** * @param {string} actionId - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ static createActionButtonForId(actionId) { - var action = WebInspector.actionRegistry.action(actionId); - return /** @type {?WebInspector.ToolbarItem} */ (action ? WebInspector.Toolbar.createActionButton(action) : null); + var action = UI.actionRegistry.action(actionId); + return /** @type {?UI.ToolbarItem} */ (action ? UI.Toolbar.createActionButton(action) : null); } /** @@ -224,7 +224,7 @@ } /** - * @param {!WebInspector.ToolbarItem} item + * @param {!UI.ToolbarItem} item */ appendToolbarItem(item) { this._items.push(item); @@ -237,18 +237,18 @@ } appendSeparator() { - this.appendToolbarItem(new WebInspector.ToolbarSeparator()); + this.appendToolbarItem(new UI.ToolbarSeparator()); } appendSpacer() { - this.appendToolbarItem(new WebInspector.ToolbarSeparator(true)); + this.appendToolbarItem(new UI.ToolbarSeparator(true)); } /** * @param {string} text */ appendText(text) { - this.appendToolbarItem(new WebInspector.ToolbarText(text)); + this.appendToolbarItem(new UI.ToolbarText(text)); } removeToolbarItems() { @@ -286,7 +286,7 @@ var lastSeparator; var nonSeparatorVisible = false; for (var i = 0; i < this._items.length; ++i) { - if (this._items[i] instanceof WebInspector.ToolbarSeparator) { + if (this._items[i] instanceof UI.ToolbarSeparator) { this._items[i].setVisible(!previousIsSeparator); previousIsSeparator = true; lastSeparator = this._items[i]; @@ -308,7 +308,7 @@ * @param {string} location */ appendLocationItems(location) { - var extensions = self.runtime.extensions(WebInspector.ToolbarItem.Provider); + var extensions = self.runtime.extensions(UI.ToolbarItem.Provider); var promises = []; for (var i = 0; i < extensions.length; ++i) { if (extensions[i].descriptor()['location'] === location) @@ -318,27 +318,27 @@ /** * @param {!Runtime.Extension} extension - * @return {!Promise.<?WebInspector.ToolbarItem>} + * @return {!Promise.<?UI.ToolbarItem>} */ function resolveItem(extension) { var descriptor = extension.descriptor(); if (descriptor['separator']) - return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */ (new WebInspector.ToolbarSeparator())); + return Promise.resolve(/** @type {?UI.ToolbarItem} */ (new UI.ToolbarSeparator())); if (descriptor['actionId']) - return Promise.resolve(WebInspector.Toolbar.createActionButtonForId(descriptor['actionId'])); + return Promise.resolve(UI.Toolbar.createActionButtonForId(descriptor['actionId'])); return extension.instance().then(fetchItemFromProvider); /** * @param {!Object} provider */ function fetchItemFromProvider(provider) { - return /** @type {!WebInspector.ToolbarItem.Provider} */ (provider).item(); + return /** @type {!UI.ToolbarItem.Provider} */ (provider).item(); } } /** - * @param {!Array.<?WebInspector.ToolbarItem>} items - * @this {WebInspector.Toolbar} + * @param {!Array.<?UI.ToolbarItem>} items + * @this {UI.Toolbar} */ function appendItemsInOrder(items) { for (var i = 0; i < items.length; ++i) { @@ -353,7 +353,7 @@ /** * @unrestricted */ -WebInspector.ToolbarItem = class extends WebInspector.Object { +UI.ToolbarItem = class extends Common.Object { /** * @param {!Element} element */ @@ -374,7 +374,7 @@ if (this._title === title) return; this._title = title; - WebInspector.Tooltip.install(this.element, title); + UI.Tooltip.install(this.element, title); } _mouseEnter() { @@ -414,7 +414,7 @@ return; this.element.classList.toggle('hidden', !x); this._visible = x; - if (this._toolbar && !(this instanceof WebInspector.ToolbarSeparator)) + if (this._toolbar && !(this instanceof UI.ToolbarSeparator)) this._toolbar._hideSeparatorDupes(); } }; @@ -422,7 +422,7 @@ /** * @unrestricted */ -WebInspector.ToolbarText = class extends WebInspector.ToolbarItem { +UI.ToolbarText = class extends UI.ToolbarItem { /** * @param {string=} text */ @@ -443,7 +443,7 @@ /** * @unrestricted */ -WebInspector.ToolbarButton = class extends WebInspector.ToolbarItem { +UI.ToolbarButton = class extends UI.ToolbarItem { /** * @param {string} title * @param {string=} glyph @@ -455,7 +455,7 @@ this.element.addEventListener('mousedown', this._mouseDown.bind(this), false); this.element.addEventListener('mouseup', this._mouseUp.bind(this), false); - this._glyphElement = WebInspector.Icon.create('', 'toolbar-glyph hidden'); + this._glyphElement = UI.Icon.create('', 'toolbar-glyph hidden'); this.element.appendChild(this._glyphElement); this._textElement = this.element.createChild('div', 'toolbar-text hidden'); @@ -501,7 +501,7 @@ */ turnIntoSelect(width) { this.element.classList.add('toolbar-has-dropdown'); - var dropdownArrowIcon = WebInspector.Icon.create('smallicon-dropdown-arrow', 'toolbar-dropdown-arrow'); + var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar-dropdown-arrow'); this.element.appendChild(dropdownArrowIcon); if (width) this.element.style.width = width + 'px'; @@ -533,7 +533,7 @@ /** * @unrestricted */ -WebInspector.ToolbarInput = class extends WebInspector.ToolbarItem { +UI.ToolbarInput = class extends UI.ToolbarItem { /** * @param {string=} placeholder * @param {number=} growFactor @@ -564,18 +564,18 @@ } _onChangeCallback() { - this.dispatchEventToListeners(WebInspector.ToolbarInput.Event.TextChanged, this.element.value); + this.dispatchEventToListeners(UI.ToolbarInput.Event.TextChanged, this.element.value); } }; -WebInspector.ToolbarInput.Event = { +UI.ToolbarInput.Event = { TextChanged: 'TextChanged' }; /** * @unrestricted */ -WebInspector.ToolbarToggle = class extends WebInspector.ToolbarButton { +UI.ToolbarToggle = class extends UI.ToolbarButton { /** * @param {string} title * @param {string=} glyph @@ -621,9 +621,9 @@ /** * @unrestricted */ -WebInspector.ToolbarMenuButton = class extends WebInspector.ToolbarButton { +UI.ToolbarMenuButton = class extends UI.ToolbarButton { /** - * @param {function(!WebInspector.ContextMenu)} contextMenuHandler + * @param {function(!UI.ContextMenu)} contextMenuHandler * @param {boolean=} useSoftMenu */ constructor(contextMenuHandler, useSoftMenu) { @@ -656,7 +656,7 @@ // after the window gains focus. See crbug.com/655556 if (this._lastTriggerTime && Date.now() - this._lastTriggerTime < 300) return; - var contextMenu = new WebInspector.ContextMenu( + var contextMenu = new UI.ContextMenu( event, this._useSoftMenu, this.element.totalOffsetLeft(), this.element.totalOffsetTop() + this.element.offsetHeight); this._contextMenuHandler(contextMenu); @@ -679,9 +679,9 @@ /** * @unrestricted */ -WebInspector.ToolbarSettingToggle = class extends WebInspector.ToolbarToggle { +UI.ToolbarSettingToggle = class extends UI.ToolbarToggle { /** - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting * @param {string} glyph * @param {string} title * @param {string=} toggledTitle @@ -714,7 +714,7 @@ /** * @unrestricted */ -WebInspector.ToolbarSeparator = class extends WebInspector.ToolbarItem { +UI.ToolbarSeparator = class extends UI.ToolbarItem { /** * @param {boolean=} spacer */ @@ -726,11 +726,11 @@ /** * @interface */ -WebInspector.ToolbarItem.Provider = function() {}; +UI.ToolbarItem.Provider = function() {}; -WebInspector.ToolbarItem.Provider.prototype = { +UI.ToolbarItem.Provider.prototype = { /** - * @return {?WebInspector.ToolbarItem} + * @return {?UI.ToolbarItem} */ item: function() {} }; @@ -738,11 +738,11 @@ /** * @interface */ -WebInspector.ToolbarItem.ItemsProvider = function() {}; +UI.ToolbarItem.ItemsProvider = function() {}; -WebInspector.ToolbarItem.ItemsProvider.prototype = { +UI.ToolbarItem.ItemsProvider.prototype = { /** - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ toolbarItems: function() {} }; @@ -750,7 +750,7 @@ /** * @unrestricted */ -WebInspector.ToolbarComboBox = class extends WebInspector.ToolbarItem { +UI.ToolbarComboBox = class extends UI.ToolbarItem { /** * @param {?function(!Event)} changeHandler * @param {string=} className @@ -759,7 +759,7 @@ super(createElementWithClass('span', 'toolbar-select-container')); this._selectElement = this.element.createChild('select', 'toolbar-item'); - var dropdownArrowIcon = WebInspector.Icon.create('smallicon-dropdown-arrow', 'toolbar-dropdown-arrow'); + var dropdownArrowIcon = UI.Icon.create('smallicon-dropdown-arrow', 'toolbar-dropdown-arrow'); this.element.appendChild(dropdownArrowIcon); if (changeHandler) this._selectElement.addEventListener('change', changeHandler, false); @@ -870,11 +870,11 @@ /** * @unrestricted */ -WebInspector.ToolbarCheckbox = class extends WebInspector.ToolbarItem { +UI.ToolbarCheckbox = class extends UI.ToolbarItem { /** * @param {string} text * @param {string=} title - * @param {!WebInspector.Setting=} setting + * @param {!Common.Setting=} setting * @param {function()=} listener */ constructor(text, title, setting, listener) { @@ -884,7 +884,7 @@ if (title) this.element.title = title; if (setting) - WebInspector.SettingsUI.bindCheckbox(this.inputElement, setting); + UI.SettingsUI.bindCheckbox(this.inputElement, setting); if (listener) this.inputElement.addEventListener('click', listener, false); }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js b/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js index 7fd8bdb8..cb8123aa 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js
@@ -4,20 +4,20 @@ /** * @unrestricted */ -WebInspector.Tooltip = class { +UI.Tooltip = class { /** * @param {!Document} doc */ constructor(doc) { this.element = doc.body.createChild('div'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/tooltip.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/tooltip.css'); this._tooltipElement = this._shadowRoot.createChild('div', 'tooltip'); doc.addEventListener('mousemove', this._mouseMove.bind(this), true); doc.addEventListener('mousedown', this._hide.bind(this, true), true); doc.addEventListener('mouseleave', this._hide.bind(this, false), true); doc.addEventListener('keydown', this._hide.bind(this, true), true); - WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._reset, this); + UI.zoomManager.addEventListener(UI.ZoomManager.Events.ZoomChanged, this._reset, this); doc.defaultView.addEventListener('resize', this._reset.bind(this), false); } @@ -25,7 +25,7 @@ * @param {!Document} doc */ static installHandler(doc) { - new WebInspector.Tooltip(doc); + new UI.Tooltip(doc); } /** @@ -36,17 +36,17 @@ */ static install(element, tooltipContent, actionId, options) { if (typeof tooltipContent === 'string' && tooltipContent === '') { - delete element[WebInspector.Tooltip._symbol]; + delete element[UI.Tooltip._symbol]; return; } - element[WebInspector.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}}; + element[UI.Tooltip._symbol] = {content: tooltipContent, actionId: actionId, options: options || {}}; } /** * @param {!Element} element */ static addNativeOverrideContainer(element) { - WebInspector.Tooltip._nativeOverrideContainer.push(element); + UI.Tooltip._nativeOverrideContainer.push(element); } /** @@ -64,7 +64,7 @@ for (var element of path) { if (element === this._anchorElement) { return; - } else if (element[WebInspector.Tooltip._symbol]) { + } else if (element[UI.Tooltip._symbol]) { this._show(element, mouseEvent); return; } @@ -76,14 +76,14 @@ * @param {!Event} event */ _show(anchorElement, event) { - var tooltip = anchorElement[WebInspector.Tooltip._symbol]; + var tooltip = anchorElement[UI.Tooltip._symbol]; this._anchorElement = anchorElement; this._tooltipElement.removeChildren(); // Check if native tooltips should be used. - for (var element of WebInspector.Tooltip._nativeOverrideContainer) { + for (var element of UI.Tooltip._nativeOverrideContainer) { if (this._anchorElement.isSelfOrDescendant(element)) { - Object.defineProperty(this._anchorElement, 'title', WebInspector.Tooltip._nativeTitle); + Object.defineProperty(this._anchorElement, 'title', UI.Tooltip._nativeTitle); this._anchorElement.title = tooltip.content; return; } @@ -95,7 +95,7 @@ this._tooltipElement.appendChild(tooltip.content); if (tooltip.actionId) { - var shortcuts = WebInspector.shortcutRegistry.shortcutDescriptorsForAction(tooltip.actionId); + var shortcuts = UI.shortcutRegistry.shortcutDescriptorsForAction(tooltip.actionId); for (var shortcut of shortcuts) { var shortcutElement = this._tooltipElement.createChild('div', 'tooltip-shortcut'); shortcutElement.textContent = shortcut.name; @@ -109,12 +109,12 @@ // Show tooltip instantly if a tooltip was shown recently. var now = Date.now(); var instant = - (this._tooltipLastClosed && now - this._tooltipLastClosed < WebInspector.Tooltip.Timing.InstantThreshold); + (this._tooltipLastClosed && now - this._tooltipLastClosed < UI.Tooltip.Timing.InstantThreshold); this._tooltipElement.classList.toggle('instant', instant); - this._tooltipLastOpened = instant ? now : now + WebInspector.Tooltip.Timing.OpeningDelay; + this._tooltipLastOpened = instant ? now : now + UI.Tooltip.Timing.OpeningDelay; // Get container element. - var container = WebInspector.Dialog.modalHostView().element; + var container = UI.Dialog.modalHostView().element; if (!anchorElement.isDescendant(container)) container = this.element.parentElement; @@ -166,19 +166,19 @@ } }; -WebInspector.Tooltip.Timing = { +UI.Tooltip.Timing = { // Max time between tooltips showing that no opening delay is required. 'InstantThreshold': 300, // Wait time before opening a tooltip. 'OpeningDelay': 600 }; -WebInspector.Tooltip._symbol = Symbol('Tooltip'); +UI.Tooltip._symbol = Symbol('Tooltip'); /** @type {!Array.<!Element>} */ -WebInspector.Tooltip._nativeOverrideContainer = []; -WebInspector.Tooltip._nativeTitle = +UI.Tooltip._nativeOverrideContainer = []; +UI.Tooltip._nativeTitle = /** @type {!ObjectPropertyDescriptor} */ (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'title')); Object.defineProperty(HTMLElement.prototype, 'title', { @@ -187,7 +187,7 @@ * @this {!Element} */ get: function() { - var tooltip = this[WebInspector.Tooltip._symbol]; + var tooltip = this[UI.Tooltip._symbol]; return tooltip ? tooltip.content : ''; }, @@ -196,6 +196,6 @@ * @this {!Element} */ set: function(x) { - WebInspector.Tooltip.install(this, x); + UI.Tooltip.install(this, x); } });
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js index fce81da4..de8d035b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -28,8 +28,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.highlightedSearchResultClassName = 'highlighted-search-result'; -WebInspector.highlightedCurrentSearchResultClassName = 'current-search-result'; +UI.highlightedSearchResultClassName = 'highlighted-search-result'; +UI.highlightedCurrentSearchResultClassName = 'current-search-result'; /** * @param {!Element} element @@ -40,13 +40,13 @@ * @param {?string=} hoverCursor * @param {number=} startDelay */ -WebInspector.installDragHandle = function( +UI.installDragHandle = function( element, elementDragStart, elementDrag, elementDragEnd, cursor, hoverCursor, startDelay) { /** * @param {!Event} event */ function onMouseDown(event) { - var dragHandler = new WebInspector.DragHandler(); + var dragHandler = new UI.DragHandler(); var dragStart = dragHandler.elementDragStart.bind( dragHandler, element, elementDragStart, elementDrag, elementDragEnd, cursor, event); if (startDelay) @@ -77,15 +77,15 @@ * @param {string} cursor * @param {!Event} event */ -WebInspector.elementDragStart = function(targetElement, elementDragStart, elementDrag, elementDragEnd, cursor, event) { - var dragHandler = new WebInspector.DragHandler(); +UI.elementDragStart = function(targetElement, elementDragStart, elementDrag, elementDragEnd, cursor, event) { + var dragHandler = new UI.DragHandler(); dragHandler.elementDragStart(targetElement, elementDragStart, elementDrag, elementDragEnd, cursor, event); }; /** * @unrestricted */ -WebInspector.DragHandler = class { +UI.DragHandler = class { constructor() { this._elementDragMove = this._elementDragMove.bind(this); this._elementDragEnd = this._elementDragEnd.bind(this); @@ -94,19 +94,19 @@ _createGlassPane() { this._glassPaneInUse = true; - if (!WebInspector.DragHandler._glassPaneUsageCount++) - WebInspector.DragHandler._glassPane = new WebInspector.GlassPane(WebInspector.DragHandler._documentForMouseOut); + if (!UI.DragHandler._glassPaneUsageCount++) + UI.DragHandler._glassPane = new UI.GlassPane(UI.DragHandler._documentForMouseOut); } _disposeGlassPane() { if (!this._glassPaneInUse) return; this._glassPaneInUse = false; - if (--WebInspector.DragHandler._glassPaneUsageCount) + if (--UI.DragHandler._glassPaneUsageCount) return; - WebInspector.DragHandler._glassPane.dispose(); - delete WebInspector.DragHandler._glassPane; - delete WebInspector.DragHandler._documentForMouseOut; + UI.DragHandler._glassPane.dispose(); + delete UI.DragHandler._glassPane; + delete UI.DragHandler._documentForMouseOut; } /** @@ -119,7 +119,7 @@ */ elementDragStart(targetElement, elementDragStart, elementDrag, elementDragEnd, cursor, event) { // Only drag upon left button. Right will likely cause a context menu. So will ctrl-click on mac. - if (event.button || (WebInspector.isMac() && event.ctrlKey)) + if (event.button || (Host.isMac() && event.ctrlKey)) return; if (this._elementDraggingEventListener) @@ -132,9 +132,9 @@ this._elementDraggingEventListener = elementDrag; this._elementEndDraggingEventListener = elementDragEnd; console.assert( - (WebInspector.DragHandler._documentForMouseOut || targetDocument) === targetDocument, + (UI.DragHandler._documentForMouseOut || targetDocument) === targetDocument, 'Dragging on multiple documents.'); - WebInspector.DragHandler._documentForMouseOut = targetDocument; + UI.DragHandler._documentForMouseOut = targetDocument; this._dragEventsTargetDocument = targetDocument; this._dragEventsTargetDocumentTop = targetDocument.defaultView.top.document; @@ -151,7 +151,7 @@ } /** * @param {string} oldCursor - * @this {WebInspector.DragHandler} + * @this {UI.DragHandler} */ function restoreCursor(oldCursor) { targetDocument.body.style.removeProperty('cursor'); @@ -167,9 +167,9 @@ } _unregisterMouseOutWhileDragging() { - if (!WebInspector.DragHandler._documentForMouseOut) + if (!UI.DragHandler._documentForMouseOut) return; - WebInspector.DragHandler._documentForMouseOut.removeEventListener('mouseout', this._mouseOutWhileDragging, true); + UI.DragHandler._documentForMouseOut.removeEventListener('mouseout', this._mouseOutWhileDragging, true); } _unregisterDragEvents() { @@ -223,7 +223,7 @@ } }; -WebInspector.DragHandler._glassPaneUsageCount = 0; +UI.DragHandler._glassPaneUsageCount = 0; /** * @param {!Element} element @@ -235,9 +235,9 @@ * @param {number=} startDelay * @param {number=} friction */ -WebInspector.installInertialDragHandle = function( +UI.installInertialDragHandle = function( element, elementDragStart, elementDrag, elementDragEnd, cursor, hoverCursor, startDelay, friction) { - WebInspector.installDragHandle( + UI.installDragHandle( element, drag.bind(null, elementDragStart), drag.bind(null, elementDrag), dragEnd, cursor, hoverCursor, startDelay); if (typeof friction !== 'number') @@ -302,7 +302,7 @@ /** * @unrestricted */ -WebInspector.GlassPane = class { +UI.GlassPane = class { /** * @param {!Document} document * @param {boolean=} dimmed @@ -310,37 +310,37 @@ constructor(document, dimmed) { this.element = createElement('div'); var background = dimmed ? 'rgba(255, 255, 255, 0.5)' : 'transparent'; - this._zIndex = WebInspector._glassPane ? - WebInspector._glassPane._zIndex + 1000 : + this._zIndex = UI._glassPane ? + UI._glassPane._zIndex + 1000 : 3000; // Deliberately starts with 3000 to hide other z-indexed elements below. this.element.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;background-color:' + background + ';z-index:' + this._zIndex + ';overflow:hidden;'; document.body.appendChild(this.element); - WebInspector._glassPane = this; + UI._glassPane = this; // TODO(dgozman): disallow focus outside of glass pane? } dispose() { - delete WebInspector._glassPane; + delete UI._glassPane; this.element.remove(); } }; -/** @type {!WebInspector.GlassPane|undefined} */ -WebInspector._glassPane; +/** @type {!UI.GlassPane|undefined} */ +UI._glassPane; /** * @param {?Node=} node * @return {boolean} */ -WebInspector.isBeingEdited = function(node) { +UI.isBeingEdited = function(node) { if (!node || node.nodeType !== Node.ELEMENT_NODE) return false; var element = /** {!Element} */ (node); if (element.classList.contains('text-prompt') || element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') return true; - if (!WebInspector.__editingCount) + if (!UI.__editingCount) return false; while (element) { @@ -355,8 +355,8 @@ * @return {boolean} * @suppressGlobalPropertiesCheck */ -WebInspector.isEditing = function() { - if (WebInspector.__editingCount) +UI.isEditing = function() { + if (UI.__editingCount) return true; var focused = document.deepActiveElement(); @@ -370,32 +370,32 @@ * @param {boolean} value * @return {boolean} */ -WebInspector.markBeingEdited = function(element, value) { +UI.markBeingEdited = function(element, value) { if (value) { if (element.__editing) return false; element.classList.add('being-edited'); element.__editing = true; - WebInspector.__editingCount = (WebInspector.__editingCount || 0) + 1; + UI.__editingCount = (UI.__editingCount || 0) + 1; } else { if (!element.__editing) return false; element.classList.remove('being-edited'); delete element.__editing; - --WebInspector.__editingCount; + --UI.__editingCount; } return true; }; -WebInspector.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/; +UI.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/; -WebInspector.StyleValueDelimiters = ' \xA0\t\n"\':;,/()'; +UI.StyleValueDelimiters = ' \xA0\t\n"\':;,/()'; /** * @param {!Event} event * @return {?string} */ -WebInspector._valueModificationDirection = function(event) { +UI._valueModificationDirection = function(event) { var direction = null; if (event.type === 'mousewheel') { // When shift is pressed while spinning mousewheel, delta comes as wheelDeltaX. @@ -417,8 +417,8 @@ * @param {!Event} event * @return {?string} */ -WebInspector._modifiedHexValue = function(hexString, event) { - var direction = WebInspector._valueModificationDirection(event); +UI._modifiedHexValue = function(hexString, event) { + var direction = UI._valueModificationDirection(event); if (!direction) return null; @@ -441,7 +441,7 @@ // If no shortcut keys are pressed then increase hex value by 1. // Keys can be pressed together to increase RGB channels. e.g trying different shades. var delta = 0; - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(mouseEvent)) + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(mouseEvent)) delta += Math.pow(16, channelLen * 2); if (mouseEvent.shiftKey) delta += Math.pow(16, channelLen); @@ -468,8 +468,8 @@ * @param {!Event} event * @return {?number} */ -WebInspector._modifiedFloatNumber = function(number, event) { - var direction = WebInspector._valueModificationDirection(event); +UI._modifiedFloatNumber = function(number, event) { + var direction = UI._valueModificationDirection(event); if (!direction) return null; @@ -481,7 +481,7 @@ // When alt is pressed, increase by 0.1. // Otherwise increase by 1. var delta = 1; - if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(mouseEvent)) + if (UI.KeyboardShortcut.eventHasCtrlOrMeta(mouseEvent)) delta = 100; else if (mouseEvent.shiftKey) delta = 10; @@ -494,7 +494,7 @@ // Make the new number and constrain it to a precision of 6, this matches numbers the engine returns. // Use the Number constructor to forget the fixed precision, so 1.100000 will print as 1.1. var result = Number((number + delta).toFixed(6)); - if (!String(result).match(WebInspector.CSSNumberRegex)) + if (!String(result).match(UI.CSSNumberRegex)) return null; return result; @@ -506,7 +506,7 @@ * @param {function(string, number, string):string=} customNumberHandler * @return {?string} */ -WebInspector.createReplacementString = function(wordString, event, customNumberHandler) { +UI.createReplacementString = function(wordString, event, customNumberHandler) { var prefix; var suffix; var number; @@ -515,7 +515,7 @@ if (matches && matches.length) { prefix = matches[1]; suffix = matches[3]; - number = WebInspector._modifiedHexValue(matches[2], event); + number = UI._modifiedHexValue(matches[2], event); if (number !== null) replacementString = prefix + number + suffix; } else { @@ -523,7 +523,7 @@ if (matches && matches.length) { prefix = matches[1]; suffix = matches[3]; - number = WebInspector._modifiedFloatNumber(parseFloat(matches[2]), event); + number = UI._modifiedFloatNumber(parseFloat(matches[2]), event); if (number !== null) replacementString = customNumberHandler ? customNumberHandler(prefix, number, suffix) : prefix + number + suffix; @@ -540,7 +540,7 @@ * @param {function(string, number, string):string=} customNumberHandler * @return {boolean} */ -WebInspector.handleElementValueModifications = function( +UI.handleElementValueModifications = function( event, element, finishHandler, suggestionHandler, customNumberHandler) { /** * @return {?Range} @@ -565,13 +565,13 @@ var originalValue = element.textContent; var wordRange = - selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, WebInspector.StyleValueDelimiters, element); + selectionRange.startContainer.rangeOfWord(selectionRange.startOffset, UI.StyleValueDelimiters, element); var wordString = wordRange.toString(); if (suggestionHandler && suggestionHandler(wordString)) return false; - var replacementString = WebInspector.createReplacementString(wordString, event, customNumberHandler); + var replacementString = UI.createReplacementString(wordString, event, customNumberHandler); if (replacementString) { var replacementTextNode = createTextNode(replacementString); @@ -605,29 +605,29 @@ Number.preciseMillisToString = function(ms, precision) { precision = precision || 0; var format = '%.' + precision + 'f\u2009ms'; - return WebInspector.UIString(format, ms); + return Common.UIString(format, ms); }; -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._microsFormat = new WebInspector.UIStringFormat('%.0f\u2009\u03bcs'); +/** @type {!Common.UIStringFormat} */ +UI._microsFormat = new Common.UIStringFormat('%.0f\u2009\u03bcs'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._subMillisFormat = new WebInspector.UIStringFormat('%.2f\u2009ms'); +/** @type {!Common.UIStringFormat} */ +UI._subMillisFormat = new Common.UIStringFormat('%.2f\u2009ms'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._millisFormat = new WebInspector.UIStringFormat('%.0f\u2009ms'); +/** @type {!Common.UIStringFormat} */ +UI._millisFormat = new Common.UIStringFormat('%.0f\u2009ms'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._secondsFormat = new WebInspector.UIStringFormat('%.2f\u2009s'); +/** @type {!Common.UIStringFormat} */ +UI._secondsFormat = new Common.UIStringFormat('%.2f\u2009s'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._minutesFormat = new WebInspector.UIStringFormat('%.1f\u2009min'); +/** @type {!Common.UIStringFormat} */ +UI._minutesFormat = new Common.UIStringFormat('%.1f\u2009min'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._hoursFormat = new WebInspector.UIStringFormat('%.1f\u2009hrs'); +/** @type {!Common.UIStringFormat} */ +UI._hoursFormat = new Common.UIStringFormat('%.1f\u2009hrs'); -/** @type {!WebInspector.UIStringFormat} */ -WebInspector._daysFormat = new WebInspector.UIStringFormat('%.1f\u2009days'); +/** @type {!Common.UIStringFormat} */ +UI._daysFormat = new Common.UIStringFormat('%.1f\u2009days'); /** * @param {number} ms @@ -642,26 +642,26 @@ return '0'; if (higherResolution && ms < 0.1) - return WebInspector._microsFormat.format(ms * 1000); + return UI._microsFormat.format(ms * 1000); if (higherResolution && ms < 1000) - return WebInspector._subMillisFormat.format(ms); + return UI._subMillisFormat.format(ms); if (ms < 1000) - return WebInspector._millisFormat.format(ms); + return UI._millisFormat.format(ms); var seconds = ms / 1000; if (seconds < 60) - return WebInspector._secondsFormat.format(seconds); + return UI._secondsFormat.format(seconds); var minutes = seconds / 60; if (minutes < 60) - return WebInspector._minutesFormat.format(minutes); + return UI._minutesFormat.format(minutes); var hours = minutes / 60; if (hours < 24) - return WebInspector._hoursFormat.format(hours); + return UI._hoursFormat.format(hours); var days = hours / 24; - return WebInspector._daysFormat.format(days); + return UI._daysFormat.format(days); }; /** @@ -681,19 +681,19 @@ */ Number.bytesToString = function(bytes) { if (bytes < 1024) - return WebInspector.UIString('%.0f\u2009B', bytes); + return Common.UIString('%.0f\u2009B', bytes); var kilobytes = bytes / 1024; if (kilobytes < 100) - return WebInspector.UIString('%.1f\u2009KB', kilobytes); + return Common.UIString('%.1f\u2009KB', kilobytes); if (kilobytes < 1024) - return WebInspector.UIString('%.0f\u2009KB', kilobytes); + return Common.UIString('%.0f\u2009KB', kilobytes); var megabytes = kilobytes / 1024; if (megabytes < 100) - return WebInspector.UIString('%.1f\u2009MB', megabytes); + return Common.UIString('%.1f\u2009MB', megabytes); else - return WebInspector.UIString('%.0f\u2009MB', megabytes); + return Common.UIString('%.0f\u2009MB', megabytes); }; /** @@ -713,7 +713,7 @@ * @param {?ArrayLike} substitutions * @return {!Element} */ -WebInspector.formatLocalized = function(format, substitutions) { +UI.formatLocalized = function(format, substitutions) { var formatters = {s: substitution => substitution}; /** * @param {!Element} a @@ -724,48 +724,48 @@ a.appendChild(typeof b === 'string' ? createTextNode(b) : b); return a; } - return String.format(WebInspector.UIString(format), substitutions, formatters, createElement('span'), append) + return String.format(Common.UIString(format), substitutions, formatters, createElement('span'), append) .formattedResult; }; /** * @return {string} */ -WebInspector.openLinkExternallyLabel = function() { - return WebInspector.UIString.capitalize('Open ^link in ^new ^tab'); +UI.openLinkExternallyLabel = function() { + return Common.UIString.capitalize('Open ^link in ^new ^tab'); }; /** * @return {string} */ -WebInspector.copyLinkAddressLabel = function() { - return WebInspector.UIString.capitalize('Copy ^link ^address'); +UI.copyLinkAddressLabel = function() { + return Common.UIString.capitalize('Copy ^link ^address'); }; /** * @return {string} */ -WebInspector.anotherProfilerActiveLabel = function() { - return WebInspector.UIString('Another profiler is already active'); +UI.anotherProfilerActiveLabel = function() { + return Common.UIString('Another profiler is already active'); }; /** * @param {string|undefined} description * @return {string} */ -WebInspector.asyncStackTraceLabel = function(description) { +UI.asyncStackTraceLabel = function(description) { if (description) - return description + ' ' + WebInspector.UIString('(async)'); - return WebInspector.UIString('Async Call'); + return description + ' ' + Common.UIString('(async)'); + return Common.UIString('Async Call'); }; /** * @param {!Element} element */ -WebInspector.installComponentRootStyles = function(element) { - WebInspector.appendStyle(element, 'ui/inspectorCommon.css'); - WebInspector.themeSupport.injectHighlightStyleSheets(element); - element.classList.add('platform-' + WebInspector.platform()); +UI.installComponentRootStyles = function(element) { + UI.appendStyle(element, 'ui/inspectorCommon.css'); + UI.themeSupport.injectHighlightStyleSheets(element); + element.classList.add('platform-' + Host.platform()); }; /** @@ -773,13 +773,13 @@ * @param {string=} cssFile * @return {!DocumentFragment} */ -WebInspector.createShadowRootWithCoreStyles = function(element, cssFile) { +UI.createShadowRootWithCoreStyles = function(element, cssFile) { var shadowRoot = element.createShadowRoot(); - WebInspector.appendStyle(shadowRoot, 'ui/inspectorCommon.css'); - WebInspector.themeSupport.injectHighlightStyleSheets(shadowRoot); + UI.appendStyle(shadowRoot, 'ui/inspectorCommon.css'); + UI.themeSupport.injectHighlightStyleSheets(shadowRoot); if (cssFile) - WebInspector.appendStyle(shadowRoot, cssFile); - shadowRoot.addEventListener('focus', WebInspector._focusChanged.bind(WebInspector), true); + UI.appendStyle(shadowRoot, cssFile); + shadowRoot.addEventListener('focus', UI._focusChanged.bind(UI), true); return shadowRoot; }; @@ -787,7 +787,7 @@ * @param {!Document} document * @param {!Event} event */ -WebInspector._windowFocused = function(document, event) { +UI._windowFocused = function(document, event) { if (event.target.document.nodeType === Node.DOCUMENT_NODE) document.body.classList.remove('inactive'); }; @@ -796,7 +796,7 @@ * @param {!Document} document * @param {!Event} event */ -WebInspector._windowBlurred = function(document, event) { +UI._windowBlurred = function(document, event) { if (event.target.document.nodeType === Node.DOCUMENT_NODE) document.body.classList.add('inactive'); }; @@ -804,16 +804,16 @@ /** * @param {!Event} event */ -WebInspector._focusChanged = function(event) { +UI._focusChanged = function(event) { var document = event.target && event.target.ownerDocument; var element = document ? document.deepActiveElement() : null; - WebInspector.Widget.focusWidgetForNode(element); + UI.Widget.focusWidgetForNode(element); }; /** * @unrestricted */ -WebInspector.ElementFocusRestorer = class { +UI.ElementFocusRestorer = class { /** * @param {!Element} element */ @@ -840,27 +840,27 @@ * @param {!Array.<!Object>=} domChanges * @return {?Element} */ -WebInspector.highlightSearchResult = function(element, offset, length, domChanges) { - var result = WebInspector.highlightSearchResults(element, [new WebInspector.SourceRange(offset, length)], domChanges); +UI.highlightSearchResult = function(element, offset, length, domChanges) { + var result = UI.highlightSearchResults(element, [new Common.SourceRange(offset, length)], domChanges); return result.length ? result[0] : null; }; /** * @param {!Element} element - * @param {!Array.<!WebInspector.SourceRange>} resultRanges + * @param {!Array.<!Common.SourceRange>} resultRanges * @param {!Array.<!Object>=} changes * @return {!Array.<!Element>} */ -WebInspector.highlightSearchResults = function(element, resultRanges, changes) { - return WebInspector.highlightRangesWithStyleClass( - element, resultRanges, WebInspector.highlightedSearchResultClassName, changes); +UI.highlightSearchResults = function(element, resultRanges, changes) { + return UI.highlightRangesWithStyleClass( + element, resultRanges, UI.highlightedSearchResultClassName, changes); }; /** * @param {!Element} element * @param {string} className */ -WebInspector.runCSSAnimationOnce = function(element, className) { +UI.runCSSAnimationOnce = function(element, className) { function animationEndCallback() { element.classList.remove(className); element.removeEventListener('webkitAnimationEnd', animationEndCallback, false); @@ -875,12 +875,12 @@ /** * @param {!Element} element - * @param {!Array.<!WebInspector.SourceRange>} resultRanges + * @param {!Array.<!Common.SourceRange>} resultRanges * @param {string} styleClass * @param {!Array.<!Object>=} changes * @return {!Array.<!Element>} */ -WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, styleClass, changes) { +UI.highlightRangesWithStyleClass = function(element, resultRanges, styleClass, changes) { changes = changes || []; var highlightNodes = []; var textNodes = element.childTextNodes(); @@ -962,7 +962,7 @@ return highlightNodes; }; -WebInspector.applyDomChanges = function(domChanges) { +UI.applyDomChanges = function(domChanges) { for (var i = 0, size = domChanges.length; i < size; ++i) { var entry = domChanges[i]; switch (entry.type) { @@ -976,7 +976,7 @@ } }; -WebInspector.revertDomChanges = function(domChanges) { +UI.revertDomChanges = function(domChanges) { for (var i = domChanges.length - 1; i >= 0; --i) { var entry = domChanges[i]; switch (entry.type) { @@ -995,7 +995,7 @@ * @param {?Element=} containerElement * @return {!Size} */ -WebInspector.measurePreferredSize = function(element, containerElement) { +UI.measurePreferredSize = function(element, containerElement) { var oldParent = element.parentElement; var oldNextSibling = element.nextSibling; containerElement = containerElement || element.ownerDocument.body; @@ -1014,7 +1014,7 @@ /** * @unrestricted */ -WebInspector.InvokeOnceHandlers = class { +UI.InvokeOnceHandlers = class { /** * @param {boolean} autoInvoke */ @@ -1062,29 +1062,29 @@ } }; -WebInspector._coalescingLevel = 0; -WebInspector._postUpdateHandlers = null; +UI._coalescingLevel = 0; +UI._postUpdateHandlers = null; -WebInspector.startBatchUpdate = function() { - if (!WebInspector._coalescingLevel++) - WebInspector._postUpdateHandlers = new WebInspector.InvokeOnceHandlers(false); +UI.startBatchUpdate = function() { + if (!UI._coalescingLevel++) + UI._postUpdateHandlers = new UI.InvokeOnceHandlers(false); }; -WebInspector.endBatchUpdate = function() { - if (--WebInspector._coalescingLevel) +UI.endBatchUpdate = function() { + if (--UI._coalescingLevel) return; - WebInspector._postUpdateHandlers.scheduleInvoke(); - WebInspector._postUpdateHandlers = null; + UI._postUpdateHandlers.scheduleInvoke(); + UI._postUpdateHandlers = null; }; /** * @param {!Object} object * @param {function()} method */ -WebInspector.invokeOnceAfterBatchUpdate = function(object, method) { - if (!WebInspector._postUpdateHandlers) - WebInspector._postUpdateHandlers = new WebInspector.InvokeOnceHandlers(true); - WebInspector._postUpdateHandlers.add(object, method); +UI.invokeOnceAfterBatchUpdate = function(object, method) { + if (!UI._postUpdateHandlers) + UI._postUpdateHandlers = new UI.InvokeOnceHandlers(true); + UI._postUpdateHandlers.add(object, method); }; /** @@ -1095,7 +1095,7 @@ * @param {function()=} animationComplete * @return {function()} */ -WebInspector.animateFunction = function(window, func, params, frames, animationComplete) { +UI.animateFunction = function(window, func, params, frames, animationComplete) { var values = new Array(params.length); var deltas = new Array(params.length); for (var i = 0; i < params.length; ++i) { @@ -1133,7 +1133,7 @@ /** * @unrestricted */ -WebInspector.LongClickController = class extends WebInspector.Object { +UI.LongClickController = class extends Common.Object { /** * @param {!Element} element * @param {function(!Event)} callback @@ -1168,7 +1168,7 @@ /** * @param {!Event} e - * @this {WebInspector.LongClickController} + * @this {UI.LongClickController} */ function mouseDown(e) { if (e.which !== 1) @@ -1179,7 +1179,7 @@ /** * @param {!Event} e - * @this {WebInspector.LongClickController} + * @this {UI.LongClickController} */ function mouseUp(e) { if (e.which !== 1) @@ -1201,28 +1201,28 @@ /** * @param {!Document} document - * @param {!WebInspector.Setting} themeSetting + * @param {!Common.Setting} themeSetting */ -WebInspector.initializeUIUtils = function(document, themeSetting) { - document.defaultView.addEventListener('focus', WebInspector._windowFocused.bind(WebInspector, document), false); - document.defaultView.addEventListener('blur', WebInspector._windowBlurred.bind(WebInspector, document), false); - document.addEventListener('focus', WebInspector._focusChanged.bind(WebInspector), true); +UI.initializeUIUtils = function(document, themeSetting) { + document.defaultView.addEventListener('focus', UI._windowFocused.bind(UI, document), false); + document.defaultView.addEventListener('blur', UI._windowBlurred.bind(UI, document), false); + document.addEventListener('focus', UI._focusChanged.bind(UI), true); - if (!WebInspector.themeSupport) - WebInspector.themeSupport = new WebInspector.ThemeSupport(themeSetting); - WebInspector.themeSupport.applyTheme(document); + if (!UI.themeSupport) + UI.themeSupport = new UI.ThemeSupport(themeSetting); + UI.themeSupport.applyTheme(document); var body = /** @type {!Element} */ (document.body); - WebInspector.appendStyle(body, 'ui/inspectorStyle.css'); - WebInspector.appendStyle(body, 'ui/popover.css'); + UI.appendStyle(body, 'ui/inspectorStyle.css'); + UI.appendStyle(body, 'ui/popover.css'); }; /** * @param {string} name * @return {string} */ -WebInspector.beautifyFunctionName = function(name) { - return name || WebInspector.UIString('(anonymous)'); +UI.beautifyFunctionName = function(name) { + return name || Common.UIString('(anonymous)'); }; /** @@ -1320,8 +1320,7 @@ * @param {string} cssFile * @suppressGlobalPropertiesCheck */ -WebInspector.appendStyle = - function(node, cssFile) { +UI.appendStyle = function(node, cssFile) { var content = Runtime.cachedResources[cssFile] || ''; if (!content) console.error(cssFile + ' not preloaded. Check module.json'); @@ -1330,7 +1329,7 @@ styleElement.textContent = content; node.appendChild(styleElement); - var themeStyleSheet = WebInspector.themeSupport.themeStyleSheet(cssFile, content); + var themeStyleSheet = UI.themeSupport.themeStyleSheet(cssFile, content); if (themeStyleSheet) { styleElement = createElement('style'); styleElement.type = 'text/css'; @@ -1347,7 +1346,7 @@ */ createdCallback: function() { this.type = 'button'; - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/textButton.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/textButton.css'); root.createChild('content'); }, @@ -1361,7 +1360,7 @@ createdCallback: function() { this.radioElement = this.createChild('input', 'dt-radio-button'); this.radioElement.type = 'radio'; - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/radioButton.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/radioButton.css'); root.createChild('content').select = '.dt-radio-button'; root.createChild('content'); this.addEventListener('click', radioClickHandler, false); @@ -1387,7 +1386,7 @@ * @this {Element} */ createdCallback: function() { - this._root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/checkboxTextLabel.css'); + this._root = UI.createShadowRootWithCoreStyles(this, 'ui/checkboxTextLabel.css'); var checkboxElement = createElementWithClass('input', 'dt-checkbox-button'); checkboxElement.type = 'checkbox'; this._root.appendChild(checkboxElement); @@ -1454,8 +1453,8 @@ * @this {Element} */ createdCallback: function() { - var root = WebInspector.createShadowRootWithCoreStyles(this); - this._iconElement = WebInspector.Icon.create(); + var root = UI.createShadowRootWithCoreStyles(this); + this._iconElement = UI.Icon.create(); this._iconElement.style.setProperty('margin-right', '4px'); root.appendChild(this._iconElement); root.createChild('content'); @@ -1477,7 +1476,7 @@ * @this {Element} */ createdCallback: function() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/slider.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/slider.css'); this.sliderElement = createElementWithClass('input', 'dt-range-input'); this.sliderElement.type = 'range'; root.appendChild(this.sliderElement); @@ -1506,7 +1505,7 @@ * @this {Element} */ createdCallback: function() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/smallBubble.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/smallBubble.css'); this._textElement = root.createChild('div'); this._textElement.className = 'info'; this._textElement.createChild('content'); @@ -1528,7 +1527,7 @@ * @this {Element} */ createdCallback: function() { - var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/closeButton.css'); + var root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css'); this._buttonElement = root.createChild('div', 'close-button'); }, @@ -1551,7 +1550,7 @@ * @param {boolean} numeric * @return {function(string)} */ -WebInspector.bindInput = function(input, apply, validate, numeric) { +UI.bindInput = function(input, apply, validate, numeric) { input.addEventListener('change', onChange, false); input.addEventListener('input', onInput, false); input.addEventListener('keydown', onKeyDown, false); @@ -1621,13 +1620,13 @@ * @param {number} maxWidth * @return {string} */ -WebInspector.trimTextMiddle = function(context, text, maxWidth) { +UI.trimTextMiddle = function(context, text, maxWidth) { const maxLength = 200; if (maxWidth <= 10) return ''; if (text.length > maxLength) text = text.trimMiddle(maxLength); - const textWidth = WebInspector.measureTextWidth(context, text); + const textWidth = UI.measureTextWidth(context, text); if (textWidth <= maxWidth) return text; @@ -1637,7 +1636,7 @@ var rv = textWidth; while (l < r && lv !== rv && lv !== maxWidth) { const m = Math.ceil(l + (r - l) * (maxWidth - lv) / (rv - lv)); - const mv = WebInspector.measureTextWidth(context, text.trimMiddle(m)); + const mv = UI.measureTextWidth(context, text.trimMiddle(m)); if (mv <= maxWidth) { l = m; lv = mv; @@ -1655,15 +1654,15 @@ * @param {string} text * @return {number} */ -WebInspector.measureTextWidth = function(context, text) { +UI.measureTextWidth = function(context, text) { const maxCacheableLength = 200; if (text.length > maxCacheableLength) return context.measureText(text).width; - var widthCache = WebInspector.measureTextWidth._textWidthCache; + var widthCache = UI.measureTextWidth._textWidthCache; if (!widthCache) { widthCache = new Map(); - WebInspector.measureTextWidth._textWidthCache = widthCache; + UI.measureTextWidth._textWidthCache = widthCache; } const font = context.font; var textWidths = widthCache.get(font); @@ -1682,9 +1681,9 @@ /** * @unrestricted */ -WebInspector.ThemeSupport = class { +UI.ThemeSupport = class { /** - * @param {!WebInspector.Setting} setting + * @param {!Common.Setting} setting */ constructor(setting) { this._themeName = setting.get() || 'default'; @@ -1716,9 +1715,9 @@ */ injectHighlightStyleSheets(element) { this._injectingStyleSheet = true; - WebInspector.appendStyle(element, 'ui/inspectorSyntaxHighlight.css'); + UI.appendStyle(element, 'ui/inspectorSyntaxHighlight.css'); if (this._themeName === 'dark') - WebInspector.appendStyle(element, 'ui/inspectorSyntaxHighlightDark.css'); + UI.appendStyle(element, 'ui/inspectorSyntaxHighlightDark.css'); this._injectingStyleSheet = false; } @@ -1833,17 +1832,17 @@ } isSelection = isSelection || selectorText.indexOf('selected') !== -1 || selectorText.indexOf('.selection') !== -1; - var colorUsage = WebInspector.ThemeSupport.ColorUsage.Unknown; + var colorUsage = UI.ThemeSupport.ColorUsage.Unknown; if (isSelection) - colorUsage |= WebInspector.ThemeSupport.ColorUsage.Selection; + colorUsage |= UI.ThemeSupport.ColorUsage.Selection; if (name.indexOf('background') === 0 || name.indexOf('border') === 0) - colorUsage |= WebInspector.ThemeSupport.ColorUsage.Background; + colorUsage |= UI.ThemeSupport.ColorUsage.Background; if (name.indexOf('background') === -1) - colorUsage |= WebInspector.ThemeSupport.ColorUsage.Foreground; + colorUsage |= UI.ThemeSupport.ColorUsage.Foreground; output.push(name); output.push(':'); - var items = value.replace(WebInspector.Color.Regex, '\0$1\0').split('\0'); + var items = value.replace(Common.Color.Regex, '\0$1\0').split('\0'); for (var i = 0; i < items.length; ++i) output.push(this.patchColor(items[i], colorUsage)); if (style.getPropertyPriority(name)) @@ -1853,28 +1852,28 @@ /** * @param {string} text - * @param {!WebInspector.ThemeSupport.ColorUsage} colorUsage + * @param {!UI.ThemeSupport.ColorUsage} colorUsage * @return {string} */ patchColor(text, colorUsage) { - var color = WebInspector.Color.parse(text); + var color = Common.Color.parse(text); if (!color) return text; var hsla = color.hsla(); this._patchHSLA(hsla, colorUsage); var rgba = []; - WebInspector.Color.hsl2rgb(hsla, rgba); - var outColor = new WebInspector.Color(rgba, color.format()); + Common.Color.hsl2rgb(hsla, rgba); + var outColor = new Common.Color(rgba, color.format()); var outText = outColor.asString(null); if (!outText) - outText = outColor.asString(outColor.hasAlpha() ? WebInspector.Color.Format.RGBA : WebInspector.Color.Format.RGB); + outText = outColor.asString(outColor.hasAlpha() ? Common.Color.Format.RGBA : Common.Color.Format.RGB); return outText || text; } /** * @param {!Array<number>} hsla - * @param {!WebInspector.ThemeSupport.ColorUsage} colorUsage + * @param {!UI.ThemeSupport.ColorUsage} colorUsage */ _patchHSLA(hsla, colorUsage) { var hue = hsla[0]; @@ -1884,10 +1883,10 @@ switch (this._themeName) { case 'dark': - if (colorUsage & WebInspector.ThemeSupport.ColorUsage.Selection) + if (colorUsage & UI.ThemeSupport.ColorUsage.Selection) hue = (hue + 0.5) % 1; - var minCap = colorUsage & WebInspector.ThemeSupport.ColorUsage.Background ? 0.14 : 0; - var maxCap = colorUsage & WebInspector.ThemeSupport.ColorUsage.Foreground ? 0.9 : 1; + var minCap = colorUsage & UI.ThemeSupport.ColorUsage.Background ? 0.14 : 0; + var maxCap = colorUsage & UI.ThemeSupport.ColorUsage.Foreground ? 0.9 : 1; lit = 1 - lit; if (lit < minCap * 2) lit = minCap + lit / 2; @@ -1906,7 +1905,7 @@ /** * @enum {number} */ -WebInspector.ThemeSupport.ColorUsage = { +UI.ThemeSupport.ColorUsage = { Unknown: 0, Foreground: 1 << 0, Background: 1 << 1, @@ -1921,7 +1920,7 @@ * @param {string=} tooltipText * @return {!Element} */ -WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, tooltipText) { +UI.linkifyURLAsNode = function(url, linkText, classes, isExternal, tooltipText) { if (!linkText) linkText = url; @@ -1929,7 +1928,7 @@ var href = url; if (url.trim().toLowerCase().startsWith('javascript:')) href = null; - if (isExternal && WebInspector.ParsedURL.isRelativeURL(url)) + if (isExternal && Common.ParsedURL.isRelativeURL(url)) href = null; if (href !== null) { a.href = href; @@ -1951,8 +1950,8 @@ * @param {string} title * @return {!Element} */ -WebInspector.linkifyDocumentationURLAsNode = function(article, title) { - return WebInspector.linkifyURLAsNode( +UI.linkifyDocumentationURLAsNode = function(article, title) { + return UI.linkifyURLAsNode( 'https://developers.google.com/web/tools/chrome-devtools/' + article, title, undefined, true); }; @@ -1960,7 +1959,7 @@ * @param {string} url * @return {!Promise<?Image>} */ -WebInspector.loadImage = function(url) { +UI.loadImage = function(url) { return new Promise(fulfill => { var image = new Image(); image.addEventListener('load', () => fulfill(image)); @@ -1969,5 +1968,5 @@ }); }; -/** @type {!WebInspector.ThemeSupport} */ -WebInspector.themeSupport; +/** @type {!UI.ThemeSupport} */ +UI.themeSupport;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/View.js b/third_party/WebKit/Source/devtools/front_end/ui/View.js index 1346f0b6e..ed6b2677 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/View.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/View.js
@@ -4,9 +4,9 @@ /** * @interface */ -WebInspector.View = function() {}; +UI.View = function() {}; -WebInspector.View.prototype = { +UI.View.prototype = { /** * @return {string} */ @@ -28,24 +28,24 @@ isTransient: function() {}, /** - * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} + * @return {!Promise<!Array<!UI.ToolbarItem>>} */ toolbarItems: function() {}, /** - * @return {!Promise<!WebInspector.Widget>} + * @return {!Promise<!UI.Widget>} */ widget: function() {} }; -WebInspector.View._symbol = Symbol('view'); -WebInspector.View._widgetSymbol = Symbol('widget'); +UI.View._symbol = Symbol('view'); +UI.View._widgetSymbol = Symbol('widget'); /** - * @implements {WebInspector.View} + * @implements {UI.View} * @unrestricted */ -WebInspector.SimpleView = class extends WebInspector.VBox { +UI.SimpleView = class extends UI.VBox { /** * @param {string} title * @param {boolean=} isWebComponent @@ -53,9 +53,9 @@ constructor(title, isWebComponent) { super(isWebComponent); this._title = title; - /** @type {!Array<!WebInspector.ToolbarItem>} */ + /** @type {!Array<!UI.ToolbarItem>} */ this._toolbarItems = []; - this[WebInspector.View._symbol] = this; + this[UI.View._symbol] = this; } /** @@ -92,14 +92,14 @@ /** * @override - * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} + * @return {!Promise<!Array<!UI.ToolbarItem>>} */ toolbarItems() { return Promise.resolve(this.syncToolbarItems()); } /** - * @return {!Array<!WebInspector.ToolbarItem>} + * @return {!Array<!UI.ToolbarItem>} */ syncToolbarItems() { return this._toolbarItems; @@ -107,14 +107,14 @@ /** * @override - * @return {!Promise<!WebInspector.Widget>} + * @return {!Promise<!UI.Widget>} */ widget() { - return /** @type {!Promise<!WebInspector.Widget>} */ (Promise.resolve(this)); + return /** @type {!Promise<!UI.Widget>} */ (Promise.resolve(this)); } /** - * @param {!WebInspector.ToolbarItem} item + * @param {!UI.ToolbarItem} item */ addToolbarItem(item) { this._toolbarItems.push(item); @@ -124,15 +124,15 @@ * @return {!Promise} */ revealView() { - return WebInspector.viewManager.revealView(this); + return UI.viewManager.revealView(this); } }; /** - * @implements {WebInspector.View} + * @implements {UI.View} * @unrestricted */ -WebInspector.ProvidedView = class { +UI.ProvidedView = class { /** * @param {!Runtime.Extension} extension */ @@ -174,14 +174,14 @@ /** * @override - * @return {!Promise<!Array<!WebInspector.ToolbarItem>>} + * @return {!Promise<!Array<!UI.ToolbarItem>>} */ toolbarItems() { var actionIds = this._extension.descriptor()['actionIds']; if (actionIds) { var result = []; for (var id of actionIds.split(',')) { - var item = WebInspector.Toolbar.createActionButtonForId(id.trim()); + var item = UI.Toolbar.createActionButtonForId(id.trim()); if (item) result.push(item); } @@ -190,20 +190,20 @@ if (this._extension.descriptor()['hasToolbar']) return this.widget().then( - widget => /** @type {!WebInspector.ToolbarItem.ItemsProvider} */ (widget).toolbarItems()); + widget => /** @type {!UI.ToolbarItem.ItemsProvider} */ (widget).toolbarItems()); return Promise.resolve([]); } /** * @override - * @return {!Promise<!WebInspector.Widget>} + * @return {!Promise<!UI.Widget>} */ widget() { return this._extension.instance().then(widget => { - if (!(widget instanceof WebInspector.Widget)) - throw new Error('view className should point to a WebInspector.Widget'); - widget[WebInspector.View._symbol] = this; - return /** @type {!WebInspector.Widget} */ (widget); + if (!(widget instanceof UI.Widget)) + throw new Error('view className should point to a UI.Widget'); + widget[UI.View._symbol] = this; + return /** @type {!UI.Widget} */ (widget); }); } }; @@ -211,47 +211,47 @@ /** * @interface */ -WebInspector.ViewLocation = function() {}; +UI.ViewLocation = function() {}; -WebInspector.ViewLocation.prototype = { +UI.ViewLocation.prototype = { /** * @param {string} locationName */ appendApplicableItems: function(locationName) {}, /** - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore */ appendView: function(view, insertBefore) {}, /** - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore * @return {!Promise} */ showView: function(view, insertBefore) {}, /** - * @param {!WebInspector.View} view + * @param {!UI.View} view */ removeView: function(view) {}, /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ widget: function() {} }; /** * @interface - * @extends {WebInspector.ViewLocation} + * @extends {UI.ViewLocation} */ -WebInspector.TabbedViewLocation = function() {}; +UI.TabbedViewLocation = function() {}; -WebInspector.TabbedViewLocation.prototype = { +UI.TabbedViewLocation.prototype = { /** - * @return {!WebInspector.TabbedPane} + * @return {!UI.TabbedPane} */ tabbedPane: function() {}, @@ -261,12 +261,12 @@ /** * @interface */ -WebInspector.ViewLocationResolver = function() {}; +UI.ViewLocationResolver = function() {}; -WebInspector.ViewLocationResolver.prototype = { +UI.ViewLocationResolver.prototype = { /** * @param {string} location - * @return {?WebInspector.ViewLocation} + * @return {?UI.ViewLocation} */ resolveLocation: function(location) {} }; @@ -274,39 +274,39 @@ /** * @unrestricted */ -WebInspector.ViewManager = class { +UI.ViewManager = class { constructor() { - /** @type {!Map<string, !WebInspector.View>} */ + /** @type {!Map<string, !UI.View>} */ this._views = new Map(); /** @type {!Map<string, string>} */ this._locationNameByViewId = new Map(); for (var extension of self.runtime.extensions('view')) { var descriptor = extension.descriptor(); - this._views.set(descriptor['id'], new WebInspector.ProvidedView(extension)); + this._views.set(descriptor['id'], new UI.ProvidedView(extension)); this._locationNameByViewId.set(descriptor['id'], descriptor['location']); } } /** * @param {!Element} element - * @param {!Array<!WebInspector.ToolbarItem>} toolbarItems + * @param {!Array<!UI.ToolbarItem>} toolbarItems */ static _populateToolbar(element, toolbarItems) { if (!toolbarItems.length) return; - var toolbar = new WebInspector.Toolbar(''); + var toolbar = new UI.Toolbar(''); element.insertBefore(toolbar.element, element.firstChild); for (var item of toolbarItems) toolbar.appendToolbarItem(item); } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view * @return {!Promise} */ revealView(view) { - var location = /** @type {?WebInspector.ViewManager._Location} */ (view[WebInspector.ViewManager._Location.symbol]); + var location = /** @type {?UI.ViewManager._Location} */ (view[UI.ViewManager._Location.symbol]); if (!location) return Promise.resolve(); location._reveal(); @@ -315,7 +315,7 @@ /** * @param {string} viewId - * @return {?WebInspector.View} + * @return {?UI.View} */ view(viewId) { return this._views.get(viewId); @@ -323,11 +323,11 @@ /** * @param {string} viewId - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ materializedWidget(viewId) { var view = this.view(viewId); - return view ? view[WebInspector.View._widgetSymbol] : null; + return view ? view[UI.View._widgetSymbol] : null; } /** @@ -343,9 +343,9 @@ var locationName = this._locationNameByViewId.get(viewId); if (locationName === 'drawer-view') - WebInspector.userMetrics.drawerShown(viewId); + Host.userMetrics.drawerShown(viewId); - var location = view[WebInspector.ViewManager._Location.symbol]; + var location = view[UI.ViewManager._Location.symbol]; if (location) { location._reveal(); return location.showView(view); @@ -361,19 +361,19 @@ /** * @param {string=} location - * @return {!Promise<?WebInspector.ViewManager._Location>} + * @return {!Promise<?UI.ViewManager._Location>} */ _resolveLocation(location) { if (!location) - return /** @type {!Promise<?WebInspector.ViewManager._Location>} */ (Promise.resolve(null)); + return /** @type {!Promise<?UI.ViewManager._Location>} */ (Promise.resolve(null)); - var resolverExtensions = self.runtime.extensions(WebInspector.ViewLocationResolver) + var resolverExtensions = self.runtime.extensions(UI.ViewLocationResolver) .filter(extension => extension.descriptor()['name'] === location); if (!resolverExtensions.length) throw new Error('Unresolved location: ' + location); var resolverExtension = resolverExtensions[0]; return resolverExtension.instance().then( - resolver => /** @type {?WebInspector.ViewManager._Location} */ (resolver.resolveLocation(location))); + resolver => /** @type {?UI.ViewManager._Location} */ (resolver.resolveLocation(location))); } /** @@ -381,24 +381,24 @@ * @param {string=} location * @param {boolean=} restoreSelection * @param {boolean=} allowReorder - * @return {!WebInspector.TabbedViewLocation} + * @return {!UI.TabbedViewLocation} */ createTabbedLocation(revealCallback, location, restoreSelection, allowReorder) { - return new WebInspector.ViewManager._TabbedLocation(this, revealCallback, location, restoreSelection, allowReorder); + return new UI.ViewManager._TabbedLocation(this, revealCallback, location, restoreSelection, allowReorder); } /** * @param {function()=} revealCallback * @param {string=} location - * @return {!WebInspector.ViewLocation} + * @return {!UI.ViewLocation} */ createStackLocation(revealCallback, location) { - return new WebInspector.ViewManager._StackLocation(this, revealCallback, location); + return new UI.ViewManager._StackLocation(this, revealCallback, location); } /** * @param {string} location - * @return {!Array<!WebInspector.View>} + * @return {!Array<!UI.View>} */ _viewsForLocation(location) { var result = []; @@ -414,9 +414,9 @@ /** * @unrestricted */ -WebInspector.ViewManager._ContainerWidget = class extends WebInspector.VBox { +UI.ViewManager._ContainerWidget = class extends UI.VBox { /** - * @param {!WebInspector.View} view + * @param {!UI.View} view */ constructor(view) { super(); @@ -434,12 +434,12 @@ return this._materializePromise; var promises = []; promises.push(this._view.toolbarItems().then( - WebInspector.ViewManager._populateToolbar.bind(WebInspector.ViewManager, this.element))); + UI.ViewManager._populateToolbar.bind(UI.ViewManager, this.element))); promises.push(this._view.widget().then(widget => { // Move focus from |this| to loaded |widget| if any. var shouldFocus = this.element.hasFocus(); this.setDefaultFocusedElement(null); - this._view[WebInspector.View._widgetSymbol] = widget; + this._view[UI.View._widgetSymbol] = widget; widget.show(this.element); if (shouldFocus) widget.focus(); @@ -452,9 +452,9 @@ /** * @unrestricted */ -WebInspector.ViewManager._ExpandableContainerWidget = class extends WebInspector.VBox { +UI.ViewManager._ExpandableContainerWidget = class extends UI.VBox { /** - * @param {!WebInspector.View} view + * @param {!UI.View} view */ constructor(view) { super(true); @@ -470,7 +470,7 @@ this.contentElement.createChild('content'); this._view = view; - view[WebInspector.ViewManager._ExpandableContainerWidget._symbol] = this; + view[UI.ViewManager._ExpandableContainerWidget._symbol] = this; } /** @@ -481,10 +481,10 @@ return this._materializePromise; var promises = []; promises.push(this._view.toolbarItems().then( - WebInspector.ViewManager._populateToolbar.bind(WebInspector.ViewManager, this._titleElement))); + UI.ViewManager._populateToolbar.bind(UI.ViewManager, this._titleElement))); promises.push(this._view.widget().then(widget => { this._widget = widget; - this._view[WebInspector.View._widgetSymbol] = widget; + this._view[UI.View._widgetSymbol] = widget; widget.show(this.element); })); this._materializePromise = Promise.all(promises); @@ -519,20 +519,20 @@ * @param {!Event} event */ _onTitleKeyDown(event) { - if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut.Keys.Space.code) + if (isEnterKey(event) || event.keyCode === UI.KeyboardShortcut.Keys.Space.code) this._toggleExpanded(); } }; -WebInspector.ViewManager._ExpandableContainerWidget._symbol = Symbol('container'); +UI.ViewManager._ExpandableContainerWidget._symbol = Symbol('container'); /** * @unrestricted */ -WebInspector.ViewManager._Location = class { +UI.ViewManager._Location = class { /** - * @param {!WebInspector.ViewManager} manager - * @param {!WebInspector.Widget} widget + * @param {!UI.ViewManager} manager + * @param {!UI.Widget} widget * @param {function()=} revealCallback */ constructor(manager, widget, revealCallback) { @@ -542,7 +542,7 @@ } /** - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ widget() { return this._widget; @@ -554,22 +554,22 @@ } }; -WebInspector.ViewManager._Location.symbol = Symbol('location'); +UI.ViewManager._Location.symbol = Symbol('location'); /** - * @implements {WebInspector.TabbedViewLocation} + * @implements {UI.TabbedViewLocation} * @unrestricted */ -WebInspector.ViewManager._TabbedLocation = class extends WebInspector.ViewManager._Location { +UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location { /** - * @param {!WebInspector.ViewManager} manager + * @param {!UI.ViewManager} manager * @param {function()=} revealCallback * @param {string=} location * @param {boolean=} restoreSelection * @param {boolean=} allowReorder */ constructor(manager, revealCallback, location, restoreSelection, allowReorder) { - var tabbedPane = new WebInspector.TabbedPane(); + var tabbedPane = new UI.TabbedPane(); if (allowReorder) tabbedPane.setAllowTabReorder(true); @@ -577,15 +577,15 @@ this._tabbedPane = tabbedPane; this._allowReorder = allowReorder; - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabSelected, this); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabClosed, this._tabClosed, this); - this._closeableTabSetting = WebInspector.settings.createSetting(location + '-closeableTabs', {}); - this._tabOrderSetting = WebInspector.settings.createSetting(location + '-tabOrder', {}); - this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabOrderChanged, this._persistTabOrder, this); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabClosed, this._tabClosed, this); + this._closeableTabSetting = Common.settings.createSetting(location + '-closeableTabs', {}); + this._tabOrderSetting = Common.settings.createSetting(location + '-tabOrder', {}); + this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabOrderChanged, this._persistTabOrder, this); if (restoreSelection) - this._lastSelectedTabSetting = WebInspector.settings.createSetting(location + '-selectedTab', ''); + this._lastSelectedTabSetting = Common.settings.createSetting(location + '-selectedTab', ''); - /** @type {!Map.<string, !WebInspector.View>} */ + /** @type {!Map.<string, !UI.View>} */ this._views = new Map(); if (location) @@ -594,7 +594,7 @@ /** * @override - * @return {!WebInspector.Widget} + * @return {!UI.Widget} */ widget() { return this._tabbedPane; @@ -602,7 +602,7 @@ /** * @override - * @return {!WebInspector.TabbedPane} + * @return {!UI.TabbedPane} */ tabbedPane() { return this._tabbedPane; @@ -613,7 +613,7 @@ */ enableMoreTabsButton() { this._tabbedPane.leftToolbar().appendToolbarItem( - new WebInspector.ToolbarMenuButton(this._appendTabsToMenu.bind(this))); + new UI.ToolbarMenuButton(this._appendTabsToMenu.bind(this))); this._tabbedPane.disableOverflowMenu(); } @@ -630,14 +630,14 @@ for (var view of views) orders.set( view.viewId(), - persistedOrders[view.viewId()] || (++i) * WebInspector.ViewManager._TabbedLocation.orderStep); + persistedOrders[view.viewId()] || (++i) * UI.ViewManager._TabbedLocation.orderStep); views.sort((a, b) => orders.get(a.viewId()) - orders.get(b.viewId())); } for (var view of views) { var id = view.viewId(); this._views.set(id, view); - view[WebInspector.ViewManager._Location.symbol] = this; + view[UI.ViewManager._Location.symbol] = this; if (view.isTransient()) continue; if (!view.isCloseable()) @@ -650,34 +650,34 @@ } /** - * @param {!WebInspector.ContextMenu} contextMenu + * @param {!UI.ContextMenu} contextMenu */ _appendTabsToMenu(contextMenu) { for (var view of this._views.values()) { - var title = WebInspector.UIString(view.title()); + var title = Common.UIString(view.title()); contextMenu.appendItem(title, this.showView.bind(this, view)); } } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view * @param {number=} index */ _appendTab(view, index) { this._tabbedPane.appendTab( - view.viewId(), view.title(), new WebInspector.ViewManager._ContainerWidget(view), undefined, false, + view.viewId(), view.title(), new UI.ViewManager._ContainerWidget(view), undefined, false, view.isCloseable() || view.isTransient(), index); } /** * @override - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore */ appendView(view, insertBefore) { if (this._tabbedPane.hasTab(view.viewId())) return; - view[WebInspector.ViewManager._Location.symbol] = this; + view[UI.ViewManager._Location.symbol] = this; this._manager._views.set(view.viewId(), view); this._views.set(view.viewId(), view); @@ -705,8 +705,8 @@ /** * @override - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore * @return {!Promise} */ showView(view, insertBefore) { @@ -717,21 +717,21 @@ } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view * @override */ removeView(view) { if (!this._tabbedPane.hasTab(view.viewId())) return; - delete view[WebInspector.ViewManager._Location.symbol]; + delete view[UI.ViewManager._Location.symbol]; this._manager._views.delete(view.viewId()); this._views.delete(view.viewId()); this._tabbedPane.closeTab(view.viewId()); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabSelected(event) { var tabId = /** @type {string} */ (event.data.tabId); @@ -753,7 +753,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _tabClosed(event) { var id = /** @type {string} */ (event.data['tabId']); @@ -765,44 +765,44 @@ } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view * @return {!Promise} */ _materializeWidget(view) { - var widget = /** @type {!WebInspector.ViewManager._ContainerWidget} */ (this._tabbedPane.tabView(view.viewId())); + var widget = /** @type {!UI.ViewManager._ContainerWidget} */ (this._tabbedPane.tabView(view.viewId())); return widget._materialize(); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _persistTabOrder(event) { var tabIds = this._tabbedPane.tabIds(); var tabOrders = {}; for (var i = 0; i < tabIds.length; i++) - tabOrders[tabIds[i]] = (i + 1) * WebInspector.ViewManager._TabbedLocation.orderStep; + tabOrders[tabIds[i]] = (i + 1) * UI.ViewManager._TabbedLocation.orderStep; this._tabOrderSetting.set(tabOrders); } }; -WebInspector.ViewManager._TabbedLocation.orderStep = 10; // Keep in sync with descriptors. +UI.ViewManager._TabbedLocation.orderStep = 10; // Keep in sync with descriptors. /** - * @implements {WebInspector.ViewLocation} + * @implements {UI.ViewLocation} * @unrestricted */ -WebInspector.ViewManager._StackLocation = class extends WebInspector.ViewManager._Location { +UI.ViewManager._StackLocation = class extends UI.ViewManager._Location { /** - * @param {!WebInspector.ViewManager} manager + * @param {!UI.ViewManager} manager * @param {function()=} revealCallback * @param {string=} location */ constructor(manager, revealCallback, location) { - var vbox = new WebInspector.VBox(); + var vbox = new UI.VBox(); super(manager, vbox, revealCallback); this._vbox = vbox; - /** @type {!Map<string, !WebInspector.ViewManager._ExpandableContainerWidget>} */ + /** @type {!Map<string, !UI.ViewManager._ExpandableContainerWidget>} */ this._expandableContainers = new Map(); if (location) @@ -811,18 +811,18 @@ /** * @override - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore */ appendView(view, insertBefore) { var container = this._expandableContainers.get(view.viewId()); if (!container) { - view[WebInspector.ViewManager._Location.symbol] = this; + view[UI.ViewManager._Location.symbol] = this; this._manager._views.set(view.viewId(), view); - container = new WebInspector.ViewManager._ExpandableContainerWidget(view); + container = new UI.ViewManager._ExpandableContainerWidget(view); var beforeElement = null; if (insertBefore) { - var beforeContainer = insertBefore[WebInspector.ViewManager._ExpandableContainerWidget._symbol]; + var beforeContainer = insertBefore[UI.ViewManager._ExpandableContainerWidget._symbol]; beforeElement = beforeContainer ? beforeContainer.element : null; } container.show(this._vbox.contentElement, beforeElement); @@ -832,8 +832,8 @@ /** * @override - * @param {!WebInspector.View} view - * @param {?WebInspector.View=} insertBefore + * @param {!UI.View} view + * @param {?UI.View=} insertBefore * @return {!Promise} */ showView(view, insertBefore) { @@ -843,7 +843,7 @@ } /** - * @param {!WebInspector.View} view + * @param {!UI.View} view * @override */ removeView(view) { @@ -853,7 +853,7 @@ container.detach(); this._expandableContainers.delete(view.viewId()); - delete view[WebInspector.ViewManager._Location.symbol]; + delete view[UI.ViewManager._Location.symbol]; this._manager._views.delete(view.viewId()); } @@ -868,6 +868,6 @@ }; /** - * @type {!WebInspector.ViewManager} + * @type {!UI.ViewManager} */ -WebInspector.viewManager; +UI.viewManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js index 25ef0cf..df26c849 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.ViewportControl = class { +UI.ViewportControl = class { /** - * @param {!WebInspector.ViewportControl.Provider} provider + * @param {!UI.ViewportControl.Provider} provider */ constructor(provider) { this.element = createElement('div'); @@ -128,7 +128,7 @@ /** * @param {number} index - * @return {?WebInspector.ViewportElement} + * @return {?UI.ViewportElement} */ _providerElement(index) { if (!this._cachedProviderElements) @@ -355,7 +355,7 @@ this._cumulativeHeights[this._cumulativeHeights.length - 1] - this._cumulativeHeights[this._lastActiveIndex]; /** - * @this {WebInspector.ViewportControl} + * @this {UI.ViewportControl} */ function prepare() { this._topGapElement.style.height = topGapHeight + 'px'; @@ -575,9 +575,9 @@ /** * @interface */ -WebInspector.ViewportControl.Provider = function() {}; +UI.ViewportControl.Provider = function() {}; -WebInspector.ViewportControl.Provider.prototype = { +UI.ViewportControl.Provider.prototype = { /** * @param {number} index * @return {number} @@ -602,7 +602,7 @@ /** * @param {number} index - * @return {?WebInspector.ViewportElement} + * @return {?UI.ViewportElement} */ itemElement: function(index) { return null; @@ -612,8 +612,8 @@ /** * @interface */ -WebInspector.ViewportElement = function() {}; -WebInspector.ViewportElement.prototype = { +UI.ViewportElement = function() {}; +UI.ViewportElement.prototype = { willHide: function() {}, wasShown: function() {}, @@ -625,10 +625,10 @@ }; /** - * @implements {WebInspector.ViewportElement} + * @implements {UI.ViewportElement} * @unrestricted */ -WebInspector.StaticViewportElement = class { +UI.StaticViewportElement = class { /** * @param {!Element} element */
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js index d7ec4f8..f06d78c 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
@@ -27,7 +27,7 @@ /** * @unrestricted */ -WebInspector.Widget = class extends WebInspector.Object { +UI.Widget = class extends Common.Object { /** * @param {boolean=} isWebComponent */ @@ -36,7 +36,7 @@ this.contentElement = createElementWithClass('div', 'widget'); if (isWebComponent) { this.element = createElementWithClass('div', 'vbox flex-auto'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element); this._shadowRoot.appendChild(this.contentElement); } else { this.element = this.contentElement; @@ -102,26 +102,26 @@ } markAsRoot() { - WebInspector.Widget.__assert(!this.element.parentElement, 'Attempt to mark as root attached node'); + UI.Widget.__assert(!this.element.parentElement, 'Attempt to mark as root attached node'); this._isRoot = true; } /** - * @return {?WebInspector.Widget} + * @return {?UI.Widget} */ parentWidget() { return this._parentWidget; } /** - * @return {!Array.<!WebInspector.Widget>} + * @return {!Array.<!UI.Widget>} */ children() { return this._children; } /** - * @param {!WebInspector.Widget} widget + * @param {!UI.Widget} widget * @protected */ childWasDetached(widget) { @@ -167,7 +167,7 @@ } /** - * @param {function(this:WebInspector.Widget)} method + * @param {function(this:UI.Widget)} method */ _callOnVisibleChildren(method) { var copy = this._children.slice(); @@ -221,7 +221,7 @@ } /** - * @param {function(this:WebInspector.Widget)} notification + * @param {function(this:UI.Widget)} notification */ _notify(notification) { ++this._notificationDepth; @@ -252,14 +252,14 @@ * @param {?Element=} insertBefore */ show(parentElement, insertBefore) { - WebInspector.Widget.__assert(parentElement, 'Attempt to attach widget with no parent element'); + UI.Widget.__assert(parentElement, 'Attempt to attach widget with no parent element'); if (!this._isRoot) { // Update widget hierarchy. var currentParent = parentElement; while (currentParent && !currentParent.__widget) currentParent = currentParent.parentElementOrShadowHost(); - WebInspector.Widget.__assert(currentParent, 'Attempt to attach widget to orphan node'); + UI.Widget.__assert(currentParent, 'Attempt to attach widget to orphan node'); this.attach(currentParent.__widget); } @@ -267,7 +267,7 @@ } /** - * @param {!WebInspector.Widget} parentWidget + * @param {!UI.Widget} parentWidget */ attach(parentWidget) { if (parentWidget === this._parentWidget) @@ -289,9 +289,9 @@ currentParent = currentParent.parentElementOrShadowHost(); if (this._isRoot) - WebInspector.Widget.__assert(!currentParent, 'Attempt to show root widget under another widget'); + UI.Widget.__assert(!currentParent, 'Attempt to show root widget under another widget'); else - WebInspector.Widget.__assert( + UI.Widget.__assert( currentParent && currentParent.__widget === this._parentWidget, 'Attempt to show under node belonging to alien widget'); @@ -308,11 +308,11 @@ // Reparent if (this.element.parentElement !== parentElement) { - WebInspector.Widget._incrementWidgetCounter(parentElement, this.element); + UI.Widget._incrementWidgetCounter(parentElement, this.element); if (insertBefore) - WebInspector.Widget._originalInsertBefore.call(parentElement, this.element, insertBefore); + UI.Widget._originalInsertBefore.call(parentElement, this.element, insertBefore); else - WebInspector.Widget._originalAppendChild.call(parentElement, this.element); + UI.Widget._originalAppendChild.call(parentElement, this.element); } if (!wasVisible && this._parentIsShowing()) @@ -346,8 +346,8 @@ this.element.classList.add('hidden'); } else { // Force legal removal - WebInspector.Widget._decrementWidgetCounter(parentElement, this.element); - WebInspector.Widget._originalRemoveChild.call(parentElement, this.element); + UI.Widget._decrementWidgetCounter(parentElement, this.element); + UI.Widget._originalRemoveChild.call(parentElement, this.element); } if (this._parentIsShowing()) @@ -366,7 +366,7 @@ // Update widget hierarchy. if (this._parentWidget) { var childIndex = this._parentWidget._children.indexOf(this); - WebInspector.Widget.__assert(childIndex >= 0, 'Attempt to remove non-child widget'); + UI.Widget.__assert(childIndex >= 0, 'Attempt to remove non-child widget'); this._parentWidget._children.splice(childIndex, 1); if (this._parentWidget._defaultFocusedChild === this) this._parentWidget._defaultFocusedChild = null; @@ -375,7 +375,7 @@ this._parentWidget = null; this._processWasDetachedFromHierarchy(); } else { - WebInspector.Widget.__assert(this._isRoot, 'Removing non-root widget from DOM'); + UI.Widget.__assert(this._isRoot, 'Removing non-root widget from DOM'); } } @@ -431,7 +431,7 @@ * @param {string} cssFile */ registerRequiredCSS(cssFile) { - WebInspector.appendStyle(this._isWebComponent ? this._shadowRoot : this.element, cssFile); + UI.appendStyle(this._isWebComponent ? this._shadowRoot : this.element, cssFile); } printWidgetHierarchy() { @@ -458,10 +458,10 @@ } /** - * @param {!WebInspector.Widget} child + * @param {!UI.Widget} child */ setDefaultFocusedChild(child) { - WebInspector.Widget.__assert(child._parentWidget === this, 'Attempt to set non-child widget as default focused.'); + UI.Widget.__assert(child._parentWidget === this, 'Attempt to set non-child widget as default focused.'); this._defaultFocusedChild = child; } @@ -503,15 +503,15 @@ var oldParent = this.element.parentElement; var oldNextSibling = this.element.nextSibling; - WebInspector.Widget._originalAppendChild.call(document.body, this.element); + UI.Widget._originalAppendChild.call(document.body, this.element); this.element.positionAt(0, 0); var result = new Size(this.element.offsetWidth, this.element.offsetHeight); this.element.positionAt(undefined, undefined); if (oldParent) - WebInspector.Widget._originalInsertBefore.call(oldParent, this.element, oldNextSibling); + UI.Widget._originalInsertBefore.call(oldParent, this.element, oldNextSibling); else - WebInspector.Widget._originalRemoveChild.call(document.body, this.element); + UI.Widget._originalRemoveChild.call(document.body, this.element); return result; } @@ -594,16 +594,16 @@ } }; -WebInspector.Widget._originalAppendChild = Element.prototype.appendChild; -WebInspector.Widget._originalInsertBefore = Element.prototype.insertBefore; -WebInspector.Widget._originalRemoveChild = Element.prototype.removeChild; -WebInspector.Widget._originalRemoveChildren = Element.prototype.removeChildren; +UI.Widget._originalAppendChild = Element.prototype.appendChild; +UI.Widget._originalInsertBefore = Element.prototype.insertBefore; +UI.Widget._originalRemoveChild = Element.prototype.removeChild; +UI.Widget._originalRemoveChildren = Element.prototype.removeChildren; /** * @unrestricted */ -WebInspector.VBox = class extends WebInspector.Widget { +UI.VBox = class extends UI.Widget { /** * @param {boolean=} isWebComponent */ @@ -620,7 +620,7 @@ var constraints = new Constraints(); /** - * @this {!WebInspector.Widget} + * @this {!UI.Widget} * @suppressReceiverCheck */ function updateForChild() { @@ -637,7 +637,7 @@ /** * @unrestricted */ -WebInspector.HBox = class extends WebInspector.Widget { +UI.HBox = class extends UI.Widget { /** * @param {boolean=} isWebComponent */ @@ -654,7 +654,7 @@ var constraints = new Constraints(); /** - * @this {!WebInspector.Widget} + * @this {!UI.Widget} * @suppressReceiverCheck */ function updateForChild() { @@ -671,7 +671,7 @@ /** * @unrestricted */ -WebInspector.VBoxWithResizeCallback = class extends WebInspector.VBox { +UI.VBoxWithResizeCallback = class extends UI.VBox { /** * @param {function()} resizeCallback */ @@ -691,9 +691,9 @@ /** * @unrestricted */ -WebInspector.WidgetFocusRestorer = class { +UI.WidgetFocusRestorer = class { /** - * @param {!WebInspector.Widget} widget + * @param {!UI.Widget} widget */ constructor(widget) { this._widget = widget; @@ -718,9 +718,9 @@ * @suppress {duplicate} */ Element.prototype.appendChild = function(child) { - WebInspector.Widget.__assert( + UI.Widget.__assert( !child.__widget || child.parentElement === this, 'Attempt to add widget via regular DOM operation.'); - return WebInspector.Widget._originalAppendChild.call(this, child); + return UI.Widget._originalAppendChild.call(this, child); }; /** @@ -731,9 +731,9 @@ * @suppress {duplicate} */ Element.prototype.insertBefore = function(child, anchor) { - WebInspector.Widget.__assert( + UI.Widget.__assert( !child.__widget || child.parentElement === this, 'Attempt to add widget via regular DOM operation.'); - return WebInspector.Widget._originalInsertBefore.call(this, child, anchor); + return UI.Widget._originalInsertBefore.call(this, child, anchor); }; /** @@ -743,14 +743,14 @@ * @suppress {duplicate} */ Element.prototype.removeChild = function(child) { - WebInspector.Widget.__assert( + UI.Widget.__assert( !child.__widgetCounter && !child.__widget, 'Attempt to remove element containing widget via regular DOM operation'); - return WebInspector.Widget._originalRemoveChild.call(this, child); + return UI.Widget._originalRemoveChild.call(this, child); }; Element.prototype.removeChildren = function() { - WebInspector.Widget.__assert( + UI.Widget.__assert( !this.__widgetCounter, 'Attempt to remove element containing widget via regular DOM operation'); - WebInspector.Widget._originalRemoveChildren.call(this); + UI.Widget._originalRemoveChildren.call(this); };
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ZoomManager.js b/third_party/WebKit/Source/devtools/front_end/ui/ZoomManager.js index 7840514..99dd413 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/ZoomManager.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/ZoomManager.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ZoomManager = class extends WebInspector.Object { +UI.ZoomManager = class extends Common.Object { /** * @param {!Window} window * @param {!InspectorFrontendHostAPI} frontendHost @@ -44,16 +44,16 @@ this._zoomFactor = this._frontendHost.zoomFactor(); if (oldZoomFactor !== this._zoomFactor) this.dispatchEventToListeners( - WebInspector.ZoomManager.Events.ZoomChanged, {from: oldZoomFactor, to: this._zoomFactor}); + UI.ZoomManager.Events.ZoomChanged, {from: oldZoomFactor, to: this._zoomFactor}); } }; /** @enum {symbol} */ -WebInspector.ZoomManager.Events = { +UI.ZoomManager.Events = { ZoomChanged: Symbol('ZoomChanged') }; /** - * @type {!WebInspector.ZoomManager} + * @type {!UI.ZoomManager} */ -WebInspector.zoomManager; +UI.zoomManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js index f5efbae..118f3a43 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
@@ -29,7 +29,7 @@ /** * @unrestricted */ -var TreeOutline = class extends WebInspector.Object { +var TreeOutline = class extends Common.Object { /** * @param {boolean=} nonFocusable */ @@ -224,7 +224,7 @@ handled = this.selectedTreeElement.ondelete(); else if (isEnterKey(event)) handled = this.selectedTreeElement.onenter(); - else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Space.code) + else if (event.keyCode === UI.KeyboardShortcut.Keys.Space.code) handled = this.selectedTreeElement.onspace(); if (handled) @@ -269,7 +269,7 @@ // Redefine element to the external one. this.element = createElement('div'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui/treeoutline.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/treeoutline.css'); this._disclosureElement = this._shadowRoot.createChild('div', 'tree-outline-disclosure'); this._disclosureElement.appendChild(this.contentElement); this._renderSelection = true; @@ -279,7 +279,7 @@ * @param {string} cssFile */ registerRequiredCSS(cssFile) { - WebInspector.appendStyle(this._shadowRoot, cssFile); + UI.appendStyle(this._shadowRoot, cssFile); } hideOverflow() { @@ -599,10 +599,10 @@ } /** - * @param {!WebInspector.InplaceEditor.Config} editingConfig + * @param {!UI.InplaceEditor.Config} editingConfig */ startEditingTitle(editingConfig) { - WebInspector.InplaceEditor.startEditing(this._titleElement, editingConfig); + UI.InplaceEditor.startEditing(this._titleElement, editingConfig); this.treeOutline._shadowRoot.getSelection().setBaseAndExtent(this._titleElement, 0, this._titleElement, 1); }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js index 8f0b020..84ffa29 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.ChartViewport = class extends WebInspector.VBox { +UI.ChartViewport = class extends UI.VBox { constructor() { super(true); @@ -12,10 +12,10 @@ this.contentElement.addEventListener('keydown', this._handleZoomPanKeys.bind(this), false); this.viewportElement = this.contentElement.createChild('div', 'fill'); - WebInspector.installInertialDragHandle( + UI.installInertialDragHandle( this.viewportElement, this._startDragging.bind(this), this._dragging.bind(this), this._endDragging.bind(this), '-webkit-grabbing', null); - WebInspector.installDragHandle( + UI.installDragHandle( this.viewportElement, this._startRangeSelection.bind(this), this._rangeSelectionDragging.bind(this), this._endRangeSelection.bind(this), 'text', null); @@ -300,7 +300,7 @@ * @private */ _handleZoomPanKeys(e) { - if (!WebInspector.KeyboardShortcut.hasNoModifiers(e)) + if (!UI.KeyboardShortcut.hasNoModifiers(e)) return; var zoomMultiplier = e.shiftKey ? 0.8 : 0.3; var panMultiplier = e.shiftKey ? 320 : 80; @@ -365,7 +365,7 @@ _requestWindowTimes(bounds) { bounds.left = Number.constrain(bounds.left, this._minimumBoundary, this._totalTime + this._minimumBoundary); bounds.right = Number.constrain(bounds.right, this._minimumBoundary, this._totalTime + this._minimumBoundary); - if (bounds.right - bounds.left < WebInspector.FlameChart.MinimalTimeWindowMs) + if (bounds.right - bounds.left < UI.FlameChart.MinimalTimeWindowMs) return; this._flameChartDelegate.requestWindowTimes(bounds.left, bounds.right); } @@ -429,7 +429,7 @@ return; } this._cancelAnimation(); - this._cancelWindowTimesAnimation = WebInspector.animateFunction( + this._cancelWindowTimesAnimation = UI.animateFunction( this.element.window(), this._animateWindowTimes.bind(this), [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindowRight, to: endTime}], 5, this._animationCompleted.bind(this));
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/CommandMenu.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/CommandMenu.js index d036845..105bd48 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/CommandMenu.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/CommandMenu.js
@@ -4,7 +4,7 @@ /** * @unrestricted */ -WebInspector.CommandMenu = class { +UI.CommandMenu = class { constructor() { this._commands = []; this._loadCommands(); @@ -17,26 +17,26 @@ * @param {string} shortcut * @param {function()} executeHandler * @param {function()=} availableHandler - * @return {!WebInspector.CommandMenu.Command} + * @return {!UI.CommandMenu.Command} */ static createCommand(category, keys, title, shortcut, executeHandler, availableHandler) { // Separate keys by null character, to prevent fuzzy matching from matching across them. var key = keys.replace(/,/g, '\0'); - return new WebInspector.CommandMenu.Command(category, title, key, shortcut, executeHandler, availableHandler); + return new UI.CommandMenu.Command(category, title, key, shortcut, executeHandler, availableHandler); } /** * @param {!Runtime.Extension} extension * @param {string} title * @param {V} value - * @return {!WebInspector.CommandMenu.Command} + * @return {!UI.CommandMenu.Command} * @template V */ static createSettingCommand(extension, title, value) { var category = extension.descriptor()['category'] || ''; var tags = extension.descriptor()['tags'] || ''; - var setting = WebInspector.settings.moduleSetting(extension.descriptor()['settingName']); - return WebInspector.CommandMenu.createCommand( + var setting = Common.settings.moduleSetting(extension.descriptor()['settingName']); + return UI.CommandMenu.createCommand( category, tags, title, '', setting.set.bind(setting, value), availableHandler); /** @@ -48,24 +48,24 @@ } /** - * @param {!WebInspector.Action} action - * @return {!WebInspector.CommandMenu.Command} + * @param {!UI.Action} action + * @return {!UI.CommandMenu.Command} */ static createActionCommand(action) { - var shortcut = WebInspector.shortcutRegistry.shortcutTitleForAction(action.id()) || ''; - return WebInspector.CommandMenu.createCommand( + var shortcut = UI.shortcutRegistry.shortcutTitleForAction(action.id()) || ''; + return UI.CommandMenu.createCommand( action.category(), action.tags(), action.title(), shortcut, action.execute.bind(action)); } /** * @param {!Runtime.Extension} extension - * @return {!WebInspector.CommandMenu.Command} + * @return {!UI.CommandMenu.Command} */ static createRevealPanelCommand(extension) { var panelName = extension.descriptor()['name']; var tags = extension.descriptor()['tags'] || ''; - return WebInspector.CommandMenu.createCommand( - WebInspector.UIString('Panel'), tags, WebInspector.UIString('Show %s', extension.title()), '', executeHandler, + return UI.CommandMenu.createCommand( + Common.UIString('Panel'), tags, Common.UIString('Show %s', extension.title()), '', executeHandler, availableHandler); /** @@ -76,34 +76,34 @@ } function executeHandler() { - WebInspector.viewManager.showView(panelName); + UI.viewManager.showView(panelName); } } /** * @param {!Runtime.Extension} extension - * @return {!WebInspector.CommandMenu.Command} + * @return {!UI.CommandMenu.Command} */ static createRevealDrawerCommand(extension) { var drawerId = extension.descriptor()['id']; - var executeHandler = WebInspector.viewManager.showView.bind(WebInspector.viewManager, drawerId); + var executeHandler = UI.viewManager.showView.bind(UI.viewManager, drawerId); var tags = extension.descriptor()['tags'] || ''; - return WebInspector.CommandMenu.createCommand( - WebInspector.UIString('Drawer'), tags, WebInspector.UIString('Show %s', extension.title()), '', executeHandler); + return UI.CommandMenu.createCommand( + Common.UIString('Drawer'), tags, Common.UIString('Show %s', extension.title()), '', executeHandler); } _loadCommands() { // Populate panels. - var panelExtensions = self.runtime.extensions(WebInspector.Panel); + var panelExtensions = self.runtime.extensions(UI.Panel); for (var extension of panelExtensions) - this._commands.push(WebInspector.CommandMenu.createRevealPanelCommand(extension)); + this._commands.push(UI.CommandMenu.createRevealPanelCommand(extension)); // Populate drawers. var drawerExtensions = self.runtime.extensions('view'); for (var extension of drawerExtensions) { if (extension.descriptor()['location'] !== 'drawer-view') continue; - this._commands.push(WebInspector.CommandMenu.createRevealDrawerCommand(extension)); + this._commands.push(UI.CommandMenu.createRevealDrawerCommand(extension)); } // Populate whitelisted settings. @@ -113,12 +113,12 @@ if (!options || !extension.descriptor()['category']) continue; for (var pair of options) - this._commands.push(WebInspector.CommandMenu.createSettingCommand(extension, pair['title'], pair['value'])); + this._commands.push(UI.CommandMenu.createSettingCommand(extension, pair['title'], pair['value'])); } } /** - * @return {!Array.<!WebInspector.CommandMenu.Command>} + * @return {!Array.<!UI.CommandMenu.Command>} */ commands() { return this._commands; @@ -128,7 +128,7 @@ /** * @unrestricted */ -WebInspector.CommandMenuDelegate = class extends WebInspector.FilteredListWidget.Delegate { +UI.CommandMenuDelegate = class extends UI.FilteredListWidget.Delegate { constructor() { super([]); this._commands = []; @@ -136,13 +136,13 @@ } _appendAvailableCommands() { - var allCommands = WebInspector.commandMenu.commands(); + var allCommands = UI.commandMenu.commands(); // Populate whitelisted actions. - var actions = WebInspector.actionRegistry.availableActions(); + var actions = UI.actionRegistry.availableActions(); for (var action of actions) { if (action.category()) - this._commands.push(WebInspector.CommandMenu.createActionCommand(action)); + this._commands.push(UI.CommandMenu.createActionCommand(action)); } for (var command of allCommands) { @@ -153,8 +153,8 @@ this._commands = this._commands.sort(commandComparator); /** - * @param {!WebInspector.CommandMenu.Command} left - * @param {!WebInspector.CommandMenu.Command} right + * @param {!UI.CommandMenu.Command} left + * @param {!UI.CommandMenu.Command} right * @return {number} */ function commandComparator(left, right) { @@ -188,11 +188,11 @@ */ itemScoreAt(itemIndex, query) { var command = this._commands[itemIndex]; - var opcodes = WebInspector.Diff.charDiff(query.toLowerCase(), command.title().toLowerCase()); + var opcodes = Diff.Diff.charDiff(query.toLowerCase(), command.title().toLowerCase()); var score = 0; // Score longer sequences higher. for (var i = 0; i < opcodes.length; ++i) { - if (opcodes[i][0] === WebInspector.Diff.Operation.Equal) + if (opcodes[i][0] === Diff.Diff.Operation.Equal) score += opcodes[i][1].length * opcodes[i][1].length; } @@ -216,8 +216,8 @@ var command = this._commands[itemIndex]; titleElement.removeChildren(); var tagElement = titleElement.createChild('span', 'tag'); - var index = String.hashCode(command.category()) % WebInspector.CommandMenuDelegate.MaterialPaletteColors.length; - tagElement.style.backgroundColor = WebInspector.CommandMenuDelegate.MaterialPaletteColors[index]; + var index = String.hashCode(command.category()) % UI.CommandMenuDelegate.MaterialPaletteColors.length; + tagElement.style.backgroundColor = UI.CommandMenuDelegate.MaterialPaletteColors[index]; tagElement.textContent = command.category(); titleElement.createTextChild(command.title()); this.highlightRanges(titleElement, query); @@ -250,7 +250,7 @@ } }; -WebInspector.CommandMenuDelegate.MaterialPaletteColors = [ +UI.CommandMenuDelegate.MaterialPaletteColors = [ '#F44336', '#E91E63', '#9C27B0', '#673AB7', '#3F51B5', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFC107', '#FF9800', '#FF5722', '#795548', '#9E9E9E', '#607D8B' ]; @@ -258,7 +258,7 @@ /** * @unrestricted */ -WebInspector.CommandMenu.Command = class { +UI.CommandMenu.Command = class { /** * @param {string} category * @param {string} title @@ -317,22 +317,22 @@ }; -/** @type {!WebInspector.CommandMenu} */ -WebInspector.commandMenu = new WebInspector.CommandMenu(); +/** @type {!UI.CommandMenu} */ +UI.commandMenu = new UI.CommandMenu(); /** - * @implements {WebInspector.ActionDelegate} + * @implements {UI.ActionDelegate} * @unrestricted */ -WebInspector.CommandMenu.ShowActionDelegate = class { +UI.CommandMenu.ShowActionDelegate = class { /** * @override - * @param {!WebInspector.Context} context + * @param {!UI.Context} context * @param {string} actionId * @return {boolean} */ handleAction(context, actionId) { - new WebInspector.FilteredListWidget(new WebInspector.CommandMenuDelegate()).showAsDialog(); + new UI.FilteredListWidget(new UI.CommandMenuDelegate()).showAsDialog(); InspectorFrontendHost.bringToFront(); return true; }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js index ff6c79e..d80891e3 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js
@@ -26,24 +26,24 @@ /** * @unrestricted */ -WebInspector.DataGrid = class extends WebInspector.Object { +UI.DataGrid = class extends Common.Object { /** - * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columnsArray - * @param {function(!WebInspector.DataGridNode, string, string, string)=} editCallback - * @param {function(!WebInspector.DataGridNode)=} deleteCallback + * @param {!Array.<!UI.DataGrid.ColumnDescriptor>} columnsArray + * @param {function(!UI.DataGridNode, string, string, string)=} editCallback + * @param {function(!UI.DataGridNode)=} deleteCallback * @param {function()=} refreshCallback */ constructor(columnsArray, editCallback, deleteCallback, refreshCallback) { super(); this.element = createElementWithClass('div', 'data-grid'); - WebInspector.appendStyle(this.element, 'ui_lazy/dataGrid.css'); + UI.appendStyle(this.element, 'ui_lazy/dataGrid.css'); this.element.tabIndex = 0; this.element.addEventListener('keydown', this._keyDown.bind(this), false); this.element.addEventListener('contextmenu', this._contextMenu.bind(this), true); - /** @type {function(!WebInspector.DataGridNode, string, string, string)|undefined} */ + /** @type {function(!UI.DataGridNode, string, string, string)|undefined} */ this._editCallback = editCallback; - /** @type {function(!WebInspector.DataGridNode)|undefined} */ + /** @type {function(!UI.DataGridNode)|undefined} */ this._deleteCallback = deleteCallback; /** @type {function()|undefined} */ this._refreshCallback = refreshCallback; @@ -68,11 +68,11 @@ /** @type {boolean} */ this._inline = false; - /** @type {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} */ + /** @type {!Array.<!UI.DataGrid.ColumnDescriptor>} */ this._columnsArray = []; - /** @type {!Object.<string, !WebInspector.DataGrid.ColumnDescriptor>} */ + /** @type {!Object.<string, !UI.DataGrid.ColumnDescriptor>} */ this._columns = {}; - /** @type {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} */ + /** @type {!Array.<!UI.DataGrid.ColumnDescriptor>} */ this._visibleColumnsArray = columnsArray; columnsArray.forEach(column => this._innerAddColumn(column)); @@ -104,11 +104,11 @@ /** @type {boolean} */ this._editing = false; - /** @type {?WebInspector.DataGridNode} */ + /** @type {?UI.DataGridNode} */ this.selectedNode = null; /** @type {boolean} */ this.expandNodesWhenArrowing = false; - this.setRootNode(new WebInspector.DataGridNode()); + this.setRootNode(new UI.DataGridNode()); /** @type {number} */ this.indentWidth = 15; /** @type {!Array.<!Element|{__index: number, __position: number}>} */ @@ -116,13 +116,13 @@ /** @type {boolean} */ this._columnWidthsInitialized = false; /** @type {number} */ - this._cornerWidth = WebInspector.DataGrid.CornerWidth; - /** @type {!WebInspector.DataGrid.ResizeMethod} */ - this._resizeMethod = WebInspector.DataGrid.ResizeMethod.Nearest; + this._cornerWidth = UI.DataGrid.CornerWidth; + /** @type {!UI.DataGrid.ResizeMethod} */ + this._resizeMethod = UI.DataGrid.ResizeMethod.Nearest; - /** @type {?function(!WebInspector.ContextMenu)} */ + /** @type {?function(!UI.ContextMenu)} */ this._headerContextMenuCallback = null; - /** @type {?function(!WebInspector.ContextMenu, !WebInspector.DataGridNode)} */ + /** @type {?function(!UI.ContextMenu, !UI.DataGridNode)} */ this._rowContextMenuCallback = null; } @@ -134,7 +134,7 @@ } /** - * @param {!WebInspector.DataGrid.ColumnDescriptor} column + * @param {!UI.DataGrid.ColumnDescriptor} column * @param {number=} position */ _innerAddColumn(column, position) { @@ -152,7 +152,7 @@ var cell = createElement('th'); cell.className = columnId + '-column'; - cell[WebInspector.DataGrid._columnIdSymbol] = columnId; + cell[UI.DataGrid._columnIdSymbol] = columnId; this._headerTableHeaders[columnId] = cell; var div = createElement('div'); @@ -175,7 +175,7 @@ } /** - * @param {!WebInspector.DataGrid.ColumnDescriptor} column + * @param {!UI.DataGrid.ColumnDescriptor} column * @param {number=} position */ addColumn(column, position) { @@ -230,7 +230,7 @@ } this._headerRow.appendChild(this._headerTableHeaders[columnId]); this._topFillerRow.createChild('td', 'top-filler-td'); - this._bottomFillerRow.createChild('td', 'bottom-filler-td')[WebInspector.DataGrid._columnIdSymbol] = columnId; + this._bottomFillerRow.createChild('td', 'bottom-filler-td')[UI.DataGrid._columnIdSymbol] = columnId; } this._headerRow.createChild('th', 'corner'); @@ -251,11 +251,11 @@ this._bottomFillerRow.style.height = bottom + 'px'; else this._bottomFillerRow.style.height = 'auto'; - this.dispatchEventToListeners(WebInspector.DataGrid.Events.PaddingChanged); + this.dispatchEventToListeners(UI.DataGrid.Events.PaddingChanged); } /** - * @param {!WebInspector.DataGridNode} rootNode + * @param {!UI.DataGridNode} rootNode * @protected */ setRootNode(rootNode) { @@ -264,7 +264,7 @@ this._rootNode.dataGrid = null; this._rootNode._isRoot = false; } - /** @type {!WebInspector.DataGridNode} */ + /** @type {!UI.DataGridNode} */ this._rootNode = rootNode; rootNode._isRoot = true; rootNode.hasChildren = false; @@ -275,7 +275,7 @@ } /** - * @return {!WebInspector.DataGridNode} + * @return {!UI.DataGridNode} */ rootNode() { return this._rootNode; @@ -295,17 +295,17 @@ } /** - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} node * @param {number} cellIndex */ _startEditingColumnOfDataGridNode(node, cellIndex) { this._editing = true; - /** @type {?WebInspector.DataGridNode} */ + /** @type {?UI.DataGridNode} */ this._editingNode = node; this._editingNode.select(); var element = this._editingNode._element.children[cellIndex]; - WebInspector.InplaceEditor.startEditing(element, this._startEditingConfig(element)); + UI.InplaceEditor.startEditing(element, this._startEditingConfig(element)); element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); } @@ -331,7 +331,7 @@ } this._editing = true; - WebInspector.InplaceEditor.startEditing(element, this._startEditingConfig(element)); + UI.InplaceEditor.startEditing(element, this._startEditingConfig(element)); element.getComponentSelection().setBaseAndExtent(element, 0, element, 1); } @@ -345,10 +345,10 @@ /** * @param {!Element} element - * @return {!WebInspector.InplaceEditor.Config} + * @return {!UI.InplaceEditor.Config} */ _startEditingConfig(element) { - return new WebInspector.InplaceEditor.Config( + return new UI.InplaceEditor.Config( this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent); } @@ -372,7 +372,7 @@ /** * @param {boolean} wasChange - * @this {WebInspector.DataGrid} + * @this {UI.DataGrid} */ function moveToNextIfNeeded(wasChange) { if (!moveDirection) @@ -466,17 +466,17 @@ sortColumnId() { if (!this._sortColumnCell) return null; - return this._sortColumnCell[WebInspector.DataGrid._columnIdSymbol]; + return this._sortColumnCell[UI.DataGrid._columnIdSymbol]; } /** * @return {?string} */ sortOrder() { - if (!this._sortColumnCell || this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Ascending)) - return WebInspector.DataGrid.Order.Ascending; - if (this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Descending)) - return WebInspector.DataGrid.Order.Descending; + if (!this._sortColumnCell || this._sortColumnCell.classList.contains(UI.DataGrid.Order.Ascending)) + return UI.DataGrid.Order.Ascending; + if (this._sortColumnCell.classList.contains(UI.DataGrid.Order.Descending)) + return UI.DataGrid.Order.Descending; return null; } @@ -484,7 +484,7 @@ * @return {boolean} */ isSortOrderAscending() { - return !this._sortColumnCell || this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Ascending); + return !this._sortColumnCell || this._sortColumnCell.classList.contains(UI.DataGrid.Order.Ascending); } /** @@ -566,10 +566,10 @@ } /** - * @param {!WebInspector.DataGridNode} rootNode - * @param {!Array<!WebInspector.DataGridNode>} result + * @param {!UI.DataGridNode} rootNode + * @param {!Array<!UI.DataGridNode>} result * @param {number} maxLevel - * @return {!Array<!WebInspector.DataGridNode>} + * @return {!Array<!UI.DataGridNode>} */ _enumerateChildren(rootNode, result, maxLevel) { if (!rootNode._isRoot) @@ -622,7 +622,7 @@ * @param {string} name */ setName(name) { - this._columnWeightsSetting = WebInspector.settings.createSetting('dataGrid-' + name + '-columnWeights', {}); + this._columnWeightsSetting = Common.settings.createSetting('dataGrid-' + name + '-columnWeights', {}); this._loadColumnWeights(); } @@ -667,7 +667,7 @@ for (var i = 0; i < this._visibleColumnsArray.length; ++i) { var column = this._visibleColumnsArray[i]; if (column.fixedWidth) { - var width = this._headerTableColumnGroup.children[i][WebInspector.DataGrid._preferredWidthSymbol] || + var width = this._headerTableColumnGroup.children[i][UI.DataGrid._preferredWidthSymbol] || this._headerTableBody.rows[0].cells[i].offsetWidth; fixedColumnWidths[i] = width; tableWidth -= width; @@ -742,7 +742,7 @@ resizer.__index = i; resizer.classList.add('data-grid-resizer'); // This resizer is associated with the column to its right. - WebInspector.installDragHandle( + UI.installDragHandle( resizer, this._startResizerDragging.bind(this), this._resizerDragging.bind(this), this._endResizerDragging.bind(this), 'col-resize'); this.element.appendChild(resizer); @@ -762,7 +762,7 @@ var emptyData = {}; for (var column in this._columns) emptyData[column] = null; - this.creationNode = new WebInspector.CreationDataGridNode(emptyData, hasChildren); + this.creationNode = new UI.CreationDataGridNode(emptyData, hasChildren); this.rootNode().appendChild(this.creationNode); } @@ -837,7 +837,7 @@ } /** - * @param {?WebInspector.DataGridNode} root + * @param {?UI.DataGridNode} root * @param {boolean} onlyAffectsSubtree */ updateSelectionBeforeRemoval(root, onlyAffectsSubtree) { @@ -872,7 +872,7 @@ /** * @param {!Node} target - * @return {?WebInspector.DataGridNode} + * @return {?UI.DataGridNode} */ dataGridNodeFromNode(target) { var rowElement = target.enclosingNodeOrSelfWithNodeName('tr'); @@ -885,7 +885,7 @@ */ columnIdFromNode(target) { var cellElement = target.enclosingNodeOrSelfWithNodeName('td'); - return cellElement && cellElement[WebInspector.DataGrid._columnIdSymbol]; + return cellElement && cellElement[UI.DataGrid._columnIdSymbol]; } /** @@ -893,31 +893,31 @@ */ _clickInHeaderCell(event) { var cell = event.target.enclosingNodeOrSelfWithNodeName('th'); - if (!cell || (cell[WebInspector.DataGrid._columnIdSymbol] === undefined) || !cell.classList.contains('sortable')) + if (!cell || (cell[UI.DataGrid._columnIdSymbol] === undefined) || !cell.classList.contains('sortable')) return; - var sortOrder = WebInspector.DataGrid.Order.Ascending; + var sortOrder = UI.DataGrid.Order.Ascending; if ((cell === this._sortColumnCell) && this.isSortOrderAscending()) - sortOrder = WebInspector.DataGrid.Order.Descending; + sortOrder = UI.DataGrid.Order.Descending; if (this._sortColumnCell) this._sortColumnCell.classList.remove( - WebInspector.DataGrid.Order.Ascending, WebInspector.DataGrid.Order.Descending); + UI.DataGrid.Order.Ascending, UI.DataGrid.Order.Descending); this._sortColumnCell = cell; cell.classList.add(sortOrder); - this.dispatchEventToListeners(WebInspector.DataGrid.Events.SortingChanged); + this.dispatchEventToListeners(UI.DataGrid.Events.SortingChanged); } /** * @param {string} columnId - * @param {!WebInspector.DataGrid.Order} sortOrder + * @param {!UI.DataGrid.Order} sortOrder */ markColumnAsSortedBy(columnId, sortOrder) { if (this._sortColumnCell) this._sortColumnCell.classList.remove( - WebInspector.DataGrid.Order.Ascending, WebInspector.DataGrid.Order.Descending); + UI.DataGrid.Order.Ascending, UI.DataGrid.Order.Descending); this._sortColumnCell = this._headerTableHeaders[columnId]; this._sortColumnCell.classList.add(sortOrder); } @@ -953,14 +953,14 @@ } /** - * @param {?function(!WebInspector.ContextMenu)} callback + * @param {?function(!UI.ContextMenu)} callback */ setHeaderContextMenuCallback(callback) { this._headerContextMenuCallback = callback; } /** - * @param {?function(!WebInspector.ContextMenu, !WebInspector.DataGridNode)} callback + * @param {?function(!UI.ContextMenu, !UI.DataGridNode)} callback */ setRowContextMenuCallback(callback) { this._rowContextMenuCallback = callback; @@ -970,7 +970,7 @@ * @param {!Event} event */ _contextMenu(event) { - var contextMenu = new WebInspector.ContextMenu(event); + var contextMenu = new UI.ContextMenu(event); var target = /** @type {!Node} */ (event.target); if (target.isSelfOrDescendant(this._headerTableBody)) { @@ -981,22 +981,22 @@ var gridNode = this.dataGridNodeFromNode(target); if (this._refreshCallback && (!gridNode || gridNode !== this.creationNode)) - contextMenu.appendItem(WebInspector.UIString('Refresh'), this._refreshCallback.bind(this)); + contextMenu.appendItem(Common.UIString('Refresh'), this._refreshCallback.bind(this)); if (gridNode && gridNode.selectable && !gridNode.isEventWithinDisclosureTriangle(event)) { if (this._editCallback) { if (gridNode === this.creationNode) - contextMenu.appendItem(WebInspector.UIString.capitalize('Add ^new'), this._startEditing.bind(this, target)); + contextMenu.appendItem(Common.UIString.capitalize('Add ^new'), this._startEditing.bind(this, target)); else { var columnId = this.columnIdFromNode(target); if (columnId && this._columns[columnId].editable) contextMenu.appendItem( - WebInspector.UIString('Edit "%s"', this._columns[columnId].title), + Common.UIString('Edit "%s"', this._columns[columnId].title), this._startEditing.bind(this, target)); } } if (this._deleteCallback && gridNode !== this.creationNode) - contextMenu.appendItem(WebInspector.UIString.capitalize('Delete'), this._deleteCallback.bind(this, gridNode)); + contextMenu.appendItem(Common.UIString.capitalize('Delete'), this._deleteCallback.bind(this, gridNode)); if (this._rowContextMenuCallback) this._rowContextMenuCallback(contextMenu, gridNode); } @@ -1026,7 +1026,7 @@ } /** - * @param {!WebInspector.DataGrid.ResizeMethod} method + * @param {!UI.DataGrid.ResizeMethod} method */ setResizeMethod(method) { this._resizeMethod = method; @@ -1067,9 +1067,9 @@ leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth; // Differences for other resize methods - if (this._resizeMethod === WebInspector.DataGrid.ResizeMethod.Last) { + if (this._resizeMethod === UI.DataGrid.ResizeMethod.Last) { rightCellIndex = this._resizers.length; - } else if (this._resizeMethod === WebInspector.DataGrid.ResizeMethod.First) { + } else if (this._resizeMethod === UI.DataGrid.ResizeMethod.First) { leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth; leftCellIndex = 0; } @@ -1078,14 +1078,14 @@ leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth; // Give each column some padding so that they don't disappear. - var leftMinimum = leftEdgeOfPreviousColumn + WebInspector.DataGrid.ColumnResizePadding; - var rightMaximum = rightEdgeOfNextColumn - WebInspector.DataGrid.ColumnResizePadding; + var leftMinimum = leftEdgeOfPreviousColumn + UI.DataGrid.ColumnResizePadding; + var rightMaximum = rightEdgeOfNextColumn - UI.DataGrid.ColumnResizePadding; if (leftMinimum > rightMaximum) return; dragPoint = Number.constrain(dragPoint, leftMinimum, rightMaximum); - var position = (dragPoint - WebInspector.DataGrid.CenterResizerOverBorderAdjustment); + var position = (dragPoint - UI.DataGrid.CenterResizerOverBorderAdjustment); resizer.__position = position; resizer.style.left = position + 'px'; @@ -1111,7 +1111,7 @@ */ _setPreferredWidth(columnIndex, width) { var pxWidth = width + 'px'; - this._headerTableColumnGroup.children[columnIndex][WebInspector.DataGrid._preferredWidthSymbol] = width; + this._headerTableColumnGroup.children[columnIndex][UI.DataGrid._preferredWidthSymbol] = width; this._headerTableColumnGroup.children[columnIndex].style.width = pxWidth; this._dataTableColumnGroup.children[columnIndex].style.width = pxWidth; } @@ -1133,17 +1133,17 @@ } /** - * @return {!WebInspector.DataGridWidget} + * @return {!UI.DataGridWidget} */ asWidget() { if (!this._dataGridWidget) - this._dataGridWidget = new WebInspector.DataGridWidget(this); + this._dataGridWidget = new UI.DataGridWidget(this); return this._dataGridWidget; } }; // Keep in sync with .data-grid col.corner style rule. -WebInspector.DataGrid.CornerWidth = 14; +UI.DataGrid.CornerWidth = 14; /** * @typedef {{ @@ -1151,8 +1151,8 @@ * title: (string|undefined), * titleDOMFragment: (?DocumentFragment|undefined), * sortable: boolean, - * sort: (?WebInspector.DataGrid.Order|undefined), - * align: (?WebInspector.DataGrid.Align|undefined), + * sort: (?UI.DataGrid.Order|undefined), + * align: (?UI.DataGrid.Align|undefined), * fixedWidth: (boolean|undefined), * editable: (boolean|undefined), * nonSelectable: (boolean|undefined), @@ -1161,10 +1161,10 @@ * weight: (number|undefined) * }} */ -WebInspector.DataGrid.ColumnDescriptor; +UI.DataGrid.ColumnDescriptor; /** @enum {symbol} */ -WebInspector.DataGrid.Events = { +UI.DataGrid.Events = { SelectedNode: Symbol('SelectedNode'), DeselectedNode: Symbol('DeselectedNode'), SortingChanged: Symbol('SortingChanged'), @@ -1172,25 +1172,25 @@ }; /** @enum {string} */ -WebInspector.DataGrid.Order = { +UI.DataGrid.Order = { Ascending: 'sort-ascending', Descending: 'sort-descending' }; /** @enum {string} */ -WebInspector.DataGrid.Align = { +UI.DataGrid.Align = { Center: 'center', Right: 'right' }; -WebInspector.DataGrid._preferredWidthSymbol = Symbol('preferredWidth'); -WebInspector.DataGrid._columnIdSymbol = Symbol('columnId'); +UI.DataGrid._preferredWidthSymbol = Symbol('preferredWidth'); +UI.DataGrid._columnIdSymbol = Symbol('columnId'); -WebInspector.DataGrid.ColumnResizePadding = 24; -WebInspector.DataGrid.CenterResizerOverBorderAdjustment = 3; +UI.DataGrid.ColumnResizePadding = 24; +UI.DataGrid.CenterResizerOverBorderAdjustment = 3; /** @enum {string} */ -WebInspector.DataGrid.ResizeMethod = { +UI.DataGrid.ResizeMethod = { Nearest: 'nearest', First: 'first', Last: 'last' @@ -1199,7 +1199,7 @@ /** * @unrestricted */ -WebInspector.DataGridNode = class extends WebInspector.Object { +UI.DataGridNode = class extends Common.Object { /** * @param {?Object.<string, *>=} data * @param {boolean=} hasChildren @@ -1218,7 +1218,7 @@ this._revealed; /** @type {boolean} */ this._attached = false; - /** @type {?{parent: !WebInspector.DataGridNode, index: number}} */ + /** @type {?{parent: !UI.DataGridNode, index: number}} */ this._savedPosition = null; /** @type {boolean} */ this._shouldRefreshChildren = true; @@ -1226,15 +1226,15 @@ this._data = data || {}; /** @type {boolean} */ this.hasChildren = hasChildren || false; - /** @type {!Array.<!WebInspector.DataGridNode>} */ + /** @type {!Array.<!UI.DataGridNode>} */ this.children = []; - /** @type {?WebInspector.DataGrid} */ + /** @type {?UI.DataGrid} */ this.dataGrid = null; - /** @type {?WebInspector.DataGridNode} */ + /** @type {?UI.DataGridNode} */ this.parent = null; - /** @type {?WebInspector.DataGridNode} */ + /** @type {?UI.DataGridNode} */ this.previousSibling = null; - /** @type {?WebInspector.DataGridNode} */ + /** @type {?UI.DataGridNode} */ this.nextSibling = null; /** @type {number} */ this.disclosureToggleWidth = 10; @@ -1456,7 +1456,7 @@ */ createTD(columnId) { var cell = this._createTDWithClass(columnId + '-column'); - cell[WebInspector.DataGrid._columnIdSymbol] = columnId; + cell[UI.DataGrid._columnIdSymbol] = columnId; var alignment = this.dataGrid._columns[columnId].align; if (alignment) @@ -1498,14 +1498,14 @@ } /** - * @param {!WebInspector.DataGridNode} child + * @param {!UI.DataGridNode} child */ appendChild(child) { this.insertChild(child, this.children.length); } /** - * @param {!WebInspector.DataGridNode} child + * @param {!UI.DataGridNode} child * @param {number} index */ insertChild(child, index) { @@ -1557,7 +1557,7 @@ } /** - * @param {!WebInspector.DataGridNode} child + * @param {!UI.DataGridNode} child */ removeChild(child) { if (!child) @@ -1715,7 +1715,7 @@ this._element.classList.add('selected'); if (!supressSelectedEvent) - this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.SelectedNode); + this.dataGrid.dispatchEventToListeners(UI.DataGrid.Events.SelectedNode); } revealAndSelect() { @@ -1739,15 +1739,15 @@ this._element.classList.remove('selected'); if (!supressDeselectedEvent) - this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.DeselectedNode); + this.dataGrid.dispatchEventToListeners(UI.DataGrid.Events.DeselectedNode); } /** * @param {boolean} skipHidden - * @param {?WebInspector.DataGridNode=} stayWithin + * @param {?UI.DataGridNode=} stayWithin * @param {boolean=} dontPopulate * @param {!Object=} info - * @return {?WebInspector.DataGridNode} + * @return {?UI.DataGridNode} */ traverseNextNode(skipHidden, stayWithin, dontPopulate, info) { if (!dontPopulate && this.hasChildren) @@ -1787,7 +1787,7 @@ /** * @param {boolean} skipHidden * @param {boolean=} dontPopulate - * @return {?WebInspector.DataGridNode} + * @return {?UI.DataGridNode} */ traversePreviousNode(skipHidden, dontPopulate) { var node = (!skipHidden || this.revealed) ? this.previousSibling : null; @@ -1882,7 +1882,7 @@ /** * @unrestricted */ -WebInspector.CreationDataGridNode = class extends WebInspector.DataGridNode { +UI.CreationDataGridNode = class extends UI.DataGridNode { constructor(data, hasChildren) { super(data, hasChildren); /** @type {boolean} */ @@ -1897,9 +1897,9 @@ /** * @unrestricted */ -WebInspector.DataGridWidget = class extends WebInspector.VBox { +UI.DataGridWidget = class extends UI.VBox { /** - * @param {!WebInspector.DataGrid} dataGrid + * @param {!UI.DataGrid} dataGrid */ constructor(dataGrid) { super();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js index f68168b..a688c4c 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FilteredListWidget.js
@@ -4,12 +4,12 @@ * found in the LICENSE file. */ /** - * @implements {WebInspector.StaticViewportControl.Provider} + * @implements {UI.StaticViewportControl.Provider} * @unrestricted */ -WebInspector.FilteredListWidget = class extends WebInspector.VBox { +UI.FilteredListWidget = class extends UI.VBox { /** - * @param {!WebInspector.FilteredListWidget.Delegate} delegate + * @param {!UI.FilteredListWidget.Delegate} delegate */ constructor(delegate) { super(true); @@ -25,7 +25,7 @@ this._promptElement = this.contentElement.createChild('div', 'filtered-list-widget-input'); this._promptElement.setAttribute('spellcheck', 'false'); this._promptElement.setAttribute('contenteditable', 'plaintext-only'); - this._prompt = new WebInspector.TextPrompt(); + this._prompt = new UI.TextPrompt(); this._prompt.initialize(() => undefined); this._prompt.renderAsBlock(); var promptProxy = this._prompt.attach(this._promptElement); @@ -33,7 +33,7 @@ promptProxy.classList.add('filtered-list-widget-prompt-element'); this._filteredItems = []; - this._viewportControl = new WebInspector.StaticViewportControl(this); + this._viewportControl = new UI.StaticViewportControl(this); this._itemElementsContainer = this._viewportControl.element; this._itemElementsContainer.classList.add('container'); this._itemElementsContainer.addEventListener('click', this._onClick.bind(this), false); @@ -70,7 +70,7 @@ } showAsDialog() { - this._dialog = new WebInspector.Dialog(); + this._dialog = new UI.Dialog(); this._dialog.setMaxSize(new Size(504, 340)); this._dialog.setPosition(undefined, 22); this.show(this._dialog.element); @@ -165,7 +165,7 @@ var query = this._delegate.rewriteQuery(this._value()); this._query = query; - var filterRegex = query ? WebInspector.FilteredListWidget.filterRegex(query) : null; + var filterRegex = query ? UI.FilteredListWidget.filterRegex(query) : null; var oldSelectedAbsoluteIndex = this._selectedIndexInFiltered ? this._filteredItems[this._selectedIndexInFiltered] : null; @@ -191,7 +191,7 @@ /** * @param {number} fromIndex - * @this {WebInspector.FilteredListWidget} + * @this {UI.FilteredListWidget} */ function scoreItems(fromIndex) { var maxWorkItems = 1000; @@ -273,32 +273,32 @@ var newSelectedIndex = this._selectedIndexInFiltered; switch (event.keyCode) { - case WebInspector.KeyboardShortcut.Keys.Down.code: + case UI.KeyboardShortcut.Keys.Down.code: if (++newSelectedIndex >= this._filteredItems.length) newSelectedIndex = 0; this._updateSelection(newSelectedIndex, true); event.consume(true); break; - case WebInspector.KeyboardShortcut.Keys.Up.code: + case UI.KeyboardShortcut.Keys.Up.code: if (--newSelectedIndex < 0) newSelectedIndex = this._filteredItems.length - 1; this._updateSelection(newSelectedIndex, false); event.consume(true); break; - case WebInspector.KeyboardShortcut.Keys.PageDown.code: + case UI.KeyboardShortcut.Keys.PageDown.code: newSelectedIndex = Math.min(newSelectedIndex + this._rowsPerViewport(), this._filteredItems.length - 1); this._updateSelection(newSelectedIndex, true); event.consume(true); break; - case WebInspector.KeyboardShortcut.Keys.PageUp.code: + case UI.KeyboardShortcut.Keys.PageUp.code: newSelectedIndex = Math.max(newSelectedIndex - this._rowsPerViewport(), 0); this._updateSelection(newSelectedIndex, false); event.consume(true); break; - case WebInspector.KeyboardShortcut.Keys.Enter.code: + case UI.KeyboardShortcut.Keys.Enter.code: this._onEnter(event); break; - case WebInspector.KeyboardShortcut.Keys.Tab.code: + case UI.KeyboardShortcut.Keys.Tab.code: this._tabKeyPressed(); break; default: @@ -355,7 +355,7 @@ if (!this._rowHeight) { var delegateIndex = this._filteredItems[index]; var element = this._createItemElement(delegateIndex); - this._rowHeight = WebInspector.measurePreferredSize(element, this._itemElementsContainer).height; + this._rowHeight = UI.measurePreferredSize(element, this._itemElementsContainer).height; } return this._rowHeight; } @@ -376,7 +376,7 @@ /** * @unrestricted */ -WebInspector.FilteredListWidget.Delegate = class { +UI.FilteredListWidget.Delegate = class { /** * @param {!Array<string>} promptHistory */ @@ -444,17 +444,17 @@ /** * @param {string} text * @param {string} query - * @return {?Array.<!WebInspector.SourceRange>} + * @return {?Array.<!Common.SourceRange>} */ function rangesForMatch(text, query) { - var opcodes = WebInspector.Diff.charDiff(query, text); + var opcodes = Diff.Diff.charDiff(query, text); var offset = 0; var ranges = []; for (var i = 0; i < opcodes.length; ++i) { var opcode = opcodes[i]; - if (opcode[0] === WebInspector.Diff.Operation.Equal) - ranges.push(new WebInspector.SourceRange(offset, opcode[1].length)); - else if (opcode[0] !== WebInspector.Diff.Operation.Insert) + if (opcode[0] === Diff.Diff.Operation.Equal) + ranges.push(new Common.SourceRange(offset, opcode[1].length)); + else if (opcode[0] !== Diff.Diff.Operation.Insert) return null; offset += opcode[1].length; } @@ -466,7 +466,7 @@ if (!ranges || !this.caseSensitive()) ranges = rangesForMatch(text.toUpperCase(), query.toUpperCase()); if (ranges) { - WebInspector.highlightRangesWithStyleClass(element, ranges, 'highlight'); + UI.highlightRangesWithStyleClass(element, ranges, 'highlight'); return true; } return false;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js index a1c7cc5c..de78c1b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.FlameChartDelegate = function() {}; +UI.FlameChartDelegate = function() {}; -WebInspector.FlameChartDelegate.prototype = { +UI.FlameChartDelegate.prototype = { /** * @param {number} startTime * @param {number} endTime @@ -49,11 +49,11 @@ /** * @unrestricted */ -WebInspector.FlameChart = class extends WebInspector.ChartViewport { +UI.FlameChart = class extends UI.ChartViewport { /** - * @param {!WebInspector.FlameChartDataProvider} dataProvider - * @param {!WebInspector.FlameChartDelegate} flameChartDelegate - * @param {!WebInspector.Setting=} groupExpansionSetting + * @param {!UI.FlameChartDataProvider} dataProvider + * @param {!UI.FlameChartDelegate} flameChartDelegate + * @param {!Common.Setting=} groupExpansionSetting */ constructor(dataProvider, flameChartDelegate, groupExpansionSetting) { super(); @@ -64,7 +64,7 @@ this._groupExpansionState = groupExpansionSetting && groupExpansionSetting.get() || {}; this._dataProvider = dataProvider; - this._calculator = new WebInspector.FlameChart.Calculator(dataProvider); + this._calculator = new UI.FlameChart.Calculator(dataProvider); this._canvas = /** @type {!HTMLCanvasElement} */ (this.viewportElement.createChild('canvas')); this._canvas.tabIndex = 1; @@ -143,7 +143,7 @@ } /** - * @return {?WebInspector.FlameChart.TimelineData} + * @return {?UI.FlameChart.TimelineData} */ _timelineData() { if (!this._dataProvider) @@ -210,7 +210,7 @@ } _updateHighlight() { - var inDividersBar = this._lastMouseOffsetY < WebInspector.FlameChart.DividersBarHeight; + var inDividersBar = this._lastMouseOffsetY < UI.FlameChart.DividersBarHeight; this._highlightedMarkerIndex = inDividersBar ? this._markerIndexAtPosition(this._lastMouseOffsetX) : -1; this._updateMarkerHighlight(); @@ -288,7 +288,7 @@ return; } this.hideRangeSelection(); - this.dispatchEventToListeners(WebInspector.FlameChart.Events.EntrySelected, this._highlightedEntryIndex); + this.dispatchEventToListeners(UI.FlameChart.Events.EntrySelected, this._highlightedEntryIndex); } /** @@ -330,7 +330,7 @@ * @param {!Event} e */ _handleSelectionNavigation(e) { - if (!WebInspector.KeyboardShortcut.hasNoModifiers(e)) + if (!UI.KeyboardShortcut.hasNoModifiers(e)) return; if (this._selectedEntryIndex === -1) return; @@ -360,7 +360,7 @@ return start1 < end2 && start2 < end1; } - var keys = WebInspector.KeyboardShortcut.Keys; + var keys = UI.KeyboardShortcut.Keys; if (e.keyCode === keys.Left.code || e.keyCode === keys.Right.code) { var level = timelineData.entryLevels[this._selectedEntryIndex]; var levelIndexes = this._timelineLevels[level]; @@ -368,7 +368,7 @@ indexOnLevel += e.keyCode === keys.Left.code ? -1 : 1; e.consume(true); if (indexOnLevel >= 0 && indexOnLevel < levelIndexes.length) - this.dispatchEventToListeners(WebInspector.FlameChart.Events.EntrySelected, levelIndexes[indexOnLevel]); + this.dispatchEventToListeners(UI.FlameChart.Events.EntrySelected, levelIndexes[indexOnLevel]); return; } if (e.keyCode === keys.Up.code || e.keyCode === keys.Down.code) { @@ -387,7 +387,7 @@ !entriesIntersect(this._selectedEntryIndex, levelIndexes[indexOnLevel])) return; } - this.dispatchEventToListeners(WebInspector.FlameChart.Events.EntrySelected, levelIndexes[indexOnLevel]); + this.dispatchEventToListeners(UI.FlameChart.Events.EntrySelected, levelIndexes[indexOnLevel]); } } @@ -435,7 +435,7 @@ var indexOnLevel = Math.max(entryIndexes.upperBound(cursorTime, comparator) - 1, 0); /** - * @this {WebInspector.FlameChart} + * @this {UI.FlameChart} * @param {number} entryIndex * @return {boolean} */ @@ -538,7 +538,7 @@ var top = this.scrollOffset(); context.scale(ratio, ratio); context.translate(0, -top); - var defaultFont = '11px ' + WebInspector.fontFamily(); + var defaultFont = '11px ' + Host.fontFamily(); context.font = defaultFont; var timeWindowRight = this._timeWindowRight; @@ -550,7 +550,7 @@ var titleIndices = []; var markerIndices = []; var textPadding = this._dataProvider.textPadding(); - var minTextWidth = 2 * textPadding + WebInspector.measureTextWidth(context, '\u2026'); + var minTextWidth = 2 * textPadding + UI.measureTextWidth(context, '\u2026'); var barHeight = this._barHeight; var minVisibleBarLevel = Math.max(this._visibleLevelOffsets.upperBound(top) - 1, 0); @@ -646,7 +646,7 @@ var text = this._dataProvider.entryTitle(entryIndex); if (text && text.length) { context.font = this._dataProvider.entryFont(entryIndex) || defaultFont; - text = WebInspector.trimTextMiddle(context, text, barWidth - 2 * textPadding); + text = UI.trimTextMiddle(context, text, barWidth - 2 * textPadding); } var unclippedBarX = this._timeToPosition(entryStartTime); if (this._dataProvider.decorateEntry( @@ -662,7 +662,7 @@ context.restore(); - WebInspector.TimelineGrid.drawCanvasGrid(context, this._calculator, 3); + UI.TimelineGrid.drawCanvasGrid(context, this._calculator, 3); this._drawMarkers(); this._drawGroupHeaders(width, height); @@ -687,13 +687,13 @@ var groupOffsets = this._groupOffsets; var lastGroupOffset = Array.prototype.peekLast.call(groupOffsets); - var colorUsage = WebInspector.ThemeSupport.ColorUsage; + var colorUsage = UI.ThemeSupport.ColorUsage; context.save(); context.scale(ratio, ratio); context.translate(0, -top); - context.fillStyle = WebInspector.themeSupport.patchColor('#eee', colorUsage.Background); + context.fillStyle = UI.themeSupport.patchColor('#eee', colorUsage.Background); forEachGroup.call(this, (offset, index, group) => { var paddingHeight = group.style.padding; if (paddingHeight < 5) @@ -703,7 +703,7 @@ if (groups.length && lastGroupOffset < top + height) context.fillRect(0, lastGroupOffset + 2, width, top + height - lastGroupOffset); - context.strokeStyle = WebInspector.themeSupport.patchColor('#bbb', colorUsage.Background); + context.strokeStyle = UI.themeSupport.patchColor('#bbb', colorUsage.Background); context.beginPath(); forEachGroup.call(this, (offset, index, group, isFirst) => { if (isFirst || group.style.padding < 4) @@ -735,7 +735,7 @@ context.font = group.style.font; if (this._isGroupCollapsible(index) && !group.expanded || group.style.shareHeaderLine) { var width = this._labelWidthForGroup(context, group); - context.fillStyle = WebInspector.Color.parse(group.style.backgroundColor).setAlpha(0.7).asString(null); + context.fillStyle = Common.Color.parse(group.style.backgroundColor).setAlpha(0.7).asString(null); context.fillRect( this._headerLeftPadding - this._headerLabelXPadding, offset + this._headerLabelYPadding, width, barHeight - 2 * this._headerLabelYPadding); @@ -747,7 +747,7 @@ }); context.restore(); - context.fillStyle = WebInspector.themeSupport.patchColor('#6e6e6e', colorUsage.Foreground); + context.fillStyle = UI.themeSupport.patchColor('#6e6e6e', colorUsage.Foreground); context.beginPath(); forEachGroup.call(this, (offset, index, group) => { if (this._isGroupCollapsible(index)) @@ -757,7 +757,7 @@ }); context.fill(); - context.strokeStyle = WebInspector.themeSupport.patchColor('#ddd', colorUsage.Background); + context.strokeStyle = UI.themeSupport.patchColor('#ddd', colorUsage.Background); context.beginPath(); context.stroke(); @@ -775,7 +775,7 @@ * @param {number} x * @param {number} y * @param {boolean} expanded - * @this {WebInspector.FlameChart} + * @this {UI.FlameChart} */ function drawExpansionArrow(x, y, expanded) { var arrowHeight = this._arrowSide * Math.sqrt(3) / 2; @@ -790,8 +790,8 @@ } /** - * @param {function(number, number, !WebInspector.FlameChart.Group, boolean)} callback - * @this {WebInspector.FlameChart} + * @param {function(number, number, !UI.FlameChart.Group, boolean)} callback + * @this {UI.FlameChart} */ function forEachGroup(callback) { /** @type !Array<{nestingLevel: number, visible: boolean}> */ @@ -818,11 +818,11 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.FlameChart.Group} group + * @param {!UI.FlameChart.Group} group * @return {number} */ _labelWidthForGroup(context, group) { - return WebInspector.measureTextWidth(context, group.name) + this._expansionArrowIndent * (group.style.nestingLevel + 1) + + return UI.measureTextWidth(context, group.name) + this._expansionArrowIndent * (group.style.nestingLevel + 1) + 2 * this._headerLabelXPadding; } @@ -832,7 +832,7 @@ * @param {number} endLevel */ _drawCollapsedOverviewForGroup(y, startLevel, endLevel) { - var range = new WebInspector.SegmentedRange(mergeCallback); + var range = new Common.SegmentedRange(mergeCallback); var timeWindowRight = this._timeWindowRight; var timeWindowLeft = this._timeWindowLeft - this._paddingLeft / this._timeToPixel; var context = /** @type {!CanvasRenderingContext2D} */ (this._canvas.getContext('2d')); @@ -857,7 +857,7 @@ break; lastDrawOffset = startPosition; var color = this._dataProvider.entryColor(entryIndex); - range.append(new WebInspector.Segment(startPosition, this._timeToPositionClipped(entryEndTime), color)); + range.append(new Common.Segment(startPosition, this._timeToPositionClipped(entryEndTime), color)); } } @@ -877,9 +877,9 @@ context.fill(); /** - * @param {!WebInspector.Segment} a - * @param {!WebInspector.Segment} b - * @return {?WebInspector.Segment} + * @param {!Common.Segment} a + * @param {!Common.Segment} b + * @return {?Common.Segment} */ function mergeCallback(a, b) { return a.data === b.data && a.end + 0.4 > b.end ? a : null; @@ -944,7 +944,7 @@ context.save(); var ratio = window.devicePixelRatio; context.scale(ratio, ratio); - var height = WebInspector.FlameChart.DividersBarHeight - 1; + var height = UI.FlameChart.DividersBarHeight - 1; for (var i = left; i < markers.length; i++) { var timestamp = markers[i].startTime(); if (timestamp > rightBoundary) @@ -971,7 +971,7 @@ } /** - * @param {?WebInspector.FlameChart.TimelineData} timelineData + * @param {?UI.FlameChart.TimelineData} timelineData */ _processTimelineData(timelineData) { if (!timelineData) { @@ -1018,7 +1018,7 @@ this._groupOffsets = new Uint32Array(groups.length + 1); var groupIndex = -1; - var currentOffset = WebInspector.FlameChart.DividersBarHeight; + var currentOffset = UI.FlameChart.DividersBarHeight; var visible = true; /** @type !Array<{nestingLevel: number, visible: boolean}> */ var groupStack = [{nestingLevel: -1, visible: true}]; @@ -1207,19 +1207,19 @@ } }; -WebInspector.FlameChart.DividersBarHeight = 18; +UI.FlameChart.DividersBarHeight = 18; -WebInspector.FlameChart.MinimalTimeWindowMs = 0.5; +UI.FlameChart.MinimalTimeWindowMs = 0.5; /** * @interface */ -WebInspector.FlameChartDataProvider = function() {}; +UI.FlameChartDataProvider = function() {}; /** - * @typedef {!{name: string, startLevel: number, expanded: (boolean|undefined), style: !WebInspector.FlameChart.GroupStyle}} + * @typedef {!{name: string, startLevel: number, expanded: (boolean|undefined), style: !UI.FlameChart.GroupStyle}} */ -WebInspector.FlameChart.Group; +UI.FlameChart.Group; /** * @typedef {!{ @@ -1234,24 +1234,24 @@ * useFirstLineForOverview: (boolean|undefined) * }} */ -WebInspector.FlameChart.GroupStyle; +UI.FlameChart.GroupStyle; /** * @unrestricted */ -WebInspector.FlameChart.TimelineData = class { +UI.FlameChart.TimelineData = class { /** * @param {!Array<number>|!Uint16Array} entryLevels * @param {!Array<number>|!Float32Array} entryTotalTimes * @param {!Array<number>|!Float64Array} entryStartTimes - * @param {?Array<!WebInspector.FlameChart.Group>} groups + * @param {?Array<!UI.FlameChart.Group>} groups */ constructor(entryLevels, entryTotalTimes, entryStartTimes, groups) { this.entryLevels = entryLevels; this.entryTotalTimes = entryTotalTimes; this.entryStartTimes = entryStartTimes; this.groups = groups; - /** @type {!Array.<!WebInspector.FlameChartMarker>} */ + /** @type {!Array.<!UI.FlameChartMarker>} */ this.markers = []; this.flowStartTimes = []; this.flowStartLevels = []; @@ -1260,7 +1260,7 @@ } }; -WebInspector.FlameChartDataProvider.prototype = { +UI.FlameChartDataProvider.prototype = { /** * @return {number} */ @@ -1289,7 +1289,7 @@ maxStackDepth: function() {}, /** - * @return {?WebInspector.FlameChart.TimelineData} + * @return {?UI.FlameChart.TimelineData} */ timelineData: function() {}, @@ -1368,9 +1368,9 @@ /** * @interface */ -WebInspector.FlameChartMarker = function() {}; +UI.FlameChartMarker = function() {}; -WebInspector.FlameChartMarker.prototype = { +UI.FlameChartMarker.prototype = { /** * @return {number} */ @@ -1396,14 +1396,14 @@ }; /** @enum {symbol} */ -WebInspector.FlameChart.Events = { +UI.FlameChart.Events = { EntrySelected: Symbol('EntrySelected') }; /** * @unrestricted */ -WebInspector.FlameChart.ColorGenerator = class { +UI.FlameChart.ColorGenerator = class { /** * @param {!{min: number, max: number}|number=} hueSpace * @param {!{min: number, max: number, count: (number|undefined)}|number=} satSpace @@ -1468,12 +1468,12 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.FlameChart.Calculator = class { +UI.FlameChart.Calculator = class { /** - * @param {!WebInspector.FlameChartDataProvider} dataProvider + * @param {!UI.FlameChartDataProvider} dataProvider */ constructor(dataProvider) { this._dataProvider = dataProvider; @@ -1489,7 +1489,7 @@ } /** - * @param {!WebInspector.FlameChart} mainPane + * @param {!UI.FlameChart} mainPane */ _updateBoundaries(mainPane) { this._totalTime = mainPane._dataProvider.totalTime();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/OverviewGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/OverviewGrid.js index ebbc903..94da67db 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/OverviewGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/OverviewGrid.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.OverviewGrid = class { +UI.OverviewGrid = class { /** * @param {string} prefix */ @@ -39,13 +39,13 @@ this.element = createElement('div'); this.element.id = prefix + '-overview-container'; - this._grid = new WebInspector.TimelineGrid(); + this._grid = new UI.TimelineGrid(); this._grid.element.id = prefix + '-overview-grid'; this._grid.setScrollTop(0); this.element.appendChild(this._grid.element); - this._window = new WebInspector.OverviewGrid.Window(this.element, this._grid.dividersLabelBarElement); + this._window = new UI.OverviewGrid.Window(this.element, this._grid.dividersLabelBarElement); } /** @@ -56,7 +56,7 @@ } /** - * @param {!WebInspector.TimelineGrid.Calculator} calculator + * @param {!UI.TimelineGrid.Calculator} calculator */ updateDividers(calculator) { this._grid.updateDividers(calculator); @@ -101,9 +101,9 @@ /** * @param {string} eventType - * @param {function(!WebInspector.Event)} listener + * @param {function(!Common.Event)} listener * @param {!Object=} thisObject - * @return {!WebInspector.EventTarget.EventDescriptor} + * @return {!Common.EventTarget.EventDescriptor} */ addEventListener(eventType, listener, thisObject) { return this._window.addEventListener(eventType, listener, thisObject); @@ -125,16 +125,16 @@ } }; -WebInspector.OverviewGrid.MinSelectableSize = 14; +UI.OverviewGrid.MinSelectableSize = 14; -WebInspector.OverviewGrid.WindowScrollSpeedFactor = .3; +UI.OverviewGrid.WindowScrollSpeedFactor = .3; -WebInspector.OverviewGrid.ResizerOffset = 3.5; // half pixel because offset values are not rounded but ceiled +UI.OverviewGrid.ResizerOffset = 3.5; // half pixel because offset values are not rounded but ceiled /** * @unrestricted */ -WebInspector.OverviewGrid.Window = class extends WebInspector.Object { +UI.OverviewGrid.Window = class extends Common.Object { /** * @param {!Element} parentElement * @param {!Element=} dividersLabelBarElement @@ -143,24 +143,24 @@ super(); this._parentElement = parentElement; - WebInspector.installDragHandle( + UI.installDragHandle( this._parentElement, this._startWindowSelectorDragging.bind(this), this._windowSelectorDragging.bind(this), this._endWindowSelectorDragging.bind(this), 'text', null); if (dividersLabelBarElement) - WebInspector.installDragHandle( + UI.installDragHandle( dividersLabelBarElement, this._startWindowDragging.bind(this), this._windowDragging.bind(this), null, '-webkit-grabbing', '-webkit-grab'); this._parentElement.addEventListener('mousewheel', this._onMouseWheel.bind(this), true); this._parentElement.addEventListener('dblclick', this._resizeWindowMaximum.bind(this), true); - WebInspector.appendStyle(this._parentElement, 'ui_lazy/overviewGrid.css'); + UI.appendStyle(this._parentElement, 'ui_lazy/overviewGrid.css'); this._leftResizeElement = parentElement.createChild('div', 'overview-grid-window-resizer'); - WebInspector.installDragHandle( + UI.installDragHandle( this._leftResizeElement, this._resizerElementStartDragging.bind(this), this._leftResizeElementDragging.bind(this), null, 'ew-resize'); this._rightResizeElement = parentElement.createChild('div', 'overview-grid-window-resizer'); - WebInspector.installDragHandle( + UI.installDragHandle( this._rightResizeElement, this._resizerElementStartDragging.bind(this), this._rightResizeElementDragging.bind(this), null, 'ew-resize'); @@ -219,7 +219,7 @@ return false; this._offsetLeft = this._parentElement.totalOffsetLeft(); var position = event.x - this._offsetLeft; - this._overviewWindowSelector = new WebInspector.OverviewGrid.WindowSelector(this._parentElement, position); + this._overviewWindowSelector = new UI.OverviewGrid.WindowSelector(this._parentElement, position); return true; } @@ -239,16 +239,16 @@ delete this._overviewWindowSelector; var clickThreshold = 3; if (window.end - window.start < clickThreshold) { - if (this.dispatchEventToListeners(WebInspector.OverviewGrid.Events.Click, event)) + if (this.dispatchEventToListeners(UI.OverviewGrid.Events.Click, event)) return; var middle = window.end; - window.start = Math.max(0, middle - WebInspector.OverviewGrid.MinSelectableSize / 2); - window.end = Math.min(this._parentElement.clientWidth, middle + WebInspector.OverviewGrid.MinSelectableSize / 2); - } else if (window.end - window.start < WebInspector.OverviewGrid.MinSelectableSize) { - if (this._parentElement.clientWidth - window.end > WebInspector.OverviewGrid.MinSelectableSize) - window.end = window.start + WebInspector.OverviewGrid.MinSelectableSize; + window.start = Math.max(0, middle - UI.OverviewGrid.MinSelectableSize / 2); + window.end = Math.min(this._parentElement.clientWidth, middle + UI.OverviewGrid.MinSelectableSize / 2); + } else if (window.end - window.start < UI.OverviewGrid.MinSelectableSize) { + if (this._parentElement.clientWidth - window.end > UI.OverviewGrid.MinSelectableSize) + window.end = window.start + UI.OverviewGrid.MinSelectableSize; else - window.start = window.end - WebInspector.OverviewGrid.MinSelectableSize; + window.start = window.end - UI.OverviewGrid.MinSelectableSize; } this._setWindowPosition(window.start, window.end); } @@ -299,8 +299,8 @@ // Glue to edge. if (end > this._parentElement.clientWidth - 10) end = this._parentElement.clientWidth; - else if (end < this._leftResizeElement.offsetLeft + WebInspector.OverviewGrid.MinSelectableSize) - end = this._leftResizeElement.offsetLeft + WebInspector.OverviewGrid.MinSelectableSize; + else if (end < this._leftResizeElement.offsetLeft + UI.OverviewGrid.MinSelectableSize) + end = this._leftResizeElement.offsetLeft + UI.OverviewGrid.MinSelectableSize; this._setWindowPosition(null, end); } @@ -316,7 +316,7 @@ this.windowLeft = windowLeft; this.windowRight = windowRight; this._updateCurtains(); - this.dispatchEventToListeners(WebInspector.OverviewGrid.Events.WindowChanged); + this.dispatchEventToListeners(UI.OverviewGrid.Events.WindowChanged); } _updateCurtains() { @@ -326,7 +326,7 @@ // We allow actual time window to be arbitrarily small but don't want the UI window to be too small. var widthInPixels = width * this._parentElement.clientWidth; - var minWidthInPixels = WebInspector.OverviewGrid.MinSelectableSize / 2; + var minWidthInPixels = UI.OverviewGrid.MinSelectableSize / 2; if (widthInPixels < minWidthInPixels) { var factor = minWidthInPixels / widthInPixels; left = ((this.windowRight + this.windowLeft) - width * factor) / 2; @@ -364,9 +364,9 @@ this._zoom(Math.pow(zoomFactor, -event.wheelDeltaY * mouseWheelZoomSpeed), reference); } if (typeof event.wheelDeltaX === 'number' && event.wheelDeltaX) { - var offset = Math.round(event.wheelDeltaX * WebInspector.OverviewGrid.WindowScrollSpeedFactor); - var windowLeft = this._leftResizeElement.offsetLeft + WebInspector.OverviewGrid.ResizerOffset; - var windowRight = this._rightResizeElement.offsetLeft + WebInspector.OverviewGrid.ResizerOffset; + var offset = Math.round(event.wheelDeltaX * UI.OverviewGrid.WindowScrollSpeedFactor); + var windowLeft = this._leftResizeElement.offsetLeft + UI.OverviewGrid.ResizerOffset; + var windowRight = this._rightResizeElement.offsetLeft + UI.OverviewGrid.ResizerOffset; if (windowLeft - offset < 0) offset = windowLeft; @@ -403,7 +403,7 @@ }; /** @enum {symbol} */ -WebInspector.OverviewGrid.Events = { +UI.OverviewGrid.Events = { WindowChanged: Symbol('WindowChanged'), Click: Symbol('Click') }; @@ -411,7 +411,7 @@ /** * @unrestricted */ -WebInspector.OverviewGrid.WindowSelector = class { +UI.OverviewGrid.WindowSelector = class { constructor(parent, position) { this._startPosition = position; this._width = parent.offsetWidth;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/PieChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/PieChart.js index ea9aefce..79bed49 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/PieChart.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/PieChart.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.PieChart = class { +UI.PieChart = class { /** * @param {number} size * @param {function(number):string=} formatter @@ -39,7 +39,7 @@ */ constructor(size, formatter, showTotal) { this.element = createElement('div'); - this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, 'ui_lazy/pieChart.css'); + this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui_lazy/pieChart.css'); var root = this._shadowRoot.createChild('div', 'root'); var svg = this._createSVGChild(root, 'svg'); this._group = this._createSVGChild(svg, 'g');
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js index 841a2aa..30c5bb3 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ShowMoreDataGridNode.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.ShowMoreDataGridNode = class extends WebInspector.DataGridNode { +UI.ShowMoreDataGridNode = class extends UI.DataGridNode { /** * @param {function(number, number)} callback * @param {number} startPosition @@ -48,7 +48,7 @@ this.showNext = createElement('button'); this.showNext.setAttribute('type', 'button'); this.showNext.addEventListener('click', this._showNextChunk.bind(this), false); - this.showNext.textContent = WebInspector.UIString('Show %d before', this._chunkSize); + this.showNext.textContent = Common.UIString('Show %d before', this._chunkSize); this.showAll = createElement('button'); this.showAll.setAttribute('type', 'button'); @@ -57,7 +57,7 @@ this.showLast = createElement('button'); this.showLast.setAttribute('type', 'button'); this.showLast.addEventListener('click', this._showLastChunk.bind(this), false); - this.showLast.textContent = WebInspector.UIString('Show %d after', this._chunkSize); + this.showLast.textContent = Common.UIString('Show %d after', this._chunkSize); this._updateLabels(); this.selectable = false; @@ -84,7 +84,7 @@ this.showNext.classList.add('hidden'); this.showLast.classList.add('hidden'); } - this.showAll.textContent = WebInspector.UIString('Show all %d', totalSize); + this.showAll.textContent = Common.UIString('Show all %d', totalSize); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/SortableDataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/SortableDataGrid.js index 5df5cbb..c29de90 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/SortableDataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/SortableDataGrid.js
@@ -4,23 +4,23 @@ /** * @unrestricted */ -WebInspector.SortableDataGrid = class extends WebInspector.ViewportDataGrid { +UI.SortableDataGrid = class extends UI.ViewportDataGrid { /** - * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columnsArray - * @param {function(!WebInspector.DataGridNode, string, string, string)=} editCallback - * @param {function(!WebInspector.DataGridNode)=} deleteCallback + * @param {!Array<!UI.DataGrid.ColumnDescriptor>} columnsArray + * @param {function(!UI.DataGridNode, string, string, string)=} editCallback + * @param {function(!UI.DataGridNode)=} deleteCallback * @param {function()=} refreshCallback */ constructor(columnsArray, editCallback, deleteCallback, refreshCallback) { super(columnsArray, editCallback, deleteCallback, refreshCallback); - /** @type {!WebInspector.SortableDataGrid.NodeComparator} */ - this._sortingFunction = WebInspector.SortableDataGrid.TrivialComparator; - this.setRootNode(new WebInspector.SortableDataGridNode()); + /** @type {!UI.SortableDataGrid.NodeComparator} */ + this._sortingFunction = UI.SortableDataGrid.TrivialComparator; + this.setRootNode(new UI.SortableDataGridNode()); } /** - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ static TrivialComparator(a, b) { @@ -29,8 +29,8 @@ /** * @param {string} columnId - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ static NumericComparator(columnId, a, b) { @@ -43,8 +43,8 @@ /** * @param {string} columnId - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ static StringComparator(columnId, a, b) { @@ -56,10 +56,10 @@ } /** - * @param {!WebInspector.SortableDataGrid.NodeComparator} comparator + * @param {!UI.SortableDataGrid.NodeComparator} comparator * @param {boolean} reverseMode - * @param {!WebInspector.DataGridNode} a - * @param {!WebInspector.DataGridNode} b + * @param {!UI.DataGridNode} a + * @param {!UI.DataGridNode} b * @return {number} */ static Comparator(comparator, reverseMode, a, b) { @@ -69,14 +69,14 @@ /** * @param {!Array.<string>} columnNames * @param {!Array.<string>} values - * @return {?WebInspector.SortableDataGrid} + * @return {?UI.SortableDataGrid} */ static create(columnNames, values) { var numColumns = columnNames.length; if (!numColumns) return null; - var columns = /** @type {!Array<!WebInspector.DataGrid.ColumnDescriptor>} */ ([]); + var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([]); for (var i = 0; i < columnNames.length; ++i) columns.push({id: String(i), title: columnNames[i], width: columnNames[i].length, sortable: true}); @@ -86,18 +86,18 @@ for (var j = 0; j < columnNames.length; ++j) data[j] = values[numColumns * i + j]; - var node = new WebInspector.SortableDataGridNode(data); + var node = new UI.SortableDataGridNode(data); node.selectable = false; nodes.push(node); } - var dataGrid = new WebInspector.SortableDataGrid(columns); + var dataGrid = new UI.SortableDataGrid(columns); var length = nodes.length; var rootNode = dataGrid.rootNode(); for (var i = 0; i < length; ++i) rootNode.appendChild(nodes[i]); - dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, sortDataGrid); + dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, sortDataGrid); function sortDataGrid() { var nodes = dataGrid.rootNode().children; @@ -114,40 +114,40 @@ } } - var comparator = columnIsNumeric ? WebInspector.SortableDataGrid.NumericComparator : - WebInspector.SortableDataGrid.StringComparator; + var comparator = columnIsNumeric ? UI.SortableDataGrid.NumericComparator : + UI.SortableDataGrid.StringComparator; dataGrid.sortNodes(comparator.bind(null, sortColumnId), !dataGrid.isSortOrderAscending()); } return dataGrid; } /** - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} node */ insertChild(node) { - var root = /** @type {!WebInspector.SortableDataGridNode} */ (this.rootNode()); + var root = /** @type {!UI.SortableDataGridNode} */ (this.rootNode()); root.insertChildOrdered(node); } /** - * @param {!WebInspector.SortableDataGrid.NodeComparator} comparator + * @param {!UI.SortableDataGrid.NodeComparator} comparator * @param {boolean} reverseMode */ sortNodes(comparator, reverseMode) { - this._sortingFunction = WebInspector.SortableDataGrid.Comparator.bind(null, comparator, reverseMode); + this._sortingFunction = UI.SortableDataGrid.Comparator.bind(null, comparator, reverseMode); this._rootNode._sortChildren(reverseMode); this.scheduleUpdateStructure(); } }; -/** @typedef {function(!WebInspector.DataGridNode, !WebInspector.DataGridNode):number} */ -WebInspector.SortableDataGrid.NodeComparator; +/** @typedef {function(!UI.DataGridNode, !UI.DataGridNode):number} */ +UI.SortableDataGrid.NodeComparator; /** * @unrestricted */ -WebInspector.SortableDataGridNode = class extends WebInspector.ViewportDataGridNode { +UI.SortableDataGridNode = class extends UI.ViewportDataGridNode { /** * @param {?Object.<string, *>=} data * @param {boolean=} hasChildren @@ -157,7 +157,7 @@ } /** - * @param {!WebInspector.DataGridNode} node + * @param {!UI.DataGridNode} node */ insertChildOrdered(node) { this.insertChild(node, this.children.upperBound(node, this.dataGrid._sortingFunction));
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js index 44ceca5..26baa88c 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.TimelineGrid = class { +UI.TimelineGrid = class { constructor() { this.element = createElement('div'); - WebInspector.appendStyle(this.element, 'ui_lazy/timelineGrid.css'); + UI.appendStyle(this.element, 'ui_lazy/timelineGrid.css'); this._dividersElement = this.element.createChild('div', 'resources-dividers'); @@ -46,7 +46,7 @@ } /** - * @param {!WebInspector.TimelineGrid.Calculator} calculator + * @param {!UI.TimelineGrid.Calculator} calculator * @param {number=} freeZoneAtLeft * @return {!{offsets: !Array.<number>, precision: number}} */ @@ -95,7 +95,7 @@ /** * @param {!CanvasRenderingContext2D} context - * @param {!WebInspector.TimelineGrid.Calculator} calculator + * @param {!UI.TimelineGrid.Calculator} calculator * @param {number} paddingTop * @param {number=} freeZoneAtLeft */ @@ -105,7 +105,7 @@ context.scale(ratio, ratio); var width = context.canvas.width / window.devicePixelRatio; var height = context.canvas.height / window.devicePixelRatio; - var dividersData = WebInspector.TimelineGrid.calculateDividerOffsets(calculator); + var dividersData = UI.TimelineGrid.calculateDividerOffsets(calculator); var dividerOffsets = dividersData.offsets; var precision = dividersData.precision; @@ -115,7 +115,7 @@ context.fillStyle = '#333'; context.strokeStyle = 'rgba(0, 0, 0, 0.1)'; context.textBaseline = 'hanging'; - context.font = '11px ' + WebInspector.fontFamily(); + context.font = '11px ' + Host.fontFamily(); context.lineWidth = 1; context.translate(0.5, 0.5); @@ -150,12 +150,12 @@ } /** - * @param {!WebInspector.TimelineGrid.Calculator} calculator + * @param {!UI.TimelineGrid.Calculator} calculator * @param {number=} freeZoneAtLeft * @return {boolean} */ updateDividers(calculator, freeZoneAtLeft) { - var dividersData = WebInspector.TimelineGrid.calculateDividerOffsets(calculator, freeZoneAtLeft); + var dividersData = UI.TimelineGrid.calculateDividerOffsets(calculator, freeZoneAtLeft); var dividerOffsets = dividersData.offsets; var precision = dividersData.precision; @@ -256,9 +256,9 @@ /** * @interface */ -WebInspector.TimelineGrid.Calculator = function() {}; +UI.TimelineGrid.Calculator = function() {}; -WebInspector.TimelineGrid.Calculator.prototype = { +UI.TimelineGrid.Calculator.prototype = { /** * @return {number} */
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineOverviewPane.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineOverviewPane.js index 705e04a..cf74b8e 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineOverviewPane.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineOverviewPane.js
@@ -31,7 +31,7 @@ /** * @unrestricted */ -WebInspector.TimelineOverviewPane = class extends WebInspector.VBox { +UI.TimelineOverviewPane = class extends UI.VBox { /** * @param {string} prefix */ @@ -39,8 +39,8 @@ super(); this.element.id = prefix + '-overview-pane'; - this._overviewCalculator = new WebInspector.TimelineOverviewCalculator(); - this._overviewGrid = new WebInspector.OverviewGrid(prefix); + this._overviewCalculator = new UI.TimelineOverviewCalculator(); + this._overviewGrid = new UI.OverviewGrid(prefix); this.element.appendChild(this._overviewGrid.element); this._cursorArea = this._overviewGrid.element.createChild('div', 'overview-grid-cursor-area'); this._cursorElement = this._overviewGrid.element.createChild('div', 'overview-grid-cursor-position'); @@ -48,17 +48,17 @@ this._cursorArea.addEventListener('mouseleave', this._hideCursor.bind(this), true); this._overviewGrid.setResizeEnabled(false); - this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); - this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.Click, this._onClick, this); + this._overviewGrid.addEventListener(UI.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this); + this._overviewGrid.addEventListener(UI.OverviewGrid.Events.Click, this._onClick, this); this._overviewControls = []; this._markers = new Map(); - this._popoverHelper = new WebInspector.PopoverHelper(this._cursorArea); + this._popoverHelper = new UI.PopoverHelper(this._cursorArea); this._popoverHelper.initializeCallbacks( this._getPopoverAnchor.bind(this), this._showPopover.bind(this), this._onHidePopover.bind(this)); this._popoverHelper.setTimeout(0); - this._updateThrottler = new WebInspector.Throttler(100); + this._updateThrottler = new Common.Throttler(100); this._cursorEnabled = false; this._cursorPosition = 0; @@ -76,18 +76,18 @@ /** * @param {!Element} anchor - * @param {!WebInspector.Popover} popover + * @param {!UI.Popover} popover */ _showPopover(anchor, popover) { this._buildPopoverContents().then(maybeShowPopover.bind(this)); /** - * @this {WebInspector.TimelineOverviewPane} + * @this {UI.TimelineOverviewPane} * @param {!DocumentFragment} fragment */ function maybeShowPopover(fragment) { if (!fragment.firstChild) return; - var content = new WebInspector.TimelineOverviewPane.PopoverContents(); + var content = new UI.TimelineOverviewPane.PopoverContents(); this._popoverContents = content.contentElement.createChild('div'); this._popoverContents.appendChild(fragment); this._popover = popover; @@ -116,7 +116,7 @@ /** * @param {!DocumentFragment} fragment - * @this {WebInspector.TimelineOverviewPane} + * @this {UI.TimelineOverviewPane} */ function updatePopover(fragment) { if (!this._popoverContents) @@ -177,7 +177,7 @@ } /** - * @param {!Array.<!WebInspector.TimelineOverview>} overviewControls + * @param {!Array.<!UI.TimelineOverview>} overviewControls */ setOverviewControls(overviewControls) { for (var i = 0; i < this._overviewControls.length; ++i) @@ -204,7 +204,7 @@ scheduleUpdate() { this._updateThrottler.schedule(process.bind(this)); /** - * @this {WebInspector.TimelineOverviewPane} + * @this {UI.TimelineOverviewPane} * @return {!Promise.<undefined>} */ function process() { @@ -264,7 +264,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onClick(event) { var domEvent = /** @type {!Event} */ (event.data); @@ -277,7 +277,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onWindowChanged(event) { if (this._muteOnWindowChanged) @@ -289,7 +289,7 @@ this._overviewControls[0].windowTimes(this._overviewGrid.windowLeft(), this._overviewGrid.windowRight()); this._windowStartTime = windowTimes.startTime; this._windowEndTime = windowTimes.endTime; - this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.WindowChanged, windowTimes); + this.dispatchEventToListeners(UI.TimelineOverviewPane.Events.WindowChanged, windowTimes); } /** @@ -303,7 +303,7 @@ this._windowEndTime = endTime; this._updateWindow(); this.dispatchEventToListeners( - WebInspector.TimelineOverviewPane.Events.WindowChanged, {startTime: startTime, endTime: endTime}); + UI.TimelineOverviewPane.Events.WindowChanged, {startTime: startTime, endTime: endTime}); } _updateWindow() { @@ -317,14 +317,14 @@ }; /** @enum {symbol} */ -WebInspector.TimelineOverviewPane.Events = { +UI.TimelineOverviewPane.Events = { WindowChanged: Symbol('WindowChanged') }; /** * @unrestricted */ -WebInspector.TimelineOverviewPane.PopoverContents = class extends WebInspector.VBox { +UI.TimelineOverviewPane.PopoverContents = class extends UI.VBox { constructor() { super(true); this.contentElement.classList.add('timeline-overview-popover'); @@ -332,10 +332,10 @@ }; /** - * @implements {WebInspector.TimelineGrid.Calculator} + * @implements {UI.TimelineGrid.Calculator} * @unrestricted */ -WebInspector.TimelineOverviewCalculator = class { +UI.TimelineOverviewCalculator = class { constructor() { this.reset(); } @@ -433,9 +433,9 @@ /** * @interface */ -WebInspector.TimelineOverview = function() {}; +UI.TimelineOverview = function() {}; -WebInspector.TimelineOverview.prototype = { +UI.TimelineOverview.prototype = { /** * @param {!Element} parentElement * @param {?Element=} insertBefore @@ -480,13 +480,13 @@ }; /** - * @implements {WebInspector.TimelineOverview} + * @implements {UI.TimelineOverview} * @unrestricted */ -WebInspector.TimelineOverviewBase = class extends WebInspector.VBox { +UI.TimelineOverviewBase = class extends UI.VBox { constructor() { super(); - /** @type {?WebInspector.TimelineOverviewCalculator} */ + /** @type {?UI.TimelineOverviewCalculator} */ this._calculator = null; this._canvas = this.element.createChild('canvas', 'fill'); this._context = this._canvas.getContext('2d'); @@ -534,7 +534,7 @@ } /** - * @param {!WebInspector.TimelineOverviewCalculator} calculator + * @param {!UI.TimelineOverviewCalculator} calculator */ setCalculator(calculator) { this._calculator = calculator;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js index 4ab5b32..2e3e577 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
@@ -4,11 +4,11 @@ /** * @unrestricted */ -WebInspector.ViewportDataGrid = class extends WebInspector.DataGrid { +UI.ViewportDataGrid = class extends UI.DataGrid { /** - * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columnsArray - * @param {function(!WebInspector.DataGridNode, string, string, string)=} editCallback - * @param {function(!WebInspector.DataGridNode)=} deleteCallback + * @param {!Array.<!UI.DataGrid.ColumnDescriptor>} columnsArray + * @param {function(!UI.DataGridNode, string, string, string)=} editCallback + * @param {function(!UI.DataGridNode)=} deleteCallback * @param {function()=} refreshCallback */ constructor(columnsArray, editCallback, deleteCallback, refreshCallback) { @@ -19,9 +19,9 @@ // This is not in setScrollContainer because mouse wheel needs to detect events on the content not the scrollbar itself. this._scrollContainer.addEventListener('mousewheel', this._onWheel.bind(this), true); - /** @type {!Array.<!WebInspector.ViewportDataGridNode>} */ + /** @type {!Array.<!UI.ViewportDataGridNode>} */ this._visibleNodes = []; - /** @type {?Array.<!WebInspector.ViewportDataGridNode>} */ + /** @type {?Array.<!UI.ViewportDataGridNode>} */ this._flatNodes = null; /** @type {boolean} */ this._inline = false; @@ -41,7 +41,7 @@ /** @type {number} */ this._lastScrollTop = 0; - this.setRootNode(new WebInspector.ViewportDataGridNode()); + this.setRootNode(new UI.ViewportDataGridNode()); } /** @@ -120,7 +120,7 @@ } /** - * @return {!Array.<!WebInspector.ViewportDataGridNode>} + * @return {!Array.<!UI.ViewportDataGridNode>} */ _flatNodesList() { if (this._flatNodes) @@ -150,7 +150,7 @@ /** * @param {number} clientHeight * @param {number} scrollTop - * @return {{topPadding: number, bottomPadding: number, contentHeight: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}} + * @return {{topPadding: number, bottomPadding: number, contentHeight: number, visibleNodes: !Array.<!UI.ViewportDataGridNode>, offset: number}} */ _calculateVisibleNodes(clientHeight, scrollTop) { var nodes = this._flatNodesList(); @@ -253,11 +253,11 @@ this.updateWidths(); } this._visibleNodes = visibleNodes; - this.dispatchEventToListeners(WebInspector.ViewportDataGrid.Events.ViewportCalculated); + this.dispatchEventToListeners(UI.ViewportDataGrid.Events.ViewportCalculated); } /** - * @param {!WebInspector.ViewportDataGridNode} node + * @param {!UI.ViewportDataGridNode} node */ _revealViewportNode(node) { var nodes = this._flatNodesList(); @@ -280,14 +280,14 @@ } }; -WebInspector.ViewportDataGrid.Events = { +UI.ViewportDataGrid.Events = { ViewportCalculated: Symbol('ViewportCalculated') }; /** * @unrestricted */ -WebInspector.ViewportDataGridNode = class extends WebInspector.DataGridNode { +UI.ViewportDataGridNode = class extends UI.DataGridNode { /** * @param {?Object.<string, *>=} data * @param {boolean=} hasChildren @@ -326,7 +326,7 @@ /** * @override - * @param {!WebInspector.DataGridNode} child + * @param {!UI.DataGridNode} child * @param {number} index */ insertChild(child, index) { @@ -352,7 +352,7 @@ /** * @override - * @param {!WebInspector.DataGridNode} child + * @param {!UI.DataGridNode} child */ removeChild(child) { if (this.dataGrid)
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/module.json b/third_party/WebKit/Source/devtools/front_end/ui_lazy/module.json index a2c72f0a..ccd610b 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/module.json +++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/module.json
@@ -1,9 +1,9 @@ { "extensions": [ { - "type": "@WebInspector.ActionDelegate", + "type": "@UI.ActionDelegate", "actionId": "commandMenu.show", - "className": "WebInspector.CommandMenu.ShowActionDelegate", + "className": "UI.CommandMenu.ShowActionDelegate", "bindings": [ { "platform": "windows,linux",
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/FileManager.js b/third_party/WebKit/Source/devtools/front_end/workspace/FileManager.js index f65591a..87d9fda 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/FileManager.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileManager.js
@@ -31,10 +31,10 @@ /** * @unrestricted */ -WebInspector.FileManager = class extends WebInspector.Object { +Workspace.FileManager = class extends Common.Object { constructor() { super(); - this._savedURLsSetting = WebInspector.settings.createLocalSetting('savedURLs', {}); + this._savedURLsSetting = Common.settings.createLocalSetting('savedURLs', {}); /** @type {!Object.<string, ?function(boolean)>} */ this._saveCallbacks = {}; @@ -61,14 +61,14 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _savedURL(event) { var url = /** @type {string} */ (event.data); var savedURLs = this._savedURLsSetting.get(); savedURLs[url] = true; this._savedURLsSetting.set(savedURLs); - this.dispatchEventToListeners(WebInspector.FileManager.Events.SavedURL, url); + this.dispatchEventToListeners(Workspace.FileManager.Events.SavedURL, url); this._invokeSaveCallback(url, true); } @@ -84,7 +84,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _canceledSaveURL(event) { var url = /** @type {string} */ (event.data); @@ -116,21 +116,21 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _appendedToURL(event) { var url = /** @type {string} */ (event.data); - this.dispatchEventToListeners(WebInspector.FileManager.Events.AppendedToURL, url); + this.dispatchEventToListeners(Workspace.FileManager.Events.AppendedToURL, url); } }; /** @enum {symbol} */ -WebInspector.FileManager.Events = { +Workspace.FileManager.Events = { SavedURL: Symbol('SavedURL'), AppendedToURL: Symbol('AppendedToURL') }; /** - * @type {?WebInspector.FileManager} + * @type {?Workspace.FileManager} */ -WebInspector.fileManager = null; +Workspace.fileManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js index 75d92d3a..bdfcb03 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
@@ -31,11 +31,11 @@ /** * @unrestricted */ -WebInspector.FileSystemMapping = class extends WebInspector.Object { +Workspace.FileSystemMapping = class extends Common.Object { constructor() { super(); - this._fileSystemMappingSetting = WebInspector.settings.createLocalSetting('fileSystemMapping', {}); - /** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.Entry>>} */ + this._fileSystemMappingSetting = Common.settings.createLocalSetting('fileSystemMapping', {}); + /** @type {!Object.<string, !Array.<!Workspace.FileSystemMapping.Entry>>} */ this._fileSystemMappings = {}; this._loadFromSettings(); } @@ -45,14 +45,14 @@ this._fileSystemMappings = {}; for (var fileSystemPath in savedMapping) { var savedFileSystemMappings = savedMapping[fileSystemPath]; - fileSystemPath = WebInspector.ParsedURL.platformPathToURL(fileSystemPath); + fileSystemPath = Common.ParsedURL.platformPathToURL(fileSystemPath); this._fileSystemMappings[fileSystemPath] = []; var fileSystemMappings = this._fileSystemMappings[fileSystemPath]; for (var i = 0; i < savedFileSystemMappings.length; ++i) { var savedEntry = savedFileSystemMappings[i]; var entry = - new WebInspector.FileSystemMapping.Entry(fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true); + new Workspace.FileSystemMapping.Entry(fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true); fileSystemMappings.push(entry); } } @@ -146,10 +146,10 @@ * @param {boolean} configurable */ _innerAddFileMapping(fileSystemPath, urlPrefix, pathPrefix, configurable) { - var entry = new WebInspector.FileSystemMapping.Entry(fileSystemPath, urlPrefix, pathPrefix, configurable); + var entry = new Workspace.FileSystemMapping.Entry(fileSystemPath, urlPrefix, pathPrefix, configurable); this._fileSystemMappings[fileSystemPath].push(entry); this._rebuildIndexes(); - this.dispatchEventToListeners(WebInspector.FileSystemMapping.Events.FileMappingAdded, entry); + this.dispatchEventToListeners(Workspace.FileSystemMapping.Events.FileMappingAdded, entry); } /** @@ -164,12 +164,12 @@ this._fileSystemMappings[fileSystemPath].remove(entry); this._rebuildIndexes(); this._saveToSettings(); - this.dispatchEventToListeners(WebInspector.FileSystemMapping.Events.FileMappingRemoved, entry); + this.dispatchEventToListeners(Workspace.FileSystemMapping.Events.FileMappingRemoved, entry); } /** * @param {string} url - * @return {?WebInspector.FileSystemMapping.Entry} + * @return {?Workspace.FileSystemMapping.Entry} */ _mappingEntryForURL(url) { for (var i = this._urlPrefixes.length - 1; i >= 0; --i) { @@ -183,7 +183,7 @@ /** * @param {string} fileSystemPath * @param {string} filePath - * @return {?WebInspector.FileSystemMapping.Entry} + * @return {?Workspace.FileSystemMapping.Entry} */ _mappingEntryForPath(fileSystemPath, filePath) { var entries = this._fileSystemMappings[fileSystemPath]; @@ -207,7 +207,7 @@ /** * @param {string} fileSystemPath * @param {string} pathPrefix - * @return {?WebInspector.FileSystemMapping.Entry} + * @return {?Workspace.FileSystemMapping.Entry} */ _configurableMappingEntryForPathPrefix(fileSystemPath, pathPrefix) { var entries = this._fileSystemMappings[fileSystemPath]; @@ -220,7 +220,7 @@ /** * @param {string} fileSystemPath - * @return {!Array.<!WebInspector.FileSystemMapping.Entry>} + * @return {!Array.<!Workspace.FileSystemMapping.Entry>} */ mappingEntries(fileSystemPath) { return this._fileSystemMappings[fileSystemPath].slice(); @@ -303,7 +303,7 @@ }; /** @enum {symbol} */ -WebInspector.FileSystemMapping.Events = { +Workspace.FileSystemMapping.Events = { FileMappingAdded: Symbol('FileMappingAdded'), FileMappingRemoved: Symbol('FileMappingRemoved') }; @@ -311,7 +311,7 @@ /** * @unrestricted */ -WebInspector.FileSystemMapping.Entry = class { +Workspace.FileSystemMapping.Entry = class { /** * @param {string} fileSystemPath * @param {string} urlPrefix @@ -327,6 +327,6 @@ }; /** - * @type {!WebInspector.FileSystemMapping} + * @type {!Workspace.FileSystemMapping} */ -WebInspector.fileSystemMapping; +Workspace.fileSystemMapping;
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js index c150fc8..07f2824 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js
@@ -31,9 +31,9 @@ /** * @unrestricted */ -WebInspector.IsolatedFileSystem = class { +Workspace.IsolatedFileSystem = class { /** - * @param {!WebInspector.IsolatedFileSystemManager} manager + * @param {!Workspace.IsolatedFileSystemManager} manager * @param {string} path * @param {string} embedderPath * @param {!DOMFileSystem} domFileSystem @@ -43,7 +43,7 @@ this._path = path; this._embedderPath = embedderPath; this._domFileSystem = domFileSystem; - this._excludedFoldersSetting = WebInspector.settings.createLocalSetting('workspaceExcludedFolders', {}); + this._excludedFoldersSetting = Common.settings.createLocalSetting('workspaceExcludedFolders', {}); /** @type {!Set<string>} */ this._excludedFolders = new Set(this._excludedFoldersSetting.get()[path] || []); /** @type {!Set<string>} */ @@ -56,23 +56,23 @@ } /** - * @param {!WebInspector.IsolatedFileSystemManager} manager + * @param {!Workspace.IsolatedFileSystemManager} manager * @param {string} path * @param {string} embedderPath * @param {string} name * @param {string} rootURL - * @return {!Promise<?WebInspector.IsolatedFileSystem>} + * @return {!Promise<?Workspace.IsolatedFileSystem>} */ static create(manager, path, embedderPath, name, rootURL) { var domFileSystem = InspectorFrontendHost.isolatedFileSystem(name, rootURL); if (!domFileSystem) - return Promise.resolve(/** @type {?WebInspector.IsolatedFileSystem} */ (null)); + return Promise.resolve(/** @type {?Workspace.IsolatedFileSystem} */ (null)); - var fileSystem = new WebInspector.IsolatedFileSystem(manager, path, embedderPath, domFileSystem); + var fileSystem = new Workspace.IsolatedFileSystem(manager, path, embedderPath, domFileSystem); var fileContentPromise = fileSystem.requestFileContentPromise('.devtools'); return fileContentPromise.then(onConfigAvailable) .then(() => fileSystem) - .catchException(/** @type {?WebInspector.IsolatedFileSystem} */ (null)); + .catchException(/** @type {?Workspace.IsolatedFileSystem} */ (null)); /** * @param {?string} projectText @@ -85,7 +85,7 @@ fileSystem._initializeProject( typeof projectObject === 'object' ? /** @type {!Object} */ (projectObject) : null); } catch (e) { - WebInspector.console.error('Invalid project file: ' + projectText); + Common.console.error('Invalid project file: ' + projectText); } } return fileSystem._initializeFilePaths(); @@ -97,7 +97,7 @@ * @return {string} */ static errorMessage(error) { - return WebInspector.UIString('File system error: %s', error.message); + return Common.UIString('File system error: %s', error.message); } /** @@ -121,7 +121,7 @@ * @param {!FileError} error */ function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when getting file metadata \'' + path); fulfill(null); } @@ -191,7 +191,7 @@ /** * @param {!Array.<!FileEntry>} entries - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function innerCallback(entries) { for (var i = 0; i < entries.length; ++i) { @@ -232,7 +232,7 @@ /** * @param {!DirectoryEntry} dirEntry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function dirEntryLoaded(dirEntry) { var nameCandidate = name; @@ -246,7 +246,7 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileCreationError(error) { if (error.name === 'InvalidModificationError') { @@ -254,7 +254,7 @@ return; } - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error( errorMessage + ' when testing if file exists \'' + (this._path + '/' + path + '/' + nameCandidate) + '\''); callback(null); @@ -262,10 +262,10 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); var filePath = this._path + '/' + path; if (nameCandidate) filePath += '/' + nameCandidate; @@ -282,7 +282,7 @@ /** * @param {!FileEntry} fileEntry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileEntryLoaded(fileEntry) { fileEntry.remove(fileEntryRemoved, errorHandler.bind(this)); @@ -293,12 +293,12 @@ /** * @param {!FileError} error - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} * @suppress {checkTypes} * TODO(jsbell): Update externs replacing FileError with DOMException. https://crbug.com/496901 */ function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when deleting file \'' + (this._path + '/' + path) + '\''); } } @@ -323,7 +323,7 @@ /** * @param {!FileEntry} entry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileEntryLoaded(entry) { entry.file(fileLoaded, errorHandler.bind(this)); @@ -335,7 +335,7 @@ function fileLoaded(file) { var reader = new FileReader(); reader.onloadend = readerLoadEnd; - if (WebInspector.IsolatedFileSystem.ImageExtensions.has(WebInspector.ParsedURL.extractExtension(path))) + if (Workspace.IsolatedFileSystem.ImageExtensions.has(Common.ParsedURL.extractExtension(path))) reader.readAsDataURL(file); else reader.readAsText(file); @@ -356,7 +356,7 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function errorHandler(error) { if (error.name === 'NotFoundError') { @@ -364,7 +364,7 @@ return; } - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when getting content for file \'' + (this._path + '/' + path) + '\''); callback(null); } @@ -376,12 +376,12 @@ * @param {function()} callback */ setFileContent(path, content, callback) { - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.FileSavedInWorkspace); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.FileSavedInWorkspace); this._domFileSystem.root.getFile(path, {create: true}, fileEntryLoaded.bind(this), errorHandler.bind(this)); /** * @param {!FileEntry} entry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileEntryLoaded(entry) { entry.createWriter(fileWriterCreated.bind(this), errorHandler.bind(this)); @@ -389,7 +389,7 @@ /** * @param {!FileWriter} fileWriter - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileWriterCreated(fileWriter) { fileWriter.onerror = errorHandler.bind(this); @@ -404,10 +404,10 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when setting content for file \'' + (this._path + '/' + path) + '\''); callback(); } @@ -431,7 +431,7 @@ /** * @param {!FileEntry} entry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function fileEntryLoaded(entry) { if (entry.name === newName) { @@ -445,7 +445,7 @@ /** * @param {!Entry} entry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function dirEntryLoaded(entry) { dirEntry = entry; @@ -460,7 +460,7 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function newFileEntryLoadErrorHandler(error) { if (error.name !== 'NotFoundError') { @@ -478,10 +478,10 @@ } /** - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when renaming file \'' + (this._path + '/' + path) + '\' to \'' + newName + '\''); callback(false); } @@ -511,7 +511,7 @@ dirReader.readEntries(innerCallback, errorHandler); function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when reading directory \'' + dirEntry.fullPath + '\''); callback([]); } @@ -526,14 +526,14 @@ /** * @param {!DirectoryEntry} dirEntry - * @this {WebInspector.IsolatedFileSystem} + * @this {Workspace.IsolatedFileSystem} */ function innerCallback(dirEntry) { this._readDirectory(dirEntry, callback); } function errorHandler(error) { - var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error); + var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); console.error(errorMessage + ' when requesting entry \'' + path + '\''); callback([]); } @@ -551,7 +551,7 @@ addExcludedFolder(path) { this._excludedFolders.add(path); this._saveExcludedFolders(); - this._manager.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderAdded, path); + this._manager.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.ExcludedFolderAdded, path); } /** @@ -560,7 +560,7 @@ removeExcludedFolder(path) { this._excludedFolders.delete(path); this._saveExcludedFolders(); - this._manager.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, path); + this._manager.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, path); } fileSystemRemoved() { @@ -596,7 +596,7 @@ /** * @param {string} query - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {function(!Array.<string>)} callback */ searchInPath(query, progress, callback) { @@ -607,14 +607,14 @@ * @param {!Array.<string>} files */ function innerCallback(files) { - files = files.map(embedderPath => WebInspector.ParsedURL.platformPathToURL(embedderPath)); + files = files.map(embedderPath => Common.ParsedURL.platformPathToURL(embedderPath)); progress.worked(1); callback(files); } } /** - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ indexContent(progress) { progress.setTotalWork(1); @@ -623,5 +623,5 @@ } }; -WebInspector.IsolatedFileSystem.ImageExtensions = +Workspace.IsolatedFileSystem.ImageExtensions = new Set(['jpeg', 'jpg', 'svg', 'gif', 'webp', 'png', 'ico', 'tiff', 'tif', 'bmp']);
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js index bf5f3db..a8f5994 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js
@@ -31,15 +31,15 @@ /** * @unrestricted */ -WebInspector.IsolatedFileSystemManager = class extends WebInspector.Object { +Workspace.IsolatedFileSystemManager = class extends Common.Object { constructor() { super(); - /** @type {!Map<string, !WebInspector.IsolatedFileSystem>} */ + /** @type {!Map<string, !Workspace.IsolatedFileSystem>} */ this._fileSystems = new Map(); /** @type {!Map<number, function(!Array.<string>)>} */ this._callbacks = new Map(); - /** @type {!Map<number, !WebInspector.Progress>} */ + /** @type {!Map<number, !Common.Progress>} */ this._progresses = new Map(); InspectorFrontendHost.events.addEventListener( @@ -63,7 +63,7 @@ } /** - * @return {!Promise<!Array<!WebInspector.IsolatedFileSystem>>} + * @return {!Promise<!Array<!Workspace.IsolatedFileSystem>>} */ _requestFileSystems() { var fulfill; @@ -74,11 +74,11 @@ return promise; /** - * @param {!WebInspector.Event} event - * @this {WebInspector.IsolatedFileSystemManager} + * @param {!Common.Event} event + * @this {Workspace.IsolatedFileSystemManager} */ function onFileSystemsLoaded(event) { - var fileSystems = /** @type {!Array.<!WebInspector.IsolatedFileSystemManager.FileSystem>} */ (event.data); + var fileSystems = /** @type {!Array.<!Workspace.IsolatedFileSystemManager.FileSystem>} */ (event.data); var promises = []; for (var i = 0; i < fileSystems.length; ++i) promises.push(this._innerAddFileSystem(fileSystems[i], false)); @@ -86,7 +86,7 @@ } /** - * @param {!Array<?WebInspector.IsolatedFileSystem>} fileSystems + * @param {!Array<?Workspace.IsolatedFileSystem>} fileSystems */ function onFileSystemsAdded(fileSystems) { fulfill(fileSystems.filter(fs => !!fs)); @@ -98,82 +98,82 @@ } /** - * @param {!WebInspector.IsolatedFileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystem} fileSystem */ removeFileSystem(fileSystem) { InspectorFrontendHost.removeFileSystem(fileSystem.embedderPath()); } /** - * @return {!Promise<!Array<!WebInspector.IsolatedFileSystem>>} + * @return {!Promise<!Array<!Workspace.IsolatedFileSystem>>} */ waitForFileSystems() { return this._fileSystemsLoadedPromise; } /** - * @param {!WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem + * @param {!Workspace.IsolatedFileSystemManager.FileSystem} fileSystem * @param {boolean} dispatchEvent - * @return {!Promise<?WebInspector.IsolatedFileSystem>} + * @return {!Promise<?Workspace.IsolatedFileSystem>} */ _innerAddFileSystem(fileSystem, dispatchEvent) { var embedderPath = fileSystem.fileSystemPath; - var fileSystemURL = WebInspector.ParsedURL.platformPathToURL(fileSystem.fileSystemPath); - var promise = WebInspector.IsolatedFileSystem.create( + var fileSystemURL = Common.ParsedURL.platformPathToURL(fileSystem.fileSystemPath); + var promise = Workspace.IsolatedFileSystem.create( this, fileSystemURL, embedderPath, fileSystem.fileSystemName, fileSystem.rootURL); return promise.then(storeFileSystem.bind(this)); /** - * @param {?WebInspector.IsolatedFileSystem} fileSystem - * @this {WebInspector.IsolatedFileSystemManager} + * @param {?Workspace.IsolatedFileSystem} fileSystem + * @this {Workspace.IsolatedFileSystemManager} */ function storeFileSystem(fileSystem) { if (!fileSystem) return null; this._fileSystems.set(fileSystemURL, fileSystem); if (dispatchEvent) - this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, fileSystem); + this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.FileSystemAdded, fileSystem); return fileSystem; } } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemAdded(event) { var errorMessage = /** @type {string} */ (event.data['errorMessage']); - var fileSystem = /** @type {?WebInspector.IsolatedFileSystemManager.FileSystem} */ (event.data['fileSystem']); + var fileSystem = /** @type {?Workspace.IsolatedFileSystemManager.FileSystem} */ (event.data['fileSystem']); if (errorMessage) - WebInspector.console.error(errorMessage); + Common.console.error(errorMessage); else if (fileSystem) this._innerAddFileSystem(fileSystem, true); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemRemoved(event) { var embedderPath = /** @type {string} */ (event.data); - var fileSystemPath = WebInspector.ParsedURL.platformPathToURL(embedderPath); + var fileSystemPath = Common.ParsedURL.platformPathToURL(embedderPath); var isolatedFileSystem = this._fileSystems.get(fileSystemPath); if (!isolatedFileSystem) return; this._fileSystems.delete(fileSystemPath); isolatedFileSystem.fileSystemRemoved(); - this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, isolatedFileSystem); + this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, isolatedFileSystem); } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onFileSystemFilesChanged(event) { var embedderPaths = /** @type {!Array<string>} */ (event.data); - var paths = embedderPaths.map(embedderPath => WebInspector.ParsedURL.platformPathToURL(embedderPath)); - this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemFilesChanged, paths); + var paths = embedderPaths.map(embedderPath => Common.ParsedURL.platformPathToURL(embedderPath)); + this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.FileSystemFilesChanged, paths); } /** - * @return {!Array<!WebInspector.IsolatedFileSystem>} + * @return {!Array<!Workspace.IsolatedFileSystem>} */ fileSystems() { return this._fileSystems.valuesArray(); @@ -181,7 +181,7 @@ /** * @param {string} fileSystemPath - * @return {?WebInspector.IsolatedFileSystem} + * @return {?Workspace.IsolatedFileSystem} */ fileSystem(fileSystemPath) { return this._fileSystems.get(fileSystemPath) || null; @@ -199,19 +199,19 @@ ]; var defaultLinuxExcludedFolders = ['/.*~$']; var defaultExcludedFolders = defaultCommonExcludedFolders; - if (WebInspector.isWin()) + if (Host.isWin()) defaultExcludedFolders = defaultExcludedFolders.concat(defaultWinExcludedFolders); - else if (WebInspector.isMac()) + else if (Host.isMac()) defaultExcludedFolders = defaultExcludedFolders.concat(defaultMacExcludedFolders); else defaultExcludedFolders = defaultExcludedFolders.concat(defaultLinuxExcludedFolders); var defaultExcludedFoldersPattern = defaultExcludedFolders.join('|'); - this._workspaceFolderExcludePatternSetting = WebInspector.settings.createRegExpSetting( - 'workspaceFolderExcludePattern', defaultExcludedFoldersPattern, WebInspector.isWin() ? 'i' : ''); + this._workspaceFolderExcludePatternSetting = Common.settings.createRegExpSetting( + 'workspaceFolderExcludePattern', defaultExcludedFoldersPattern, Host.isWin() ? 'i' : ''); } /** - * @return {!WebInspector.Setting} + * @return {!Common.Setting} */ workspaceFolderExcludePatternSetting() { return this._workspaceFolderExcludePatternSetting; @@ -222,23 +222,23 @@ * @return {number} */ registerCallback(callback) { - var requestId = ++WebInspector.IsolatedFileSystemManager._lastRequestId; + var requestId = ++Workspace.IsolatedFileSystemManager._lastRequestId; this._callbacks.set(requestId, callback); return requestId; } /** - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @return {number} */ registerProgress(progress) { - var requestId = ++WebInspector.IsolatedFileSystemManager._lastRequestId; + var requestId = ++Workspace.IsolatedFileSystemManager._lastRequestId; this._progresses.set(requestId, progress); return requestId; } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onIndexingTotalWorkCalculated(event) { var requestId = /** @type {number} */ (event.data['requestId']); @@ -251,7 +251,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onIndexingWorked(event) { var requestId = /** @type {number} */ (event.data['requestId']); @@ -268,7 +268,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onIndexingDone(event) { var requestId = /** @type {number} */ (event.data['requestId']); @@ -281,7 +281,7 @@ } /** - * @param {!WebInspector.Event} event + * @param {!Common.Event} event */ _onSearchCompleted(event) { var requestId = /** @type {number} */ (event.data['requestId']); @@ -296,10 +296,10 @@ }; /** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}} */ -WebInspector.IsolatedFileSystemManager.FileSystem; +Workspace.IsolatedFileSystemManager.FileSystem; /** @enum {symbol} */ -WebInspector.IsolatedFileSystemManager.Events = { +Workspace.IsolatedFileSystemManager.Events = { FileSystemAdded: Symbol('FileSystemAdded'), FileSystemRemoved: Symbol('FileSystemRemoved'), FileSystemFilesChanged: Symbol('FileSystemFilesChanged'), @@ -307,9 +307,9 @@ ExcludedFolderRemoved: Symbol('ExcludedFolderRemoved') }; -WebInspector.IsolatedFileSystemManager._lastRequestId = 0; +Workspace.IsolatedFileSystemManager._lastRequestId = 0; /** - * @type {!WebInspector.IsolatedFileSystemManager} + * @type {!Workspace.IsolatedFileSystemManager} */ -WebInspector.isolatedFileSystemManager; +Workspace.isolatedFileSystemManager;
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/SearchConfig.js b/third_party/WebKit/Source/devtools/front_end/workspace/SearchConfig.js index 9379998..64e4912a 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/SearchConfig.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/SearchConfig.js
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {WebInspector.ProjectSearchConfig} + * @implements {Workspace.ProjectSearchConfig} * @unrestricted */ -WebInspector.SearchConfig = class { +Workspace.SearchConfig = class { /** * @param {string} query * @param {boolean} ignoreCase @@ -20,10 +20,10 @@ /** * @param {{query: string, ignoreCase: boolean, isRegex: boolean}} object - * @return {!WebInspector.SearchConfig} + * @return {!Workspace.SearchConfig} */ static fromPlainObject(object) { - return new WebInspector.SearchConfig(object.query, object.ignoreCase, object.isRegex); + return new Workspace.SearchConfig(object.query, object.ignoreCase, object.isRegex); } /** @@ -73,7 +73,7 @@ var queryParts = this._query.match(regexp) || []; /** - * @type {!Array.<!WebInspector.SearchConfig.QueryTerm>} + * @type {!Array.<!Workspace.SearchConfig.QueryTerm>} */ this._fileQueries = []; @@ -89,7 +89,7 @@ var fileQuery = this._parseFileQuery(queryPart); if (fileQuery) { this._fileQueries.push(fileQuery); - /** @type {!Array.<!WebInspector.SearchConfig.RegexQuery>} */ + /** @type {!Array.<!Workspace.SearchConfig.RegexQuery>} */ this._fileRegexQueries = this._fileRegexQueries || []; this._fileRegexQueries.push( {regex: new RegExp(fileQuery.text, this.ignoreCase ? 'i' : ''), isNegative: fileQuery.isNegative}); @@ -142,7 +142,7 @@ /** * @param {string} query - * @return {?WebInspector.SearchConfig.QueryTerm} + * @return {?Workspace.SearchConfig.QueryTerm} */ _parseFileQuery(query) { var match = query.match(/^(-)?f(ile)?:/); @@ -166,18 +166,18 @@ result += query.charAt(i); } } - return new WebInspector.SearchConfig.QueryTerm(result, isNegative); + return new Workspace.SearchConfig.QueryTerm(result, isNegative); } }; /** @typedef {!{regex: !RegExp, isNegative: boolean}} */ -WebInspector.SearchConfig.RegexQuery; +Workspace.SearchConfig.RegexQuery; /** * @unrestricted */ -WebInspector.SearchConfig.QueryTerm = class { +Workspace.SearchConfig.QueryTerm = class { /** * @param {string} text * @param {boolean} isNegative
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js index 466760c..fff83b1 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
@@ -28,14 +28,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.UISourceCode = class extends WebInspector.Object { +Workspace.UISourceCode = class extends Common.Object { /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @param {string} url - * @param {!WebInspector.ResourceType} contentType + * @param {!Common.ResourceType} contentType */ constructor(project, url, contentType) { super(); @@ -60,18 +60,18 @@ this._requestContentCallback = null; /** @type {?Promise<?string>} */ this._requestContentPromise = null; - /** @type {!Map<string, !Map<number, !WebInspector.UISourceCode.LineMarker>>} */ + /** @type {!Map<string, !Map<number, !Workspace.UISourceCode.LineMarker>>} */ this._lineDecorations = new Map(); - /** @type {!Array.<!WebInspector.Revision>} */ + /** @type {!Array.<!Workspace.Revision>} */ this.history = []; - /** @type {!Array<!WebInspector.UISourceCode.Message>} */ + /** @type {!Array<!Workspace.UISourceCode.Message>} */ this._messages = []; } /** - * @return {!Promise<?WebInspector.UISourceCodeMetadata>} + * @return {!Promise<?Workspace.UISourceCodeMetadata>} */ requestMetadata() { return this._project.requestMetadata(this); @@ -123,7 +123,7 @@ */ displayName(skipTrim) { if (!this._name) - return WebInspector.UIString('(index)'); + return Common.UIString('(index)'); var name = this._name; try { name = decodeURI(name); @@ -136,7 +136,7 @@ * @return {boolean} */ isFromServiceProject() { - return WebInspector.Project.isServiceProject(this._project); + return Workspace.Project.isServiceProject(this._project); } /** @@ -157,14 +157,14 @@ * @param {boolean} success * @param {string=} newName * @param {string=} newURL - * @param {!WebInspector.ResourceType=} newContentType - * @this {WebInspector.UISourceCode} + * @param {!Common.ResourceType=} newContentType + * @this {Workspace.UISourceCode} */ function innerCallback(success, newName, newURL, newContentType) { if (success) this._updateName( /** @type {string} */ (newName), /** @type {string} */ (newURL), - /** @type {!WebInspector.ResourceType} */ (newContentType)); + /** @type {!Common.ResourceType} */ (newContentType)); callback(success); } } @@ -176,7 +176,7 @@ /** * @param {string} name * @param {string} url - * @param {!WebInspector.ResourceType=} contentType + * @param {!Common.ResourceType=} contentType */ _updateName(name, url, contentType) { var oldURL = this.url(); @@ -186,7 +186,7 @@ this._url = url; if (contentType) this._contentType = contentType; - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.TitleChanged, oldURL); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.TitleChanged, oldURL); } /** @@ -199,14 +199,14 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._contentType; } /** - * @return {!WebInspector.Project} + * @return {!Workspace.Project} */ project() { return this._project; @@ -273,7 +273,7 @@ /** * @param {?string} updatedContent - * @this {WebInspector.UISourceCode} + * @this {Workspace.UISourceCode} */ function contentLoaded(updatedContent) { if (updatedContent === null) { @@ -301,7 +301,7 @@ } var shouldUpdate = - window.confirm(WebInspector.UIString('This file was changed externally. Would you like to reload it?')); + window.confirm(Common.UIString('This file was changed externally. Would you like to reload it?')); if (shouldUpdate) this._contentCommitted(updatedContent, false); else @@ -330,9 +330,9 @@ _commitContent(content) { if (this._project.canSetFileContent()) { this._project.setFileContent(this, content, function() {}); - } else if (this._url && WebInspector.fileManager.isURLSaved(this._url)) { - WebInspector.fileManager.save(this._url, content, false, function() {}); - WebInspector.fileManager.close(this._url); + } else if (this._url && Workspace.fileManager.isURLSaved(this._url)) { + Workspace.fileManager.save(this._url, content, false, function() {}); + Workspace.fileManager.close(this._url); } this._contentCommitted(content, true); } @@ -348,26 +348,26 @@ var lastRevision = this.history.length ? this.history[this.history.length - 1] : null; if (!lastRevision || lastRevision._content !== this._content) { - var revision = new WebInspector.Revision(this, this._content, new Date()); + var revision = new Workspace.Revision(this, this._content, new Date()); this.history.push(revision); } this._innerResetWorkingCopy(); - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyCommitted, {content: content}); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.WorkingCopyCommitted, {content: content}); this._project.workspace().dispatchEventToListeners( - WebInspector.Workspace.Events.WorkingCopyCommitted, {uiSourceCode: this, content: content}); + Workspace.Workspace.Events.WorkingCopyCommitted, {uiSourceCode: this, content: content}); if (committedByUser) this._project.workspace().dispatchEventToListeners( - WebInspector.Workspace.Events.WorkingCopyCommittedByUser, {uiSourceCode: this, content: content}); + Workspace.Workspace.Events.WorkingCopyCommittedByUser, {uiSourceCode: this, content: content}); } saveAs() { - WebInspector.fileManager.save(this._url, this.workingCopy(), true, callback.bind(this)); - WebInspector.fileManager.close(this._url); + Workspace.fileManager.save(this._url, this.workingCopy(), true, callback.bind(this)); + Workspace.fileManager.close(this._url); /** * @param {boolean} accepted - * @this {WebInspector.UISourceCode} + * @this {Workspace.UISourceCode} */ function callback(accepted) { if (accepted) @@ -387,7 +387,7 @@ */ revertToOriginal() { /** - * @this {WebInspector.UISourceCode} + * @this {Workspace.UISourceCode} * @param {?string} content */ function callback(content) { @@ -397,16 +397,16 @@ this.addRevision(content); } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.RevisionApplied); return this.requestOriginalContent().then(callback.bind(this)); } /** - * @param {function(!WebInspector.UISourceCode)} callback + * @param {function(!Workspace.UISourceCode)} callback */ revertAndClearHistory(callback) { /** - * @this {WebInspector.UISourceCode} + * @this {Workspace.UISourceCode} * @param {?string} content */ function revert(content) { @@ -418,7 +418,7 @@ callback(this); } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.RevisionApplied); this.requestOriginalContent().then(revert.bind(this)); } @@ -437,7 +437,7 @@ resetWorkingCopy() { this._innerResetWorkingCopy(); - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.WorkingCopyChanged); } _innerResetWorkingCopy() { @@ -451,16 +451,16 @@ setWorkingCopy(newWorkingCopy) { this._workingCopy = newWorkingCopy; delete this._workingCopyGetter; - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.WorkingCopyChanged); this._project.workspace().dispatchEventToListeners( - WebInspector.Workspace.Events.WorkingCopyChanged, {uiSourceCode: this}); + Workspace.Workspace.Events.WorkingCopyChanged, {uiSourceCode: this}); } setWorkingCopyGetter(workingCopyGetter) { this._workingCopyGetter = workingCopyGetter; - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.WorkingCopyChanged); this._project.workspace().dispatchEventToListeners( - WebInspector.Workspace.Events.WorkingCopyChanged, {uiSourceCode: this}); + Workspace.Workspace.Events.WorkingCopyChanged, {uiSourceCode: this}); } removeWorkingCopyGetter() { @@ -486,7 +486,7 @@ * @return {string} */ extension() { - return WebInspector.ParsedURL.extractExtension(this._name); + return Common.ParsedURL.extractExtension(this._name); } /** @@ -501,7 +501,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { var content = this.content(); @@ -517,7 +517,7 @@ * @param {string} content */ function doSearch(content) { - callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); + callback(Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); } } @@ -545,59 +545,59 @@ /** * @param {number} lineNumber * @param {number=} columnNumber - * @return {!WebInspector.UILocation} + * @return {!Workspace.UILocation} */ uiLocation(lineNumber, columnNumber) { if (typeof columnNumber === 'undefined') columnNumber = 0; - return new WebInspector.UILocation(this, lineNumber, columnNumber); + return new Workspace.UILocation(this, lineNumber, columnNumber); } /** - * @return {!Array<!WebInspector.UISourceCode.Message>} + * @return {!Array<!Workspace.UISourceCode.Message>} */ messages() { return this._messages.slice(); } /** - * @param {!WebInspector.UISourceCode.Message.Level} level + * @param {!Workspace.UISourceCode.Message.Level} level * @param {string} text * @param {number} lineNumber * @param {number=} columnNumber - * @return {!WebInspector.UISourceCode.Message} message + * @return {!Workspace.UISourceCode.Message} message */ addLineMessage(level, text, lineNumber, columnNumber) { return this.addMessage( - level, text, new WebInspector.TextRange(lineNumber, columnNumber || 0, lineNumber, columnNumber || 0)); + level, text, new Common.TextRange(lineNumber, columnNumber || 0, lineNumber, columnNumber || 0)); } /** - * @param {!WebInspector.UISourceCode.Message.Level} level + * @param {!Workspace.UISourceCode.Message.Level} level * @param {string} text - * @param {!WebInspector.TextRange} range - * @return {!WebInspector.UISourceCode.Message} message + * @param {!Common.TextRange} range + * @return {!Workspace.UISourceCode.Message} message */ addMessage(level, text, range) { - var message = new WebInspector.UISourceCode.Message(this, level, text, range); + var message = new Workspace.UISourceCode.Message(this, level, text, range); this._messages.push(message); - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageAdded, message); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageAdded, message); return message; } /** - * @param {!WebInspector.UISourceCode.Message} message + * @param {!Workspace.UISourceCode.Message} message */ removeMessage(message) { if (this._messages.remove(message)) - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageRemoved, message); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved, message); } removeAllMessages() { var messages = this._messages; this._messages = []; for (var message of messages) - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageRemoved, message); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved, message); } /** @@ -611,9 +611,9 @@ markers = new Map(); this._lineDecorations.set(type, markers); } - var marker = new WebInspector.UISourceCode.LineMarker(lineNumber, type, data); + var marker = new Workspace.UISourceCode.LineMarker(lineNumber, type, data); markers.set(lineNumber, marker); - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.LineDecorationAdded, marker); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.LineDecorationAdded, marker); } /** @@ -628,7 +628,7 @@ if (!marker) return; markers.delete(lineNumber); - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.LineDecorationRemoved, marker); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.LineDecorationRemoved, marker); if (!markers.size) this._lineDecorations.delete(type); } @@ -642,13 +642,13 @@ return; this._lineDecorations.delete(type); markers.forEach(marker => { - this.dispatchEventToListeners(WebInspector.UISourceCode.Events.LineDecorationRemoved, marker); + this.dispatchEventToListeners(Workspace.UISourceCode.Events.LineDecorationRemoved, marker); }); } /** * @param {string} type - * @return {?Map<number, !WebInspector.UISourceCode.LineMarker>} + * @return {?Map<number, !Workspace.UISourceCode.LineMarker>} */ lineDecorations(type) { return this._lineDecorations.get(type) || null; @@ -656,7 +656,7 @@ }; /** @enum {symbol} */ -WebInspector.UISourceCode.Events = { +Workspace.UISourceCode.Events = { WorkingCopyChanged: Symbol('WorkingCopyChanged'), WorkingCopyCommitted: Symbol('WorkingCopyCommitted'), TitleChanged: Symbol('TitleChanged'), @@ -670,9 +670,9 @@ /** * @unrestricted */ -WebInspector.UILocation = class { +Workspace.UILocation = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber */ @@ -708,8 +708,8 @@ } /** - * @param {!WebInspector.UILocation} location1 - * @param {!WebInspector.UILocation} location2 + * @param {!Workspace.UILocation} location1 + * @param {!Workspace.UILocation} location2 * @return {number} */ static comparator(location1, location2) { @@ -717,7 +717,7 @@ } /** - * @param {!WebInspector.UILocation} other + * @param {!Workspace.UILocation} other * @return {number} */ compareTo(other) { @@ -730,12 +730,12 @@ }; /** - * @implements {WebInspector.ContentProvider} + * @implements {Common.ContentProvider} * @unrestricted */ -WebInspector.Revision = class { +Workspace.Revision = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {?string|undefined} content * @param {!Date} timestamp */ @@ -746,7 +746,7 @@ } /** - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ get uiSourceCode() { return this._uiSourceCode; @@ -772,13 +772,13 @@ revertToThis() { /** * @param {?string} content - * @this {WebInspector.Revision} + * @this {Workspace.Revision} */ function revert(content) { if (content && this._uiSourceCode._content !== content) this._uiSourceCode.addRevision(content); } - WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.RevisionApplied); return this.requestContent().then(revert.bind(this)); } @@ -792,7 +792,7 @@ /** * @override - * @return {!WebInspector.ResourceType} + * @return {!Common.ResourceType} */ contentType() { return this._uiSourceCode.contentType(); @@ -811,7 +811,7 @@ * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInContent(query, caseSensitive, isRegex, callback) { callback([]); @@ -821,12 +821,12 @@ /** * @unrestricted */ -WebInspector.UISourceCode.Message = class { +Workspace.UISourceCode.Message = class { /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @param {!WebInspector.UISourceCode.Message.Level} level + * @param {!Workspace.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode.Message.Level} level * @param {string} text - * @param {!WebInspector.TextRange} range + * @param {!Common.TextRange} range */ constructor(uiSourceCode, level, text, range) { this._uiSourceCode = uiSourceCode; @@ -836,14 +836,14 @@ } /** - * @return {!WebInspector.UISourceCode} + * @return {!Workspace.UISourceCode} */ uiSourceCode() { return this._uiSourceCode; } /** - * @return {!WebInspector.UISourceCode.Message.Level} + * @return {!Workspace.UISourceCode.Message.Level} */ level() { return this._level; @@ -857,7 +857,7 @@ } /** - * @return {!WebInspector.TextRange} + * @return {!Common.TextRange} */ range() { return this._range; @@ -878,7 +878,7 @@ } /** - * @param {!WebInspector.UISourceCode.Message} another + * @param {!Workspace.UISourceCode.Message} another * @return {boolean} */ isEqual(another) { @@ -894,7 +894,7 @@ /** * @enum {string} */ -WebInspector.UISourceCode.Message.Level = { +Workspace.UISourceCode.Message.Level = { Error: 'Error', Warning: 'Warning' }; @@ -902,7 +902,7 @@ /** * @unrestricted */ -WebInspector.UISourceCode.LineMarker = class { +Workspace.UISourceCode.LineMarker = class { /** * @param {number} line * @param {string} type @@ -939,7 +939,7 @@ /** * @unrestricted */ -WebInspector.UISourceCodeMetadata = class { +Workspace.UISourceCodeMetadata = class { /** * @param {?Date} modificationTime * @param {?number} contentSize
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js index 114f5fde..b6e2f2cb 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js
@@ -30,9 +30,9 @@ /** * @interface */ -WebInspector.ProjectSearchConfig = function() {}; +Workspace.ProjectSearchConfig = function() {}; -WebInspector.ProjectSearchConfig.prototype = { +Workspace.ProjectSearchConfig.prototype = { /** * @return {string} */ @@ -63,20 +63,20 @@ /** * @interface */ -WebInspector.Project = function() {}; +Workspace.Project = function() {}; /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project * @return {boolean} */ -WebInspector.Project.isServiceProject = function(project) { - return project.type() === WebInspector.projectTypes.Debugger || - project.type() === WebInspector.projectTypes.Formatter || project.type() === WebInspector.projectTypes.Service; +Workspace.Project.isServiceProject = function(project) { + return project.type() === Workspace.projectTypes.Debugger || + project.type() === Workspace.projectTypes.Formatter || project.type() === Workspace.projectTypes.Service; }; -WebInspector.Project.prototype = { +Workspace.Project.prototype = { /** - * @return {!WebInspector.Workspace} + * @return {!Workspace.Workspace} */ workspace: function() {}, @@ -96,13 +96,13 @@ displayName: function() {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode - * @return {!Promise<?WebInspector.UISourceCodeMetadata>} + * @param {!Workspace.UISourceCode} uiSourceCode + * @return {!Promise<?Workspace.UISourceCodeMetadata>} */ requestMetadata: function(uiSourceCode) {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {function(?string)} callback */ requestFileContent: function(uiSourceCode, callback) {}, @@ -113,7 +113,7 @@ canSetFileContent: function() {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newContent * @param {function(?string)} callback */ @@ -125,9 +125,9 @@ canRename: function() {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newName - * @param {function(boolean, string=, string=, !WebInspector.ResourceType=)} callback + * @param {function(boolean, string=, string=, !Common.ResourceType=)} callback */ rename: function(uiSourceCode, newName, callback) {}, @@ -140,7 +140,7 @@ * @param {string} path * @param {?string} name * @param {string} content - * @param {function(?WebInspector.UISourceCode)} callback + * @param {function(?Workspace.UISourceCode)} callback */ createFile: function(path, name, content, callback) {}, @@ -152,35 +152,35 @@ remove: function() {}, /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} query * @param {boolean} caseSensitive * @param {boolean} isRegex - * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback + * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback */ searchInFileContent: function(uiSourceCode, query, caseSensitive, isRegex, callback) {}, /** - * @param {!WebInspector.ProjectSearchConfig} searchConfig + * @param {!Workspace.ProjectSearchConfig} searchConfig * @param {!Array.<string>} filesMathingFileQuery - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress * @param {function(!Array.<string>)} callback */ findFilesMatchingSearchRequest: function(searchConfig, filesMathingFileQuery, progress, callback) {}, /** - * @param {!WebInspector.Progress} progress + * @param {!Common.Progress} progress */ indexContent: function(progress) {}, /** * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCodeForURL: function(url) {}, /** - * @return {!Array.<!WebInspector.UISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ uiSourceCodes: function() {} }; @@ -188,7 +188,7 @@ /** * @enum {string} */ -WebInspector.projectTypes = { +Workspace.projectTypes = { Debugger: 'debugger', Formatter: 'formatter', Network: 'network', @@ -201,11 +201,11 @@ /** * @unrestricted */ -WebInspector.ProjectStore = class { +Workspace.ProjectStore = class { /** - * @param {!WebInspector.Workspace} workspace + * @param {!Workspace.Workspace} workspace * @param {string} id - * @param {!WebInspector.projectTypes} type + * @param {!Workspace.projectTypes} type * @param {string} displayName */ constructor(workspace, id, type, displayName) { @@ -214,12 +214,12 @@ this._type = type; this._displayName = displayName; - /** @type {!Map.<string, !{uiSourceCode: !WebInspector.UISourceCode, index: number}>} */ + /** @type {!Map.<string, !{uiSourceCode: !Workspace.UISourceCode, index: number}>} */ this._uiSourceCodesMap = new Map(); - /** @type {!Array.<!WebInspector.UISourceCode>} */ + /** @type {!Array.<!Workspace.UISourceCode>} */ this._uiSourceCodesList = []; - this._project = /** @type {!WebInspector.Project} */ (this); + this._project = /** @type {!Workspace.Project} */ (this); } /** @@ -244,7 +244,7 @@ } /** - * @return {!WebInspector.Workspace} + * @return {!Workspace.Workspace} */ workspace() { return this._workspace; @@ -252,15 +252,15 @@ /** * @param {string} url - * @param {!WebInspector.ResourceType} contentType - * @return {!WebInspector.UISourceCode} + * @param {!Common.ResourceType} contentType + * @return {!Workspace.UISourceCode} */ createUISourceCode(url, contentType) { - return new WebInspector.UISourceCode(this._project, url, contentType); + return new Workspace.UISourceCode(this._project, url, contentType); } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {boolean=} replace * @return {boolean} */ @@ -274,7 +274,7 @@ } this._uiSourceCodesMap.set(url, {uiSourceCode: uiSourceCode, index: this._uiSourceCodesList.length}); this._uiSourceCodesList.push(uiSourceCode); - this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCode); + this._workspace.dispatchEventToListeners(Workspace.Workspace.Events.UISourceCodeAdded, uiSourceCode); return true; } @@ -293,7 +293,7 @@ movedEntry.index = entry.index; this._uiSourceCodesList.splice(this._uiSourceCodesList.length - 1, 1); this._uiSourceCodesMap.delete(url); - this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeRemoved, entry.uiSourceCode); + this._workspace.dispatchEventToListeners(Workspace.Workspace.Events.UISourceCodeRemoved, entry.uiSourceCode); } removeProject() { @@ -304,7 +304,7 @@ /** * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCodeForURL(url) { var entry = this._uiSourceCodesMap.get(url); @@ -312,21 +312,21 @@ } /** - * @return {!Array.<!WebInspector.UISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ uiSourceCodes() { return this._uiSourceCodesList; } /** - * @param {!WebInspector.UISourceCode} uiSourceCode + * @param {!Workspace.UISourceCode} uiSourceCode * @param {string} newName */ renameUISourceCode(uiSourceCode, newName) { var oldPath = uiSourceCode.url(); var newPath = uiSourceCode.parentURL() ? uiSourceCode.parentURL() + '/' + newName : newName; var value = - /** @type {!{uiSourceCode: !WebInspector.UISourceCode, index: number}} */ (this._uiSourceCodesMap.get(oldPath)); + /** @type {!{uiSourceCode: !Workspace.UISourceCode, index: number}} */ (this._uiSourceCodesMap.get(oldPath)); this._uiSourceCodesMap.set(newPath, value); this._uiSourceCodesMap.delete(oldPath); } @@ -335,10 +335,10 @@ /** * @unrestricted */ -WebInspector.Workspace = class extends WebInspector.Object { +Workspace.Workspace = class extends Common.Object { constructor() { super(); - /** @type {!Map<string, !WebInspector.Project>} */ + /** @type {!Map<string, !Workspace.Project>} */ this._projects = new Map(); this._hasResourceContentTrackingExtensions = false; } @@ -346,7 +346,7 @@ /** * @param {string} projectId * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCode(projectId, url) { var project = this._projects.get(projectId); @@ -355,7 +355,7 @@ /** * @param {string} url - * @return {?WebInspector.UISourceCode} + * @return {?Workspace.UISourceCode} */ uiSourceCodeForURL(url) { for (var project of this._projects.values()) { @@ -368,7 +368,7 @@ /** * @param {string} type - * @return {!Array.<!WebInspector.UISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ uiSourceCodesForProjectType(type) { var result = []; @@ -380,32 +380,32 @@ } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project */ addProject(project) { console.assert(!this._projects.has(project.id()), `A project with id ${project.id()} already exists!`); this._projects.set(project.id(), project); - this.dispatchEventToListeners(WebInspector.Workspace.Events.ProjectAdded, project); + this.dispatchEventToListeners(Workspace.Workspace.Events.ProjectAdded, project); } /** - * @param {!WebInspector.Project} project + * @param {!Workspace.Project} project */ _removeProject(project) { this._projects.delete(project.id()); - this.dispatchEventToListeners(WebInspector.Workspace.Events.ProjectRemoved, project); + this.dispatchEventToListeners(Workspace.Workspace.Events.ProjectRemoved, project); } /** * @param {string} projectId - * @return {?WebInspector.Project} + * @return {?Workspace.Project} */ project(projectId) { return this._projects.get(projectId) || null; } /** - * @return {!Array.<!WebInspector.Project>} + * @return {!Array.<!Workspace.Project>} */ projects() { return this._projects.valuesArray(); @@ -413,7 +413,7 @@ /** * @param {string} type - * @return {!Array.<!WebInspector.Project>} + * @return {!Array.<!Workspace.Project>} */ projectsForType(type) { function filterByType(project) { @@ -423,7 +423,7 @@ } /** - * @return {!Array.<!WebInspector.UISourceCode>} + * @return {!Array.<!Workspace.UISourceCode>} */ uiSourceCodes() { var result = []; @@ -448,7 +448,7 @@ }; /** @enum {symbol} */ -WebInspector.Workspace.Events = { +Workspace.Workspace.Events = { UISourceCodeAdded: Symbol('UISourceCodeAdded'), UISourceCodeRemoved: Symbol('UISourceCodeRemoved'), WorkingCopyChanged: Symbol('WorkingCopyChanged'), @@ -459,6 +459,6 @@ }; /** - * @type {!WebInspector.Workspace} + * @type {!Workspace.Workspace} */ -WebInspector.workspace; +Workspace.workspace;
diff --git a/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py b/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py index af89d8af..e095c38 100755 --- a/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py +++ b/third_party/WebKit/Source/devtools/scripts/build/build_release_applications.py
@@ -189,7 +189,13 @@ non_autostart_deps = deps & non_autostart if len(non_autostart_deps): bail_error('Non-autostart dependencies specified for the autostarted module "%s": %s' % (name, non_autostart_deps)) + + namespace = name.replace('_lazy', '') + if namespace == 'sdk' or namespace == 'ui': + namespace = namespace.upper(); + namespace = "".join(map(lambda x: x[0].upper() + x[1:], namespace.split('_'))) output.write('\n/* Module %s */\n' % name) + output.write('\nself[\'%s\'] = self[\'%s\'] || {};\n' % (namespace, namespace)) modular_build.concatenate_scripts(desc.get('scripts'), join(self.application_dir, name), self.output_dir, output) else: non_autostart.add(name)
diff --git a/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py b/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py index cecbfae..a5993f77 100755 --- a/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py +++ b/third_party/WebKit/Source/devtools/scripts/build/generate_supported_css.py
@@ -69,4 +69,4 @@ properties = properties_from_file(sys.argv[1]) with open(sys.argv[2], "w") as f: - f.write("WebInspector.CSSMetadata._generatedProperties = %s;" % json.dumps(properties)) + f.write("SDK.CSSMetadata._generatedProperties = %s;" % json.dumps(properties))
diff --git a/third_party/WebKit/Source/devtools/scripts/namespaces.js b/third_party/WebKit/Source/devtools/scripts/namespaces.js new file mode 100644 index 0000000..a144a2f --- /dev/null +++ b/third_party/WebKit/Source/devtools/scripts/namespaces.js
@@ -0,0 +1,146 @@ +const fs = require('fs'); + +function depends(module, from) +{ + if (module === from) + return true; + var desc = descriptors[module]; + if (!desc) + return false; + for (var dep of desc.dependencies || []) { + if (dep === from) + return true; + if (depends(dep, from)) + return true; + } + return false; +} + +var map = new Map(); +var sortedKeys; +var moduleNames = new Set(); + +String.prototype.replaceAll = function(a, b) +{ + var result = this; + while (result.includes(a)) + result = result.replace(a, b); + return result; +} + +function read(filePath) +{ + var content = fs.readFileSync(filePath).toString(); + + var oldModuleName = filePath.replace(/front_end\/([^/]+)\/.*/, "$1"); + if (oldModuleName.endsWith("_lazy")) + oldModuleName = oldModuleName.substring(0, oldModuleName.length - "_lazy".length); + + var moduleName = oldModuleName; + + // if (oldModuleName === "accessibility") + // moduleName = "a11y"; + // if (oldModuleName === "resources") + // moduleName = "storage"; + // if (oldModuleName === "console") + // moduleName = "consoleUI"; + + + // if (oldModuleName === "timeline") + // moduleName = "timelineUI"; + // if (oldModuleName === "timeline_model") + // moduleName = "timeline"; + + // moduleName = "com.google.chrome.devtools." + moduleName; + // moduleName = "dt";// + moduleName; + if (moduleName === "sdk" || moduleName == "ui") + moduleName = moduleName.toUpperCase(); + // moduleName = "dt" + moduleName.substring(0, 1).toUpperCase() + moduleName.substring(1); + moduleName = moduleName.split("_").map(a => a.substring(0, 1).toUpperCase() + a.substring(1)).join(""); + if (moduleName.includes("/")) + return; + moduleNames.add(moduleName); + + var lines = content.split("\n"); + for (var line of lines) { + var line = line.trim(); + if (!line.startsWith("WebInspector.")) + continue; + var match = line.match(/^(WebInspector.[a-z_A-Z0-9]+)\s*(\=[^,}]|[;])/) || line.match(/^(WebInspector.[a-z_A-Z0-9]+)\s*\=$/); + if (!match) + continue; + var name = match[1]; + if (name.split(".").length !== 2) + continue; + var weight = line.endsWith(name + ";") ? 2 : 1; + + var newName; + var shortName = newName; + + newName = name.replace("WebInspector.", moduleName + "."); + shortName = newName.replace(moduleName + ".", ""); + var existing = map.get(name); + if (existing && existing.weight > weight) + continue; + if (existing && existing.weight === weight && newName !== existing.name) + console.log("Conflict: " + newName + " vs " + existing.name + " " + weight); + map.set(name, {name:newName, weight}); + } +} + + +function write(filePath) +{ + var content = fs.readFileSync(filePath).toString(); + var newContent = content; + for (var key of sortedKeys) + newContent = newContent.replaceAll(key, map.get(key).name); + newContent = newContent.replaceAll("UI._focusChanged.bind(WebInspector", "UI._focusChanged.bind(UI"); + newContent = newContent.replaceAll("UI._windowFocused.bind(WebInspector", "UI._windowFocused.bind(UI"); + newContent = newContent.replaceAll("UI._windowBlurred.bind(WebInspector", "UI._windowBlurred.bind(UI"); + newContent = newContent.replaceAll("UI._focusChanged.bind(WebInspector", "UI._focusChanged.bind(UI"); + newContent = newContent.replaceAll("UI._focusChanged.bind(WebInspector", "UI._focusChanged.bind(UI"); + newContent = newContent.replaceAll("Components.reload.bind(WebInspector", "Components.reload.bind(Components"); + newContent = newContent.replaceAll("window.opener.WebInspector['AdvancedApp']['_instance']()", "window.opener['Emulation']['AdvancedApp']['_instance']()"); + newContent = newContent.replaceAll("if (window['WebInspector'][", "if (window['WebInspector'] && window['WebInspector']["); + + if (content !== newContent) + fs.writeFileSync(filePath, newContent); +} + +function walkSync(currentDirPath, process, json) { + var fs = require('fs'), + path = require('path'); + fs.readdirSync(currentDirPath).forEach(function (name) { + var filePath = path.join(currentDirPath, name); + var stat = fs.statSync(filePath); + if (stat.isFile() && (filePath.endsWith(".js") || filePath.endsWith(".html") || filePath.endsWith(".xhtml") || filePath.endsWith("-expected.txt") || (json && filePath.endsWith(".json")))) { + if (filePath.includes("ExtensionAPI.js")) + return; + if (filePath.includes("externs.js")) + return; + if (filePath.includes("eslint") || filePath.includes("lighthouse-background.js") || filePath.includes("/cm/") || filePath.includes("/xterm.js/") || filePath.includes("/acorn/") || filePath.includes("/gonzales-scss")) + return; + if (filePath.includes("/cm_modes/") && !filePath.includes("DefaultCodeMirror") && !filePath.includes("module.json")) + return; + process(filePath); + } else if (stat.isDirectory()) { + walkSync(filePath, process, json); + } + }); +} + +walkSync('front_end', read); +sortedKeys = Array.from(map.keys()); +sortedKeys.sort((a, b) => (b.length - a.length) || a.localeCompare(b)); +for (var key of sortedKeys) + console.log(key + " => " + map.get(key).name); +walkSync('front_end', write, true); + +walkSync('../../LayoutTests/http/tests/inspector', write, false); +walkSync('../../LayoutTests/http/tests/inspector-enabled', write, false); +walkSync('../../LayoutTests/http/tests/inspector-protocol', write, false); +walkSync('../../LayoutTests/http/tests/inspector-unit', write, false); +walkSync('../../LayoutTests/inspector', write, false); +walkSync('../../LayoutTests/inspector-enabled', write, false); +walkSync('../../LayoutTests/inspector-protocol', write, false);
diff --git a/tools/perf/benchmarks/system_health.py b/tools/perf/benchmarks/system_health.py index 04c66d7..6303fbb 100644 --- a/tools/perf/benchmarks/system_health.py +++ b/tools/perf/benchmarks/system_health.py
@@ -49,8 +49,7 @@ def Name(cls): return 'system_health.common_%s' % cls.PLATFORM -@benchmark.Disabled('win10') # crbug.com/657665, crbug.com/653893 -@benchmark.Disabled('mac') # crbug.com/664661 + class DesktopCommonSystemHealth(_CommonSystemHealthBenchmark): """Desktop Chrome Energy System Health Benchmark.""" PLATFORM = 'desktop' @@ -120,8 +119,6 @@ return not _IGNORED_STATS_RE.search(value.name) -@benchmark.Disabled('win') # crbug.com/656040 -@benchmark.Disabled('mac') # crbug.com/663025 class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): """Desktop Chrome Memory System Health Benchmark.""" PLATFORM = 'desktop'