Backed out changeset 36e71bcb0266 (bug 1192945)

This commit is contained in:
Randell Jesup 2016-06-10 02:24:08 -04:00
parent bdd004d3e4
commit 05bb25d9c0
11 changed files with 18 additions and 65 deletions

View File

@ -303,9 +303,7 @@ NS_IMETHODIMP
nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
nsISupportsArray * aArrayTransferables,
nsIScriptableRegion * aRegion,
uint32_t aActionType,
nsContentPolicyType aContentPolicyType =
nsIContentPolicy::TYPE_OTHER)
uint32_t aActionType)
{
MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::InvokeDragSession"));
@ -317,8 +315,7 @@ nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
return NS_ERROR_NOT_AVAILABLE;
return nsBaseDragService::InvokeDragSession(aDOMNode, aArrayTransferables,
aRegion, aActionType,
aContentPolicyType);
aRegion, aActionType);
}
// nsBaseDragService

View File

@ -66,8 +66,7 @@ public:
NS_IMETHOD InvokeDragSession (nsIDOMNode *aDOMNode,
nsISupportsArray * anArrayTransferables,
nsIScriptableRegion * aRegion,
uint32_t aActionType,
nsContentPolicyType aContentPolicyType) override;
uint32_t aActionType) override;
NS_IMETHOD StartDragSession() override;
NS_IMETHOD EndDragSession(bool aDoneDrag) override;

View File

