Skip to content

Commit

Permalink
Add blimp to root GN check_targets
Browse files Browse the repository at this point in the history
//blimp has not been checked for GN issues until now, which has caused
incorrect dependencies to creep in, as well as several missing
dependencies.

This CL adds //blimp/* to the list of targets that should always be
checked by GN, which should prevent further issues.

As part of this change, several parts of //blimp/engine:app had to be
split out into their own source_sets since otherwise there would be
cyclic dependencies between different targets in //blimp/engine/*.

The functionality related to getting the user agent was also moved
from the blimp_content_client.h header into its own file, also to
remove a cyclic dependency.

The blimp_client_export.h file is not needed anymore, since no symbols
ever need to be exported from the client, so it has thus been removed.

Lastly, all deps that used to be //content have now been changed to
more specific ones, such as //content/public/browser. This lead to an
issue with //content/app, since //content/app/content_main_runner.cc
refers to PpapiPluginMain in RunZygote if ENABLE_PLUGINS is defined, a
missing dependency was added to the content_app_deps in
//content/app/BUILD.gn. This should only be added on linux though,
since the code that uses it is only used on linux, and adding it on
Windows when is_multi_dll_chrome is true would lead to both the browser
and the child process to get it, when only the child process should
have it. This also required updating the visibility
of the //content/ppapi:ppapi_plugin_sources target to allow for this.

BUG=597830

