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

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed)

Created:
4 years, 5 months ago by nyquist
Modified:
4 years, 5 months ago
CC:
chromium-reviews, anandc+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, jam, nyquist+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, jessicag+watch-blimp_chromium.org, kmarshall+watch-blimp_chromium.org, lethalantidote+watch-blimp_chromium.org, darin-cc_chromium.org, dtrainor+watch-blimp_chromium.org, shaktisahu+watch-blimp_chromium.org, khushalsagar+watch-blimp_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add BlimpClientContext and factory with real and dummy implementation The BlimpClientContext is the core class which wires up all of the blimp functionality. When it's created, it will get all its dependencies from the embedder. It is currently in charge of creating BlimpContents, but will also own things like the BlimpClientSession. It is part of the public //blimp/client/public API. It is a KeyedService and is typically tied to a Profile. The BlimpClientContextFactory lives in //chrome to be able to access Profile during construction, since //blimp/client currently does not depend on //content where BrowserContext lives, and there are upcoming dependencies that will be implemented by classes in //chrome. The BlimpClientContext has two implementations in //blimp/client/core, an actual one and a dummy implementation. The dummy implementation is to be used when we do not want the blimp code to be used, and the core implementation is the real blimp implementation. Which one of these are in use is controlled by the GN argument enable_blimp which defaults to false. The BlimpClientContext has a public static create-method that is not implemented in //blimp/client/public, but instead it is implemented by //blimp/client/core by both the actual and the dummy implementation, so the right method will be chosen at link-time. This means that a target can only link with either the actual or dummy implementation. Everything in //blimp/client/core is only visible to //blimp/client/* and embedders should only ever depend on //blimp/client/public, which will bring in the correct implementation. This works the same for both C++ and Java, so when using the BlimpClientContextFactory (either in Java or C++), the right implementation (actual or dummy) will always be chosen correctly based on the link-time selection of the Create-method. The BlimpClientContext has a delegate that it can call out to whenever it needs specific functionality from the embedder. As an example, this CL adds a helper for attaching a Profile to every created BlimpContents to make have similar functionality as what is built into WebContents so one can get a Profile and thereby services by only having access to a BlimpContents. BUG=611094 TBR=erg@chromium.org Committed: https://crrev.com/9aa0cdee23229ca95a3bea79abcc584a395d016e Cr-Commit-Position: refs/heads/master@{#405860}

Patch Set 1 #

Patch Set 2 : Move factory to chrome and add dummy #

Patch Set 3 : add blimp include to chrome GN file #

Patch Set 4 : Add simple unittest for factory and fix build for !enable_blimp #

Patch Set 5 : Fix naming of create vs get #

Patch Set 6 : Cleaned up the patch #

Patch Set 7 : Track master #

Patch Set 8 : Fix includes, DEPS and deps #

Patch Set 9 : remove unused private field #

Patch Set 10 : Added delegate-support to BlimpClientContext #

Total comments: 6

Patch Set 11 : Address comments. #

Patch Set 12 : merge origin/master for good measure #

Total comments: 6

Patch Set 13 : Move //blimp/client/dummy to //blimp/client/core and make //chrome depend only on //blimp/client/pu… #

Total comments: 9

Patch Set 14 : Address last comments from dpranke #

