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

Issue 2943913002: [Android WebAPK] Make webapk_installer.cc return proto as base64 string

Created:
3 years, 6 months ago by pkotwicz
Modified:
3 years, 5 months ago
Reviewers:
dominickn, Xi Han
CC:
chromium-reviews, dominickn+watch_chromium.org, pkotwicz+watch_chromium.org, zpeng+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android WebAPK] Make webapk_installer.cc return proto as base64 string This CL makes webapk_installer.cc return the proto as a base64 encoded string instead of as a byte array. This change is because SharedPreferences does not support array extras. We can't set the serialized proto as an extra on com.google.android.gms.gcm.Task because the size of the extras on Tasks is capped at 10Kb. BUG=713655

Patch Set 1 #

Total comments: 5

Patch Set 2 : Merge branch 'background_updates0_5' into background_updates00 #

Total comments: 3

Patch Set 3 : Merge branch 'master' into background_updates00 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -161 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java View 1 2 13 chunks +58 lines, -54 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java View 1 2 5 chunks +37 lines, -0 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java View 1 2 9 chunks +12 lines, -8 lines 0 comments Download
M chrome/browser/android/webapk/webapk_install_service.h View 1 2 2 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/android/webapk/webapk_install_service.cc View 1 2 2 chunks +3 lines, -6 lines 0 comments Download
M chrome/browser/android/webapk/webapk_installer.h View 1 2 7 chunks +33 lines, -26 lines 0 comments Download
M chrome/browser/android/webapk/webapk_installer.cc View 1 2 11 chunks +111 lines, -36 lines 0 comments Download
M chrome/browser/android/webapk/webapk_update_manager.cc View 1 2 6 chunks +21 lines, -25 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
pkotwicz
Xi, can you please take a look?
3 years, 6 months ago (2017-06-19 01:40:56 UTC) #2
Xi Han
Most of the CL looks pretty good, just one question about the encoding/decoding. https://codereview.chromium.org/2943913002/diff/1/chrome/browser/android/webapk/webapk_installer.cc File ...
3 years, 6 months ago (2017-06-19 13:48:58 UTC) #3
pkotwicz
Xi, can you please take a look? https://codereview.chromium.org/2943913002/diff/1/chrome/browser/android/webapk/webapk_installer.cc File chrome/browser/android/webapk/webapk_installer.cc (right): https://codereview.chromium.org/2943913002/diff/1/chrome/browser/android/webapk/webapk_installer.cc#newcode486 chrome/browser/android/webapk/webapk_installer.cc:486: base::Base64Decode(*serialized_proto, &decoded_proto); ...
3 years, 6 months ago (2017-06-19 14:54:06 UTC) #4
Xi Han
lgtm with nits. https://codereview.chromium.org/2943913002/diff/1/chrome/browser/android/webapk/webapk_install_service.h File chrome/browser/android/webapk/webapk_install_service.h (right): https://codereview.chromium.org/2943913002/diff/1/chrome/browser/android/webapk/webapk_install_service.h#newcode12 chrome/browser/android/webapk/webapk_install_service.h:12: #include <vector> Nit: you probably don't ...
3 years, 6 months ago (2017-06-19 17:14:14 UTC) #5
pkotwicz
Dominick, can you please take a look?
3 years, 6 months ago (2017-06-20 00:36:05 UTC) #8
dominickn
Where does the SharedPreference come into play? Is that a follow up CL? https://codereview.chromium.org/2943913002/diff/20001/chrome/browser/android/webapk/webapk_installer.cc File ...
3 years, 6 months ago (2017-06-20 01:07:21 UTC) #9
pkotwicz
Dominick, can you please take another look? The SharedPreference is introduced in https://codereview.chromium.org/2948713002/ which is ...
3 years, 6 months ago (2017-06-20 22:18:26 UTC) #10
dominickn
3 years, 6 months ago (2017-06-21 04:13:49 UTC) #11
How big is this proto going to be? SharedPreferences are held entirely in memory
and are backed by an XML file. The proto has serialized images in it. I don't
know if it's a good idea to be storing that in SharedPreferences (particularly
if the images are large).

https://codereview.chromium.org/2943913002/diff/20001/chrome/browser/android/...
File chrome/browser/android/webapk/webapk_installer.cc (right):

https://codereview.chromium.org/2943913002/diff/20001/chrome/browser/android/...
chrome/browser/android/webapk/webapk_installer.cc:179: std::string
serialized_proto;
On 2017/06/20 22:18:26, pkotwicz wrote:
> I can do this change. However, this does not decrease the number of string
> allocations since base::Base64Encode() does a copy internally

I meant that you'll save one of |serialized_proto| and |base64_serialized_proto|
from being allocated when they're default-constructed (we only use one instead
of both). I'm not overly fussed though.

Powered by Google App Engine
This is Rietveld 408576698