Index: content/renderer/memory_benchmarking_extension.cc |
diff --git a/content/renderer/memory_benchmarking_extension.cc b/content/renderer/memory_benchmarking_extension.cc |
index f6b9c7df375faeafedd419bb35deb8c3ded3848b..0f5320daa06084b5dcd37f0aa0469750a3070cd7 100644 |
--- a/content/renderer/memory_benchmarking_extension.cc |
+++ b/content/renderer/memory_benchmarking_extension.cc |
@@ -5,6 +5,7 @@ |
#include "content/renderer/memory_benchmarking_extension.h" |
#include "content/common/memory_benchmark_messages.h" |
+#include "content/renderer/chrome_object_extensions_utils.h" |
#include "content/renderer/render_thread_impl.h" |
#include "gin/arguments.h" |
#include "gin/handle.h" |
@@ -35,13 +36,8 @@ void MemoryBenchmarkingExtension::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, "memoryBenchmarking"), |
controller.ToV8()); |
} |