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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1483733002: Remove support for NPObjects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad rebase. Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 } 703 }
704 704
705 void WebLocalFrameImpl::dispatchUnloadEvent() 705 void WebLocalFrameImpl::dispatchUnloadEvent()
706 { 706 {
707 if (!frame()) 707 if (!frame())
708 return; 708 return;
709 SubframeLoadingDisabler disabler(frame()->document()); 709 SubframeLoadingDisabler disabler(frame()->document());
710 frame()->loader().dispatchUnloadEvent(); 710 frame()->loader().dispatchUnloadEvent();
711 } 711 }
712 712
713 NPObject* WebLocalFrameImpl::windowObject() const
714 {
715 if (!frame() || ScriptForbiddenScope::isScriptForbidden())
716 return 0;
717 return frame()->script().windowScriptNPObject();
718 }
719
720 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje ct)
721 {
722 bindToWindowObject(name, object, 0);
723 }
724
725 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje ct, void*)
726 {
727 if (!frame() || !frame()->script().canExecuteScripts(NotAboutToExecuteScript ))
728 return;
729 frame()->script().bindToWindowObject(frame(), String(name), object);
730 }
731
732 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) 713 void WebLocalFrameImpl::executeScript(const WebScriptSource& source)
733 { 714 {
734 ASSERT(frame()); 715 ASSERT(frame());
735 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first()); 716 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first());
736 v8::HandleScope handleScope(toIsolate(frame())); 717 v8::HandleScope handleScope(toIsolate(frame()));
737 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou rce.url, position)); 718 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou rce.url, position));
738 } 719 }
739 720
740 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip tSource* sourcesIn, unsigned numSources, int extensionGroup) 721 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip tSource* sourcesIn, unsigned numSources, int extensionGroup)
741 { 722 {
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 return WebSandboxFlags::None; 2168 return WebSandboxFlags::None;
2188 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2169 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2189 } 2170 }
2190 2171
2191 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2172 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2192 { 2173 {
2193 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2174 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2194 } 2175 }
2195 2176
2196 } // namespace blink 2177 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698