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

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

Issue 9403006: Extensions: run "custom bindings" v8-extensions in content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final comments Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/chrome_v8_context.cc
diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc
index 98b0c077573cf934e0882ad1b7638516bdab2707..3e214f519718cf8d61b58bae04bb317c06bdeadd 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -22,18 +22,30 @@ const char kChromeHidden[] = "chromeHidden";
const char kValidateCallbacks[] = "validateCallbacks";
#endif
-} // namespace
+std::string GetContextTypeDescription(
+ ChromeV8Context::ContextType context_type) {
+ switch (context_type) {
+ case ChromeV8Context::OTHER: return "other";
+ case ChromeV8Context::CONTENT_SCRIPT: return "content script";
+ }
+ NOTREACHED();
+ return "";
+}
+} // namespace
ChromeV8Context::ChromeV8Context(v8::Handle<v8::Context> v8_context,
WebKit::WebFrame* web_frame,
- const std::string& extension_id)
+ const std::string& extension_id,
+ ChromeV8Context::ContextType context_type)
: v8_context_(v8::Persistent<v8::Context>::New(v8_context)),
web_frame_(web_frame),
- extension_id_(extension_id) {
+ extension_id_(extension_id),
+ context_type_(context_type) {
VLOG(1) << "Created context for extension\n"
- << " id: " << extension_id << "\n"
- << " frame: " << web_frame_;
+ << " id: " << extension_id << "\n"
+ << " frame: " << web_frame_ << "\n"
+ << " context type: " << GetContextTypeDescription(context_type);
}
ChromeV8Context::~ChromeV8Context() {
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context.h ('k') | chrome/renderer/extensions/chrome_v8_context_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698