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

Issue 2011383002: Get rid of {Run,Terminate}MainApplication(), and more ApplicationDelegate conversion. (Closed)

Created:
4 years, 6 months ago by viettrungluu
Modified:
4 years, 6 months ago
Reviewers:
vardhan
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, yzshen+mojopublicwatch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Get rid of {Run,Terminate}MainApplication(), and more ApplicationDelegate conversion. Why RunMainApplication() was a bad idea: 1. The intention is to allow the use of //base, which often requires some initialization (e.g., having an AtExitManager). 2. But your ApplicationImplBase implementation would be created before that initialization (so using //base in its constructor would be dodgy). 3. And it would be destroyed after, e.g., the AtExitManager was torn down (so using //base in its destructor -- or in the destructor of any member variable of your ApplicationImplBase implementation -- is potentially problematic). So, instead just have a ScopedChromiumInit class, to make that stuff explicit, and make the "scopes" not overlap. Note that ApplicationRunnerChromium had a similar problem: Your ApplicationDelegate implementation would be created before that initialization (like 2.). However, the ApplicationImpl would destroy your ApplicationDelegate implementation before tearing down the AtExitManager, so it didn't have problem 3. (exactly). Nonetheless, it was kind of horrible (since you couldn't really use //base in your MojoMain()). R=vardhan@google.com Committed: https://chromium.googlesource.com/external/mojo/+/911b5de92406e7644cc15f457039e57629788508

Patch Set 1 #

Patch Set 2 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+331 lines, -422 lines) Patch
M examples/apptest/example_service_application.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M examples/audio_play_test/play_tone.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/audio_play_test/play_wav.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/authentication_demo/google_authentication_demo.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/bank_app/bank.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/bank_app/customer.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/content_handler_demo/content_handler_demo.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/echo/echo_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/echo/echo_client_sync.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/echo/echo_server.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/echo_terminal/main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M examples/hello_mojo/hello_mojo_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/hello_mojo/hello_mojo_server.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/http_handler/http_handler.cc View 2 chunks +3 lines, -1 line 0 comments Download
M examples/indirect_service/indirect_integer_service.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M examples/indirect_service/indirect_service_demo.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M examples/indirect_service/integer_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/media_test/media_test_app.cc View 2 chunks +3 lines, -1 line 0 comments Download
M examples/native_run_app/native_run_app.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M examples/notification_generator/notification_generator.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M examples/spinning_cube/spinning_cube_app.cc View 1 chunk +1 line, -1 line 0 comments Download
M examples/wget/wget.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/application/BUILD.gn View 1 chunk +1 line, -1 line 0 comments Download
M mojo/application/run_application.cc View 5 chunks +9 lines, -27 lines 0 comments Download
M mojo/application/run_application_options_chromium.h View 1 chunk +1 line, -2 lines 0 comments Download
M mojo/environment/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A mojo/environment/scoped_chromium_init.h View 1 chunk +42 lines, -0 lines 0 comments Download
A mojo/environment/scoped_chromium_init.cc View 1 chunk +22 lines, -0 lines 0 comments Download
M mojo/public/cpp/application/lib/run_application.cc View 2 chunks +0 lines, -10 lines 0 comments Download
M mojo/public/cpp/application/run_application.h View 1 chunk +17 lines, -26 lines 0 comments Download
M mojo/public/cpp/bindings/tests/versioning_test_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/log/cpp/log_client.h View 1 chunk +1 line, -1 line 0 comments Download
M services/asset_bundle/main.cc View 3 chunks +6 lines, -3 lines 0 comments Download
M services/authenticating_url_loader_interceptor/main.cc View 1 chunk +3 lines, -1 line 0 comments Download
M services/authentication/main.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M services/clipboard/main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/device_info/device_info.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/files/main.cc View 1 chunk +3 lines, -1 line 0 comments Download
M services/http_server/http_server_app.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/icu_data/main.cc View 1 chunk +3 lines, -1 line 0 comments Download
M services/js/content_handler_main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/keyboard/linux/main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/log/main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/media/audio/audio_server_app.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/nacl/nonsfi/content_handler_main_nexe.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/nacl/nonsfi/content_handler_main_pexe.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/nacl/nonsfi/pnacl_compile.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/nacl/nonsfi/pnacl_link.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/nacl/sfi/content_handler_main.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/native_support/main.cc View 4 chunks +6 lines, -12 lines 0 comments Download
M services/native_viewport/BUILD.gn View 6 chunks +15 lines, -8 lines 0 comments Download
D services/native_viewport/app_delegate.h View 1 chunk +0 lines, -51 lines 0 comments Download
D services/native_viewport/app_delegate.cc View 1 chunk +0 lines, -84 lines 0 comments Download
M services/native_viewport/main.cc View 1 chunk +13 lines, -8 lines 0 comments Download
A services/native_viewport/native_viewport_app.h View 1 chunk +37 lines, -0 lines 0 comments Download
A + services/native_viewport/native_viewport_app.cc View 2 chunks +32 lines, -33 lines 0 comments Download
D services/native_viewport/ozone/app_delegate_ozone.h View 1 chunk +0 lines, -27 lines 0 comments Download
D services/native_viewport/ozone/app_delegate_ozone.cc View 1 chunk +0 lines, -41 lines 0 comments Download
A + services/native_viewport/ozone/native_viewport_app_ozone.h View 2 chunks +8 lines, -8 lines 0 comments Download
A + services/native_viewport/ozone/native_viewport_app_ozone.cc View 1 chunk +9 lines, -11 lines 0 comments Download
M services/prediction/prediction_service_impl.cc View 2 chunks +3 lines, -1 line 0 comments Download
M services/python/content_handler/content_handler_main.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M services/test_service/test_request_tracker_application.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/test_service/test_service_application.cc View 1 chunk +1 line, -1 line 0 comments Download
M services/tracing/main.cc View 1 chunk +3 lines, -1 line 0 comments Download
M shell/test/pingable_app.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/mojo/drm_ipc_init_helper.cc View 3 chunks +10 lines, -10 lines 0 comments Download
M ui/ozone/public/ipc_init_helper_mojo.h View 1 chunk +10 lines, -7 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
viettrungluu
This change isn't really quite as big as it looks (though it's still unfortunately a ...
4 years, 6 months ago (2016-05-27 18:24:59 UTC) #1
viettrungluu
ping
4 years, 6 months ago (2016-05-31 16:52:40 UTC) #2
vardhan
lgtm
4 years, 6 months ago (2016-05-31 18:25:42 UTC) #3
viettrungluu
4 years, 6 months ago (2016-05-31 19:19:25 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
911b5de92406e7644cc15f457039e57629788508 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698