Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Issue 12253057: Implement WebStorage API methods (Closed)

Created:
7 years, 10 months ago by boliu
Modified:
7 years, 10 months ago
CC:
chromium-reviews, android-webview-reviews_chromium.org
Visibility:
Public.

Description

Implement WebStorage API methods Most of the methods involves calling methods to QuotaManager on the IO thread and translating the arguments between Java and native code. Introduce AwQuotaManagerBridge to facilitate this logic. The Java AwQuotaManagerBridge is currently a singleton but should be owned by AwBrowserContext when we have one. The native one is owned by native AwBrowserContext. Java calls the corresponding native AwBrowserContext to obtain the pointer. Introduced JniDependencyFactory interface used to create native objects under native but is used or passed in BrowserContext or ContentsBrowserClient. Also added base::android::ToJavaLongArray to convert to Java long arrays. BUG= Android only change. Ran through android bots. NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184139

Patch Set 1 #

Total comments: 1

Patch Set 2 : Implementation mostly done. #

Total comments: 46

Patch Set 3 : Leveling up base::Bind-foo. -150 lines. Implementation code ready for review. Still need real tests. #

Patch Set 4 : Rearrange usage/quota #

Total comments: 34

Patch Set 5 : Address comments. Still don't look at tests. #

Total comments: 2

