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

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

Issue 16032015: Extensions: pass ChromeV8Context around instead of v8::Handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (kalman) Created 7 years, 7 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/content_watcher.cc
diff --git a/chrome/renderer/extensions/content_watcher.cc b/chrome/renderer/extensions/content_watcher.cc
index 3176fdd0cf7dfac7a65aee9825988953358de025..505d1e88f9c6aefc8d2aefa7ab25ea02157bc362 100644
--- a/chrome/renderer/extensions/content_watcher.cc
+++ b/chrome/renderer/extensions/content_watcher.cc
@@ -20,9 +20,9 @@ namespace {
class MutationHandler : public ChromeV8Extension {
public:
explicit MutationHandler(Dispatcher* dispatcher,
- v8::Handle<v8::Context> v8_context,
+ ChromeV8Context* context,
base::WeakPtr<ContentWatcher> content_watcher)
- : ChromeV8Extension(dispatcher, v8_context),
+ : ChromeV8Extension(dispatcher, context),
content_watcher_(content_watcher) {
RouteFunction("FrameMutated",
base::Bind(&MutationHandler::FrameMutated,
@@ -33,7 +33,7 @@ class MutationHandler : public ChromeV8Extension {
v8::Handle<v8::Value> FrameMutated(const v8::Arguments& args) {
if (content_watcher_) {
content_watcher_->ScanAndNotify(
- WebKit::WebFrame::frameForContext(v8_context()));
+ WebKit::WebFrame::frameForContext(context()->v8_context()));
not at google - send to devlin 2013/05/29 17:41:55 I am curious: how will this work in a world where
marja 2013/05/31 10:06:44 Yeah, we need a HandleScope whenever we're dealing
}
return v8::Undefined();
}
@@ -49,9 +49,9 @@ ContentWatcher::ContentWatcher(Dispatcher* dispatcher)
ContentWatcher::~ContentWatcher() {}
scoped_ptr<NativeHandler> ContentWatcher::MakeNatives(
- v8::Handle<v8::Context> v8_context) {
+ ChromeV8Context* context) {
return scoped_ptr<NativeHandler>(new MutationHandler(
- dispatcher_, v8_context, weak_ptr_factory_.GetWeakPtr()));
+ dispatcher_, context, weak_ptr_factory_.GetWeakPtr()));
}
void ContentWatcher::OnWatchPages(

Powered by Google App Engine
This is Rietveld 408576698