Patch Set 15 : git merge origin/master before CQ for good measure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1423 lines, -147 lines) Patch
M blimp/client/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +5 lines, -4 lines 0 comments Download
A + blimp/client/app/android/blimp_app_jni_registrar.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
A + blimp/client/app/android/blimp_app_jni_registrar.cc View 1 4 chunks +2 lines, -11 lines 0 comments Download
D blimp/client/app/android/blimp_jni_registrar.h View 1 1 chunk +0 lines, -21 lines 0 comments Download
D blimp/client/app/android/blimp_jni_registrar.cc View 1 1 chunk +0 lines, -47 lines 0 comments Download
M blimp/client/app/android/blimp_library_loader.cc View 1 2 chunks +5 lines, -1 line 0 comments Download
M blimp/client/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +106 lines, -8 lines 0 comments Download
A blimp/client/core/android/blimp_client_context_impl_android.h View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download
A blimp/client/core/android/blimp_client_context_impl_android.cc View 1 2 3 4 5 1 chunk +59 lines, -0 lines 0 comments Download
A + blimp/client/core/android/blimp_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +10 lines, -17 lines 0 comments Download
A blimp/client/core/android/dummy_blimp_client_context_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +36 lines, -0 lines 0 comments Download
A blimp/client/core/android/dummy_blimp_client_context_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
A blimp/client/core/android/dummy_blimp_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A blimp/client/core/android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A blimp/client/core/android/java/src/org/chromium/blimp/core/DummyBlimpClientContext.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
A blimp/client/core/blimp_client_context_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +52 lines, -0 lines 0 comments Download
A blimp/client/core/blimp_client_context_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +75 lines, -0 lines 0 comments Download
A blimp/client/core/blimp_client_context_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +30 lines, -0 lines 0 comments Download
M blimp/client/core/blimp_contents_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -4 lines 0 comments Download
A blimp/client/core/dummy_blimp_client_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +49 lines, -0 lines 0 comments Download
A blimp/client/core/dummy_blimp_client_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +69 lines, -0 lines 0 comments Download
M blimp/client/public/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +47 lines, -2 lines 0 comments Download
M blimp/client/public/DEPS View 1 chunk +2 lines, -0 lines 0 comments Download
A + blimp/client/public/android/blimp_jni_registrar.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
A blimp/client/public/android/java/src/org/chromium/blimp_public/BlimpClientContext.java View 1 2 3 4 5 1 chunk +20 lines, -0 lines 0 comments Download
A blimp/client/public/blimp_client_context.h View 1 2 3 4 5 6 7 8 9 1 chunk +56 lines, -0 lines 0 comments Download
A blimp/client/public/blimp_client_context_delegate.h View 1 2 3 4 5 6 7 8 9 1 chunk +33 lines, -0 lines 0 comments Download
M blimp/client/public/blimp_contents.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -3 lines 0 comments Download
A + blimp/client/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -15 lines 0 comments Download
A blimp/client/test/test_blimp_client_context_delegate.h View 1 2 3 4 5 6 7 8 9 1 chunk +39 lines, -0 lines 0 comments Download
A blimp/client/test/test_blimp_client_context_delegate.cc View 1 2 3 4 5 6 7 8 9 1 chunk +28 lines, -0 lines 0 comments Download
M build/args/blimp_client.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +1 line, -5 lines 0 comments Download
M chrome/android/java/DEPS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/blimp/ChromeBlimpClientContextDelegate.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +56 lines, -0 lines 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_client_context_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_client_context_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_client_context_factory_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_client_context_factory_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +32 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_contents_profile_attachment.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/blimp_contents_profile_attachment.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/chrome_blimp_client_context_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/chrome_blimp_client_context_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/chrome_blimp_client_context_delegate_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/android/blimp/chrome_blimp_client_context_delegate_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 4 chunks +8 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (25 generated)
nyquist
dtrainor: PTAL I'll start working on adding the delegate instead of taking the context in ...
4 years, 5 months ago (2016-07-13 16:53:45 UTC) #10
David Trainor- moved to gerrit
pretty straightforward. lgtm. https://codereview.chromium.org/2132163002/diff/180001/blimp/client/core/blimp_client_context_impl_unittest.cc File blimp/client/core/blimp_client_context_impl_unittest.cc (right): https://codereview.chromium.org/2132163002/diff/180001/blimp/client/core/blimp_client_context_impl_unittest.cc#newcode25 blimp/client/core/blimp_client_context_impl_unittest.cc:25: delegate.GetBlimpContentsWithLastAttachedHelpers()); Should we use gmock for ...
4 years, 5 months ago (2016-07-14 19:07:13 UTC) #20
David Trainor- moved to gerrit
On 2016/07/14 19:07:13, David Trainor wrote: > pretty straightforward. lgtm. On that note, I really ...
4 years, 5 months ago (2016-07-14 19:08:58 UTC) #21
nyquist
all done https://codereview.chromium.org/2132163002/diff/180001/blimp/client/core/blimp_client_context_impl_unittest.cc File blimp/client/core/blimp_client_context_impl_unittest.cc (right): https://codereview.chromium.org/2132163002/diff/180001/blimp/client/core/blimp_client_context_impl_unittest.cc#newcode25 blimp/client/core/blimp_client_context_impl_unittest.cc:25: delegate.GetBlimpContentsWithLastAttachedHelpers()); On 2016/07/14 19:07:13, David Trainor wrote: ...
4 years, 5 months ago (2016-07-14 22:56:50 UTC) #22
nyquist
dpranke: PTAL //build/args/blimp_client.gn and also //chrome/browser/BUILD.gn for guidance. thestig: PTAL OWNERS for //chrome/browser/BUILD.gn erg: PTAL ...
4 years, 5 months ago (2016-07-14 23:09:40 UTC) #24
Lei Zhang
https://codereview.chromium.org/2132163002/diff/220001/chrome/browser/android/blimp/blimp_client_context_factory.h File chrome/browser/android/blimp/blimp_client_context_factory.h (right): https://codereview.chromium.org/2132163002/diff/220001/chrome/browser/android/blimp/blimp_client_context_factory.h#newcode26 chrome/browser/android/blimp/blimp_client_context_factory.h:26: namespace chrome { BTW, a few years ago we ...
4 years, 5 months ago (2016-07-14 23:21:58 UTC) #25
Lei Zhang
4 years, 5 months ago (2016-07-14 23:24:32 UTC) #26
Dirk Pranke
https://codereview.chromium.org/2132163002/diff/220001/blimp/client/core/BUILD.gn File blimp/client/core/BUILD.gn (right): https://codereview.chromium.org/2132163002/diff/220001/blimp/client/core/BUILD.gn#newcode12 blimp/client/core/BUILD.gn:12: source_set("core") { It seems like it might make more ...
4 years, 5 months ago (2016-07-14 23:25:51 UTC) #27
nyquist
dpranke, thestig: PTAL https://codereview.chromium.org/2132163002/diff/220001/blimp/client/core/BUILD.gn File blimp/client/core/BUILD.gn (right): https://codereview.chromium.org/2132163002/diff/220001/blimp/client/core/BUILD.gn#newcode12 blimp/client/core/BUILD.gn:12: source_set("core") { On 2016/07/14 23:25:51, Dirk ...
4 years, 5 months ago (2016-07-15 17:38:19 UTC) #28
Dirk Pranke
lgtm, much cleaner (though I just checked the BUILD.gn files). https://codereview.chromium.org/2132163002/diff/240001/blimp/client/core/BUILD.gn File blimp/client/core/BUILD.gn (right): https://codereview.chromium.org/2132163002/diff/240001/blimp/client/core/BUILD.gn#newcode16 ...
4 years, 5 months ago (2016-07-15 18:31:21 UTC) #30
Lei Zhang
lgtm
4 years, 5 months ago (2016-07-15 19:01:28 UTC) #31
nyquist
All done! https://codereview.chromium.org/2132163002/diff/240001/blimp/client/core/BUILD.gn File blimp/client/core/BUILD.gn (right): https://codereview.chromium.org/2132163002/diff/240001/blimp/client/core/BUILD.gn#newcode16 blimp/client/core/BUILD.gn:16: # This target is here to facilitate ...
4 years, 5 months ago (2016-07-15 19:03:54 UTC) #32
nyquist
erg: TBRing for the DEPS on //components/keyed_service/core since we discussed this exact CL offline before ...
4 years, 5 months ago (2016-07-15 19:06:50 UTC) #34
Dirk Pranke
https://codereview.chromium.org/2132163002/diff/240001/blimp/client/public/BUILD.gn File blimp/client/public/BUILD.gn (right): https://codereview.chromium.org/2132163002/diff/240001/blimp/client/public/BUILD.gn#newcode62 blimp/client/public/BUILD.gn:62: android_library("public_headers_java") { On 2016/07/15 19:03:54, nyquist wrote: > On ...
4 years, 5 months ago (2016-07-15 19:07:59 UTC) #35
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/2132163002/280001
4 years, 5 months ago (2016-07-15 19:22:38 UTC) #38
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 5 months ago (2016-07-15 21:20:41 UTC) #40
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-15 21:21:05 UTC) #41
commit-bot: I haz the power
4 years, 5 months ago (2016-07-15 21:22:01 UTC) #43
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/9aa0cdee23229ca95a3bea79abcc584a395d016e
Cr-Commit-Position: refs/heads/master@{#405860}

Powered by Google App Engine
This is Rietveld 408576698