| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 566 } |
| 567 | 567 |
| 568 void DevToolsUIBindings::IndexPath(int request_id, | 568 void DevToolsUIBindings::IndexPath(int request_id, |
| 569 const std::string& file_system_path) { | 569 const std::string& file_system_path) { |
| 570 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 570 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 571 CHECK(web_contents_->GetURL().SchemeIs(content::kChromeDevToolsScheme)); | 571 CHECK(web_contents_->GetURL().SchemeIs(content::kChromeDevToolsScheme)); |
| 572 if (!file_helper_->IsFileSystemAdded(file_system_path)) { | 572 if (!file_helper_->IsFileSystemAdded(file_system_path)) { |
| 573 IndexingDone(request_id, file_system_path); | 573 IndexingDone(request_id, file_system_path); |
| 574 return; | 574 return; |
| 575 } | 575 } |
| 576 if (indexing_jobs_.count(request_id) != 0) |
| 577 return; |
| 576 indexing_jobs_[request_id] = | 578 indexing_jobs_[request_id] = |
| 577 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob>( | 579 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob>( |
| 578 file_system_indexer_->IndexPath( | 580 file_system_indexer_->IndexPath( |
| 579 file_system_path, | 581 file_system_path, |
| 580 Bind(&DevToolsUIBindings::IndexingTotalWorkCalculated, | 582 Bind(&DevToolsUIBindings::IndexingTotalWorkCalculated, |
| 581 weak_factory_.GetWeakPtr(), | 583 weak_factory_.GetWeakPtr(), |
| 582 request_id, | 584 request_id, |
| 583 file_system_path), | 585 file_system_path), |
| 584 Bind(&DevToolsUIBindings::IndexingWorked, | 586 Bind(&DevToolsUIBindings::IndexingWorked, |
| 585 weak_factory_.GetWeakPtr(), | 587 weak_factory_.GetWeakPtr(), |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 if (frontend_loaded_) | 906 if (frontend_loaded_) |
| 905 return; | 907 return; |
| 906 frontend_loaded_ = true; | 908 frontend_loaded_ = true; |
| 907 | 909 |
| 908 // Call delegate first - it seeds importants bit of information. | 910 // Call delegate first - it seeds importants bit of information. |
| 909 delegate_->OnLoadCompleted(); | 911 delegate_->OnLoadCompleted(); |
| 910 | 912 |
| 911 UpdateTheme(); | 913 UpdateTheme(); |
| 912 AddDevToolsExtensionsToClient(); | 914 AddDevToolsExtensionsToClient(); |
| 913 } | 915 } |
| OLD | NEW |