Skip to content

Commit

Permalink
Reland of Mojo: Eliminate duplicate C API symbols (patchset chromium#1
Browse files Browse the repository at this point in the history
…id:1 of https://codereview.chromium.org/2047813003/ )

Reason for revert:
Reverting this didn't fix the failure after all

Original issue's description:
> Revert of Mojo: Eliminate duplicate C API symbols (patchset chromium#3 id:80001 of https://codereview.chromium.org/2044023004/ )
>
> Reason for revert:
> tentative revert due to linker errors. this doesn't make sense. nothing makes sense. RIP sanity
>
> Original issue's description:
> > Mojo: Eliminate duplicate C API symbols
> >
> > This gets rid of the duplicate definitions of public
> > Mojo C API symbols, instead making mojo/public/c/system
> > the singular source of these definitions. This allows
> > targets to be linked against mojo/public libraries
> > without requiring any additional EDK dependencies at
> > build time.
> >
> > To facilitate this the EDK uses the same set of API
> > thunks as the public library, and the public library
> > exposes a special embedder API (distinct from the DSO
> > MojoSetSystemThunks call used by the native app loader)
> > for setting these thunks. The MojoSetSystemThunks API
> > is moved to a module which is only linked directly into
> > app DSOs.
> >
> > Because mojo/public/c/system and mojo/edk/system are
> > now both components, and because there are no longer
> > redundant exports between the two, it's now safe for
> > targets to depend on either one or both of them as
> > needed without encountering duplicate definitions.
> >
> > Also some opportunistic cleanup of Mojo build rules.
> >
> > BUG=612500
> >
> > Committed: https://crrev.com/464e306a82ead839f02f1930a684400228b72495
> > Cr-Commit-Position: refs/heads/master@{#398605}
>
> [email protected]
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=612500
>
> Committed: https://crrev.com/e8e242161954d86ce8e064f8a6515bc818d5b600
> Cr-Commit-Position: refs/heads/master@{#398614}

[email protected]
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=612500

Review-Url: https://codereview.chromium.org/2048053003
Cr-Commit-Position: refs/heads/master@{#398622}
  • Loading branch information
krockot authored and Commit bot committed Jun 8, 2016
1 parent 55b6d51 commit 26ec28c
Show file tree
Hide file tree
Showing 23 changed files with 273 additions and 383 deletions.
12 changes: 2 additions & 10 deletions mojo/edk/embedder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ source_set("embedder") {
"embedder.h",
"embedder_internal.h",
"entrypoints.cc",
"entrypoints.h",

# Test-only code:
# TODO(vtl): It's a little unfortunate that these end up in the same
Expand All @@ -46,12 +47,7 @@ source_set("embedder") {
"test_embedder.h",
]

defines = [
"MOJO_SYSTEM_IMPL_IMPLEMENTATION",
"MOJO_SYSTEM_IMPLEMENTATION",
]

configs += [ "//mojo/edk/system:system_config" ]
defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]

public_deps = [
":delegates",
Expand Down Expand Up @@ -98,8 +94,6 @@ source_set("platform") {

defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]

configs += [ "//mojo/edk/system:system_config" ]

public_deps = [
"//mojo/public/cpp/system",
]
Expand Down Expand Up @@ -131,8 +125,6 @@ source_set("delegates") {

defines = [ "MOJO_SYSTEM_IMPL_IMPLEMENTATION" ]

configs += [ "//mojo/edk/system:system_config" ]

public_deps = [
"//mojo/public/cpp/system",
]
Expand Down
5 changes: 5 additions & 0 deletions mojo/edk/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "base/task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/embedder/entrypoints.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/process_delegate.h"
#include "mojo/edk/system/core.h"
Expand Down Expand Up @@ -68,6 +69,10 @@ void SetParentPipeHandleFromCommandLine() {
}

void Init() {
MojoSystemThunks thunks = MakeSystemThunks();
size_t expected_size = MojoEmbedderSetSystemThunks(&thunks);
DCHECK_EQ(expected_size, sizeof(thunks));

internal::g_core = new Core();
}

Expand Down
Loading

0 comments on commit 26ec28c

Please sign in to comment.