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

Side by Side Diff: content/shell/renderer/layout_test/gc_controller.cc

Issue 1113783002: Use Local instead of Handle in src/content/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/layout_test/gc_controller.h" 5 #include "content/shell/renderer/layout_test/gc_controller.h"
6 6
7 #include "gin/arguments.h" 7 #include "gin/arguments.h"
8 #include "gin/handle.h" 8 #include "gin/handle.h"
9 #include "gin/object_template_builder.h" 9 #include "gin/object_template_builder.h"
10 #include "third_party/WebKit/public/web/WebFrame.h" 10 #include "third_party/WebKit/public/web/WebFrame.h"
11 #include "third_party/WebKit/public/web/WebKit.h" 11 #include "third_party/WebKit/public/web/WebKit.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 gin::WrapperInfo GCController::kWrapperInfo = {gin::kEmbedderNativeGin}; 16 gin::WrapperInfo GCController::kWrapperInfo = {gin::kEmbedderNativeGin};
17 17
18 // static 18 // static
19 void GCController::Install(blink::WebFrame* frame) { 19 void GCController::Install(blink::WebFrame* frame) {
20 v8::Isolate* isolate = blink::mainThreadIsolate(); 20 v8::Isolate* isolate = blink::mainThreadIsolate();
21 v8::HandleScope handle_scope(isolate); 21 v8::HandleScope handle_scope(isolate);
22 v8::Handle<v8::Context> context = frame->mainWorldScriptContext(); 22 v8::Local<v8::Context> context = frame->mainWorldScriptContext();
23 if (context.IsEmpty()) 23 if (context.IsEmpty())
24 return; 24 return;
25 25
26 v8::Context::Scope context_scope(context); 26 v8::Context::Scope context_scope(context);
27 27
28 gin::Handle<GCController> controller = 28 gin::Handle<GCController> controller =
29 gin::CreateHandle(isolate, new GCController()); 29 gin::CreateHandle(isolate, new GCController());
30 if (controller.IsEmpty()) 30 if (controller.IsEmpty())
31 return; 31 return;
32 v8::Handle<v8::Object> global = context->Global(); 32 v8::Local<v8::Object> global = context->Global();
33 global->Set(gin::StringToV8(isolate, "GCController"), controller.ToV8()); 33 global->Set(gin::StringToV8(isolate, "GCController"), controller.ToV8());
34 } 34 }
35 35
36 GCController::GCController() {} 36 GCController::GCController() {}
37 37
38 GCController::~GCController() {} 38 GCController::~GCController() {}
39 39
40 gin::ObjectTemplateBuilder GCController::GetObjectTemplateBuilder( 40 gin::ObjectTemplateBuilder GCController::GetObjectTemplateBuilder(
41 v8::Isolate* isolate) { 41 v8::Isolate* isolate) {
42 return gin::Wrappable<GCController>::GetObjectTemplateBuilder(isolate) 42 return gin::Wrappable<GCController>::GetObjectTemplateBuilder(isolate)
(...skipping 20 matching lines...) Expand all
63 v8::Isolate::kFullGarbageCollection); 63 v8::Isolate::kFullGarbageCollection);
64 } 64 }
65 } 65 }
66 66
67 void GCController::MinorCollect(const gin::Arguments& args) { 67 void GCController::MinorCollect(const gin::Arguments& args) {
68 args.isolate()->RequestGarbageCollectionForTesting( 68 args.isolate()->RequestGarbageCollectionForTesting(
69 v8::Isolate::kMinorGarbageCollection); 69 v8::Isolate::kMinorGarbageCollection);
70 } 70 }
71 71
72 } // namespace content 72 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/binding_helpers.h ('k') | content/shell/renderer/test_runner/accessibility_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698