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

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

Issue 538933002: ScriptState::contextIsEmpty shouldn't return true for a context whose global object is detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 v8::Local<v8::Object> WebPluginContainerImpl::v8ObjectForElement() 425 v8::Local<v8::Object> WebPluginContainerImpl::v8ObjectForElement()
426 { 426 {
427 LocalFrame* frame = m_element->document().frame(); 427 LocalFrame* frame = m_element->document().frame();
428 if (!frame) 428 if (!frame)
429 return v8::Local<v8::Object>(); 429 return v8::Local<v8::Object>();
430 430
431 if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) 431 if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
432 return v8::Local<v8::Object>(); 432 return v8::Local<v8::Object>();
433 433
434 ScriptState* scriptState = ScriptState::forMainWorld(frame); 434 ScriptState* scriptState = ScriptState::forMainWorld(frame);
435 if (scriptState->contextIsEmpty()) 435 if (scriptState->contextIsValue())
436 return v8::Local<v8::Object>(); 436 return v8::Local<v8::Object>();
437 437
438 v8::Handle<v8::Value> v8value = toV8(m_element, scriptState->context()->Glob al(), scriptState->isolate()); 438 v8::Handle<v8::Value> v8value = toV8(m_element, scriptState->context()->Glob al(), scriptState->isolate());
439 ASSERT(v8value->IsObject()); 439 ASSERT(v8value->IsObject());
440 440
441 return v8::Handle<v8::Object>::Cast(v8value); 441 return v8::Handle<v8::Object>::Cast(v8value);
442 } 442 }
443 443
444 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup sAllowed) 444 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup sAllowed)
445 { 445 {
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 954
955 return clipRect; 955 return clipRect;
956 } 956 }
957 957
958 bool WebPluginContainerImpl::pluginShouldPersist() const 958 bool WebPluginContainerImpl::pluginShouldPersist() const
959 { 959 {
960 return m_webPlugin->shouldPersist(); 960 return m_webPlugin->shouldPersist();
961 } 961 }
962 962
963 } // namespace blink 963 } // namespace blink
OLDNEW
« Source/bindings/core/v8/ScriptState.h ('K') | « Source/core/inspector/PageRuntimeAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698