OLD | NEW |
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 "extensions/renderer/guest_view/extensions_guest_view_container.h" | 5 #include "extensions/renderer/guest_view/extensions_guest_view_container.h" |
6 | 6 |
7 #include "content/public/renderer/render_frame.h" | 7 #include "content/public/renderer/render_frame.h" |
8 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" | 8 #include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" |
9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 v8::HandleScope handle_scope(destruction_isolate_); | 24 v8::HandleScope handle_scope(destruction_isolate_); |
25 v8::Local<v8::Function> callback = v8::Local<v8::Function>::New( | 25 v8::Local<v8::Function> callback = v8::Local<v8::Function>::New( |
26 destruction_isolate_, destruction_callback_); | 26 destruction_isolate_, destruction_callback_); |
27 v8::Local<v8::Context> context = callback->CreationContext(); | 27 v8::Local<v8::Context> context = callback->CreationContext(); |
28 if (context.IsEmpty()) | 28 if (context.IsEmpty()) |
29 return; | 29 return; |
30 | 30 |
31 v8::Context::Scope context_scope(context); | 31 v8::Context::Scope context_scope(context); |
32 blink::WebScopedMicrotaskSuppression suppression; | 32 blink::WebScopedMicrotaskSuppression suppression; |
33 | 33 |
34 callback->Call(context->Global(), 0 /* argc */, nullptr); | 34 auto maybe = |
| 35 callback->Call(context, context->Global(), 0 /* argc */, nullptr); |
| 36 DCHECK(!maybe.IsEmpty()); |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 void ExtensionsGuestViewContainer::RegisterDestructionCallback( | 40 void ExtensionsGuestViewContainer::RegisterDestructionCallback( |
39 v8::Local<v8::Function> callback, | 41 v8::Local<v8::Function> callback, |
40 v8::Isolate* isolate) { | 42 v8::Isolate* isolate) { |
41 destruction_callback_.Reset(isolate, callback); | 43 destruction_callback_.Reset(isolate, callback); |
42 destruction_isolate_ = isolate; | 44 destruction_isolate_ = isolate; |
43 } | 45 } |
44 | 46 |
(...skipping 25 matching lines...) Expand all Loading... |
70 return; | 72 return; |
71 | 73 |
72 const int argc = 2; | 74 const int argc = 2; |
73 v8::Local<v8::Value> argv[argc] = { | 75 v8::Local<v8::Value> argv[argc] = { |
74 v8::Integer::New(element_resize_isolate_, new_size.width()), | 76 v8::Integer::New(element_resize_isolate_, new_size.width()), |
75 v8::Integer::New(element_resize_isolate_, new_size.height())}; | 77 v8::Integer::New(element_resize_isolate_, new_size.height())}; |
76 | 78 |
77 v8::Context::Scope context_scope(context); | 79 v8::Context::Scope context_scope(context); |
78 blink::WebScopedMicrotaskSuppression suppression; | 80 blink::WebScopedMicrotaskSuppression suppression; |
79 | 81 |
80 callback->Call(context->Global(), argc, argv); | 82 auto maybe = callback->Call(context, context->Global(), argc, argv); |
| 83 DCHECK(!maybe.IsEmpty()); |
81 } | 84 } |
82 | 85 |
83 } // namespace extensions | 86 } // namespace extensions |
OLD | NEW |