Patch Set 6 : Tests still work in progress :( #

Total comments: 18

Patch Set 7 : Real tests passing! #

Total comments: 1

Patch Set 8 : Added minimal comments #

Total comments: 14

Patch Set 9 : Address comments from joth. #

Total comments: 6

Patch Set 10 : Address Selim's comments. #

Total comments: 6

Patch Set 11 : Address nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1063 lines, -39 lines) Patch
M android_webview/android_webview.gyp View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.h View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -6 lines 0 comments Download
M android_webview/browser/aw_browser_context.cc View 1 2 3 4 5 6 7 8 4 chunks +14 lines, -3 lines 0 comments Download
M android_webview/browser/aw_content_browser_client.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -7 lines 0 comments Download
M android_webview/browser/aw_content_browser_client.cc View 1 2 3 4 5 6 7 8 3 chunks +12 lines, -5 lines 0 comments Download
A android_webview/browser/aw_quota_manager_bridge.h View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download
A + android_webview/browser/aw_quota_manager_bridge.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M android_webview/browser/aw_quota_permission_context.cc View 1 2 3 4 1 chunk +4 lines, -8 lines 0 comments Download
A android_webview/browser/jni_dependency_factory.h View 1 2 3 4 5 6 7 8 1 chunk +34 lines, -0 lines 0 comments Download
A android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +162 lines, -0 lines 0 comments Download
A android_webview/javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java View 1 2 3 4 5 6 7 8 9 1 chunk +291 lines, -0 lines 0 comments Download
M android_webview/lib/aw_browser_dependency_factory_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/lib/main/aw_main_delegate.h View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -1 line 0 comments Download
M android_webview/lib/main/aw_main_delegate.cc View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -5 lines 0 comments Download
M android_webview/native/android_webview_jni_registrar.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M android_webview/native/aw_geolocation_permission_context.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M android_webview/native/aw_geolocation_permission_context.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A android_webview/native/aw_quota_manager_bridge_impl.h View 1 2 3 4 5 6 7 1 chunk +74 lines, -0 lines 0 comments Download
A android_webview/native/aw_quota_manager_bridge_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +337 lines, -0 lines 0 comments Download
M android_webview/native/webview_native.gyp View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M base/android/jni_array.h View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M base/android/jni_array.cc View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M base/android/jni_array_unittest.cc View 1 2 3 4 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
boliu
Not ready for full review yet but breaking some new ground so uploading. Ideally this ...
7 years, 10 months ago (2013-02-15 03:57:54 UTC) #1
mnaganov (inactive)
https://codereview.chromium.org/12253057/diff/1/android_webview/browser/aw_quota_permission_context.cc File android_webview/browser/aw_quota_permission_context.cc (right): https://codereview.chromium.org/12253057/diff/1/android_webview/browser/aw_quota_permission_context.cc#newcode29 android_webview/browser/aw_quota_permission_context.cc:29: if (new_quota > 10 * 1024 * 1024) { ...
7 years, 10 months ago (2013-02-15 10:06:23 UTC) #2
boliu
Pretty epic patch...thread topping, callbacks, native->java conversions. Basic implementation done, still need cleanups, add unit ...
7 years, 10 months ago (2013-02-16 03:55:05 UTC) #3
boliu
https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc File android_webview/browser/aw_quota_permission_context.cc (right): https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc#newcode26 android_webview/browser/aw_quota_permission_context.cc:26: callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); This path is only used for PERSISTENT storage, ...
7 years, 10 months ago (2013-02-16 03:55:15 UTC) #4
mkosiba (inactive)
https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc File android_webview/browser/aw_quota_permission_context.cc (right): https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc#newcode26 android_webview/browser/aw_quota_permission_context.cc:26: callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); On 2013/02/16 03:55:15, boliu wrote: > This path ...
7 years, 10 months ago (2013-02-19 11:37:13 UTC) #5
boliu
Posting some replies without new patch/code. https://codereview.chromium.org/12253057/diff/5001/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java File android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java (right): https://codereview.chromium.org/12253057/diff/5001/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java#newcode87 android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java:87: assert !mPendingGetQuotaForOriginCallbacks.containsKey(callbackId); On ...
7 years, 10 months ago (2013-02-19 17:03:21 UTC) #6
boliu
Implementation code ready for review. https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc File android_webview/browser/aw_quota_permission_context.cc (right): https://codereview.chromium.org/12253057/diff/5001/android_webview/browser/aw_quota_permission_context.cc#newcode26 android_webview/browser/aw_quota_permission_context.cc:26: callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); On 2013/02/19 11:37:13, ...
7 years, 10 months ago (2013-02-20 00:53:50 UTC) #7
mnaganov (inactive)
https://codereview.chromium.org/12253057/diff/17001/android_webview/browser/aw_quota_manager_bridge.h File android_webview/browser/aw_quota_manager_bridge.h (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/browser/aw_quota_manager_bridge.h#newcode10 android_webview/browser/aw_quota_manager_bridge.h:10: // Empty super class so this can be owned ...
7 years, 10 months ago (2013-02-20 09:29:02 UTC) #8
mkosiba (inactive)
This one is looking much much better! Thanks for all the improvements. https://codereview.chromium.org/12253057/diff/17001/android_webview/browser/aw_quota_manager_bridge.h File android_webview/browser/aw_quota_manager_bridge.h ...
7 years, 10 months ago (2013-02-20 12:21:38 UTC) #9
joth
https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode187 android_webview/native/aw_quota_manager_bridge_impl.cc:187: int ALL_CLIENT_MASK = QuotaClient::kFileSystem | you should make it ...
7 years, 10 months ago (2013-02-20 19:49:33 UTC) #10
boliu
Address comments. Still don't look at instrumentation tests yet. https://codereview.chromium.org/12253057/diff/17001/android_webview/browser/aw_quota_manager_bridge.h File android_webview/browser/aw_quota_manager_bridge.h (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/browser/aw_quota_manager_bridge.h#newcode10 android_webview/browser/aw_quota_manager_bridge.h:10: ...
7 years, 10 months ago (2013-02-20 20:14:16 UTC) #11
joth
On 20 February 2013 12:14, <boliu@chromium.org> wrote: > Address comments. Still don't look at instrumentation ...
7 years, 10 months ago (2013-02-20 21:22:10 UTC) #12
mnaganov (inactive)
https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode187 android_webview/native/aw_quota_manager_bridge_impl.cc:187: int ALL_CLIENT_MASK = QuotaClient::kFileSystem | On 2013/02/20 20:14:16, boliu ...
7 years, 10 months ago (2013-02-20 21:54:34 UTC) #13
boliu
I'll upload a new patch when the tests are done https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode187 ...
7 years, 10 months ago (2013-02-20 22:26:26 UTC) #14
boliu
Tests still work in progress, but getting there. https://codereview.chromium.org/12253057/diff/31004/android_webview/javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java File android_webview/javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java (right): https://codereview.chromium.org/12253057/diff/31004/android_webview/javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java#newcode195 android_webview/javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java:195: assertTrue(getUsageForOrigin(mOrigin) ...
7 years, 10 months ago (2013-02-21 02:36:04 UTC) #15
mkosiba (inactive)
https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/17001/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode212 android_webview/native/aw_quota_manager_bridge_impl.cc:212: void AwQuotaManagerBridgeImpl::DeleteAllData(JNIEnv* env, jobject object) { On 2013/02/20 20:14:16, ...
7 years, 10 months ago (2013-02-21 11:38:30 UTC) #16
boliu
Just replying. No new patch. https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode128 android_webview/native/aw_quota_manager_bridge_impl.cc:128: base::Bind(&GetOriginsTask::DoneOnUIThread, this)); On 2013/02/21 ...
7 years, 10 months ago (2013-02-21 17:01:57 UTC) #17
boliu
Finally got some real tests passing. Still needs comments all around. But otherwise everything ready ...
7 years, 10 months ago (2013-02-21 18:44:45 UTC) #18
boliu
Ready for full review.
7 years, 10 months ago (2013-02-21 22:10:55 UTC) #19
joth
fly by commentage. https://codereview.chromium.org/12253057/diff/28003/android_webview/browser/native_factory.h File android_webview/browser/native_factory.h (right): https://codereview.chromium.org/12253057/diff/28003/android_webview/browser/native_factory.h#newcode20 android_webview/browser/native_factory.h:20: class NativeFactory { native is a ...
7 years, 10 months ago (2013-02-21 22:57:52 UTC) #20
boliu
https://codereview.chromium.org/12253057/diff/28003/android_webview/browser/native_factory.h File android_webview/browser/native_factory.h (right): https://codereview.chromium.org/12253057/diff/28003/android_webview/browser/native_factory.h#newcode20 android_webview/browser/native_factory.h:20: class NativeFactory { On 2013/02/21 22:57:52, joth wrote: > ...
7 years, 10 months ago (2013-02-22 00:07:02 UTC) #21
joth
On 21 February 2013 16:07, <boliu@chromium.org> wrote: > > https://codereview.chromium.**org/12253057/diff/28003/** > android_webview/browser/**native_factory.h<https://codereview.chromium.org/12253057/diff/28003/android_webview/browser/native_factory.h> > File android_webview/browser/**native_factory.h ...
7 years, 10 months ago (2013-02-22 00:14:51 UTC) #22
sgurun-gerrit only
a few nits. I will look more tomorrow. https://codereview.chromium.org/12253057/diff/23008/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java File android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java (right): https://codereview.chromium.org/12253057/diff/23008/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java#newcode42 android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java:42: // ...
7 years, 10 months ago (2013-02-22 02:44:01 UTC) #23
boliu
https://codereview.chromium.org/12253057/diff/23008/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java File android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java (right): https://codereview.chromium.org/12253057/diff/23008/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java#newcode42 android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java:42: // Origin, usage, and quota data in parallel arrays ...
7 years, 10 months ago (2013-02-22 02:54:03 UTC) #24
mkosiba (inactive)
lgtm https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode128 android_webview/native/aw_quota_manager_bridge_impl.cc:128: base::Bind(&GetOriginsTask::DoneOnUIThread, this)); On 2013/02/21 17:01:57, boliu wrote: > ...
7 years, 10 months ago (2013-02-22 15:47:08 UTC) #25
mnaganov (inactive)
lgtm % comments https://codereview.chromium.org/12253057/diff/36006/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java File android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java (right): https://codereview.chromium.org/12253057/diff/36006/android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java#newcode30 android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java:30: assert Looper.myLooper() == Looper.getMainLooper(); nit: Can ...
7 years, 10 months ago (2013-02-22 16:09:15 UTC) #26
boliu
https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc File android_webview/native/aw_quota_manager_bridge_impl.cc (right): https://codereview.chromium.org/12253057/diff/31004/android_webview/native/aw_quota_manager_bridge_impl.cc#newcode128 android_webview/native/aw_quota_manager_bridge_impl.cc:128: base::Bind(&GetOriginsTask::DoneOnUIThread, this)); On 2013/02/22 15:47:08, Martin Kosiba wrote: > ...
7 years, 10 months ago (2013-02-22 16:58:54 UTC) #27
joth
lgtm for base/ (and rest too, but I didn't read every line)
7 years, 10 months ago (2013-02-22 17:43:54 UTC) #28
sgurun-gerrit only
lgtm
7 years, 10 months ago (2013-02-22 17:50:10 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/12253057/30015
7 years, 10 months ago (2013-02-22 18:52:33 UTC) #30
commit-bot: I haz the power
7 years, 10 months ago (2013-02-22 18:53:06 UTC) #31
Message was sent while issue was closed.
Change committed as 184139

Powered by Google App Engine
This is Rietveld 408576698