Skip to content

Commit

Permalink
Merge pull request #12 from brave/split-patches
Browse files Browse the repository at this point in the history
patchfile modifications: split master_patch.patch using new utility
  • Loading branch information
bridiver authored Dec 29, 2017
2 parents 9fe9732 + 49f25e5 commit d5de8e4
Show file tree
Hide file tree
Showing 30 changed files with 635 additions and 635 deletions.
11 changes: 11 additions & 0 deletions patches/build-config-chrome_build.gni.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/build/config/chrome_build.gni b/build/config/chrome_build.gni
index c649018a7a0aeb20caeb2bf37c60d57c48630f1b..9a320d8b5f46f2c7f2d269b7a1cc3b2cf91c07a7 100644
--- a/build/config/chrome_build.gni
+++ b/build/config/chrome_build.gni
@@ -18,5 +18,5 @@ declare_args() {
if (is_chrome_branded) {
branding_path_component = "google_chrome"
} else {
- branding_path_component = "chromium"
+ branding_path_component = "brave"
}
112 changes: 112 additions & 0 deletions patches/chrome-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 5d0274b0424ecfd527962c5116370a7593d10d15..7ac0fbca6097048f8011a60fed753740c427de3e 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -54,7 +54,7 @@ if (is_win) {
"$root_out_dir/initialexe/chrome.exe",
]
outputs = [
- "$root_out_dir/chrome.exe",
+ "$root_out_dir/brave.exe",
]
if (symbol_level != 0) {
outputs += [ "$root_out_dir/chrome.exe.pdb" ]
@@ -238,6 +238,8 @@ if (!is_android && !is_mac) {
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
+ "//brave/app/brave_main_delegate.cc",
+ "//brave/app/brave_main_delegate.h",
]

deps += [
@@ -308,7 +310,7 @@ if (!is_android && !is_mac) {
if (is_win) {
output_name = "initialexe/chrome"
} else {
- output_name = "chrome"
+ output_name = "brave"
}

sources = []
@@ -357,6 +359,8 @@ if (is_win) {
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
+ "//brave/app/brave_main_delegate.cc",
+ "//brave/app/brave_main_delegate.h",
]

output_name = "chrome"
@@ -465,6 +469,8 @@ if (is_win) {
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
+ "//brave/app/brave_main_delegate.cc",
+ "//brave/app/brave_main_delegate.h",
]

configs += [ "//build/config/compiler:wexit_time_destructors" ]
@@ -534,7 +540,9 @@ if (is_win) {
} else if (is_mac) {
chrome_helper_name = chrome_product_full_name + " Helper"
chrome_framework_name = chrome_product_full_name + " Framework"
- chrome_framework_version = "A"
+ # TODO(bridiver) - not sure why this has to be commented out, but otherwise
+ # it puts the framework in the wrong place for chrome_exe_main_mac.cc
+ # chrome_framework_version = "A"

group("chrome") {
deps = [
@@ -649,7 +657,7 @@ if (is_win) {
args =
[
"-b",
- "${branding_path_component}_strings",
+ _strings_file,
"-v",
rebase_path(chrome_version_file, root_build_dir),
"-g",
@@ -1150,6 +1158,8 @@ if (is_win) {
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
+ "//brave/app/brave_main_delegate.cc",
+ "//brave/app/brave_main_delegate.h",
"app/chrome_main_mac.h",
"app/chrome_main_mac.mm",
]
@@ -1389,6 +1399,7 @@ if (is_win) {

group("browser_dependencies") {
public_deps = [
+ "//brave:browser_dependencies",
"//chrome/browser",
"//chrome/common",
"//components/sync",
@@ -1426,6 +1437,7 @@ group("browser_dependencies") {

group("child_dependencies") {
public_deps = [
+ "//brave:child_dependencies",
"//chrome/browser/devtools",
"//chrome/child",
"//chrome/common",
@@ -1715,6 +1727,8 @@ if (is_android) {
"app/android/chrome_main_delegate_android.h",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
+ "//brave/app/brave_main_delegate.cc",
+ "//brave/app/brave_main_delegate.h",
]

include_dirs = [ android_ndk_include_dir ]
@@ -1770,7 +1784,7 @@ if (is_linux) {
dump_syms_binary =
get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"

- chrome_binary = "$root_out_dir/chrome"
+ chrome_binary = "$root_out_dir/brave"
if (current_cpu == "x86") {
# GYP used "ia32" so keep that naming for back-compat.
symbol_file = "$root_out_dir/chrome.breakpad.ia32"
13 changes: 13 additions & 0 deletions patches/chrome-app-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn
index 8896752d5b9faacff253afa54ae264417dbe3372..18c4df2427bb3ed0dffdf20faeeb71322200ed7c 100644
--- a/chrome/app/BUILD.gn
+++ b/chrome/app/BUILD.gn
@@ -243,7 +243,7 @@ grit("google_chrome_strings") {
}

grit("chromium_strings") {
- source = "chromium_strings.grd"
+ source = "${branding_path_component}_strings.grd"
defines = chrome_grit_defines
output_dir = "$root_gen_dir/chrome"
outputs = [
21 changes: 21 additions & 0 deletions patches/chrome-app-chrome_main.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index 90b02a13ed7674b5b4266ffd8e09fcca0392dfc3..0e182ac84efab144a310c6687996d59e4fbe3620 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -7,6 +7,7 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/time/time.h"
+#include "brave/app/brave_main_delegate.h"
#include "build/build_config.h"
#include "chrome/app/chrome_main_delegate.h"
#include "chrome/common/chrome_switches.h"
@@ -60,7 +61,7 @@ int ChromeMain(int argc, const char** argv) {
install_static::InitializeFromPrimaryModule();
#endif

- ChromeMainDelegate chrome_main_delegate(
+ BraveMainDelegate chrome_main_delegate(
base::TimeTicks::FromInternalValue(exe_entry_point_ticks));
content::ContentMainParams params(&chrome_main_delegate);

12 changes: 12 additions & 0 deletions patches/chrome-browser-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 3bb9e572d56851f54a973cda36ec1ea78c489279..e31a0397bdaa585e22f4becdcb922fc071785147 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1769,6 +1769,7 @@ split_static_library("browser") {
"//ui/strings",
"//ui/surface",
"//ui/web_dialogs",
+ "//brave/browser:browser_process",
]

if (is_android) {
21 changes: 21 additions & 0 deletions patches/chrome-browser-browser_process_impl.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 4d8b9911eb906dc2d691224eeb106a990c5d5215..2de52b498cadaa18d362333a19ba5ba5d0aaac75 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -34,6 +34,7 @@
#include "base/time/default_clock.h"
#include "base/time/default_tick_clock.h"
#include "base/trace_event/trace_event.h"
+#include "brave/components/brave_shields/browser/brave_resource_dispatcher_host_delegate.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/chrome_child_process_watcher.h"
@@ -991,7 +992,7 @@ BrowserProcessImpl::supervised_user_whitelist_installer() {

void BrowserProcessImpl::ResourceDispatcherHostCreated() {
resource_dispatcher_host_delegate_ =
- base::MakeUnique<ChromeResourceDispatcherHostDelegate>();
+ base::MakeUnique<BraveResourceDispatcherHostDelegate>();
ResourceDispatcherHost::Get()->SetDelegate(
resource_dispatcher_host_delegate_.get());

12 changes: 12 additions & 0 deletions patches/chrome-browser-browser_process_impl.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
index da85f01c59cf8a2b34dc7d189f3043580fd84e29..7c8c973f2639b6c4c43523939cca859ce36769aa 100644
--- a/chrome/browser/browser_process_impl.h
+++ b/chrome/browser/browser_process_impl.h
@@ -163,6 +163,7 @@ class BrowserProcessImpl : public BrowserProcess,
static void RegisterPrefs(PrefRegistrySimple* registry);

private:
+ friend class BraveBrowserProcessImpl;
// KeepAliveStateObserver implementation
void OnKeepAliveStateChanged(bool is_keeping_alive) override;
void OnKeepAliveRestartStateChanged(bool can_restart) override;
21 changes: 21 additions & 0 deletions patches/chrome-browser-chrome_browser_main.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 11c6e800349c9e5ba967c94f81a053efa387ec9a..372a4b846c919484762bc45623e815baf5010f0b 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -44,6 +44,7 @@
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
+#include "brave/browser/brave_browser_process_impl.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
#include "chrome/browser/about_flags.h"
@@ -955,7 +956,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
{
TRACE_EVENT0("startup",
"ChromeBrowserMainParts::PreCreateThreadsImpl:InitBrowswerProcessImpl");
- browser_process_.reset(new BrowserProcessImpl(local_state_task_runner.get(),
+ browser_process_.reset(new BraveBrowserProcessImpl(local_state_task_runner.get(),
parsed_command_line()));
}

12 changes: 12 additions & 0 deletions patches/chrome-browser-chrome_content_browser_client.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 9c4601f9cecefbf11af5ffd110aa7ba4f7c0f2e4..450454de247773495767fac28b038be588a888b5 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -372,6 +372,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
content::BrowserContext* browser_context);

private:
+ friend class BraveContentBrowserClient;
friend class DisableWebRtcEncryptionFlagTest;
friend class InProcessBrowserTest;

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc
index 17c4ec23b3816b62f65e01a6f27397413272dd71..56d8602e422ed4e16e33f521b355dca4c0e2596c 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/api/chrome_extensions_api_client.h"
#include "chrome/browser/extensions/api/content_settings/content_settings_service.h"
+#include "brave/common/extensions/api/generated_api_registration.h"
#include "chrome/browser/extensions/api/generated_api_registration.h"
#include "chrome/browser/extensions/api/preference/preference_api.h"
#include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h"
@@ -284,6 +285,9 @@ void ChromeExtensionsBrowserClient::RegisterExtensionFunctions(

// Generated APIs from Chrome.
api::ChromeGeneratedFunctionRegistry::RegisterAll(registry);
+
+ // Generated APIs from Brave.
+ api::BraveGeneratedFunctionRegistry::RegisterAll(registry);
}

void ChromeExtensionsBrowserClient::RegisterExtensionInterfaces(
13 changes: 13 additions & 0 deletions patches/chrome-browser-net-chrome_network_delegate.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index e055ef156da9ea78b1dee96ee04f9c061267c775..5ffcecf64f39f3ff593cd30d9c1ef551be5f1a27 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -144,6 +144,8 @@ class ChromeNetworkDelegate : public net::NetworkDelegateImpl {
static void EnableAccessToAllFilesForTesting(bool enabled);

private:
+ friend class BraveNetworkDelegate;
+
// NetworkDelegate implementation.
int OnBeforeURLRequest(net::URLRequest* request,
const net::CompletionCallback& callback,
21 changes: 21 additions & 0 deletions patches/chrome-browser-profiles-profile_io_data.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 7bcc72f67676bf1bd388109e94bd0739cd588957..cd1cfd7930ace33eb1c6e72b39133c815a656be2 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -25,6 +25,7 @@
#include "base/strings/string_util.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "brave/browser/net/brave_network_delegate.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -1020,7 +1021,7 @@ void ProfileIOData::Init(
builder->set_ssl_config_service(profile_params_->ssl_config_service);

std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate(
- new ChromeNetworkDelegate(
+ new BraveNetworkDelegate(
#if BUILDFLAG(ENABLE_EXTENSIONS)
io_thread_globals->extension_event_router_forwarder.get(),
#else
20 changes: 20 additions & 0 deletions patches/chrome-browser-ui-tab_helpers.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc
index ff3b6d2d23c6d785da2358bfac6723e1fce971a1..3eb0a4e6e813e65dd33fd4bfb750c3957311ed1f 100644
--- a/chrome/browser/ui/tab_helpers.cc
+++ b/chrome/browser/ui/tab_helpers.cc
@@ -11,6 +11,7 @@
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/time/default_tick_clock.h"
+#include "brave/browser/brave_tab_helpers.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
@@ -184,6 +185,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
BookmarkLastVisitUpdater::MaybeCreateForWebContentsWithBookmarkModel(
web_contents, BookmarkModelFactory::GetForBrowserContext(
web_contents->GetBrowserContext()));
+ brave::AttachTabHelpers(web_contents);
chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents);
chrome_browser_net::PredictorTabHelper::CreateForWebContents(web_contents);
if (base::FeatureList::IsEnabled(kDecoupleTranslateLanguageFeature)) {
18 changes: 18 additions & 0 deletions patches/chrome-common-chrome_constants.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index d4e0823a55994118bacfe4fd7f8ec1881640e8ac..84788c9cc020c756c45e96fab8ab2119df1b18f8 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -10,11 +10,11 @@
#define FPL FILE_PATH_LITERAL

#if defined(OS_MACOSX)
-#define CHROMIUM_PRODUCT_STRING "Chromium"
+#define CHROMIUM_PRODUCT_STRING "Brave"
#if defined(GOOGLE_CHROME_BUILD)
#define PRODUCT_STRING "Google Chrome"
#elif defined(CHROMIUM_BUILD)
-#define PRODUCT_STRING "Chromium"
+#define PRODUCT_STRING "Brave"
#else
#error Unknown branding
#endif
16 changes: 16 additions & 0 deletions patches/chrome-common-chrome_paths_linux.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc
index fc47bd3f12418fdaed879e0b485bfc7cb572a6e8..9f02b6d08385a175354831a8037cb7be933de7df 100644
--- a/chrome/common/chrome_paths_linux.cc
+++ b/chrome/common/chrome_paths_linux.cc
@@ -89,8 +89,10 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {

#if defined(GOOGLE_CHROME_BUILD)
*result = config_dir.Append("google-chrome" + GetChannelSuffixForDataDir());
+#elif defined(OFFICIAL_BUILD)
+ *result = config_dir.Append("brave");
#else
- *result = config_dir.Append("chromium");
+ *result = config_dir.Append("brave-development");
#endif
return true;
}
16 changes: 16 additions & 0 deletions patches/chrome-common-chrome_paths_mac.mm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index cca3bbb41ae25484c3e87c9aba09a8b07741e2b2..f231ca44af970aed896f3c62e0a39fc6e61d0b72 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -58,8 +58,10 @@ char* ProductDirNameForBundle(NSBundle* chrome_bundle) {
if (!product_dir_name) {
#if defined(GOOGLE_CHROME_BUILD)
product_dir_name = "Google/Chrome";
+#elif defined(OFFICIAL_BUILD)
+ product_dir_name = "Brave";
#else
- product_dir_name = "Chromium";
+ product_dir_name = "Brave-Development";
#endif
}

Loading

0 comments on commit d5de8e4

Please sign in to comment.