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

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: jeffrey 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
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 12084ffc2fffded9c4d4f434fa7396c3daf2f1c9..2f7c7530c2ef166eb2364208305708bdf259e099 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());
+ v8::Local<v8::Context> current = v8::Context::GetCurrent();
+ return current.IsEmpty() ? NULL : GetByV8Context(current);
+}
+
+ChromeV8Context* ChromeV8ContextSet::GetCalling() const {
+ v8::Local<v8::Context> calling = v8::Context::GetCalling();
+ return calling.IsEmpty() ? NULL : GetByV8Context(calling);
}
ChromeV8Context* ChromeV8ContextSet::GetByV8Context(

Powered by Google App Engine
This is Rietveld 408576698