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

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

Issue 10698163: Make miscellaneous_bindings.js not depend on onLoad(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 6772a6f6b142397e30d99ed90e87726d42693eec..a8477ab37b56ed0343ab087c6d9f7b56ce20025d 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -29,18 +29,6 @@ const char kValidateCallbacks[] = "validateCallbacks";
const char kValidateAPI[] = "validateAPI";
#endif
-std::string GetContextTypeDescription(Feature::Context context_type) {
- switch (context_type) {
- case Feature::UNSPECIFIED_CONTEXT: return "UNSPECIFIED";
- case Feature::BLESSED_EXTENSION_CONTEXT: return "BLESSED_EXTENSION";
- case Feature::UNBLESSED_EXTENSION_CONTEXT: return "UNBLESSED_EXTENSION";
- case Feature::CONTENT_SCRIPT_CONTEXT: return "CONTENT_SCRIPT";
- case Feature::WEB_PAGE_CONTEXT: return "WEB_PAGE";
- }
- NOTREACHED();
- return "";
-}
-
} // namespace
ChromeV8Context::ChromeV8Context(v8::Handle<v8::Context> v8_context,
@@ -54,7 +42,8 @@ ChromeV8Context::ChromeV8Context(v8::Handle<v8::Context> v8_context,
VLOG(1) << "Created context:\n"
<< " extension id: " << GetExtensionID() << "\n"
<< " frame: " << web_frame_ << "\n"
- << " context type: " << GetContextTypeDescription(context_type);
+ << " context type: "
+ << GetContextTypeDescription();
not at google - send to devlin 2012/07/12 05:47:41 Doesn't fit on 1 line?
koz (OOO until 15th September) 2012/07/12 06:06:12 Done.
}
ChromeV8Context::~ChromeV8Context() {
@@ -169,7 +158,7 @@ void ChromeV8Context::DispatchOnLoadEvent(bool is_incognito_process,
v8::HandleScope handle_scope;
v8::Handle<v8::Value> argv[] = {
v8::String::New(GetExtensionID().c_str()),
- v8::String::New(GetContextTypeDescription(context_type_).c_str()),
+ v8::String::New(GetContextTypeDescription().c_str()),
v8::Boolean::New(is_incognito_process),
v8::Integer::New(manifest_version),
};
@@ -180,3 +169,15 @@ void ChromeV8Context::DispatchOnUnloadEvent() {
v8::HandleScope handle_scope;
CallChromeHiddenMethod("dispatchOnUnload", 0, NULL, NULL);
}
+
+std::string ChromeV8Context::GetContextTypeDescription() {
+ switch (context_type_) {
+ case Feature::UNSPECIFIED_CONTEXT: return "UNSPECIFIED";
+ case Feature::BLESSED_EXTENSION_CONTEXT: return "BLESSED_EXTENSION";
+ case Feature::UNBLESSED_EXTENSION_CONTEXT: return "UNBLESSED_EXTENSION";
+ case Feature::CONTENT_SCRIPT_CONTEXT: return "CONTENT_SCRIPT";
+ case Feature::WEB_PAGE_CONTEXT: return "WEB_PAGE";
+ }
+ NOTREACHED();
+ return "";
+}

Powered by Google App Engine
This is Rietveld 408576698