Skip to content

Commit

Permalink
Move GURL ParamTraits to url/ipc
Browse files Browse the repository at this point in the history
As a part of the GPU refactor for Mus, we are trying to eliminate spots where content/common/gpu depends on
content/. One such dependency is GURL. As per discussion here:
https://codereview.chromium.org/1703163002/, the plan of record is to move
GURL ParamTraits out of content/ and into url/.

BUG=586368
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Committed: https://crrev.com/45eb2e749a8b08988ab45bfd6806c004e9f511fa
Cr-Commit-Position: refs/heads/master@{#378859}

Review URL: https://codereview.chromium.org/1722773002

Cr-Commit-Position: refs/heads/master@{#379122}
  • Loading branch information
mdittmer authored and Commit bot committed Mar 3, 2016
1 parent c4c351d commit 67b71ea
Show file tree
Hide file tree
Showing 66 changed files with 338 additions and 153 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ group("both_gn_and_gyp") {
"//ui/events:events_unittests",
"//ui/gl:gl_unittests",
"//ui/touch_selection:ui_touch_selection_unittests",
"//url/ipc:url_ipc_unittests",
]
} else {
deps += [
Expand Down
1 change: 1 addition & 0 deletions android_webview/android_webview.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
'../ui/events/events.gyp:gesture_detection',
'../ui/gl/gl.gyp:gl',
'../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
'../url/ipc/url_ipc.gyp:url_ipc',
'../v8/tools/gyp/v8.gyp:v8',
'android_webview_pak',
'android_webview_version',
Expand Down
1 change: 1 addition & 0 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
['OS!="ios"', {
'dependencies': [
'../ui/gl/gl_tests.gyp:gl_unittests',
'../url/ipc/url_ipc.gyp:url_ipc_unittests',
],
}],
['OS!="ios" and OS!="mac"', {
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "base/macros.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
Expand Down
6 changes: 5 additions & 1 deletion chrome/chrome_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
'<(DEPTH)/ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/url/url.gyp:url_lib',
'<(DEPTH)/url/ipc/url_ipc.gyp:url_ipc',
],
'sources': [
'<@(chrome_common_sources)'
Expand Down Expand Up @@ -496,7 +497,10 @@
],
}, {
# Non-Android.
'sources': [ '<@(chrome_common_importer_sources)' ]
'sources': [ '<@(chrome_common_importer_sources)' ],
'dependencies': [
'<(DEPTH)/url/ipc/url_ipc.gyp:url_ipc',
],
}],
['OS=="win"', {
'include_dirs': [
Expand Down
1 change: 0 additions & 1 deletion chrome/common/common_message_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ namespace IPC {
namespace IPC {
#include "chrome/common/common_message_generator.h"
} // namespace IPC

4 changes: 3 additions & 1 deletion chrome/common/common_message_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

#include "chrome/common/benchmarking_messages.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/common_param_traits_macros.h"
#include "chrome/common/mac/app_shim_messages.h"
#include "chrome/common/prerender_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/common/tts_messages.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"

#if defined(ENABLE_EXTENSIONS)
#include "chrome/common/cast_messages.h"
Expand All @@ -33,4 +36,3 @@
#if defined(ENABLE_WEBRTC)
#include "chrome/common/media/webrtc_logging_messages.h"
#endif

2 changes: 1 addition & 1 deletion chrome/common/importer/profile_import_process_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "components/autofill/content/common/autofill_param_traits_macros.h"
#include "components/autofill/core/common/password_form.h"
#include "components/favicon_base/favicon_usage_data.h"
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "url/ipc/url_param_traits.h"

// Force multiple inclusion of the param traits file to generate all methods.
#undef CHROME_COMMON_IMPORTER_PROFILE_IMPORT_PROCESS_PARAM_TRAITS_MACROS_H_
Expand Down
2 changes: 1 addition & 1 deletion chrome/common/prerender_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

#include <stdint.h>

#include "content/public/common/common_param_traits.h"
#include "content/public/common/referrer.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_param_traits.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START PrerenderMsgStart

Expand Down
8 changes: 6 additions & 2 deletions chrome/common/render_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/common/common_param_traits.h"
#include "chrome/common/instant_types.h"
#include "chrome/common/ntp_logging_events.h"
#include "chrome/common/search_provider.h"
#include "chrome/common/web_application_info.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/omnibox/common/omnibox_focus_state.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/top_controls_state.h"
#include "content/public/common/webplugininfo.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerPromptReply.h"
#include "third_party/WebKit/public/web/WebConsoleMessage.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/window_open_disposition.h"
#include "url/ipc/url_param_traits.h"

// Singly-included section for enums and custom IPC traits.
#ifndef CHROME_COMMON_RENDER_MESSAGES_H_
Expand Down
2 changes: 2 additions & 0 deletions chrome/renderer/chrome_render_frame_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "base/command_line.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/common/chrome_isolated_world_ids.h"
Expand All @@ -22,6 +23,7 @@
#include "chrome/renderer/prerender/prerender_helper.h"
#include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
#include "components/translate/content/renderer/translate_helper.h"
#include "content/public/common/ssl_status.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "extensions/common/constants.h"
Expand Down
1 change: 1 addition & 0 deletions components/autofill.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc',
'../url/url.gyp:url_lib',
'../url/ipc/url_ipc.gyp:url_ipc',
],
'include_dirs': [
'..',
Expand Down
2 changes: 1 addition & 1 deletion components/content_settings.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@
'dependencies': [
'content_settings_core_common',
'../base/base.gyp:base',
'../content/content.gyp:content_common',
'../ipc/ipc.gyp:ipc',
'../url/url.gyp:url_lib',
'../url/ipc/url_ipc.gyp:url_ipc',
],
'include_dirs': [
'..',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
// Multiply-included file, no traditional include guard.
#include "base/strings/string16.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"
#include "ipc/ipc_message_macros.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START ContentSettingsMsgStart

Expand Down
1 change: 1 addition & 0 deletions components/nacl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@
],
'dependencies': [
'../content/content.gyp:content_common',
'../url/ipc/url_ipc.gyp:url_ipc',
],
},
]
Expand Down
2 changes: 1 addition & 1 deletion components/nacl/common/nacl_host_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "components/nacl/common/nacl_types.h"
#include "components/nacl/common/nacl_types_param_traits.h"
#include "components/nacl/common/pnacl_types.h"
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START NaClHostMsgStart

Expand Down
1 change: 1 addition & 0 deletions components/nacl/loader/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ if (is_linux) {
"//crypto",
"//ipc",
"//sandbox/linux:sandbox_services",
"//url/ipc:url_ipc",
]

cflags = [ "-fPIE" ]
Expand Down
1 change: 1 addition & 0 deletions components/network_hints.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'dependencies': [
'../base/base.gyp:base',
'../ui/accessibility/accessibility.gyp:accessibility',
'../url/ipc/url_ipc.gyp:url_ipc',
],
'sources': [
'network_hints/common/network_hints_common.cc',
Expand Down
2 changes: 1 addition & 1 deletion components/network_hints/common/network_hints_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <vector>

#include "components/network_hints/common/network_hints_common.h"
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "url/ipc/url_param_traits.h"

// Singly-included section for custom IPC traits.
#ifndef COMPONENTS_NETWORK_HINTS_COMMON_NETWORK_HINTS_MESSAGES_H_
Expand Down
1 change: 1 addition & 0 deletions components/network_hints/renderer/renderer_dns_prefetch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/thread_task_runner_handle.h"
#include "components/network_hints/common/network_hints_common.h"
#include "components/network_hints/common/network_hints_messages.h"
#include "components/network_hints/renderer/dns_prefetch_queue.h"
Expand Down
2 changes: 2 additions & 0 deletions components/password_manager.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
'../content/content.gyp:content_common',
'../ipc/ipc.gyp:ipc',
'../third_party/WebKit/public/blink.gyp:blink_minimal',
'../url/ipc/url_ipc.gyp:url_ipc',
'password_manager_core_common',
],
'include_dirs': [
Expand All @@ -281,6 +282,7 @@
'../content/content.gyp:content_common',
'../ipc/ipc.gyp:ipc',
'../third_party/WebKit/public/blink.gyp:blink',
'../url/ipc/url_ipc.gyp:url_ipc',
'password_manager_core_common',
'password_manager_content_common',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "base/strings/string16.h"
#include "components/password_manager/core/common/credential_manager_types.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "third_party/WebKit/public/platform/WebCredentialManagerError.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START CredentialManagerMsgStart

Expand Down
1 change: 1 addition & 0 deletions components/pdf.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'<(DEPTH)/content/content.gyp:content_common',
'<(DEPTH)/ipc/ipc.gyp:ipc',
'<(DEPTH)/url/url.gyp:url_lib',
'<(DEPTH)/url/ipc/url_ipc.gyp:url_ipc',
],
'sources': [
'pdf/common/pdf_message_generator.cc',
Expand Down
2 changes: 1 addition & 1 deletion components/pdf/common/pdf_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// Multiply-included file, no traditional include guard.
#include <string.h>

#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"
#include "content/public/common/referrer.h"
#include "ipc/ipc_message_macros.h"
#include "url/gurl.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START PDFMsgStart

Expand Down
2 changes: 0 additions & 2 deletions components/safe_json/safe_json_parser_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <vector>

#include "base/strings/string16.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/common_param_traits_macros.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"

Expand Down
2 changes: 1 addition & 1 deletion components/translate.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@
'translate_core_common',
'translate_core_language_detection',
'../base/base.gyp:base',
'../content/content.gyp:content_common',
'../ipc/ipc.gyp:ipc',
'../url/ipc/url_ipc.gyp:url_ipc',
],
'include_dirs': [
'..',
Expand Down
2 changes: 1 addition & 1 deletion components/translate/content/common/translate_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "components/translate/core/common/language_detection_details.h"
#include "components/translate/core/common/translate_errors.h"
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "url/ipc/url_param_traits.h"

#define IPC_MESSAGE_START TranslateMsgStart

Expand Down
5 changes: 3 additions & 2 deletions content/browser/frame_host/navigator_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "content/public/common/resource_response.h"
#include "content/public/common/url_constants.h"
#include "net/base/net_errors.h"
#include "url/url_constants.h"

namespace content {

Expand Down Expand Up @@ -290,8 +291,8 @@ bool NavigatorImpl::NavigateToEntry(

// The renderer will reject IPC messages with URLs longer than
// this limit, so don't attempt to navigate with a longer URL.
if (dest_url.spec().size() > kMaxURLChars) {
LOG(WARNING) << "Refusing to load URL as it exceeds " << kMaxURLChars
if (dest_url.spec().size() > url::kMaxURLChars) {
LOG(WARNING) << "Refusing to load URL as it exceeds " << url::kMaxURLChars
<< " characters.";
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion content/browser/web_contents/web_contents_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "net/test/cert_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColor.h"
#include "url/url_constants.h"

namespace content {
namespace {
Expand Down Expand Up @@ -488,7 +489,7 @@ TEST_F(WebContentsImplTest, SimpleNavigation) {
TEST_F(WebContentsImplTest, NavigateToExcessivelyLongURL) {
// Construct a URL that's kMaxURLChars + 1 long of all 'a's.
const GURL url(std::string("http://example.org/").append(
kMaxURLChars + 1, 'a'));
url::kMaxURLChars + 1, 'a'));

controller().LoadURL(
url, Referrer(), ui::PAGE_TRANSITION_GENERATED, std::string());
Expand Down
3 changes: 2 additions & 1 deletion content/child/plugin_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
#include "content/common/content_export.h"
#include "content/common/content_param_traits.h"
#include "content/common/cursors/webcursor.h"
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/surface/transport_dib.h"
#include "url/ipc/url_param_traits.h"

#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
Expand Down
7 changes: 4 additions & 3 deletions content/child/service_worker/service_worker_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "content/public/common/content_constants.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h"
#include "url/url_constants.h"

using blink::WebServiceWorkerError;
using blink::WebServiceWorkerProvider;
Expand Down Expand Up @@ -110,8 +111,8 @@ void ServiceWorkerDispatcher::RegisterServiceWorker(
WebServiceWorkerRegistrationCallbacks* callbacks) {
DCHECK(callbacks);

if (pattern.possibly_invalid_spec().size() > kMaxURLChars ||
script_url.possibly_invalid_spec().size() > kMaxURLChars) {
if (pattern.possibly_invalid_spec().size() > url::kMaxURLChars ||
script_url.possibly_invalid_spec().size() > url::kMaxURLChars) {
scoped_ptr<WebServiceWorkerRegistrationCallbacks>
owned_callbacks(callbacks);
std::string error_message(kServiceWorkerRegisterErrorPrefix);
Expand Down Expand Up @@ -161,7 +162,7 @@ void ServiceWorkerDispatcher::GetRegistration(
WebServiceWorkerGetRegistrationCallbacks* callbacks) {
DCHECK(callbacks);

if (document_url.possibly_invalid_spec().size() > kMaxURLChars) {
if (document_url.possibly_invalid_spec().size() > url::kMaxURLChars) {
scoped_ptr<WebServiceWorkerGetRegistrationCallbacks> owned_callbacks(
callbacks);
std::string error_message(kServiceWorkerGetRegistrationErrorPrefix);
Expand Down
1 change: 1 addition & 0 deletions content/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ source_set("common") {
"//ui/gfx/ipc",
"//ui/shell_dialogs",
"//url",
"//url/ipc:url_ipc",
]

if (!is_ios) {
Expand Down
Loading

0 comments on commit 67b71ea

Please sign in to comment.