Index: content/shell/renderer/test_runner/unsafe_persistent.h |
diff --git a/chrome/renderer/extensions/unsafe_persistent.h b/content/shell/renderer/test_runner/unsafe_persistent.h |
similarity index 72% |
copy from chrome/renderer/extensions/unsafe_persistent.h |
copy to content/shell/renderer/test_runner/unsafe_persistent.h |
index f8fa9bbd42acfa9a57eb531dbb17c4b37ce49c38..112e1fd9e1647d2200e2de4f5601fc7cc4994a5a 100644 |
--- a/chrome/renderer/extensions/unsafe_persistent.h |
+++ b/content/shell/renderer/test_runner/unsafe_persistent.h |
@@ -1,13 +1,13 @@ |
-// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_RENDERER_EXTENSIONS_UNSAFE_PERSISTENT_H_ |
-#define CHROME_RENDERER_EXTENSIONS_UNSAFE_PERSISTENT_H_ |
+#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_ |
+#define CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_ |
#include "v8/include/v8.h" |
-namespace extensions { |
+namespace content { |
// An unsafe way to pass Persistent handles around. Do not use unless you know |
// what you're doing. UnsafePersistent is only safe to use when we know that the |
@@ -27,9 +27,17 @@ template<typename T> class UnsafePersistent { |
value_ = persistent.ClearAndLeak(); |
} |
+ T* Value() const { |
+ return value_; |
+ } |
+ |
+ T* operator ->() const { |
kouhei (in TOK)
2014/02/27 05:50:54
no space between operator and ->
hajimehoshi
2014/02/27 07:33:07
Done (Removed).
|
+ return value_; |
+ } |
+ |
// Usage of this function requires |
// V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR to be defined |
- void dispose() { |
+ void Dispose() { |
v8::Persistent<T> handle(value_); |
handle.Reset(); |
value_ = 0; |
@@ -37,7 +45,7 @@ template<typename T> class UnsafePersistent { |
// Usage of this function requires |
// V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR to be defined |
- v8::Local<T> newLocal(v8::Isolate* isolate) { |
+ v8::Local<T> NewLocal(v8::Isolate* isolate) { |
return v8::Local<T>::New(isolate, v8::Local<T>(value_)); |
} |
@@ -45,6 +53,6 @@ template<typename T> class UnsafePersistent { |
T* value_; |
}; |
-} // namespace extensions |
+} // namespace content |
-#endif // CHROME_RENDERER_EXTENSIONS_UNSAFE_PERSISTENT_H_ |
+#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_ |