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

Side by Side Diff: Source/web/WebPluginContainerImpl.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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
« no previous file with comments | « Source/web/WebDevToolsFrontendImpl.cpp ('k') | 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 return v8::Local<v8::Object>(); 456 return v8::Local<v8::Object>();
457 457
458 if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) 458 if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
459 return v8::Local<v8::Object>(); 459 return v8::Local<v8::Object>();
460 460
461 ScriptState* scriptState = ScriptState::forMainWorld(frame); 461 ScriptState* scriptState = ScriptState::forMainWorld(frame);
462 if (!scriptState->contextIsValid()) 462 if (!scriptState->contextIsValid())
463 return v8::Local<v8::Object>(); 463 return v8::Local<v8::Object>();
464 464
465 v8::Local<v8::Value> v8value = toV8(m_element.get(), scriptState->context()- >Global(), scriptState->isolate()); 465 v8::Local<v8::Value> v8value = toV8(m_element.get(), scriptState->context()- >Global(), scriptState->isolate());
466 if (v8value.IsEmpty())
467 return v8::Local<v8::Object>();
466 ASSERT(v8value->IsObject()); 468 ASSERT(v8value->IsObject());
467 469
468 return v8::Local<v8::Object>::Cast(v8value); 470 return v8::Local<v8::Object>::Cast(v8value);
469 } 471 }
470 472
471 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup sAllowed) 473 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup sAllowed)
472 { 474 {
473 LocalFrame* frame = m_element->document().frame(); 475 LocalFrame* frame = m_element->document().frame();
474 if (!frame) 476 if (!frame)
475 return WebString(); 477 return WebString();
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 for (size_t i = 0; i < cutOutRects.size(); i++) 1016 for (size_t i = 0; i < cutOutRects.size(); i++)
1015 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 1017 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
1016 } 1018 }
1017 1019
1018 bool WebPluginContainerImpl::pluginShouldPersist() const 1020 bool WebPluginContainerImpl::pluginShouldPersist() const
1019 { 1021 {
1020 return m_webPlugin->shouldPersist(); 1022 return m_webPlugin->shouldPersist();
1021 } 1023 }
1022 1024
1023 } // namespace blink 1025 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebDevToolsFrontendImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698