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

Unified Diff: gin/runner.h

Issue 74753002: Introduce gin_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: gin/runner.h
diff --git a/gin/runner.h b/gin/runner.h
index 3e999e1fe7558637548999e164400878da2c72d7..9396207e8a666b017215283923e6e757473134dd 100644
--- a/gin/runner.h
+++ b/gin/runner.h
@@ -6,11 +6,13 @@
#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 +21,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 +39,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 +60,8 @@ class Runner : public ContextHolder {
RunnerDelegate* delegate_;
+ base::WeakPtrFactory<Runner> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Runner);
};
« gin/gin.gyp ('K') | « gin/modules/module_runner_delegate.cc ('k') | gin/runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698