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

Unified Diff: gin/runner.h

Issue 74753002: Introduce gin_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more header nits Created 7 years, 1 month 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 | « gin/per_context_data.cc ('k') | gin/runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/runner.h
diff --git a/gin/runner.h b/gin/runner.h
index 3e999e1fe7558637548999e164400878da2c72d7..fa412598baee710a168ace9a067cbce0ec42333d 100644
--- a/gin/runner.h
+++ b/gin/runner.h
@@ -6,11 +6,14 @@
#define GIN_RUNNER_H_
#include <string>
+
+#include "base/memory/weak_ptr.h"
#include "gin/context_holder.h"
namespace gin {
class Runner;
+class TryCatch;
class RunnerDelegate {
public:
@@ -19,8 +22,10 @@ class RunnerDelegate {
// Returns the template for the global object.
virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate(Runner* runner);
-
virtual void DidCreateContext(Runner* runner);
+ virtual void WillRunScript(Runner* runner, v8::Handle<v8::Script> script);
+ virtual void DidRunScript(Runner* runner, v8::Handle<v8::Script> script);
+ virtual void UnhandledException(Runner* runner, TryCatch& try_catch);
};
class Runner : public ContextHolder {
@@ -35,6 +40,10 @@ class Runner : public ContextHolder {
return context()->Global();
}
+ base::WeakPtr<Runner> GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+ }
+
class Scope {
public:
explicit Scope(Runner* runner);
@@ -52,6 +61,8 @@ class Runner : public ContextHolder {
RunnerDelegate* delegate_;
+ base::WeakPtrFactory<Runner> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Runner);
};
« no previous file with comments | « gin/per_context_data.cc ('k') | gin/runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698