Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1AC95D34D for ; Thu, 6 Sep 2012 20:20:58 +0000 (UTC) Received: (qmail 44623 invoked by uid 500); 6 Sep 2012 20:20:57 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 44603 invoked by uid 500); 6 Sep 2012 20:20:57 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 44593 invoked by uid 99); 6 Sep 2012 20:20:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 20:20:57 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FRT_ADOBE2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of braden@google.com designates 209.85.210.175 as permitted sender) Received: from [209.85.210.175] (HELO mail-iy0-f175.google.com) (209.85.210.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 20:20:53 +0000 Received: by iaky10 with SMTP id y10so2589349iak.6 for ; Thu, 06 Sep 2012 13:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :x-system-of-record; bh=79/GQpjNG8j0g2HoaZcyjjgtH3i6rfq2qwb3d0fO3dc=; b=kOq0wL3mBqwQFN0RllPw0kninANgPSHJCml4xWu2hX+tLDvHyP5wyjU3/qh9O6555e ic+BnIsHOtCdnRQYr+5vs2e7mUghbTfYYfbdoQV9Yehg6P4vmAXWFCKNxRvdvM0GiTZ0 OdJH58moM7ba2944jPsQgMNGJ/ejvltvODya410R9nYddLwOQ/Xw4eGS1035Snd3WBEa 7vlSZMQl3eAkVeX0yd9BEn3VAzofkqiXON1FwXjWfZt+waOrLTob0251RDBGnxQBE7x1 bmlFpyWXwCK2YFpw3QYmMRSAlAjLmnCcL+OFlSdsStrbDW1XiSe9acQMRAypzSYzC3s/ kGZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :x-system-of-record:x-gm-message-state; bh=79/GQpjNG8j0g2HoaZcyjjgtH3i6rfq2qwb3d0fO3dc=; b=KoS8vRE/IN+OzspVFu4eS1qfpuXP+n3NNXvACFZrfss12k8tQwRD1yfAARVTE898r8 LxRklZULR4jY4kyUMjvVdapp0NJHcL2KZa+zo75vkQ49PO2mZ3HXUKbjCKfti4w1iDF2 um0VOsixUAxoupDE7hHy9WMvgwML4j3n7KwKRZJljF3/tjYNptqfScxdOJfyPrHyclX4 wqP0K1IdoZ0QpGk/Nk1p813iu0MkwJEd3bWw/9i380qwMT3/wsIWYX81+VUBCzbJcyBm of7lkPxmY8/+w3bbBpsaA2Dk7k1jpzhtN7i0gJC62h7UKf7UOK18goxEJnXM+fMqH471 bj0A== Received: by 10.50.195.161 with SMTP id if1mr4866221igc.66.1346962832455; Thu, 06 Sep 2012 13:20:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.195.161 with SMTP id if1mr4866206igc.66.1346962832272; Thu, 06 Sep 2012 13:20:32 -0700 (PDT) Sender: braden@google.com Received: by 10.231.129.9 with HTTP; Thu, 6 Sep 2012 13:20:32 -0700 (PDT) In-Reply-To: References: Date: Thu, 6 Sep 2012 16:20:32 -0400 X-Google-Sender-Auth: 5Do9yL72VUpQdJIrV3sIVJBz7VU Message-ID: Subject: Re: Wiping plugins on navigation From: Braden Shepherdson To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=14dae9340e1d24abb904c90e3956 X-System-Of-Record: true X-Gm-Message-State: ALoCoQllixHb9x14id9s1LWHfKAiXAjR45eJPkdKeeSA/mGwIctepCzIjw4eSTMH9x8VlL3hW2WMwKmwFZj901Fq5vTra+QiRhfdGzjc6omfW/HAIDUzbYLve+GYly9RFEaxUNwCfVkk0PTBi+hiv7QOYyJQh3MzFkgFjRFU6AxLjpEZ6IedZOGTcIexSrDQEABW6M/vuG9haLDyGL6lcUTB9rvkWItTBQ== X-Virus-Checked: Checked by ClamAV on apache.org --14dae9340e1d24abb904c90e3956 Content-Type: text/plain; charset=ISO-8859-1 Alright, we seem to have a consensus. I'll start working on this tomorrow for Android. I'll tackle iOS afterwards if no one else wants to look after it; my progress there will require an expensive initialization step while I learn enough Obj-C to do it. I think this will manifest on Android as a reset() method on plugins called in this situation. On Thu, Sep 6, 2012 at 4:04 PM, Andrew Grieve wrote: > Some good use-cases Jesse. > > Given that we'll just use a reset method, we should also seed the JS > callback counter with a random value (as Jimmy originally suggested). > > > On Thu, Sep 6, 2012 at 3:57 PM, Filip Maj wrote: > > > What Jesse said times a million. > > > > Notify plugin of changes. We already do this (on pause, on resume, on > > message/postmessage). Plugin should handle this. > > > > On 9/6/12 12:09 PM, "Jesse" wrote: > > > > >I don't think that plugins should be recreated, but I also don't think > > >they should be destroyed during page changes. > > >In my opinion, the best option is to simply notify the native portion > > >that the page is changing, and place the responsibility in the hands > > >of the plugin developer. > > > > > >In the case of platforms without a native portion, any persistence > > >would need to be managed differently, via localStorage or something. > > >Usually these platforms DO provide a way to play background sounds, or > > >continue downloading a file across pages. > > > > > >Here are some use cases where it makes sense to have a persistent native > > >piece. > > > > > >- an XMPP service, where establishing a connection can take 10 > > >seconds. It would not make sense to have to re-connect when changing > > >'views' in the application. > > >- a sound board app, where multiple sounds are loaded from disk ( once > > >) and used by multiple views in the app > > >- a game where background music can continue to play even when loading > > >a new level ( page ), going to the leader-board(page) or the settings > > >view (page ) > > >- any long running process that does not require continuous > > >monitoring, like image processing happening in the background even > > >while navigation views in the app. > > >- background file transfers > > >- any UI Extention plugins like a titlebar or a action bar are > > >technically considered siblings to the webbrowser control anyway, it > > >makes sense for them to persist between page loads. > > > > > >Personally, I consider multiple pages within an app to be multiple > > >views, so I think it makes sense to continue to have some native > > >services potentially running across views. > > > > > >[PROPOSAL] > > > > > >When the page reloads, the following events occur: > > > > > >1. All running plugins are notified, but not otherwise impacted > > >2. the js callback stack is destroyed > > > > > >Some assumptions: > > >- When the JS portion of a plugin in instantiated, it is responsible > > >for calling it's native portion to re-establish any state. This is > > >beyond the scope of the frameworks responsibilities. > > >- Calls from native to javascript with non-existent callbackIDs fail > > >gracefully > > >- Plugin developers write code that behaves well, a big assumption, > > >but if we assume they are idiots then we have a lot more work to do. ( > > >this item speaks mainly to having adequate documentation so our > > >developers can be educated. ) > > > > > >Another, slightly more complex option : > > >- provide an API whereby a plugin can choose to be destroyed > > >(returning false from onPageChangeNotification for example), or > > >request to be persistent somehow. > > > > > >-- > > >@purplecabbage > > >risingj.com > > > > > --14dae9340e1d24abb904c90e3956--