Index: content/renderer/skia_benchmarking_extension.cc |
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc |
index 6d29155b141d0e1ac4c4a039115110c34457d2a8..ab565a650d2dce29b9e25b5c224180a0a69d456e 100644 |
--- a/content/renderer/skia_benchmarking_extension.cc |
+++ b/content/renderer/skia_benchmarking_extension.cc |
@@ -10,6 +10,7 @@ |
#include "cc/base/math_util.h" |
#include "cc/resources/picture.h" |
#include "content/public/renderer/v8_value_converter.h" |
+#include "content/renderer/chrome_object_extensions_utils.h" |
#include "content/renderer/render_thread_impl.h" |
#include "gin/arguments.h" |
#include "gin/handle.h" |
@@ -77,13 +78,8 @@ void SkiaBenchmarking::Install(blink::WebFrame* frame) { |
if (controller.IsEmpty()) |
return; |
- v8::Handle<v8::Object> global = context->Global(); |
- v8::Handle<v8::Object> chrome = |
- global->Get(gin::StringToV8(isolate, "chrome"))->ToObject(); |
- if (chrome.IsEmpty()) { |
- chrome = v8::Object::New(isolate); |
- global->Set(gin::StringToV8(isolate, "chrome"), chrome); |
- } |
+ v8::Handle<v8::Object> chrome = GetOrCreateChromeObject(isolate, |
+ context->Global()); |
chrome->Set(gin::StringToV8(isolate, "skiaBenchmarking"), controller.ToV8()); |
} |