@ -58,7 +58,6 @@ nsBaseDragService::nsBaseDragService()
mDragAction(DRAGDROP_ACTION_NONE),
mDragActionFromChildProcess(DRAGDROP_ACTION_UNINITIALIZED), mTargetSize(0,0),
mScreenX(-1), mScreenY(-1), mSuppressLevel(0),
mContentPolicyType(nsIContentPolicy::TYPE_OTHER),
mInputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE)
{
}
@ -210,9 +209,7 @@ NS_IMETHODIMP
nsBaseDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
nsISupportsArray* aTransferableArray,
nsIScriptableRegion* aDragRgn,
uint32_t aActionType,
nsContentPolicyType aContentPolicyType =
nsIContentPolicy::TYPE_OTHER)
uint32_t aActionType)
{
PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
@ -222,7 +219,6 @@ nsBaseDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
// stash the document of the dom node
aDOMNode->GetOwnerDocument(getter_AddRefs(mSourceDocument));
mSourceNode = aDOMNode;
mContentPolicyType = aContentPolicyType;
mEndDragPoint = LayoutDeviceIntPoint(0, 0);
// When the mouse goes down, the selection code starts a mouse
@ -268,8 +264,7 @@ nsBaseDragService::InvokeDragSessionWithImage(nsIDOMNode* aDOMNode,
aDragEvent->GetMozInputSource(&mInputSource);
nsresult rv = InvokeDragSession(aDOMNode, aTransferableArray,
aRegion, aActionType,
nsIContentPolicy::TYPE_INTERNAL_IMAGE);
aRegion, aActionType);
if (NS_FAILED(rv)) {
mImage = nullptr;
@ -309,8 +304,7 @@ nsBaseDragService::InvokeDragSessionWithSelection(nsISelection* aSelection,
aSelection->GetFocusNode(getter_AddRefs(node));
nsresult rv = InvokeDragSession(node, aTransferableArray,
nullptr, aActionType,
nsIContentPolicy::TYPE_OTHER);
nullptr, aActionType);
if (NS_FAILED(rv)) {
mHasImage = false;

View File

@ -156,8 +156,6 @@ protected:
nsCOMPtr<nsIDOMNode> mSourceNode;
nsCOMPtr<nsIDOMDocument> mSourceDocument; // the document at the drag source. will be null
// if it came from outside the app.
nsContentPolicyType mContentPolicyType; // the contentpolicy type passed to the channel
// when initiating the drag session
nsCOMPtr<nsIDOMDataTransfer> mDataTransfer;
// used to determine the image to appear on the cursor while dragging

View File

@ -8,7 +8,7 @@
#include "nsISupportsArray.idl"
#include "nsIDragSession.idl"
#include "nsIScriptableRegion.idl"
#include "nsIContentPolicyBase.idl"
interface nsIDOMNode;
interface nsIDOMDragEvent;
@ -44,15 +44,9 @@ interface nsIDragService : nsISupports
* @param aRegion - a region containing rectangles for cursor feedback,
* in window coordinates.
* @param aActionType - specified which of copy/move/link are allowed
* @param aContentPolicyType - the contentPolicyType that will be
* passed to the loadInfo when creating a new channel
* (defaults to TYPE_OTHER)
*/
void invokeDragSession (in nsIDOMNode aDOMNode,
in nsISupportsArray aTransferables,
in nsIScriptableRegion aRegion,
in unsigned long aActionType,
[optional] in nsContentPolicyType aContentPolicyType);
void invokeDragSession ( in nsIDOMNode aDOMNode, in nsISupportsArray aTransferables,
in nsIScriptableRegion aRegion, in unsigned long aActionType );
/**
* Starts a modal drag session using an image. The first four arguments are

View File

@ -7,7 +7,6 @@
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsIFormatConverter.idl"
#include "nsIContentPolicyBase.idl"
interface nsIDOMNode;
@ -200,13 +199,11 @@ interface nsITransferable : nsISupports
[noscript] attribute boolean isPrivateData;
/**
* The source dom node this transferable was created from and
* the contentPolicyType for the transferable.
* Note, currently only in use on Windows for network principal and
* contentPolicyType information in drag operations.
* The source dom node this transferable was created from.
* Note, currently only in use on Windows for network principal
* information in drag operations.
*/
[noscript] attribute nsIDOMNode requestingNode;
[noscript] attribute nsContentPolicyType contentPolicyType;
};

View File

@ -18,7 +18,6 @@ Notes to self:
#include "nsReadableUtils.h"
#include "nsTArray.h"
#include "nsIFormatConverter.h"
#include "nsIContentPolicy.h"
#include "nsIComponentManager.h"
#include "nsCOMPtr.h"
#include "nsXPCOM.h"
@ -219,7 +218,6 @@ DataStruct::ReadCache(nsISupports** aData, uint32_t* aDataLen)
//-------------------------------------------------------------------------
nsTransferable::nsTransferable()
: mPrivateData(false)
, mContentPolicyType(nsIContentPolicy::TYPE_OTHER)
#ifdef DEBUG
, mInitialized(false)
#endif
@ -645,18 +643,3 @@ nsTransferable::SetRequestingNode(nsIDOMNode* aRequestingNode)
mRequestingNode = do_GetWeakReference(aRequestingNode);
return NS_OK;
}
NS_IMETHODIMP
nsTransferable::GetContentPolicyType(nsContentPolicyType* outContentPolicyType)
{
NS_ENSURE_ARG_POINTER(outContentPolicyType);
*outContentPolicyType = mContentPolicyType;
return NS_OK;
}
NS_IMETHODIMP
nsTransferable::SetContentPolicyType(nsContentPolicyType aContentPolicyType)
{
mContentPolicyType = aContentPolicyType;
return NS_OK;
}

View File

@ -6,7 +6,6 @@
#ifndef nsTransferable_h__
#define nsTransferable_h__
#include "nsIContentPolicyBase.h"
#include "nsIFormatConverter.h"
#include "nsITransferable.h"
#include "nsCOMPtr.h"
@ -75,7 +74,6 @@ protected:
nsCOMPtr<nsIFormatConverter> mFormatConv;
bool mPrivateData;
nsWeakPtr mRequestingNode;
nsContentPolicyType mContentPolicyType;
#if DEBUG
bool mInitialized;
#endif

View File

@ -64,7 +64,6 @@ nsDataObj::CStream::~CStream()
//-----------------------------------------------------------------------------
// helper - initializes the stream
nsresult nsDataObj::CStream::Init(nsIURI *pSourceURI,
uint32_t aContentPolicyType,
nsINode* aRequestingNode)
{
// we can not create a channel without a requestingNode
@ -75,14 +74,14 @@ nsresult nsDataObj::CStream::Init(nsIURI *pSourceURI,
rv = NS_NewChannel(getter_AddRefs(mChannel),
pSourceURI,
aRequestingNode,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS,
aContentPolicyType,
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
nullptr, // loadGroup
nullptr, // aCallbacks
nsIRequest::LOAD_FROM_CACHE);
NS_ENSURE_SUCCESS(rv, rv);
rv = mChannel->AsyncOpen2(this);
rv = mChannel->AsyncOpen(this, nullptr);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
@ -346,10 +345,8 @@ HRESULT nsDataObj::CreateStream(IStream **outStream)
mTransferable->GetRequestingNode(getter_AddRefs(requestingDomNode));
nsCOMPtr<nsINode> requestingNode = do_QueryInterface(requestingDomNode);
MOZ_ASSERT(requestingNode, "can not create channel without a node");
// default transferable content policy is nsIContentPolicy::TYPE_OTHER
uint32_t contentPolicyType = nsIContentPolicy::TYPE_OTHER;
mTransferable->GetContentPolicyType(&contentPolicyType);
rv = pStream->Init(sourceURI, contentPolicyType, requestingNode);
rv = pStream->Init(sourceURI, requestingNode);
if (NS_FAILED(rv))
{
pStream->Release();

View File

@ -249,9 +249,7 @@ protected:
public:
CStream();
nsresult Init(nsIURI *pSourceURI,
uint32_t aContentPolicyType,
nsINode* aRequestingNode);
nsresult Init(nsIURI *pSourceURI, nsINode* aRequestingNode);
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER

View File

@ -207,7 +207,6 @@ nsDragService::InvokeDragSessionImpl(nsISupportsArray* anArrayTransferables,
if (trans) {
// set the requestingNode on the transferable
trans->SetRequestingNode(mSourceNode);
trans->SetContentPolicyType(mContentPolicyType);
RefPtr<IDataObject> dataObj;
rv = nsClipboard::CreateNativeDataObject(trans,
getter_AddRefs(dataObj), uri);
@ -227,7 +226,6 @@ nsDragService::InvokeDragSessionImpl(nsISupportsArray* anArrayTransferables,
if (trans) {
// set the requestingNode on the transferable
trans->SetRequestingNode(mSourceNode);
trans->SetContentPolicyType(mContentPolicyType);
rv = nsClipboard::CreateNativeDataObject(trans,
getter_AddRefs(itemToDrag),
uri);