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

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 951953002: [DevTools] Check request_id in DevToolsUIBindings::IndexPath (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | 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 // 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698