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

Unified Diff: content/renderer/skia_benchmarking_extension.cc

Issue 611483002: Fix for crash when attaching a frame in WebUI renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: As suggested, factored out the solution and used in other extensions. Created 6 years, 3 months 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 | « content/renderer/memory_benchmarking_extension.cc ('k') | content/renderer/web_ui_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « content/renderer/memory_benchmarking_extension.cc ('k') | content/renderer/web_ui_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698