Review-Url: https://codereview.chromium.org/1922613003
Cr-Commit-Position: refs/heads/master@{#390483}
  • Loading branch information
tommynyquist authored and Commit bot committed Apr 28, 2016
1 parent e98a8fb commit 409b336
Show file tree
Hide file tree
Showing 21 changed files with 213 additions and 88 deletions.
1 change: 1 addition & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ check_targets = [
#"//apps/*", # Medium-hard.
"//ash/*",
"//base/*",
"//blimp/*",
"//blink/*",
"//breakpad/*",
"//build/*",
Expand Down
19 changes: 16 additions & 3 deletions blimp/client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ source_set("blimp_client") {
"app/blimp_discardable_memory_allocator.h",
"app/blimp_startup.cc",
"app/blimp_startup.h",
"blimp_client_export.h",
"session/assignment_source.cc",
"session/assignment_source.h",
"session/blimp_client_session.cc",
"session/blimp_client_session.h",
]

defines = [ "BLIMP_CLIENT_IMPLEMENTATION=1" ]

public_deps = [
"//components/safe_json",
"//components/url_formatter",
Expand All @@ -35,6 +32,7 @@ source_set("blimp_client") {
deps = [
":feature",
"//base",
"//blimp/common:blimp_common",
"//blimp/common/proto",
"//blimp/net:blimp_net",
"//cc",
Expand All @@ -43,6 +41,7 @@ source_set("blimp_client") {
"//net",
"//third_party/libwebp",
"//ui/gfx/geometry",
"//ui/gl",
"//url:url",
]
}
Expand All @@ -57,6 +56,7 @@ source_set("blimp_client_unit_tests") {
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//blimp/common:blimp_common",
"//testing/gmock",
"//testing/gtest",
]
Expand Down Expand Up @@ -129,12 +129,18 @@ source_set("feature") {
"//blimp/net:blimp_net",
"//cc",
"//cc/proto",
"//components/url_formatter",
"//gpu/command_buffer/client",
"//gpu/command_buffer/client:gl_in_process_context",
"//gpu/command_buffer/client:gles2_c_lib",
"//gpu/command_buffer/client:gles2_implementation",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/skia_bindings",
"//net",
"//skia",
"//third_party/WebKit/public:blink_headers",
"//ui/base/ime:text_input_types",
"//ui/events:gesture_detection",
"//ui/events/blink",
"//ui/events/gestures/blink",
"//ui/gl",
Expand Down Expand Up @@ -165,9 +171,13 @@ source_set("feature_unit_tests") {
"//blimp/net:blimp_net",
"//blimp/net:test_support",
"//cc/proto",
"//net",
"//net:test_support",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//ui/events:gesture_detection",
"//ui/gfx/geometry",
]

if (is_linux) {
Expand All @@ -193,6 +203,7 @@ if (is_linux && !is_chromeos && use_x11) {
"//blimp/net:blimp_net",
"//net",
"//ui/events/platform/x11",
"//ui/platform_window",
"//ui/platform_window/x11",
]

Expand Down Expand Up @@ -362,10 +373,12 @@ if (is_android) {
":feature",
":jni_headers",
"//base",
"//blimp/common:blimp_common",
"//blimp/common/proto",
"//blimp/net:blimp_net",
"//components/safe_json/android:safe_json_jni_headers",
"//components/url_formatter",
"//net",
"//skia",
"//ui/base/ime:text_input_types",
"//ui/gfx/geometry",
Expand Down
6 changes: 2 additions & 4 deletions blimp/client/app/blimp_startup.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
#ifndef BLIMP_CLIENT_APP_BLIMP_STARTUP_H_
#define BLIMP_CLIENT_APP_BLIMP_STARTUP_H_

#include "blimp/client/blimp_client_export.h"

namespace blimp {
namespace client {

BLIMP_CLIENT_EXPORT void InitializeLogging();
void InitializeLogging();

BLIMP_CLIENT_EXPORT bool InitializeMainMessageLoop();
bool InitializeMainMessageLoop();

} // namespace client
} // namespace blimp
Expand Down
29 changes: 0 additions & 29 deletions blimp/client/blimp_client_export.h

This file was deleted.

3 changes: 1 addition & 2 deletions blimp/client/feature/compositor/blimp_compositor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/client/feature/compositor/blimp_input_manager.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_client.h"
Expand Down Expand Up @@ -85,7 +84,7 @@ class BlimpCompositorClient {
// RenderWidget, identified by a custom |render_widget_id| generated on the
// engine. The lifetime of this compositor is controlled by its corresponding
// RenderWidget.
class BLIMP_CLIENT_EXPORT BlimpCompositor
class BlimpCompositor
: public cc::LayerTreeHostClient,
public cc::RemoteProtoChannel,
public BlimpInputManagerClient {
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/feature/ime_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <string>

#include "base/macros.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/net/blimp_message_processor.h"
#include "ui/base/ime/text_input_type.h"

Expand All @@ -29,7 +28,7 @@ namespace client {
// user navigates away from the currently page or the page loads for the first
// time), ImeMessage::HIDE_IME will be sent.

class BLIMP_CLIENT_EXPORT ImeFeature : public BlimpMessageProcessor {
class ImeFeature : public BlimpMessageProcessor {
public:
// A delegate to be notified of text input requests.
class Delegate {
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/feature/navigation_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "base/containers/small_map.h"
#include "base/macros.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/net/blimp_message_processor.h"

class GURL;
Expand All @@ -22,7 +21,7 @@ namespace client {
// Handles all incoming and outgoing protobuf messages of type
// RenderWidget::NAVIGATION. Delegates can be added to be notified of incoming
// messages.
class BLIMP_CLIENT_EXPORT NavigationFeature : public BlimpMessageProcessor {
class NavigationFeature : public BlimpMessageProcessor {
public:
// A delegate to be notified of specific navigation events related to a
// a particular tab.
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/feature/render_widget_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "base/containers/small_map.h"
#include "base/macros.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/net/blimp_message_processor.h"
#include "blimp/net/input_message_generator.h"

Expand All @@ -38,7 +37,7 @@ namespace client {
// notified of incoming messages. This class automatically attaches a specific
// id so that the engine can drop stale RenderWidget related messages after it
// sends a RenderWidgetMessage::INITIALIZE message.
class BLIMP_CLIENT_EXPORT RenderWidgetFeature : public BlimpMessageProcessor {
class RenderWidgetFeature : public BlimpMessageProcessor {
public:
// A delegate to be notified of specific RenderWidget related incoming events.
class RenderWidgetFeatureDelegate {
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/feature/settings_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
#define BLIMP_CLIENT_FEATURE_SETTINGS_FEATURE_H_

#include "base/macros.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/net/blimp_message_processor.h"

namespace blimp {
namespace client {

// The feature is used to send global settings to the engine.
class BLIMP_CLIENT_EXPORT SettingsFeature : public BlimpMessageProcessor {
class SettingsFeature : public BlimpMessageProcessor {
public:
SettingsFeature();
~SettingsFeature() override;
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/feature/tab_control_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <memory>

#include "base/macros.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/net/blimp_message_processor.h"
#include "ui/gfx/geometry/size.h"

Expand All @@ -19,7 +18,7 @@ class Size;
namespace blimp {
namespace client {

class BLIMP_CLIENT_EXPORT TabControlFeature : public BlimpMessageProcessor {
class TabControlFeature : public BlimpMessageProcessor {
public:
TabControlFeature();
~TabControlFeature() override;
Expand Down
5 changes: 2 additions & 3 deletions blimp/client/session/assignment_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "blimp/client/blimp_client_export.h"
#include "net/base/ip_endpoint.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
Expand All @@ -34,7 +33,7 @@ const char kDummyClientToken[] = "MyVoiceIsMyPassport";

// An Assignment contains the configuration data needed for a client
// to connect to the engine.
struct BLIMP_CLIENT_EXPORT Assignment {
struct Assignment {
enum TransportProtocol {
UNKNOWN = 0,
SSL = 1,
Expand Down Expand Up @@ -64,7 +63,7 @@ struct BLIMP_CLIENT_EXPORT Assignment {

// AssignmentSource provides functionality to find out how a client should
// connect to an engine.
class BLIMP_CLIENT_EXPORT AssignmentSource : public net::URLFetcherDelegate {
class AssignmentSource : public net::URLFetcherDelegate {
public:
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blimp.assignment
Expand Down
3 changes: 1 addition & 2 deletions blimp/client/session/blimp_client_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/threading/thread.h"
#include "blimp/client/blimp_client_export.h"
#include "blimp/client/session/assignment_source.h"
#include "blimp/common/proto/blimp_message.pb.h"
#include "blimp/net/blimp_message_processor.h"
Expand Down Expand Up @@ -54,7 +53,7 @@ class NetworkEventObserver {
// This session glues together the feature proxy components and the network
// layer. The network components must be interacted with on the IO thread. The
// feature proxies must be interacted with on the UI thread.
class BLIMP_CLIENT_EXPORT BlimpClientSession : public NetworkEventObserver {
class BlimpClientSession : public NetworkEventObserver {
public:
explicit BlimpClientSession(const GURL& assigner_endpoint);

Expand Down
3 changes: 3 additions & 0 deletions blimp/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ source_set("unit_tests") {

deps = [
":blimp_common",
"//base",
"//blimp/common/proto",
"//blimp/net:test_support",
"//crypto",
"//testing/gmock",
"//testing/gtest",
]
Expand Down
Loading

0 comments on commit 409b336

Please sign in to comment.