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

Unified Diff: chrome/renderer/extensions/chrome_v8_context_set.cc

Issue 17104003: Improvements to fatal JavaScript extension errors: (1) include the extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: channel restriction Created 7 years, 6 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/renderer/extensions/chrome_v8_context_set.h ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/chrome_v8_context_set.cc
diff --git a/chrome/renderer/extensions/chrome_v8_context_set.cc b/chrome/renderer/extensions/chrome_v8_context_set.cc
index fa7d34b05202711aaefa06a6a559c5e76e0086fa..b9eb58005d2ef83018abbd0ed6ae5eb19a4b7582 100644
--- a/chrome/renderer/extensions/chrome_v8_context_set.cc
+++ b/chrome/renderer/extensions/chrome_v8_context_set.cc
@@ -60,10 +60,13 @@ ChromeV8ContextSet::ContextSet ChromeV8ContextSet::GetAll() const {
}
ChromeV8Context* ChromeV8ContextSet::GetCurrent() const {
- if (!v8::Context::InContext())
- return NULL;
- else
- return GetByV8Context(v8::Context::GetCurrent());
+ return v8::Context::InContext() ?
+ GetByV8Context(v8::Context::GetCurrent()) : NULL;
+}
+
+ChromeV8Context* ChromeV8ContextSet::GetCalling() const {
+ v8::Local<v8::Context> calling = v8::Context::GetCalling();
+ return calling.IsEmpty() ? NULL : GetByV8Context(calling);
}
ChromeV8Context* ChromeV8ContextSet::GetByV8Context(
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context_set.h ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698