dom/plugins/base/android/ANPNativeWindow.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 // must include config.h first for webkit to fiddle with new/delete
     7 #include <android/log.h>
     8 #include "AndroidBridge.h"
     9 #include "ANPBase.h"
    10 #include "nsIPluginInstanceOwner.h"
    11 #include "nsPluginInstanceOwner.h"
    12 #include "nsNPAPIPluginInstance.h"
    13 #include "gfxRect.h"
    15 using namespace mozilla;
    16 using namespace mozilla;
    18 #define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
    19 #define ASSIGN(obj, name)   (obj)->name = anp_native_window_##name
    21 static ANPNativeWindow anp_native_window_acquireNativeWindow(NPP instance) {
    22   nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
    23   return pinst->AcquireContentWindow();
    24 }
    26 static void anp_native_window_invertPluginContent(NPP instance, bool isContentInverted) {
    27   nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
    28   pinst->SetInverted(isContentInverted);
    29   pinst->RedrawPlugin();
    30 }
    33 void InitNativeWindowInterface(ANPNativeWindowInterfaceV0* i) {
    34     ASSIGN(i, acquireNativeWindow);
    35     ASSIGN(i, invertPluginContent);
    36 }

mercurial