diff options
author | Steve Block <steveblock@google.com> | 2009-11-05 09:23:40 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-11-10 22:41:12 +0000 |
commit | cac0f67c402d107cdb10971b95719e2ff9c7c76b (patch) | |
tree | d182c7f87211c6f201a5f038e332336493ebdbe7 /WebKit/mac/Plugins/Hosted | |
parent | 4b2ef0f288e7c6c4602f621b7a0e9feed304b70e (diff) | |
download | external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.zip external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.gz external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.bz2 |
Merge webkit.org at r50258 : Initial merge by git.
Change-Id: I1a9e1dc4ed654b69174ad52a4f031a07240f37b0
Diffstat (limited to 'WebKit/mac/Plugins/Hosted')
8 files changed, 49 insertions, 28 deletions
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h index a1d9bad..9e29062 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h @@ -43,7 +43,7 @@ class NetscapePluginHostManager { public: static NetscapePluginHostManager& shared(); - PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame); + PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled); void pluginHostDied(NetscapePluginHostProxy*); diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm index 4aa290a..6b36a6d 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm @@ -211,7 +211,7 @@ void NetscapePluginHostManager::pluginHostDied(NetscapePluginHostProxy* pluginHo } } -PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame) +PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled) { NetscapePluginHostProxy* hostProxy = hostForPackage(pluginPackage); if (!hostProxy) @@ -235,6 +235,7 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl [properties.get() setObject:[sourceURL absoluteString] forKey:@"sourceURL"]; [properties.get() setObject:[NSNumber numberWithBool:fullFrame] forKey:@"fullFrame"]; + [properties.get() setObject:[NSNumber numberWithBool:isPrivateBrowsingEnabled] forKey:@"privateBrowsingEnabled"]; NSData *data = [NSPropertyListSerialization dataFromPropertyList:properties.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil]; ASSERT(data); diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm index e8874cd..970f5f5 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm @@ -187,7 +187,8 @@ NetscapePluginInstanceProxy* NetscapePluginHostProxy::pluginInstance(uint32_t pl void NetscapePluginHostProxy::deadNameNotificationCallback(CFMachPortRef port, void *msg, CFIndex size, void *info) { - ASSERT(msg && static_cast<mach_msg_header_t*>(msg)->msgh_id == MACH_NOTIFY_DEAD_NAME); + ASSERT(msg); + ASSERT(static_cast<mach_msg_header_t*>(msg)->msgh_id == MACH_NOTIFY_DEAD_NAME); static_cast<NetscapePluginHostProxy*>(info)->pluginHostDied(); } diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 280f161..c950ab7 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -163,6 +163,7 @@ public: void resolveURL(const char* url, const char* target, data_t& resolvedURLData, mach_msg_type_number_t& resolvedURLLength); void didDraw(); + void privateBrowsingModeDidChange(bool isPrivateBrowsingEnabled); // Reply structs struct Reply { diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index 21f35e2..4ae0220 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -575,9 +575,10 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch return NPERR_INVALID_URL; // Don't allow requests to be loaded when the document loader is stopping all loaders. - if ([[m_pluginView dataSource] _documentLoader]->isStopping()) + DocumentLoader* documentLoader = [[m_pluginView dataSource] _documentLoader]; + if (!documentLoader || documentLoader->isStopping()) return NPERR_GENERIC_ERROR; - + NSString *target = nil; if (cTarget) { // Find the frame given the target string. @@ -587,7 +588,7 @@ NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const ch // don't let a plugin start any loads if it is no longer part of a document that is being // displayed unless the loads are in the same frame as the plugin. - if ([[m_pluginView dataSource] _documentLoader] != core([m_pluginView webFrame])->loader()->activeDocumentLoader() && + if (documentLoader != core([m_pluginView webFrame])->loader()->activeDocumentLoader() && (!cTarget || [frame findFrameNamed:target] != frame)) { return NPERR_GENERIC_ERROR; } @@ -665,7 +666,7 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID) if (!frame->script()->isEnabled()) objectID = 0; else - objectID = idForObject(frame->script()->windowShell()->window()); + objectID = idForObject(frame->script()->windowShell(pluginWorld())->window()); return true; } @@ -703,7 +704,7 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri JSLock lock(SilenceAssertionsOnly); - ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(); + ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld()); ExecState* exec = globalObject->globalExec(); bool oldAllowPopups = frame->script()->allowPopupsFromPlugin(); @@ -744,7 +745,7 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue function = object->get(exec, methodName); CallData callData; @@ -755,7 +756,7 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); - ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(); + ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld()); globalObject->globalData()->timeoutChecker.start(); JSValue value = call(exec, function, callType, callData, object, argList); globalObject->globalData()->timeoutChecker.stop(); @@ -778,7 +779,7 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); CallData callData; CallType callType = object->getCallData(callData); @@ -788,7 +789,7 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); - ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(); + ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld()); globalObject->globalData()->timeoutChecker.start(); JSValue value = call(exec, object, callType, callData, object, argList); globalObject->globalData()->timeoutChecker.stop(); @@ -811,7 +812,7 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); ConstructData constructData; @@ -822,7 +823,7 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); - ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(); + ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld()); globalObject->globalData()->timeoutChecker.start(); JSValue value = JSC::construct(exec, object, constructType, constructData, argList); globalObject->globalData()->timeoutChecker.stop(); @@ -845,7 +846,7 @@ bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifie if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = object->get(exec, propertyName); @@ -864,7 +865,7 @@ bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned proper if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = object->get(exec, propertyName); @@ -886,7 +887,7 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifie if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = demarshalValue(exec, valueData, valueLength); @@ -910,7 +911,7 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned proper if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = demarshalValue(exec, valueData, valueLength); @@ -933,7 +934,7 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identi if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); if (!object->hasProperty(exec, propertyName)) { exec->clearException(); return false; @@ -958,7 +959,7 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned pro if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); if (!object->hasProperty(exec, propertyName)) { exec->clearException(); return false; @@ -983,7 +984,7 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifie if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); bool result = object->hasProperty(exec, propertyName); exec->clearException(); @@ -1003,7 +1004,7 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned proper if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); bool result = object->hasProperty(exec, propertyName); exec->clearException(); @@ -1023,7 +1024,7 @@ bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue func = object->get(exec, methodName); exec->clearException(); @@ -1043,7 +1044,7 @@ bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultDat if (!frame) return false; - ExecState* exec = frame->script()->globalObject()->globalExec(); + ExecState* exec = frame->script()->globalObject(pluginWorld())->globalExec(); JSLock lock(SilenceAssertionsOnly); PropertyNameArray propertyNames(exec); @@ -1442,6 +1443,11 @@ void NetscapePluginInstanceProxy::resolveURL(const char* url, const char* target memcpy(resolvedURLData, resolvedURL.data(), resolvedURLLength); } +void NetscapePluginInstanceProxy::privateBrowsingModeDidChange(bool isPrivateBrowsingEnabled) +{ + _WKPHPluginInstancePrivateBrowsingModeDidChange(m_pluginHostProxy->port(), m_pluginID, isPrivateBrowsingEnabled); +} + } // namespace WebKit #endif // USE(PLUGIN_HOST_PROCESS) diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm index 0b3a32f..6be3953 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm +++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm @@ -370,7 +370,7 @@ JSC::JSValue ProxyInstance::fieldValue(ExecState* exec, const Field* field) cons void ProxyInstance::setFieldValue(ExecState* exec, const Field* field, JSValue value) const { - if (m_instanceProxy) + if (!m_instanceProxy) return; uint64_t serverIdentifier = static_cast<const ProxyField*>(field)->serverIdentifier(); diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index 34a2211..8de2aa6 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -90,7 +90,8 @@ extern "C" { - (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values { - ASSERT(!_attributeKeys && !_attributeValues); + ASSERT(!_attributeKeys); + ASSERT(!_attributeValues); _attributeKeys.adoptNS([keys copy]); _attributeValues.adoptNS([values copy]); @@ -102,7 +103,8 @@ extern "C" { NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()]; - _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), _mode == NP_FULL); + _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), + _mode == NP_FULL, _isPrivateBrowsingEnabled); if (!_proxy) return NO; @@ -128,6 +130,12 @@ extern "C" { [newLayer addSublayer:_pluginLayer.get()]; } +- (void)privateBrowsingModeDidChange +{ + if (_proxy) + _proxy->privateBrowsingModeDidChange(_isPrivateBrowsingEnabled); +} + - (void)loadStream { } @@ -414,7 +422,7 @@ extern "C" { ASSERT([webPluginContainerCheck isKindOfClass:[WebPluginContainerCheck class]]); id contextInfo = [webPluginContainerCheck contextInfo]; - ASSERT(contextInfo && [contextInfo isKindOfClass:[NSNumber class]]); + ASSERT([contextInfo isKindOfClass:[NSNumber class]]); if (!_proxy) return; diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs index 04edf64..9882bb5 100644 --- a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs +++ b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs @@ -236,4 +236,8 @@ simpleroutine PHBooleanAndDataReply(pluginHostPort :mach_port_t; simpleroutine PHPluginInstanceDidDraw(pluginHostPort :mach_port_t; pluginID :uint32_t); +simpleroutine PHPluginInstancePrivateBrowsingModeDidChange(pluginHostPort :mach_port_t; + pluginID :uint32_t; + privateBrowsingEnabled :boolean_t); + |