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

Side by Side Diff: chrome/browser/dom_ui/bug_report_ui.cc

Issue 3405037: Fixed user feedback crash on parameter check (std exception was thrown).... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/dom_ui/bug_report_ui.h" 5 #include "chrome/browser/dom_ui/bug_report_ui.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } 447 }
448 448
449 base::StringPiece BugReportHandler::Init() { 449 base::StringPiece BugReportHandler::Init() {
450 std::string page_url; 450 std::string page_url;
451 if (tab_->controller().GetActiveEntry()) { 451 if (tab_->controller().GetActiveEntry()) {
452 page_url = tab_->controller().GetActiveEntry()->url().spec(); 452 page_url = tab_->controller().GetActiveEntry()->url().spec();
453 } 453 }
454 454
455 std::string params = page_url.substr(strlen(chrome::kChromeUIBugReportURL)); 455 std::string params = page_url.substr(strlen(chrome::kChromeUIBugReportURL));
456 // Erase the # - the first character. 456 // Erase the # - the first character.
457 params.erase(params.begin(),params.begin() + 1); 457 if (params.length())
458 params.erase(params.begin(),params.begin() + 1);
458 459
459 int index = 0; 460 int index = 0;
460 if (!base::StringToInt(params, &index)) { 461 if (!base::StringToInt(params, &index)) {
461 return base::StringPiece( 462 return base::StringPiece(
462 ResourceBundle::GetSharedInstance().GetRawDataResource( 463 ResourceBundle::GetSharedInstance().GetRawDataResource(
463 IDR_BUGREPORT_HTML_INVALID)); 464 IDR_BUGREPORT_HTML_INVALID));
464 } 465 }
465 466
466 Browser* browser = BrowserList::GetLastActive(); 467 Browser* browser = BrowserList::GetLastActive();
467 // Sanity checks. 468 // Sanity checks.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 BugReportUIHTMLSource* html_source = 689 BugReportUIHTMLSource* html_source =
689 new BugReportUIHTMLSource(handler->Init()); 690 new BugReportUIHTMLSource(handler->Init());
690 // Set up the chrome://bugreport/ source. 691 // Set up the chrome://bugreport/ source.
691 ChromeThread::PostTask( 692 ChromeThread::PostTask(
692 ChromeThread::IO, FROM_HERE, 693 ChromeThread::IO, FROM_HERE,
693 NewRunnableMethod( 694 NewRunnableMethod(
694 Singleton<ChromeURLDataManager>::get(), 695 Singleton<ChromeURLDataManager>::get(),
695 &ChromeURLDataManager::AddDataSource, 696 &ChromeURLDataManager::AddDataSource,
696 make_scoped_refptr(html_source))); 697 make_scoped_refptr(html_source)));
697 } 698 }
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