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

Issue 2770633002: Export all CWV* symbols from the ios/web_view dynamic library. (Closed)

Created:
3 years, 9 months ago by Hiroshi Ichikawa
Modified:
3 years, 8 months ago
CC:
chromium-reviews, Eugene But (OOO till 7-30), ios-reviews+web_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Export all CWV* symbols from the ios/web_view dynamic library. Only symbols explicitly marked __attribute__((visibility("default"))) are exported from a dynamic library. So all public classes in ios/web_view must be marked as __attribute__((visibility("default"))). Otherwise the users of the dynamic library cannot access these classes. Here I followed other code using __attribute__((visibility("default"))) in Chromium like this one: https://cs.chromium.org/chromium/src/dbus/dbus_export.h to define a macro CWV_EXPORT instead of directly using __attribute__. This makes it possible to export symbols only when *building* the dynamic library (by checking CWV_IMPLEMENTATION), not when *using* the dynamic library. BUG=704043 Review-Url: https://codereview.chromium.org/2770633002 Cr-Commit-Position: refs/heads/master@{#460017} Committed: https://chromium.googlesource.com/chromium/src/+/a548ad0c0108bc06d5e622acfc89777bcb00ee23

Patch Set 1 #

Total comments: 16

Patch Set 2 : Apply review comments. #

Total comments: 2

Patch Set 3 : Break a line after CWV_EXPORT. #

Patch Set 4 : Apply review comments. #

Total comments: 6

Patch Set 5 : Apply review comments. #

Patch Set 6 : Add TODO comment. #

Patch Set 7 : Rebase. #

