diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 7a386c2d7f..4ba0caa67d 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -84,6 +84,10 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_schemes->push_back(content::kChromeUIScheme); } +net::NetLog* BrowserClient::GetNetLog() { + return &net_log_; +} + base::FilePath BrowserClient::GetDefaultDownloadDirectory() { // ~/Downloads base::FilePath path; diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index b5ee8a1894..acb12b9970 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -5,6 +5,7 @@ #ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ #define BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_ +#include "browser/net_log.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/content_browser_client.h" @@ -33,13 +34,6 @@ class BrowserClient : public content::ContentBrowserClient { callback.Run(true); } - protected: - // Subclasses should override this to provide their own BrowserMainParts - // implementation. The lifetime of the returned instance is managed by the - // caller. - virtual BrowserMainParts* OverrideCreateBrowserMainParts( - const content::MainFunctionParams&); - // Subclasses that override this (e.g., to provide their own protocol // handlers) should call this implementation after doing their own work. content::BrowserMainParts* CreateBrowserMainParts( @@ -48,12 +42,21 @@ class BrowserClient : public content::ContentBrowserClient { content::PlatformNotificationService* GetPlatformNotificationService() override; void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) override; + net::NetLog* GetNetLog() override; base::FilePath GetDefaultDownloadDirectory() override; content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; - BrowserMainParts* browser_main_parts_; + protected: + // Subclasses should override this to provide their own BrowserMainParts + // implementation. The lifetime of the returned instance is managed by the + // caller. + virtual BrowserMainParts* OverrideCreateBrowserMainParts( + const content::MainFunctionParams&); private: + BrowserMainParts* browser_main_parts_; + NetLog net_log_; + std::unique_ptr notification_service_; std::unique_ptr notification_presenter_; diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 9992f06eb0..236a8f5c1f 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -5,6 +5,7 @@ #include "browser/browser_context.h" #include "browser/brightray_paths.h" +#include "browser/browser_client.h" #include "browser/inspectable_web_contents_impl.h" #include "browser/network_delegate.h" #include "browser/permission_manager.h" @@ -145,7 +146,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext( url_request_getter_ = new URLRequestContextGetter( this, network_controller_handle(), - &net_log_, + static_cast(BrowserClient::Get()->GetNetLog()), GetPath(), in_memory_, BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO), diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 00cf4d51f4..31db2ce23f 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -7,7 +7,6 @@ #include -#include "browser/net_log.h" #include "browser/net/devtools_network_controller_handle.h" #include "browser/permission_manager.h" #include "browser/url_request_context_getter.h" @@ -25,7 +24,6 @@ class SpecialStoragePolicy; namespace brightray { -class NetLog; class PermissionManager; class BrowserContext : public base::RefCounted, @@ -122,7 +120,6 @@ class BrowserContext : public base::RefCounted, bool in_memory_; DevToolsNetworkControllerHandle network_controller_handle_; - NetLog net_log_; std::unique_ptr resource_context_; scoped_refptr url_request_getter_;