Last Comment Bug 692988 - anp_system_getApplicationDataDirectory() is just plain wrong
: anp_system_getApplicationDataDirectory() is just plain wrong
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: ---
Assigned To: James Willcox (:snorp) (jwillcox@mozilla.com)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-07 16:13 PDT by Brad Lassey [:blassey] (use needinfo?)
Modified: 2011-11-16 06:39 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Give Flash a valid application directory (1.53 KB, patch)
2011-11-14 16:47 PST, James Willcox (:snorp) (jwillcox@mozilla.com)
blassey.bugs: review+
Details | Diff | Splinter Review

Description Brad Lassey [:blassey] (use needinfo?) 2011-10-07 16:13:09 PDT
this function should return a directory where the plugin can store data. Currently this can return a directory that doesn't exist (it just uses the MOZ_APP_NAME to construct the path) and if it does exist it is the top of our data dir, which is probably bad
Comment 1 James Willcox (:snorp) (jwillcox@mozilla.com) 2011-10-27 12:34:07 PDT
It looks like stock browser might use /data/data/<package>/app_plugins/<plugin_package>, so I'll try to make that work.
Comment 2 James Willcox (:snorp) (jwillcox@mozilla.com) 2011-11-14 16:47:47 PST
Created attachment 574477 [details] [diff] [review]
Give Flash a valid application directory
Comment 3 Brad Lassey [:blassey] (use needinfo?) 2011-11-14 17:12:55 PST
Comment on attachment 574477 [details] [diff] [review]
Give Flash a valid application directory

Review of attachment 574477 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/plugins/base/android/ANPSystem.cpp
@@ +58,5 @@
> +    dir = getenv("ANDROID_PLUGIN_DATADIR");
> +  }
> +
> +  LOG("getApplicationDataDirectory return %s", dir);
> +  return dir;

this should be <pluginDir>/<plugin-package>
Comment 4 James Willcox (:snorp) (jwillcox@mozilla.com) 2011-11-14 17:20:43 PST
(In reply to Brad Lassey [:blassey] from comment #3)
> Comment on attachment 574477 [details] [diff] [review] [diff] [details] [review]
> Give Flash a valid application directory
> 
> Review of attachment 574477 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/plugins/base/android/ANPSystem.cpp
> @@ +58,5 @@
> > +    dir = getenv("ANDROID_PLUGIN_DATADIR");
> > +  }
> > +
> > +  LOG("getApplicationDataDirectory return %s", dir);
> > +  return dir;
> 
> this should be <pluginDir>/<plugin-package>

As discussed on IRC, this function takes no arguments so I think it's working as designed. There is nothing to tie it to an instance, so the toplevel path is all we can return (and WebKit does basically the same thing).
Comment 5 Brad Lassey [:blassey] (use needinfo?) 2011-11-14 17:21:31 PST
Comment on attachment 574477 [details] [diff] [review]
Give Flash a valid application directory

after talking to snorp on irc, the flash plugin is creating its own subdir with its package name.
Comment 6 Mark Finkle (:mfinkle) (use needinfo?) 2011-11-16 06:39:56 PST
https://hg.mozilla.org/projects/birch/rev/151de04e6bd6

Note You need to log in before you can comment on or make changes to this bug.