OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/plugins/renderer/webview_plugin.h" | 5 #include "components/plugins/renderer/webview_plugin.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 return; | 310 return; |
311 if (plugin_->container_) { | 311 if (plugin_->container_) { |
312 // This should never happen; see also crbug.com/545039 for context. | 312 // This should never happen; see also crbug.com/545039 for context. |
313 DCHECK(!plugin_->is_painting_); | 313 DCHECK(!plugin_->is_painting_); |
314 plugin_->container_->scheduleAnimation(); | 314 plugin_->container_->scheduleAnimation(); |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 void WebViewPlugin::WebViewHelper::didClearWindowObject( | 318 void WebViewPlugin::WebViewHelper::didClearWindowObject( |
319 WebLocalFrame* frame) { | 319 WebLocalFrame* frame) { |
| 320 DCHECK_EQ(frame, web_view_->mainFrame()); |
320 if (!plugin_->delegate_) | 321 if (!plugin_->delegate_) |
321 return; | 322 return; |
322 | 323 |
323 v8::Isolate* isolate = blink::mainThreadIsolate(); | 324 v8::Isolate* isolate = blink::mainThreadIsolate(); |
324 v8::HandleScope handle_scope(isolate); | 325 v8::HandleScope handle_scope(isolate); |
325 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); | 326 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); |
326 DCHECK(!context.IsEmpty()); | 327 DCHECK(!context.IsEmpty()); |
327 | 328 |
328 v8::Context::Scope context_scope(context); | 329 v8::Context::Scope context_scope(context); |
329 v8::Local<v8::Object> global = context->Global(); | 330 v8::Local<v8::Object> global = context->Global(); |
(...skipping 16 matching lines...) Expand all Loading... |
346 if (!delegate_) | 347 if (!delegate_) |
347 return; | 348 return; |
348 | 349 |
349 // The delegate may instantiate a new plugin. | 350 // The delegate may instantiate a new plugin. |
350 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect)); | 351 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect)); |
351 // The delegate may have dirtied style and layout of the WebView. | 352 // The delegate may have dirtied style and layout of the WebView. |
352 // See for example the resizePoster function in plugin_poster.html. | 353 // See for example the resizePoster function in plugin_poster.html. |
353 // Run the lifecycle now so that it is clean. | 354 // Run the lifecycle now so that it is clean. |
354 web_view()->updateAllLifecyclePhases(); | 355 web_view()->updateAllLifecyclePhases(); |
355 } | 356 } |
OLD | NEW |