Patch Set 8 : Add cwv_export.h to "sources" attribute of //ios/web_view:web_view. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -1 line) Patch
M ios/web_view/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 3 comments Download
M ios/web_view/internal/BUILD.gn View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M ios/web_view/internal/translate/BUILD.gn View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M ios/web_view/public/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ios/web_view/public/criwv_translate_manager.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv.h View 1 2 3 4 5 1 chunk +10 lines, -1 line 0 comments Download
M ios/web_view/public/cwv_delegate.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
A ios/web_view/public/cwv_export.h View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_html_element.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_navigation_action.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_navigation_delegate.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_translate_delegate.h View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_ui_delegate.h View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_web_view.h View 1 2 3 4 5 6 2 chunks +9 lines, -0 lines 0 comments Download
M ios/web_view/public/cwv_web_view_configuration.h View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M ios/web_view/shell/BUILD.gn View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (17 generated)
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h File ios/web_view/public/cwv.h (right): https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h#newcode11 ios/web_view/public/cwv.h:11: #include "cwv_export.h" Can you advise me if this relative ...
3 years, 9 months ago (2017-03-22 09:44:24 UTC) #3
Eugene But (OOO till 7-30)
What does it do in practice? Would it allow to strip all unused symbols from ...
3 years, 9 months ago (2017-03-22 15:18:55 UTC) #4
michaeldo
https://codereview.chromium.org/2770633002/diff/1/ios/web_view/BUILD.gn File ios/web_view/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/1/ios/web_view/BUILD.gn#newcode28 ios/web_view/BUILD.gn:28: "public/cwv_export.h", Is this file missing, I don't see it ...
3 years, 9 months ago (2017-03-22 23:16:22 UTC) #5
michaeldo
Thanks for updating the description, I just looked into the WebKit headers for reference which ...
3 years, 9 months ago (2017-03-23 04:46:11 UTC) #10
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/1/ios/web_view/BUILD.gn File ios/web_view/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/1/ios/web_view/BUILD.gn#newcode28 ios/web_view/BUILD.gn:28: "public/cwv_export.h", On 2017/03/22 23:16:22, michaeldo wrote: > Is this ...
3 years, 9 months ago (2017-03-23 05:03:03 UTC) #11
michaeldo
https://codereview.chromium.org/2770633002/diff/1/ios/web_view/internal/BUILD.gn File ios/web_view/internal/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/1/ios/web_view/internal/BUILD.gn#newcode40 ios/web_view/internal/BUILD.gn:40: defines = [ "CWV_IMPLEMENTATION" ] On 2017/03/23 05:03:02, Hiroshi ...
3 years, 9 months ago (2017-03-23 15:12:42 UTC) #12
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h File ios/web_view/public/cwv.h (right): https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h#newcode11 ios/web_view/public/cwv.h:11: #include "cwv_export.h" On 2017/03/23 15:12:41, michaeldo wrote: > On ...
3 years, 9 months ago (2017-03-24 04:57:42 UTC) #13
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/20001/ios/web_view/public/cwv_export.h File ios/web_view/public/cwv_export.h (right): https://codereview.chromium.org/2770633002/diff/20001/ios/web_view/public/cwv_export.h#newcode14 ios/web_view/public/cwv_export.h:14: // Here I define a macro CWV_EXPORT instead of ...
3 years, 9 months ago (2017-03-24 06:34:20 UTC) #14
michaeldo
On 2017/03/24 04:57:42, Hiroshi Ichikawa wrote: > https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h > File ios/web_view/public/cwv.h (right): > > https://codereview.chromium.org/2770633002/diff/1/ios/web_view/public/cwv.h#newcode11 ...
3 years, 9 months ago (2017-03-24 15:42:52 UTC) #15
michaeldo
lgtm https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/shell/BUILD.gn File ios/web_view/shell/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/shell/BUILD.gn#newcode33 ios/web_view/shell/BUILD.gn:33: # A workaround for an issue that we ...
3 years, 9 months ago (2017-03-24 15:49:25 UTC) #16
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/internal/BUILD.gn File ios/web_view/internal/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/internal/BUILD.gn#newcode42 ios/web_view/internal/BUILD.gn:42: defines = [ "CWV_IMPLEMENTATION" ] Is it possible to ...
3 years, 9 months ago (2017-03-24 16:39:20 UTC) #17
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/internal/BUILD.gn File ios/web_view/internal/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/60001/ios/web_view/internal/BUILD.gn#newcode42 ios/web_view/internal/BUILD.gn:42: defines = [ "CWV_IMPLEMENTATION" ] On 2017/03/24 16:39:20, Eugene ...
3 years, 9 months ago (2017-03-27 02:09:25 UTC) #18
Eugene But (OOO till 7-30)
lgtm for a (hopefully) temporary solution. Sorry for holding this
3 years, 9 months ago (2017-03-27 16:24:29 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2770633002/100001
3 years, 9 months ago (2017-03-28 00:24:55 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-clang/builds/63772) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 9 months ago (2017-03-28 00:28:16 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2770633002/120001
3 years, 9 months ago (2017-03-28 03:29:38 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xcode-clang/builds/67594)
3 years, 9 months ago (2017-03-28 03:37:05 UTC) #29
Hiroshi Ichikawa
https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn File ios/web_view/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn#newcode22 ios/web_view/BUILD.gn:22: "public/cwv_export.h", I needed to add this here too, otherwise ...
3 years, 8 months ago (2017-03-28 04:35:02 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2770633002/140001
3 years, 8 months ago (2017-03-28 04:35:38 UTC) #33
commit-bot: I haz the power
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/a548ad0c0108bc06d5e622acfc89777bcb00ee23
3 years, 8 months ago (2017-03-28 05:36:48 UTC) #36
sdefresne
https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn File ios/web_view/BUILD.gn (right): https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn#newcode22 ios/web_view/BUILD.gn:22: "public/cwv_export.h", On 2017/03/28 04:35:02, Hiroshi Ichikawa wrote: > I ...
3 years, 8 months ago (2017-03-28 10:29:27 UTC) #38
michaeldo
3 years, 8 months ago (2017-03-28 17:34:19 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn
File ios/web_view/BUILD.gn (right):

https://codereview.chromium.org/2770633002/diff/140001/ios/web_view/BUILD.gn#...
ios/web_view/BUILD.gn:22: "public/cwv_export.h",
On 2017/03/28 04:35:02, Hiroshi Ichikawa wrote:
> I needed to add this here too, otherwise it causes a weird error below. Maybe
we
> should add all headers to "sources" as well?
> 
> $ gn gen //out/Debug-iphonesimulator --check
> ERROR at //ios/web_view/public/cwv.h:14:11: Include not allowed.
> #include "ios/web_view/public/cwv_export.h"
>           ^-------------------------------
> It is not in any dependency of
>   //ios/web_view:web_view_compile_headers_map
> The include file is in the target(s):
>   //ios/web_view:web_view_copy_public_headers
>   //ios/web_view/public:public
> at least one of which should somehow be reachable.

I think it's fine to only have cwv_export.h in sources. none of the other
headers are referenced so they should be fine to leave only in the
public_headers section.

Powered by Google App Engine
This is Rietveld 408576698