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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 23923003: Expand RuntimeErrors for ErrorConsole (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyright fix Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/event_router.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index bd439288bb516a74e933d5a50b9d3a7bd87ca7eb..3fac6b03fb13d7d75b5526a77a2ff2558802fe6a 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -580,15 +580,20 @@ void ExtensionHost::OnDetailedConsoleMessageAdded(
const StackTrace& stack_trace,
int32 severity_level) {
if (IsSourceFromAnExtension(source)) {
+ GURL context_url;
+ if (associated_web_contents_)
+ context_url = associated_web_contents_->GetLastCommittedURL();
+ else if (host_contents_.get())
+ context_url = host_contents_->GetLastCommittedURL();
+
ErrorConsole::Get(profile_)->ReportError(
scoped_ptr<ExtensionError>(new RuntimeError(
+ extension_id_,
profile_->IsOffTheRecord(),
source,
message,
stack_trace,
- associated_web_contents_ ?
- associated_web_contents_->GetLastCommittedURL() :
- GURL::EmptyGURL(),
+ context_url,
static_cast<logging::LogSeverity>(severity_level))));
}
}
« no previous file with comments | « chrome/browser/extensions/event_router.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698