NetLog should be managed by BrowserClient
This commit is contained in:
parent
4ccf4394d7
commit
f5bfbada97
4 changed files with 17 additions and 12 deletions
|
@ -84,6 +84,10 @@ void BrowserClient::GetAdditionalAllowedSchemesForFileSystem(
|
||||||
additional_schemes->push_back(content::kChromeUIScheme);
|
additional_schemes->push_back(content::kChromeUIScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
net::NetLog* BrowserClient::GetNetLog() {
|
||||||
|
return &net_log_;
|
||||||
|
}
|
||||||
|
|
||||||
base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
|
base::FilePath BrowserClient::GetDefaultDownloadDirectory() {
|
||||||
// ~/Downloads
|
// ~/Downloads
|
||||||
base::FilePath path;
|
base::FilePath path;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
|
#ifndef BRIGHTRAY_BROWSER_BROWSER_CLIENT_H_
|
||||||
#define 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/browser_context.h"
|
||||||
#include "content/public/browser/content_browser_client.h"
|
#include "content/public/browser/content_browser_client.h"
|
||||||
|
|
||||||
|
@ -33,13 +34,6 @@ class BrowserClient : public content::ContentBrowserClient {
|
||||||
callback.Run(true);
|
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
|
// Subclasses that override this (e.g., to provide their own protocol
|
||||||
// handlers) should call this implementation after doing their own work.
|
// handlers) should call this implementation after doing their own work.
|
||||||
content::BrowserMainParts* CreateBrowserMainParts(
|
content::BrowserMainParts* CreateBrowserMainParts(
|
||||||
|
@ -48,12 +42,21 @@ class BrowserClient : public content::ContentBrowserClient {
|
||||||
content::PlatformNotificationService* GetPlatformNotificationService() override;
|
content::PlatformNotificationService* GetPlatformNotificationService() override;
|
||||||
void GetAdditionalAllowedSchemesForFileSystem(
|
void GetAdditionalAllowedSchemesForFileSystem(
|
||||||
std::vector<std::string>* additional_schemes) override;
|
std::vector<std::string>* additional_schemes) override;
|
||||||
|
net::NetLog* GetNetLog() override;
|
||||||
base::FilePath GetDefaultDownloadDirectory() override;
|
base::FilePath GetDefaultDownloadDirectory() override;
|
||||||
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() 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:
|
private:
|
||||||
|
BrowserMainParts* browser_main_parts_;
|
||||||
|
NetLog net_log_;
|
||||||
|
|
||||||
std::unique_ptr<PlatformNotificationService> notification_service_;
|
std::unique_ptr<PlatformNotificationService> notification_service_;
|
||||||
std::unique_ptr<NotificationPresenter> notification_presenter_;
|
std::unique_ptr<NotificationPresenter> notification_presenter_;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "browser/browser_context.h"
|
#include "browser/browser_context.h"
|
||||||
|
|
||||||
#include "browser/brightray_paths.h"
|
#include "browser/brightray_paths.h"
|
||||||
|
#include "browser/browser_client.h"
|
||||||
#include "browser/inspectable_web_contents_impl.h"
|
#include "browser/inspectable_web_contents_impl.h"
|
||||||
#include "browser/network_delegate.h"
|
#include "browser/network_delegate.h"
|
||||||
#include "browser/permission_manager.h"
|
#include "browser/permission_manager.h"
|
||||||
|
@ -145,7 +146,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
||||||
url_request_getter_ = new URLRequestContextGetter(
|
url_request_getter_ = new URLRequestContextGetter(
|
||||||
this,
|
this,
|
||||||
network_controller_handle(),
|
network_controller_handle(),
|
||||||
&net_log_,
|
static_cast<NetLog*>(BrowserClient::Get()->GetNetLog()),
|
||||||
GetPath(),
|
GetPath(),
|
||||||
in_memory_,
|
in_memory_,
|
||||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
|
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "browser/net_log.h"
|
|
||||||
#include "browser/net/devtools_network_controller_handle.h"
|
#include "browser/net/devtools_network_controller_handle.h"
|
||||||
#include "browser/permission_manager.h"
|
#include "browser/permission_manager.h"
|
||||||
#include "browser/url_request_context_getter.h"
|
#include "browser/url_request_context_getter.h"
|
||||||
|
@ -25,7 +24,6 @@ class SpecialStoragePolicy;
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
class NetLog;
|
|
||||||
class PermissionManager;
|
class PermissionManager;
|
||||||
|
|
||||||
class BrowserContext : public base::RefCounted<BrowserContext>,
|
class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
|
@ -122,7 +120,6 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
bool in_memory_;
|
bool in_memory_;
|
||||||
|
|
||||||
DevToolsNetworkControllerHandle network_controller_handle_;
|
DevToolsNetworkControllerHandle network_controller_handle_;
|
||||||
NetLog net_log_;
|
|
||||||
|
|
||||||
std::unique_ptr<ResourceContext> resource_context_;
|
std::unique_ptr<ResourceContext> resource_context_;
|
||||||
scoped_refptr<URLRequestContextGetter> url_request_getter_;
|
scoped_refptr<URLRequestContextGetter> url_request_getter_;
|
||||||
|
|
Loading…
Reference in a new issue