Skip to content

Commit

Permalink
chore: update api for Ch66
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Nov 23, 2018
1 parent 624161b commit 47c9ab1
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 49 deletions.
9 changes: 4 additions & 5 deletions atom/browser/api/atom_api_net_log.cc
Expand Up @@ -43,17 +43,16 @@ void NetLog::StartLogging(mate::Arguments* args) {
return;
}

auto* network_context =
content::BrowserContext::GetDefaultStoragePartition(browser_context_)
->GetNetworkContext();
net_log::NetExportFileWriter::URLRequestContextGetterList context_getters = {
browser_context_->GetRequestContext()};

// TODO(deepak1556): Provide more flexibility to this module
// by allowing customizations on the capturing options.
net_log_writer_->StartNetLog(
log_path, net::NetLogCaptureMode::Default(),
net_log::NetExportFileWriter::kNoLimit /* file size limit */,
base::CommandLine::ForCurrentProcess()->GetCommandLineString(),
std::string(), network_context);
std::string(), context_getters);
}

std::string NetLog::GetLoggingState() const {
Expand Down Expand Up @@ -95,7 +94,7 @@ void NetLog::StopLogging(mate::Arguments* args) {

if (IsCurrentlyLogging()) {
stop_callback_queue_.emplace_back(callback);
net_log_writer_->StopNetLog(nullptr);
net_log_writer_->StopNetLog(nullptr, nullptr);
} else {
callback.Run(base::FilePath());
}
Expand Down
1 change: 1 addition & 0 deletions atom/browser/atom_browser_client.cc
Expand Up @@ -33,6 +33,7 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/printing/printing_message_filter.h"
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
#include "chrome/browser/speech/tts_message_filter.h"
Expand Down
5 changes: 3 additions & 2 deletions atom/browser/atom_browser_context.cc
Expand Up @@ -14,7 +14,6 @@
#include "atom/browser/cookie_change_notifier.h"
#include "atom/browser/net/resolve_proxy_helper.h"
#include "atom/browser/pref_store_delegate.h"
#include "atom/browser/special_storage_policy.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/atom_version.h"
#include "atom/common/chrome_version.h"
Expand All @@ -28,6 +27,7 @@
#include "base/threading/thread_restrictions.h"
#include "brightray/browser/brightray_paths.h"
#include "brightray/browser/inspectable_web_contents_impl.h"
#include "brightray/browser/special_storage_policy.h"
#include "brightray/browser/zoom_level_delegate.h"
#include "brightray/common/application_info.h"
#include "chrome/common/chrome_paths.h"
Expand All @@ -40,6 +40,7 @@
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_pref_names.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/user_agent.h"
#include "net/base/escape.h"
Expand Down Expand Up @@ -74,7 +75,7 @@ AtomBrowserContext::AtomBrowserContext(const std::string& partition,
: base::RefCountedDeleteOnSequence<AtomBrowserContext>(
base::SequencedTaskRunnerHandle::Get()),
in_memory_pref_store_(nullptr),
storage_policy_(new SpecialStoragePolicy),
storage_policy_(new brightray::SpecialStoragePolicy),
in_memory_(in_memory),
weak_factory_(this) {
// Construct user agent string.
Expand Down
5 changes: 4 additions & 1 deletion atom/browser/atom_browser_context.h
Expand Up @@ -21,6 +21,10 @@ class PrefRegistrySimple;
class PrefService;
class ValueMapPrefStore;

namespace brightray {
class SpecialStoragePolicy;
}

namespace atom {

class AtomBlobReader;
Expand All @@ -29,7 +33,6 @@ class AtomDownloadManagerDelegate;
class AtomPermissionManager;
class CookieChangeNotifier;
class ResolveProxyHelper;
class SpecialStoragePolicy;
class WebViewManager;

class AtomBrowserContext
Expand Down
5 changes: 4 additions & 1 deletion atom/browser/atom_browser_main_parts.cc
Expand Up @@ -22,6 +22,7 @@
#include "chrome/browser/net/chrome_net_log_helper.h"
#include "components/net_log/chrome_net_log.h"
#include "components/net_log/net_export_file_writer.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/service_manager_connection.h"
Expand Down Expand Up @@ -195,7 +196,9 @@ int AtomBrowserMainParts::PreCreateThreads() {
}
}
// Initialize net log file exporter.
net_log_->net_export_file_writer()->Initialize();
net_log_->net_export_file_writer()->Initialize(
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::IO));

// Manage global state of net and other IO thread related.
io_thread_ = std::make_unique<IOThread>(net_log_.get());
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/io_thread.cc
Expand Up @@ -6,7 +6,7 @@

#include "components/net_log/chrome_net_log.h"
#include "content/public/browser/browser_thread.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/proxy_resolution/proxy_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_context_getter.h"
Expand Down
9 changes: 0 additions & 9 deletions atom/browser/net/resolve_proxy_helper.cc
Expand Up @@ -84,13 +84,4 @@ ResolveProxyHelper::PendingRequest::PendingRequest(
const ResolveProxyCallback& callback)
: url(url), callback(callback) {}

ResolveProxyHelper::PendingRequest::PendingRequest(
ResolveProxyHelper::PendingRequest&& pending_request) = default;

ResolveProxyHelper::PendingRequest::~PendingRequest() noexcept = default;

ResolveProxyHelper::PendingRequest& ResolveProxyHelper::PendingRequest::
operator=(ResolveProxyHelper::PendingRequest&& pending_request) noexcept =
default;

} // namespace atom
9 changes: 1 addition & 8 deletions atom/browser/net/resolve_proxy_helper.h
Expand Up @@ -9,7 +9,7 @@
#include <string>

#include "base/memory/ref_counted.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/proxy_resolution/proxy_service.h"
#include "url/gurl.h"

namespace net {
Expand All @@ -35,16 +35,9 @@ class ResolveProxyHelper
struct PendingRequest {
public:
PendingRequest(const GURL& url, const ResolveProxyCallback& callback);
PendingRequest(PendingRequest&& pending_request) noexcept;
~PendingRequest();

PendingRequest& operator=(PendingRequest&& pending_request) noexcept;

GURL url;
ResolveProxyCallback callback;

private:
DISALLOW_COPY_AND_ASSIGN(PendingRequest);
};

~ResolveProxyHelper();
Expand Down
12 changes: 4 additions & 8 deletions atom/browser/net/url_request_context_getter.cc
Expand Up @@ -46,8 +46,7 @@
#include "net/log/net_log.h"
#include "net/proxy_resolution/proxy_config.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "net/proxy_resolution/proxy_config_with_annotation.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/proxy_resolution/proxy_service.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/data_protocol_handler.h"
#include "net/url_request/static_http_user_agent_settings.h"
Expand Down Expand Up @@ -80,10 +79,6 @@ network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams(
network_context_params->enable_brotli = true;
network_context_params->user_agent = user_agent;
network_context_params->http_cache_enabled = use_cache;
network_context_params->accept_language =
net::HttpUtil::GenerateAcceptLanguageHeader(
brightray::BrowserClient::Get()->GetApplicationLocale());
network_context_params->allow_gssapi_library_load = true;
network_context_params->enable_data_url_support = false;
network_context_params->proxy_resolver_factory =
ChromeMojoProxyResolverFactory::CreateWithStrongBinding().PassInterface();
Expand Down Expand Up @@ -112,8 +107,9 @@ void SetupAtomURLRequestJobFactory(
net::URLRequestContext* url_request_context,
AtomURLRequestJobFactory* job_factory) {
for (auto& protocol_handler : *protocol_handlers) {
job_factory->SetProtocolHandler(protocol_handler.first,
std::move(protocol_handler.second));
job_factory->SetProtocolHandler(
protocol_handler.first,
base::WrapUnique(protocol_handler.second.release()));
}
protocol_handlers->clear();

Expand Down
3 changes: 3 additions & 0 deletions brightray/brightray.gyp
Expand Up @@ -126,6 +126,7 @@
'<(libchromiumcontent_dir)/librenderer.a',
'<(libchromiumcontent_dir)/libsecurity_state.a',
'<(libchromiumcontent_dir)/libviz_service.a',
'<(libchromiumcontent_dir)/libchrome.a',
# services/device/wake_lock/power_save_blocker/
'<(libchromiumcontent_dir)/libpower_save_blocker.a',
# Friends of libpdf.a:
Expand Down Expand Up @@ -221,6 +222,7 @@
'<(libchromiumcontent_dir)/librenderer.a',
'<(libchromiumcontent_dir)/libsecurity_state.a',
'<(libchromiumcontent_dir)/libviz_service.a',
'<(libchromiumcontent_dir)/libchrome.a',
# services/device/wake_lock/power_save_blocker/
'<(libchromiumcontent_dir)/libpower_save_blocker.a',
# Friends of libpdf.a:
Expand Down Expand Up @@ -360,6 +362,7 @@
'<(libchromiumcontent_dir)/renderer.lib',
'<(libchromiumcontent_dir)/security_state.lib',
'<(libchromiumcontent_dir)/viz_service.lib',
'<(libchromiumcontent_dir)/chrome.lib',
# services/device/wake_lock/power_save_blocker/
'<(libchromiumcontent_dir)/power_save_blocker.lib',
# Friends of pdf.lib:
Expand Down
10 changes: 0 additions & 10 deletions brightray/filenames.gypi
Expand Up @@ -4,8 +4,6 @@
'browser/brightray_paths.h',
'browser/browser_client.cc',
'browser/browser_client.h',
'browser/browser_context.cc',
'browser/browser_context.h',
'browser/browser_main_parts.cc',
'browser/browser_main_parts.h',
'browser/browser_main_parts_mac.mm',
Expand All @@ -29,8 +27,6 @@
'browser/inspectable_web_contents_view.h',
'browser/inspectable_web_contents_view_mac.h',
'browser/inspectable_web_contents_view_mac.mm',
'browser/io_thread.cc',
'browser/io_thread.h',
'browser/mac/bry_inspectable_web_contents_view.h',
'browser/mac/bry_inspectable_web_contents_view.mm',
'browser/mac/cocoa_notification.h',
Expand All @@ -49,8 +45,6 @@
'browser/media/media_stream_devices_controller.h',
'browser/net/require_ct_delegate.cc',
'browser/net/require_ct_delegate.h',
'browser/net_log.cc',
'browser/net_log.h',
'browser/notification_delegate.h',
'browser/notification_presenter.cc',
'browser/notification_presenter.h',
Expand Down Expand Up @@ -81,8 +75,6 @@
'browser/win/windows_toast_notification.h',
'browser/special_storage_policy.cc',
'browser/special_storage_policy.h',
'browser/url_request_context_getter.cc',
'browser/url_request_context_getter.h',
'browser/views/inspectable_web_contents_view_views.h',
'browser/views/inspectable_web_contents_view_views.cc',
'browser/views/views_delegate.cc',
Expand All @@ -102,8 +94,6 @@
'common/main_delegate.cc',
'common/main_delegate.h',
'common/main_delegate_mac.mm',
'common/switches.cc',
'common/switches.h',
'common/platform_util_linux.cc',
'common/platform_util.h',
],
Expand Down
16 changes: 12 additions & 4 deletions filenames.gypi
Expand Up @@ -230,6 +230,10 @@
'atom/browser/common_web_contents_delegate_views.cc',
'atom/browser/common_web_contents_delegate.cc',
'atom/browser/common_web_contents_delegate.h',
'atom/browser/cookie_change_notifier.cc',
'atom/browser/cookie_change_notifier.h',
'atom/browser/io_thread.cc',
'atom/browser/io_thread.h',
'atom/browser/javascript_environment.cc',
'atom/browser/javascript_environment.h',
'atom/browser/lib/bluetooth_chooser.cc',
Expand Down Expand Up @@ -285,29 +289,33 @@
'atom/browser/net/http_protocol_handler.h',
'atom/browser/net/js_asker.cc',
'atom/browser/net/js_asker.h',
'atom/browser/net/resolve_proxy_helper.cc',
'atom/browser/net/resolve_proxy_helper.h',
'atom/browser/net/url_request_about_job.cc',
'atom/browser/net/url_request_about_job.h',
'atom/browser/net/url_request_async_asar_job.cc',
'atom/browser/net/url_request_async_asar_job.h',
'atom/browser/net/url_request_string_job.cc',
'atom/browser/net/url_request_string_job.h',
'atom/browser/net/url_request_buffer_job.cc',
'atom/browser/net/url_request_buffer_job.h',
'atom/browser/net/url_request_context_getter.cc',
'atom/browser/net/url_request_context_getter.h',
'atom/browser/net/url_request_fetch_job.cc',
'atom/browser/net/url_request_fetch_job.h',
'atom/browser/net/url_request_stream_job.cc',
'atom/browser/net/url_request_stream_job.h',
'atom/browser/net/url_request_string_job.cc',
'atom/browser/net/url_request_string_job.h',
'atom/browser/node_debugger.cc',
'atom/browser/node_debugger.h',
'atom/browser/pref_store_delegate.cc',
'atom/browser/pref_store_delegate.h',
'atom/browser/relauncher_linux.cc',
'atom/browser/relauncher_mac.cc',
'atom/browser/relauncher_win.cc',
'atom/browser/relauncher.cc',
'atom/browser/relauncher.h',
'atom/browser/render_process_preferences.cc',
'atom/browser/render_process_preferences.h',
'atom/browser/request_context_delegate.cc',
'atom/browser/request_context_delegate.h',
'atom/browser/session_preferences.cc',
'atom/browser/session_preferences.h',
'atom/browser/ui/accelerator_util.cc',
Expand Down

0 comments on commit 47c9ab1

Please sign in to comment.