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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesSearchScope.js

Issue 2564733002: DevTools: [Search] do not search inside binary files. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/search/search-ignore-binary-files-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 * @param {!Workspace.Project} project 132 * @param {!Workspace.Project} project
133 * @param {!Workspace.ProjectSearchConfig} searchConfig 133 * @param {!Workspace.ProjectSearchConfig} searchConfig
134 * @param {boolean=} dirtyOnly 134 * @param {boolean=} dirtyOnly
135 * @return {!Array.<string>} 135 * @return {!Array.<string>}
136 */ 136 */
137 _projectFilesMatchingFileQuery(project, searchConfig, dirtyOnly) { 137 _projectFilesMatchingFileQuery(project, searchConfig, dirtyOnly) {
138 var result = []; 138 var result = [];
139 var uiSourceCodes = project.uiSourceCodes(); 139 var uiSourceCodes = project.uiSourceCodes();
140 for (var i = 0; i < uiSourceCodes.length; ++i) { 140 for (var i = 0; i < uiSourceCodes.length; ++i) {
141 var uiSourceCode = uiSourceCodes[i]; 141 var uiSourceCode = uiSourceCodes[i];
142 if (!uiSourceCode.contentType().isTextType())
143 continue;
142 var binding = Persistence.persistence.binding(uiSourceCode); 144 var binding = Persistence.persistence.binding(uiSourceCode);
143 if (binding && binding.network === uiSourceCode) 145 if (binding && binding.network === uiSourceCode)
144 continue; 146 continue;
145 if (dirtyOnly && !uiSourceCode.isDirty()) 147 if (dirtyOnly && !uiSourceCode.isDirty())
146 continue; 148 continue;
147 if (this._searchConfig.filePathMatchesFileQuery(uiSourceCode.fullDisplayNa me())) 149 if (this._searchConfig.filePathMatchesFileQuery(uiSourceCode.fullDisplayNa me()))
148 result.push(uiSourceCode.url()); 150 result.push(uiSourceCode.url());
149 } 151 }
150 result.sort(String.naturalOrderComparator); 152 result.sort(String.naturalOrderComparator);
151 return result; 153 return result;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 294
293 /** 295 /**
294 * @override 296 * @override
295 * @param {!Workspace.ProjectSearchConfig} searchConfig 297 * @param {!Workspace.ProjectSearchConfig} searchConfig
296 * @return {!Sources.FileBasedSearchResultsPane} 298 * @return {!Sources.FileBasedSearchResultsPane}
297 */ 299 */
298 createSearchResultsPane(searchConfig) { 300 createSearchResultsPane(searchConfig) {
299 return new Sources.FileBasedSearchResultsPane(searchConfig); 301 return new Sources.FileBasedSearchResultsPane(searchConfig);
300 } 302 }
301 }; 303 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/search/search-ignore-binary-files-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698