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

Side by Side Diff: components/plugins/renderer/webview_plugin.cc

Issue 2778393002: Add DCHECK to WebViewPlugin helper to assert WebFrameClient params. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698