mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: rename the atom namespace to electron
This commit is contained in:
committed by
Samuel Attard
parent
8c4496a9c9
commit
34c4c8d508
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "shell/browser/net/url_request_about_job.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
AboutProtocolHandler::AboutProtocolHandler() {}
|
||||
|
||||
@@ -22,4 +22,4 @@ bool AboutProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AboutProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
|
||||
public:
|
||||
@@ -24,6 +24,6 @@ class AboutProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
|
||||
DISALLOW_COPY_AND_ASSIGN(AboutProtocolHandler);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ABOUT_PROTOCOL_HANDLER_H_
|
||||
|
||||
@@ -215,7 +215,7 @@ void URLRequestAsarJob::GetResponseInfo(net::HttpResponseInfo* info) {
|
||||
std::string status("HTTP/1.1 200 OK");
|
||||
auto* headers = new net::HttpResponseHeaders(status);
|
||||
|
||||
headers->AddHeader(atom::kCORSHeader);
|
||||
headers->AddHeader(electron::kCORSHeader);
|
||||
info->headers = headers;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
VerifyRequestParams::VerifyRequestParams() = default;
|
||||
VerifyRequestParams::~VerifyRequestParams() = default;
|
||||
@@ -206,4 +206,4 @@ CertVerifierRequest* AtomCertVerifier::FindRequest(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "net/cert/cert_verifier.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class CertVerifierRequest;
|
||||
class RequireCTDelegate;
|
||||
@@ -66,6 +66,6 @@ class AtomCertVerifier : public net::CertVerifier {
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomCertVerifier);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ATOM_CERT_VERIFIER_H_
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
const char* ResourceTypeToString(content::ResourceType type) {
|
||||
switch (type) {
|
||||
@@ -51,7 +51,7 @@ const char* ResourceTypeToString(content::ResourceType type) {
|
||||
int32_t GetWebContentsID(int process_id, int frame_id) {
|
||||
auto* webContents = content::WebContents::FromRenderFrameHost(
|
||||
content::RenderFrameHost::FromID(process_id, frame_id));
|
||||
return atom::api::WebContents::GetIDFromWrappedClass(webContents);
|
||||
return electron::api::WebContents::GetIDFromWrappedClass(webContents);
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -542,4 +542,4 @@ void AtomNetworkDelegate::OnListenerResultInUI(
|
||||
base::Unretained(this), id, out, std::move(copy)));
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
class URLPattern;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
using URLPatterns = std::set<URLPattern>;
|
||||
|
||||
@@ -178,6 +178,6 @@ class AtomNetworkDelegate : public net::NetworkDelegate {
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomNetworkDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ATOM_NETWORK_DELEGATE_H_
|
||||
|
||||
@@ -34,23 +34,23 @@ using content::BrowserThread;
|
||||
namespace mate {
|
||||
|
||||
template <>
|
||||
struct Converter<atom::ProtocolType> {
|
||||
struct Converter<electron::ProtocolType> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
atom::ProtocolType* out) {
|
||||
electron::ProtocolType* out) {
|
||||
std::string type;
|
||||
if (!ConvertFromV8(isolate, val, &type))
|
||||
return false;
|
||||
if (type == "buffer")
|
||||
*out = atom::ProtocolType::kBuffer;
|
||||
*out = electron::ProtocolType::kBuffer;
|
||||
else if (type == "string")
|
||||
*out = atom::ProtocolType::kString;
|
||||
*out = electron::ProtocolType::kString;
|
||||
else if (type == "file")
|
||||
*out = atom::ProtocolType::kFile;
|
||||
*out = electron::ProtocolType::kFile;
|
||||
else if (type == "http")
|
||||
*out = atom::ProtocolType::kHttp;
|
||||
*out = electron::ProtocolType::kHttp;
|
||||
else if (type == "stream")
|
||||
*out = atom::ProtocolType::kStream;
|
||||
*out = electron::ProtocolType::kStream;
|
||||
else // note "free" is internal type, not allowed to be passed from user
|
||||
return false;
|
||||
return true;
|
||||
@@ -59,7 +59,7 @@ struct Converter<atom::ProtocolType> {
|
||||
|
||||
} // namespace mate
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -478,4 +478,4 @@ void AtomURLLoaderFactory::SendContents(
|
||||
base::BindOnce(OnWrite, std::move(write_data)));
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
#include "services/network/public/mojom/url_loader_factory.mojom.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// Old Protocol API can only serve one type of response for one scheme.
|
||||
enum class ProtocolType {
|
||||
@@ -106,6 +106,6 @@ class AtomURLLoaderFactory : public network::mojom::URLLoaderFactory {
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomURLLoaderFactory);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ATOM_URL_LOADER_FACTORY_H_
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace {
|
||||
const int kBufferSize = 4096;
|
||||
} // namespace
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@@ -518,4 +518,4 @@ void AtomURLRequest::GetUploadProgress(mate::Dictionary* progress) const {
|
||||
progress->Set("total", upload_progress.size());
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "shell/browser/api/atom_api_url_request.h"
|
||||
#include "shell/browser/atom_browser_context.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomURLRequest : public base::RefCountedThreadSafe<AtomURLRequest>,
|
||||
public net::URLRequest::Delegate,
|
||||
@@ -117,6 +117,6 @@ class AtomURLRequest : public base::RefCountedThreadSafe<AtomURLRequest>,
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomURLRequest);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ATOM_URL_REQUEST_H_
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -144,4 +144,4 @@ bool AtomURLRequestJobFactory::IsSafeRedirectTarget(
|
||||
return IsHandledProtocol(location.scheme());
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
const void* DisableProtocolInterceptFlagKey();
|
||||
|
||||
@@ -74,6 +74,6 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomURLRequestJobFactory);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_ATOM_URL_REQUEST_JOB_FACTORY_H_
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace net {
|
||||
class CanonicalCookie;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
struct CookieDetails {
|
||||
public:
|
||||
@@ -26,6 +26,6 @@ struct CookieDetails {
|
||||
network::mojom::CookieChangeCause cause;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_COOKIE_DETAILS_H_
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "net/url_request/url_request_http_job.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
HttpProtocolHandler::HttpProtocolHandler(const std::string& scheme)
|
||||
: scheme_(scheme) {}
|
||||
@@ -19,4 +19,4 @@ net::URLRequestJob* HttpProtocolHandler::MaybeCreateJob(
|
||||
return net::URLRequestHttpJob::Factory(request, network_delegate, scheme_);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class HttpProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
|
||||
public:
|
||||
@@ -25,6 +25,6 @@ class HttpProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
|
||||
std::string scheme_;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_HTTP_PROTOCOL_HANDLER_H_
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "shell/common/native_mate_converters/once_callback.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
JsAsker::JsAsker() = default;
|
||||
|
||||
@@ -52,4 +52,4 @@ bool JsAsker::IsErrorOptions(base::Value* value, int* error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
using JavaScriptHandler =
|
||||
base::Callback<void(const base::DictionaryValue&, v8::Local<v8::Value>)>;
|
||||
@@ -53,6 +53,6 @@ class JsAsker {
|
||||
DISALLOW_COPY_AND_ASSIGN(JsAsker);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_JS_ASKER_H_
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shell/browser/browser_process_impl.h"
|
||||
#include "shell/browser/net/system_network_context_manager.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
NetworkContextService::NetworkContextService(content::BrowserContext* context)
|
||||
: browser_context_(static_cast<AtomBrowserContext*>(context)),
|
||||
@@ -88,4 +88,4 @@ NetworkContextService::CreateNetworkContextParams(bool in_memory,
|
||||
return network_context_params;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "shell/browser/atom_browser_context.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// KeyedService that initializes and provides access to the NetworkContexts for
|
||||
// a BrowserContext.
|
||||
@@ -36,6 +36,6 @@ class NetworkContextService : public KeyedService {
|
||||
ProxyConfigMonitor proxy_config_monitor_;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_NETWORK_CONTEXT_SERVICE_H_
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
||||
#include "shell/browser/net/network_context_service.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
NetworkContextService* NetworkContextServiceFactory::GetForContext(
|
||||
content::BrowserContext* browser_context) {
|
||||
@@ -37,4 +37,4 @@ content::BrowserContext* NetworkContextServiceFactory::GetBrowserContextToUse(
|
||||
return context;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace contenet {
|
||||
class BrowserContext;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class NetworkContextService;
|
||||
|
||||
@@ -45,6 +45,6 @@ class NetworkContextServiceFactory : public BrowserContextKeyedServiceFactory {
|
||||
content::BrowserContext* context) const override;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_NETWORK_CONTEXT_SERVICE_FACTORY_H_
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
NodeStreamLoader::NodeStreamLoader(network::ResourceResponseHead head,
|
||||
network::mojom::URLLoaderRequest loader,
|
||||
@@ -139,4 +139,4 @@ void NodeStreamLoader::On(const char* event, EventCallback callback) {
|
||||
// No more code bellow, as this class may destruct when subscribing.
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "services/network/public/mojom/url_loader.mojom.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// Read data from node Stream and feed it to NetworkService.
|
||||
//
|
||||
@@ -82,6 +82,6 @@ class NodeStreamLoader : public network::mojom::URLLoader {
|
||||
DISALLOW_COPY_AND_ASSIGN(NodeStreamLoader);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_NODE_STREAM_LOADER_H_
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "services/network/public/mojom/url_loader.mojom.h"
|
||||
#include "shell/browser/net/asar/asar_url_loader.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
ProxyingURLLoaderFactory::ProxyingURLLoaderFactory(
|
||||
const HandlersMap& handlers,
|
||||
@@ -74,4 +74,4 @@ void ProxyingURLLoaderFactory::OnProxyBindingError() {
|
||||
delete this;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "shell/browser/net/atom_url_loader_factory.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class ProxyingURLLoaderFactory : public network::mojom::URLLoaderFactory {
|
||||
public:
|
||||
@@ -47,6 +47,6 @@ class ProxyingURLLoaderFactory : public network::mojom::URLLoaderFactory {
|
||||
DISALLOW_COPY_AND_ASSIGN(ProxyingURLLoaderFactory);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_PROXYING_URL_LOADER_FACTORY_H_
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
RequireCTDelegate::RequireCTDelegate() {}
|
||||
|
||||
@@ -33,4 +33,4 @@ RequireCTDelegate::CTRequirementLevel RequireCTDelegate::IsCTRequiredForHost(
|
||||
return CTRequirementLevel::DEFAULT;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "net/http/transport_security_state.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class RequireCTDelegate
|
||||
: public net::TransportSecurityState::RequireCTDelegate {
|
||||
@@ -32,6 +32,6 @@ class RequireCTDelegate
|
||||
DISALLOW_COPY_AND_ASSIGN(RequireCTDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
ResolveProxyHelper::ResolveProxyHelper(AtomBrowserContext* browser_context)
|
||||
: binding_(this), browser_context_(browser_context) {}
|
||||
@@ -97,4 +97,4 @@ ResolveProxyHelper::PendingRequest& ResolveProxyHelper::PendingRequest::
|
||||
operator=(ResolveProxyHelper::PendingRequest&& pending_request) noexcept =
|
||||
default;
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "services/network/public/mojom/proxy_lookup_client.mojom.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomBrowserContext;
|
||||
|
||||
@@ -70,6 +70,6 @@ class ResolveProxyHelper
|
||||
DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_RESOLVE_PROXY_HELPER_H_
|
||||
|
||||
@@ -44,24 +44,24 @@ network::mojom::HttpAuthStaticParamsPtr CreateHttpAuthStaticParams() {
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams() {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params =
|
||||
network::mojom::HttpAuthDynamicParams::New();
|
||||
|
||||
auth_dynamic_params->server_whitelist =
|
||||
command_line->GetSwitchValueASCII(atom::switches::kAuthServerWhitelist);
|
||||
auth_dynamic_params->server_whitelist = command_line->GetSwitchValueASCII(
|
||||
electron::switches::kAuthServerWhitelist);
|
||||
auth_dynamic_params->delegate_whitelist = command_line->GetSwitchValueASCII(
|
||||
atom::switches::kAuthNegotiateDelegateWhitelist);
|
||||
electron::switches::kAuthNegotiateDelegateWhitelist);
|
||||
auth_dynamic_params->enable_negotiate_port =
|
||||
command_line->HasSwitch(atom::switches::kEnableAuthNegotiatePort);
|
||||
command_line->HasSwitch(electron::switches::kEnableAuthNegotiatePort);
|
||||
|
||||
return auth_dynamic_params;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
// SharedURLLoaderFactory backed by a SystemNetworkContextManager and its
|
||||
// network context. Transparently handles crashes.
|
||||
@@ -195,7 +195,7 @@ void SystemNetworkContextManager::SetUp(
|
||||
*network_context_params = CreateDefaultNetworkContextParams();
|
||||
}
|
||||
*http_auth_static_params = CreateHttpAuthStaticParams();
|
||||
*http_auth_dynamic_params = atom::CreateHttpAuthDynamicParams();
|
||||
*http_auth_dynamic_params = electron::CreateHttpAuthDynamicParams();
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -234,7 +234,8 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(
|
||||
return;
|
||||
|
||||
network_service->SetUpHttpAuth(CreateHttpAuthStaticParams());
|
||||
network_service->ConfigureHttpAuthPrefs(atom::CreateHttpAuthDynamicParams());
|
||||
network_service->ConfigureHttpAuthPrefs(
|
||||
electron::CreateHttpAuthDynamicParams());
|
||||
|
||||
// The system NetworkContext must be created first, since it sets
|
||||
// |primary_network_context| to true.
|
||||
@@ -252,7 +253,7 @@ SystemNetworkContextManager::CreateNetworkContextParams() {
|
||||
network_context_params->context_name = std::string("system");
|
||||
|
||||
network_context_params->user_agent =
|
||||
atom::AtomBrowserClient::Get()->GetUserAgent();
|
||||
electron::AtomBrowserClient::Get()->GetUserAgent();
|
||||
|
||||
network_context_params->http_cache_enabled = false;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace net_log {
|
||||
class NetExportFileWriter;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
URLPipeLoader::URLPipeLoader(
|
||||
scoped_refptr<network::SharedURLLoaderFactory> factory,
|
||||
@@ -99,4 +99,4 @@ void URLPipeLoader::OnComplete(bool success) {
|
||||
NotifyComplete(loader_->NetError());
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace network {
|
||||
class SharedURLLoaderFactory;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// Read data from URL and pipe it to NetworkService.
|
||||
//
|
||||
@@ -77,6 +77,6 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
||||
DISALLOW_COPY_AND_ASSIGN(URLPipeLoader);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_PIPE_LOADER_H_
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
URLRequestAboutJob::URLRequestAboutJob(net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate)
|
||||
@@ -34,4 +34,4 @@ void URLRequestAboutJob::StartAsync() {
|
||||
NotifyHeadersComplete();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "net/url_request/url_request_job.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class URLRequestAboutJob : public net::URLRequestJob {
|
||||
public:
|
||||
@@ -30,6 +30,6 @@ class URLRequestAboutJob : public net::URLRequestJob {
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestAboutJob);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_ABOUT_JOB_H_
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "shell/common/native_mate_converters/net_converter.h"
|
||||
#include "shell/common/native_mate_converters/v8_value_converter.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -121,4 +121,4 @@ void URLRequestAsyncAsarJob::GetResponseInfo(net::HttpResponseInfo* info) {
|
||||
info->headers = response_headers_;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "shell/browser/net/asar/url_request_asar_job.h"
|
||||
#include "shell/browser/net/js_asker.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// Like URLRequestAsarJob, but asks the JavaScript handler for file path.
|
||||
class URLRequestAsyncAsarJob : public asar::URLRequestAsarJob, public JsAsker {
|
||||
@@ -32,6 +32,6 @@ class URLRequestAsyncAsarJob : public asar::URLRequestAsarJob, public JsAsker {
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestAsyncAsarJob);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_ASYNC_ASAR_JOB_H_
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "shell/common/native_mate_converters/net_converter.h"
|
||||
#include "shell/common/native_mate_converters/v8_value_converter.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -152,4 +152,4 @@ int URLRequestBufferJob::GetRefCountedData(
|
||||
return net::OK;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "net/url_request/url_request_simple_job.h"
|
||||
#include "shell/browser/net/js_asker.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class URLRequestBufferJob : public JsAsker, public net::URLRequestSimpleJob {
|
||||
public:
|
||||
@@ -44,6 +44,6 @@ class URLRequestBufferJob : public JsAsker, public net::URLRequestSimpleJob {
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestBufferJob);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_BUFFER_JOB_H_
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -317,7 +317,7 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
||||
static_cast<net::CookieMonster*>(url_request_context_->cookie_store());
|
||||
std::vector<std::string> cookie_schemes(
|
||||
{url::kHttpScheme, url::kHttpsScheme, url::kWsScheme, url::kWssScheme});
|
||||
const auto& custom_standard_schemes = atom::api::GetStandardSchemes();
|
||||
const auto& custom_standard_schemes = electron::api::GetStandardSchemes();
|
||||
cookie_schemes.insert(cookie_schemes.end(), custom_standard_schemes.begin(),
|
||||
custom_standard_schemes.end());
|
||||
cookie_monster->SetCookieableSchemes(cookie_schemes, base::NullCallback());
|
||||
@@ -349,4 +349,4 @@ URLRequestContextGetter::GetNetworkTaskRunner() const {
|
||||
return base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO});
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "base/debug/leak_tracker.h"
|
||||
#endif
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomBrowserContext;
|
||||
class AtomNetworkDelegate;
|
||||
@@ -109,6 +109,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestContextGetter);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
using content::BrowserThread;
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -340,4 +340,4 @@ void URLRequestFetchJob::ClearWriteBuffer() {
|
||||
write_num_bytes_ = 0;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "net/url_request/url_request_job.h"
|
||||
#include "shell/browser/net/js_asker.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomBrowserContext;
|
||||
|
||||
@@ -76,6 +76,6 @@ class URLRequestFetchJob : public JsAsker,
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestFetchJob);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_FETCH_JOB_H_
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "shell/common/native_mate_converters/net_converter.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -255,4 +255,4 @@ int URLRequestStreamJob::BufferCopy(std::vector<char>* source,
|
||||
return bytes_written;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "shell/browser/api/stream_subscriber.h"
|
||||
#include "shell/browser/net/js_asker.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class URLRequestStreamJob : public JsAsker, public net::URLRequestJob {
|
||||
public:
|
||||
@@ -68,6 +68,6 @@ class URLRequestStreamJob : public JsAsker, public net::URLRequestJob {
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestStreamJob);
|
||||
};
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_STREAM_JOB_H_
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "shell/common/native_mate_converters/net_converter.h"
|
||||
#include "shell/common/native_mate_converters/v8_value_converter.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -114,4 +114,4 @@ int URLRequestStringJob::GetData(std::string* mime_type,
|
||||
return net::OK;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "net/url_request/url_request_simple_job.h"
|
||||
#include "shell/browser/net/js_asker.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class URLRequestStringJob : public JsAsker, public net::URLRequestSimpleJob {
|
||||
public:
|
||||
@@ -41,6 +41,6 @@ class URLRequestStringJob : public JsAsker, public net::URLRequestSimpleJob {
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestStringJob);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_NET_URL_REQUEST_STRING_JOB_H_
|
||||
|
||||
Reference in New Issue
Block a user