Update to API changes of Chrome 51
This commit is contained in:
parent
05c2999651
commit
7ba391da7c
87 changed files with 225 additions and 231 deletions
|
@ -61,7 +61,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||
#endif // !defined(OS_WIN)
|
||||
|
||||
// Only enable logging when --enable-logging is specified.
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (!command_line->HasSwitch(switches::kEnableLogging) &&
|
||||
!env->HasVar("ELECTRON_ENABLE_LOGGING")) {
|
||||
settings.logging_dest = logging::LOG_NONE;
|
||||
|
@ -94,7 +94,7 @@ void AtomMainDelegate::PreSandboxStartup() {
|
|||
brightray::MainDelegate::PreSandboxStartup();
|
||||
|
||||
// Set google API key.
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (!env->HasVar("GOOGLE_API_KEY"))
|
||||
env->SetVar("GOOGLE_API_KEY", GOOGLEAPIS_API_KEY);
|
||||
|
||||
|
@ -134,8 +134,8 @@ content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() {
|
|||
return utility_client_.get();
|
||||
}
|
||||
|
||||
scoped_ptr<brightray::ContentClient> AtomMainDelegate::CreateContentClient() {
|
||||
return scoped_ptr<brightray::ContentClient>(new AtomContentClient);
|
||||
std::unique_ptr<brightray::ContentClient> AtomMainDelegate::CreateContentClient() {
|
||||
return std::unique_ptr<brightray::ContentClient>(new AtomContentClient);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -24,7 +24,7 @@ class AtomMainDelegate : public brightray::MainDelegate {
|
|||
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
||||
|
||||
// brightray::MainDelegate:
|
||||
scoped_ptr<brightray::ContentClient> CreateContentClient() override;
|
||||
std::unique_ptr<brightray::ContentClient> CreateContentClient() override;
|
||||
#if defined(OS_MACOSX)
|
||||
void OverrideChildProcessPath() override;
|
||||
void OverrideFrameworkBundlePath() override;
|
||||
|
@ -36,9 +36,9 @@ class AtomMainDelegate : public brightray::MainDelegate {
|
|||
#endif
|
||||
|
||||
brightray::ContentClient content_client_;
|
||||
scoped_ptr<content::ContentBrowserClient> browser_client_;
|
||||
scoped_ptr<content::ContentRendererClient> renderer_client_;
|
||||
scoped_ptr<content::ContentUtilityClient> utility_client_;
|
||||
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
||||
std::unique_ptr<content::ContentRendererClient> renderer_client_;
|
||||
std::unique_ptr<content::ContentUtilityClient> utility_client_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
|
||||
};
|
||||
|
|
|
@ -319,7 +319,7 @@ void App::AllowCertificateError(
|
|||
void App::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
scoped_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
std::shared_ptr<content::ClientCertificateDelegate>
|
||||
shared_delegate(delegate.release());
|
||||
bool prevent_default =
|
||||
|
@ -370,7 +370,7 @@ void App::SetPath(mate::Arguments* args,
|
|||
|
||||
void App::SetDesktopName(const std::string& desktop_name) {
|
||||
#if defined(OS_LINUX)
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
env->SetVar("CHROME_DESKTOP", desktop_name);
|
||||
#endif
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ void App::ImportCertificate(
|
|||
const net::CompletionCallback& callback) {
|
||||
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
|
||||
if (!certificate_manager_model_) {
|
||||
scoped_ptr<base::DictionaryValue> copy = options.CreateDeepCopy();
|
||||
std::unique_ptr<base::DictionaryValue> copy = options.CreateDeepCopy();
|
||||
CertificateManagerModel::Create(browser_context,
|
||||
base::Bind(&App::OnCertificateManagerModelCreated,
|
||||
base::Unretained(this),
|
||||
|
@ -427,9 +427,9 @@ void App::ImportCertificate(
|
|||
}
|
||||
|
||||
void App::OnCertificateManagerModelCreated(
|
||||
scoped_ptr<base::DictionaryValue> options,
|
||||
std::unique_ptr<base::DictionaryValue> options,
|
||||
const net::CompletionCallback& callback,
|
||||
scoped_ptr<CertificateManagerModel> model) {
|
||||
std::unique_ptr<CertificateManagerModel> model) {
|
||||
certificate_manager_model_ = std::move(model);
|
||||
int rv = ImportIntoCertStore(certificate_manager_model_.get(),
|
||||
*(options.get()));
|
||||
|
|
|
@ -51,9 +51,9 @@ class App : public AtomBrowserClient::Delegate,
|
|||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
void OnCertificateManagerModelCreated(
|
||||
scoped_ptr<base::DictionaryValue> options,
|
||||
std::unique_ptr<base::DictionaryValue> options,
|
||||
const net::CompletionCallback& callback,
|
||||
scoped_ptr<CertificateManagerModel> model);
|
||||
std::unique_ptr<CertificateManagerModel> model);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -93,7 +93,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
void SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
scoped_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
|
||||
// content::GpuDataManagerObserver:
|
||||
void OnGpuProcessCrashed(base::TerminationStatus exit_code) override;
|
||||
|
@ -116,10 +116,10 @@ class App : public AtomBrowserClient::Delegate,
|
|||
const net::CompletionCallback& callback);
|
||||
#endif
|
||||
|
||||
scoped_ptr<ProcessSingleton> process_singleton_;
|
||||
std::unique_ptr<ProcessSingleton> process_singleton_;
|
||||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
scoped_ptr<CertificateManagerModel> certificate_manager_model_;
|
||||
std::unique_ptr<CertificateManagerModel> certificate_manager_model_;
|
||||
#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(App);
|
||||
|
|
|
@ -112,7 +112,7 @@ void RunCallbackInUI(const base::Closure& callback) {
|
|||
}
|
||||
|
||||
// Remove cookies from |list| not matching |filter|, and pass it to |callback|.
|
||||
void FilterCookies(scoped_ptr<base::DictionaryValue> filter,
|
||||
void FilterCookies(std::unique_ptr<base::DictionaryValue> filter,
|
||||
const Cookies::GetCallback& callback,
|
||||
const net::CookieList& list) {
|
||||
net::CookieList result;
|
||||
|
@ -125,7 +125,7 @@ void FilterCookies(scoped_ptr<base::DictionaryValue> filter,
|
|||
|
||||
// Receives cookies matching |filter| in IO thread.
|
||||
void GetCookiesOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
||||
scoped_ptr<base::DictionaryValue> filter,
|
||||
std::unique_ptr<base::DictionaryValue> filter,
|
||||
const Cookies::GetCallback& callback) {
|
||||
std::string url;
|
||||
filter->GetString("url", &url);
|
||||
|
@ -157,7 +157,7 @@ void OnSetCookie(const Cookies::SetCallback& callback, bool success) {
|
|||
|
||||
// Sets cookie with |details| in IO thread.
|
||||
void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
||||
scoped_ptr<base::DictionaryValue> details,
|
||||
std::unique_ptr<base::DictionaryValue> details,
|
||||
const Cookies::SetCallback& callback) {
|
||||
std::string url, name, value, domain, path;
|
||||
bool secure = false;
|
||||
|
@ -197,8 +197,8 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
|||
GetCookieStore(getter)->SetCookieWithDetailsAsync(
|
||||
GURL(url), name, value, domain, path, creation_time,
|
||||
expiration_time, last_access_time, secure, http_only,
|
||||
false, false, net::COOKIE_PRIORITY_DEFAULT,
|
||||
base::Bind(OnSetCookie, callback));
|
||||
net::CookieSameSite::DEFAULT_MODE, false,
|
||||
net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -214,7 +214,7 @@ Cookies::~Cookies() {
|
|||
|
||||
void Cookies::Get(const base::DictionaryValue& filter,
|
||||
const GetCallback& callback) {
|
||||
scoped_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy());
|
||||
std::unique_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy());
|
||||
auto getter = make_scoped_refptr(request_context_getter_);
|
||||
content::BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
|
@ -231,7 +231,7 @@ void Cookies::Remove(const GURL& url, const std::string& name,
|
|||
|
||||
void Cookies::Set(const base::DictionaryValue& details,
|
||||
const SetCallback& callback) {
|
||||
scoped_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
|
||||
std::unique_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
|
||||
auto getter = make_scoped_refptr(request_context_getter_);
|
||||
content::BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
|
|
|
@ -52,7 +52,7 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
|
|||
const std::string& message) {
|
||||
DCHECK(agent_host == agent_host_.get());
|
||||
|
||||
scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
|
||||
std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
|
||||
if (!parsed_message->IsType(base::Value::TYPE_DICTIONARY))
|
||||
return;
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
|||
options.set_disable_effects(false);
|
||||
#endif
|
||||
|
||||
scoped_ptr<webrtc::ScreenCapturer> screen_capturer(
|
||||
std::unique_ptr<webrtc::ScreenCapturer> screen_capturer(
|
||||
capture_screen ? webrtc::ScreenCapturer::Create(options) : nullptr);
|
||||
scoped_ptr<webrtc::WindowCapturer> window_capturer(
|
||||
std::unique_ptr<webrtc::WindowCapturer> window_capturer(
|
||||
capture_window ? webrtc::WindowCapturer::Create(options) : nullptr);
|
||||
media_list_.reset(new NativeDesktopMediaList(
|
||||
std::move(screen_capturer), std::move(window_capturer)));
|
||||
|
|
|
@ -39,7 +39,7 @@ class DesktopCapturer: public mate::EventEmitter<DesktopCapturer>,
|
|||
bool OnRefreshFinished() override;
|
||||
|
||||
private:
|
||||
scoped_ptr<DesktopMediaList> media_list_;
|
||||
std::unique_ptr<DesktopMediaList> media_list_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DesktopCapturer);
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@ class Menu : public mate::TrackableObject<Menu>,
|
|||
int x = -1, int y = -1,
|
||||
int positioning_item = 0) = 0;
|
||||
|
||||
scoped_ptr<AtomMenuModel> model_;
|
||||
std::unique_ptr<AtomMenuModel> model_;
|
||||
Menu* parent_;
|
||||
|
||||
private:
|
||||
|
|
|
@ -70,7 +70,7 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
|
|||
}
|
||||
|
||||
if (!power_save_blocker_ || new_blocker_type != current_blocker_type_) {
|
||||
scoped_ptr<content::PowerSaveBlocker> new_blocker =
|
||||
std::unique_ptr<content::PowerSaveBlocker> new_blocker =
|
||||
content::PowerSaveBlocker::Create(
|
||||
new_blocker_type,
|
||||
content::PowerSaveBlocker::kReasonOther,
|
||||
|
|
|
@ -37,7 +37,7 @@ class PowerSaveBlocker : public mate::TrackableObject<PowerSaveBlocker> {
|
|||
bool Stop(int id);
|
||||
bool IsStarted(int id);
|
||||
|
||||
scoped_ptr<content::PowerSaveBlocker> power_save_blocker_;
|
||||
std::unique_ptr<content::PowerSaveBlocker> power_save_blocker_;
|
||||
|
||||
// Currnet blocker type used by |power_save_blocker_|
|
||||
content::PowerSaveBlocker::PowerSaveBlockerType current_blocker_type_;
|
||||
|
|
|
@ -110,7 +110,7 @@ class Protocol : public mate::Wrappable<Protocol> {
|
|||
const Handler& handler) {
|
||||
if (job_factory_->IsHandledProtocol(scheme))
|
||||
return PROTOCOL_REGISTERED;
|
||||
scoped_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
|
||||
std::unique_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
|
||||
new CustomProtocolHandler<RequestJob>(
|
||||
isolate(), request_context_getter_, handler));
|
||||
if (job_factory_->SetProtocolHandler(scheme, std::move(protocol_handler)))
|
||||
|
@ -152,7 +152,7 @@ class Protocol : public mate::Wrappable<Protocol> {
|
|||
return PROTOCOL_FAIL;
|
||||
if (ContainsKey(original_protocols_, scheme))
|
||||
return PROTOCOL_INTERCEPTED;
|
||||
scoped_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
|
||||
std::unique_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
|
||||
new CustomProtocolHandler<RequestJob>(
|
||||
isolate(), request_context_getter_, handler));
|
||||
original_protocols_.set(
|
||||
|
@ -176,7 +176,7 @@ class Protocol : public mate::Wrappable<Protocol> {
|
|||
// Map that stores the original protocols of schemes.
|
||||
using OriginalProtocolsMap = base::ScopedPtrHashMap<
|
||||
std::string,
|
||||
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>>;
|
||||
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>>;
|
||||
OriginalProtocolsMap original_protocols_;
|
||||
|
||||
AtomURLRequestJobFactory* job_factory_; // weak ref
|
||||
|
|
|
@ -369,7 +369,7 @@ void Session::SetDownloadPath(const base::FilePath& path) {
|
|||
}
|
||||
|
||||
void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
|
||||
scoped_ptr<brightray::DevToolsNetworkConditions> conditions;
|
||||
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
|
||||
bool offline = false;
|
||||
double latency, download_throughput, upload_throughput;
|
||||
if (options.Get("offline", &offline) && offline) {
|
||||
|
@ -392,7 +392,7 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
|
|||
}
|
||||
|
||||
void Session::DisableNetworkEmulation() {
|
||||
scoped_ptr<brightray::DevToolsNetworkConditions> conditions;
|
||||
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
|
||||
browser_context_->network_controller_handle()->SetNetworkState(
|
||||
devtools_network_emulation_client_id_, std::move(conditions));
|
||||
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
|
||||
|
|
|
@ -36,7 +36,7 @@ int SystemPreferences::SubscribeNotification(
|
|||
object:nil
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification* notification) {
|
||||
scoped_ptr<base::DictionaryValue> user_info =
|
||||
std::unique_ptr<base::DictionaryValue> user_info =
|
||||
NSDictionaryToDictionaryValue(notification.userInfo);
|
||||
if (user_info) {
|
||||
copied_callback.Run(
|
||||
|
|
|
@ -70,7 +70,7 @@ class Tray : public mate::TrackableObject<Tray>,
|
|||
v8::Local<v8::Object> ModifiersToObject(v8::Isolate* isolate, int modifiers);
|
||||
|
||||
v8::Global<v8::Object> menu_;
|
||||
scoped_ptr<TrayIcon> tray_icon_;
|
||||
std::unique_ptr<TrayIcon> tray_icon_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Tray);
|
||||
};
|
||||
|
|
|
@ -155,7 +155,7 @@ struct Converter<net::HttpResponseHeaders*> {
|
|||
if (response_headers.GetList(key, &values))
|
||||
values->AppendString(value);
|
||||
} else {
|
||||
scoped_ptr<base::ListValue> values(new base::ListValue());
|
||||
std::unique_ptr<base::ListValue> values(new base::ListValue());
|
||||
values->AppendString(value);
|
||||
response_headers.Set(key, std::move(values));
|
||||
}
|
||||
|
@ -1125,7 +1125,7 @@ void WebContents::BeginFrameSubscription(
|
|||
const FrameSubscriber::FrameCaptureCallback& callback) {
|
||||
const auto view = web_contents()->GetRenderWidgetHostView();
|
||||
if (view) {
|
||||
scoped_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
|
||||
std::unique_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
|
||||
isolate(), view, callback));
|
||||
view->BeginFrameSubscription(std::move(frame_subscriber));
|
||||
}
|
||||
|
|
|
@ -289,7 +289,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
v8::Global<v8::Value> devtools_web_contents_;
|
||||
v8::Global<v8::Value> debugger_;
|
||||
|
||||
scoped_ptr<WebViewGuestDelegate> guest_delegate_;
|
||||
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
|
||||
|
||||
// The host webcontents that may contain this webcontents.
|
||||
WebContents* embedder_;
|
||||
|
|
|
@ -193,7 +193,7 @@ class Window : public mate::TrackableObject<Window>,
|
|||
|
||||
api::WebContents* api_web_contents_;
|
||||
|
||||
scoped_ptr<NativeWindow> window_;
|
||||
std::unique_ptr<NativeWindow> window_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Window);
|
||||
};
|
||||
|
|
|
@ -123,7 +123,7 @@ class TrackableObject : public TrackableObjectBase,
|
|||
|
||||
private:
|
||||
static int32_t next_id_;
|
||||
static scoped_ptr<atom::KeyWeakMap<int32_t>> weak_map_;
|
||||
static std::unique_ptr<atom::KeyWeakMap<int32_t>> weak_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrackableObject);
|
||||
};
|
||||
|
@ -132,7 +132,7 @@ template<typename T>
|
|||
int32_t TrackableObject<T>::next_id_ = 0;
|
||||
|
||||
template<typename T>
|
||||
scoped_ptr<atom::KeyWeakMap<int32_t>> TrackableObject<T>::weak_map_;
|
||||
std::unique_ptr<atom::KeyWeakMap<int32_t>> TrackableObject<T>::weak_map_;
|
||||
|
||||
} // namespace mate
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void AtomBrowserClient::AllowCertificateError(
|
|||
void AtomBrowserClient::SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
scoped_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
|
||||
if (!cert_request_info->client_certs.empty() && delegate_) {
|
||||
delegate_->SelectClientCertificate(
|
||||
web_contents, cert_request_info, std::move(delegate));
|
||||
|
|
|
@ -73,7 +73,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
|||
void SelectClientCertificate(
|
||||
content::WebContents* web_contents,
|
||||
net::SSLCertRequestInfo* cert_request_info,
|
||||
scoped_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
||||
void ResourceDispatcherHostCreated() override;
|
||||
bool CanCreateWindow(const GURL& opener_url,
|
||||
const GURL& opener_top_level_frame_url,
|
||||
|
@ -106,7 +106,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
|||
// pending_render_process => current_render_process.
|
||||
std::map<int, int> pending_processes_;
|
||||
|
||||
scoped_ptr<AtomResourceDispatcherHostDelegate>
|
||||
std::unique_ptr<AtomResourceDispatcherHostDelegate>
|
||||
resource_dispatcher_host_delegate_;
|
||||
|
||||
Delegate* delegate_;
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace {
|
|||
|
||||
class NoCacheBackend : public net::HttpCache::BackendFactory {
|
||||
int CreateBackend(net::NetLog* net_log,
|
||||
scoped_ptr<disk_cache::Backend>* backend,
|
||||
std::unique_ptr<disk_cache::Backend>* backend,
|
||||
const net::CompletionCallback& callback) override {
|
||||
return net::ERR_FAILED;
|
||||
}
|
||||
|
@ -95,11 +95,11 @@ std::string AtomBrowserContext::GetUserAgent() {
|
|||
return content::BuildUserAgentFromProduct(user_agent);
|
||||
}
|
||||
|
||||
scoped_ptr<net::URLRequestJobFactory>
|
||||
std::unique_ptr<net::URLRequestJobFactory>
|
||||
AtomBrowserContext::CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* handlers,
|
||||
content::URLRequestInterceptorScopedVector* interceptors) {
|
||||
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
|
||||
std::unique_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
|
||||
|
||||
for (auto& it : *handlers) {
|
||||
job_factory->SetProtocolHandler(it.first,
|
||||
|
@ -134,7 +134,7 @@ AtomBrowserContext::CreateURLRequestJobFactory(
|
|||
new net::FtpNetworkLayer(host_resolver))));
|
||||
|
||||
// Set up interceptors in the reverse order.
|
||||
scoped_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
std::move(job_factory);
|
||||
content::URLRequestInterceptorScopedVector::reverse_iterator it;
|
||||
for (it = interceptors->rbegin(); it != interceptors->rend(); ++it)
|
||||
|
@ -177,7 +177,7 @@ content::PermissionManager* AtomBrowserContext::GetPermissionManager() {
|
|||
return permission_manager_.get();
|
||||
}
|
||||
|
||||
scoped_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
|
||||
std::unique_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
|
||||
return make_scoped_ptr(cert_verifier_);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
|||
// brightray::URLRequestContextGetter::Delegate:
|
||||
net::NetworkDelegate* CreateNetworkDelegate() override;
|
||||
std::string GetUserAgent() override;
|
||||
scoped_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
|
||||
std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
|
||||
content::ProtocolHandlerMap* handlers,
|
||||
content::URLRequestInterceptorScopedVector* interceptors) override;
|
||||
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
|
||||
const base::FilePath& base_path) override;
|
||||
scoped_ptr<net::CertVerifier> CreateCertVerifier() override;
|
||||
std::unique_ptr<net::CertVerifier> CreateCertVerifier() override;
|
||||
net::SSLConfigService* CreateSSLConfigService() override;
|
||||
bool AllowNTLMCredentialsForDomain(const GURL& auth_origin) override;
|
||||
|
||||
|
@ -52,9 +52,9 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
|||
AtomNetworkDelegate* network_delegate() const { return network_delegate_; }
|
||||
|
||||
private:
|
||||
scoped_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
|
||||
scoped_ptr<WebViewManager> guest_manager_;
|
||||
scoped_ptr<AtomPermissionManager> permission_manager_;
|
||||
std::unique_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
|
||||
std::unique_ptr<WebViewManager> guest_manager_;
|
||||
std::unique_ptr<AtomPermissionManager> permission_manager_;
|
||||
|
||||
// Managed by brightray::BrowserContext.
|
||||
AtomCertVerifier* cert_verifier_;
|
||||
|
|
|
@ -68,7 +68,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
|||
#endif
|
||||
|
||||
// A fake BrowserProcess object that used to feed the source code from chrome.
|
||||
scoped_ptr<BrowserProcess> fake_browser_process_;
|
||||
std::unique_ptr<BrowserProcess> fake_browser_process_;
|
||||
|
||||
// The gin::PerIsolateData requires a task runner to create, so we feed it
|
||||
// with a task runner that will post all work to main loop.
|
||||
|
@ -77,11 +77,11 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
|||
// Pointer to exit code.
|
||||
int* exit_code_;
|
||||
|
||||
scoped_ptr<Browser> browser_;
|
||||
scoped_ptr<JavascriptEnvironment> js_env_;
|
||||
scoped_ptr<NodeBindings> node_bindings_;
|
||||
scoped_ptr<AtomBindings> atom_bindings_;
|
||||
scoped_ptr<NodeDebugger> node_debugger_;
|
||||
std::unique_ptr<Browser> browser_;
|
||||
std::unique_ptr<JavascriptEnvironment> js_env_;
|
||||
std::unique_ptr<NodeBindings> node_bindings_;
|
||||
std::unique_ptr<AtomBindings> atom_bindings_;
|
||||
std::unique_ptr<NodeDebugger> node_debugger_;
|
||||
|
||||
base::Timer gc_timer_;
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace atom {
|
|||
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
||||
content::WebContents* web_contents,
|
||||
const GURL& origin_url,
|
||||
const std::string& accept_lang,
|
||||
content::JavaScriptMessageType javascript_message_type,
|
||||
const base::string16& message_text,
|
||||
const base::string16& default_prompt_text,
|
||||
|
@ -24,12 +23,10 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
|||
|
||||
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
|
||||
content::WebContents* web_contents,
|
||||
const base::string16& message_text,
|
||||
bool is_reload,
|
||||
const DialogClosedCallback& callback) {
|
||||
bool prevent_reload = message_text.empty() ||
|
||||
message_text == base::ASCIIToUTF16("false");
|
||||
callback.Run(!prevent_reload, message_text);
|
||||
// FIXME(zcbenz): the |message_text| is removed, figure out what should we do.
|
||||
callback.Run(true);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -17,7 +17,6 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
|||
void RunJavaScriptDialog(
|
||||
content::WebContents* web_contents,
|
||||
const GURL& origin_url,
|
||||
const std::string& accept_lang,
|
||||
content::JavaScriptMessageType javascript_message_type,
|
||||
const base::string16& message_text,
|
||||
const base::string16& default_prompt_text,
|
||||
|
@ -25,7 +24,6 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
|||
bool* did_suppress_message) override;
|
||||
void RunBeforeUnloadDialog(
|
||||
content::WebContents* web_contents,
|
||||
const base::string16& message_text,
|
||||
bool is_reload,
|
||||
const DialogClosedCallback& callback) override;
|
||||
void CancelActiveAndPendingDialogs(
|
||||
|
|
|
@ -40,7 +40,7 @@ void AtomPermissionManager::SetPermissionRequestHandler(
|
|||
if (handler.is_null() && !pending_requests_.empty()) {
|
||||
for (const auto& request : pending_requests_) {
|
||||
if (!WebContentsDestroyed(request.second.render_process_id))
|
||||
request.second.callback.Run(content::PermissionStatus::DENIED);
|
||||
request.second.callback.Run(blink::mojom::PermissionStatus::DENIED);
|
||||
}
|
||||
pending_requests_.clear();
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ int AtomPermissionManager::RequestPermission(
|
|||
return request_id_;
|
||||
}
|
||||
|
||||
response_callback.Run(content::PermissionStatus::GRANTED);
|
||||
response_callback.Run(blink::mojom::PermissionStatus::GRANTED);
|
||||
return kNoPendingOperation;
|
||||
}
|
||||
|
||||
|
@ -82,15 +82,15 @@ int AtomPermissionManager::RequestPermissions(
|
|||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
const base::Callback<void(
|
||||
const std::vector<content::PermissionStatus>&)>& callback) {
|
||||
const std::vector<blink::mojom::PermissionStatus>&)>& callback) {
|
||||
// FIXME(zcbenz): Just ignore multiple permissions request for now.
|
||||
std::vector<content::PermissionStatus> permissionStatuses;
|
||||
std::vector<blink::mojom::PermissionStatus> permissionStatuses;
|
||||
for (auto permission : permissions) {
|
||||
if (permission == content::PermissionType::MIDI_SYSEX) {
|
||||
content::ChildProcessSecurityPolicy::GetInstance()->
|
||||
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
|
||||
}
|
||||
permissionStatuses.push_back(content::PermissionStatus::GRANTED);
|
||||
permissionStatuses.push_back(blink::mojom::PermissionStatus::GRANTED);
|
||||
}
|
||||
callback.Run(permissionStatuses);
|
||||
return kNoPendingOperation;
|
||||
|
@ -100,7 +100,7 @@ void AtomPermissionManager::OnPermissionResponse(
|
|||
int request_id,
|
||||
const GURL& origin,
|
||||
const ResponseCallback& callback,
|
||||
content::PermissionStatus status) {
|
||||
blink::mojom::PermissionStatus status) {
|
||||
auto request = pending_requests_.find(request_id);
|
||||
if (request != pending_requests_.end()) {
|
||||
if (!WebContentsDestroyed(request->second.render_process_id))
|
||||
|
@ -113,7 +113,7 @@ void AtomPermissionManager::CancelPermissionRequest(int request_id) {
|
|||
auto request = pending_requests_.find(request_id);
|
||||
if (request != pending_requests_.end()) {
|
||||
if (!WebContentsDestroyed(request->second.render_process_id))
|
||||
request->second.callback.Run(content::PermissionStatus::DENIED);
|
||||
request->second.callback.Run(blink::mojom::PermissionStatus::DENIED);
|
||||
pending_requests_.erase(request);
|
||||
}
|
||||
}
|
||||
|
@ -124,11 +124,11 @@ void AtomPermissionManager::ResetPermission(
|
|||
const GURL& embedding_origin) {
|
||||
}
|
||||
|
||||
content::PermissionStatus AtomPermissionManager::GetPermissionStatus(
|
||||
blink::mojom::PermissionStatus AtomPermissionManager::GetPermissionStatus(
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) {
|
||||
return content::PermissionStatus::GRANTED;
|
||||
return blink::mojom::PermissionStatus::GRANTED;
|
||||
}
|
||||
|
||||
void AtomPermissionManager::RegisterPermissionUsage(
|
||||
|
|
|
@ -23,7 +23,7 @@ class AtomPermissionManager : public content::PermissionManager {
|
|||
~AtomPermissionManager() override;
|
||||
|
||||
using ResponseCallback =
|
||||
base::Callback<void(content::PermissionStatus)>;
|
||||
base::Callback<void(blink::mojom::PermissionStatus)>;
|
||||
using RequestHandler =
|
||||
base::Callback<void(content::WebContents*,
|
||||
content::PermissionType,
|
||||
|
@ -43,20 +43,20 @@ class AtomPermissionManager : public content::PermissionManager {
|
|||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
const base::Callback<void(
|
||||
const std::vector<content::PermissionStatus>&)>& callback) override;
|
||||
const std::vector<blink::mojom::PermissionStatus>&)>& callback) override;
|
||||
|
||||
protected:
|
||||
void OnPermissionResponse(int request_id,
|
||||
const GURL& url,
|
||||
const ResponseCallback& callback,
|
||||
content::PermissionStatus status);
|
||||
blink::mojom::PermissionStatus status);
|
||||
|
||||
// content::PermissionManager:
|
||||
void CancelPermissionRequest(int request_id) override;
|
||||
void ResetPermission(content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) override;
|
||||
content::PermissionStatus GetPermissionStatus(
|
||||
blink::mojom::PermissionStatus GetPermissionStatus(
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) override;
|
||||
|
@ -67,7 +67,8 @@ class AtomPermissionManager : public content::PermissionManager {
|
|||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin,
|
||||
const base::Callback<void(content::PermissionStatus)>& callback) override;
|
||||
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
|
||||
override;
|
||||
void UnsubscribePermissionStatusChange(int subscription_id) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -32,7 +32,7 @@ class AtomSecurityStateModelClient
|
|||
friend class content::WebContentsUserData<AtomSecurityStateModelClient>;
|
||||
|
||||
content::WebContents* web_contents_;
|
||||
scoped_ptr<security_state::SecurityStateModel> security_state_model_;
|
||||
std::unique_ptr<security_state::SecurityStateModel> security_state_model_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomSecurityStateModelClient);
|
||||
};
|
||||
|
|
|
@ -281,7 +281,7 @@ PCWSTR Browser::GetAppUserModelID() {
|
|||
std::string Browser::GetExecutableFileVersion() const {
|
||||
base::FilePath path;
|
||||
if (PathService::Get(base::FILE_EXE, &path)) {
|
||||
scoped_ptr<FileVersionInfo> version_info(
|
||||
std::unique_ptr<FileVersionInfo> version_info(
|
||||
FileVersionInfo::CreateFileVersionInfo(path));
|
||||
return base::UTF16ToUTF8(version_info->product_version());
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ std::string Browser::GetExecutableFileVersion() const {
|
|||
std::string Browser::GetExecutableFileProductName() const {
|
||||
base::FilePath path;
|
||||
if (PathService::Get(base::FILE_EXE, &path)) {
|
||||
scoped_ptr<FileVersionInfo> version_info(
|
||||
std::unique_ptr<FileVersionInfo> version_info(
|
||||
FileVersionInfo::CreateFileVersionInfo(path));
|
||||
return base::UTF16ToUTF8(version_info->product_name());
|
||||
}
|
||||
|
|
|
@ -464,7 +464,7 @@ void CommonWebContentsDelegate::DevToolsAddFileSystem(
|
|||
FileSystem file_system = CreateFileSystemStruct(GetDevToolsWebContents(),
|
||||
file_system_id,
|
||||
path.AsUTF8Unsafe());
|
||||
scoped_ptr<base::DictionaryValue> file_system_value(
|
||||
std::unique_ptr<base::DictionaryValue> file_system_value(
|
||||
CreateFileSystemValue(file_system));
|
||||
|
||||
auto pref_service = GetPrefService(GetDevToolsWebContents());
|
||||
|
|
|
@ -146,8 +146,8 @@ class CommonWebContentsDelegate
|
|||
// Whether window is fullscreened by window api.
|
||||
bool native_fullscreen_;
|
||||
|
||||
scoped_ptr<WebDialogHelper> web_dialog_helper_;
|
||||
scoped_ptr<AtomJavaScriptDialogManager> dialog_manager_;
|
||||
std::unique_ptr<WebDialogHelper> web_dialog_helper_;
|
||||
std::unique_ptr<AtomJavaScriptDialogManager> dialog_manager_;
|
||||
scoped_refptr<DevToolsFileSystemIndexer> devtools_file_system_indexer_;
|
||||
|
||||
// Make sure BrowserContext is alwasys destroyed after WebContents.
|
||||
|
@ -157,7 +157,7 @@ class CommonWebContentsDelegate
|
|||
// Notice that web_contents_ must be placed after dialog_manager_, so we can
|
||||
// make sure web_contents_ is destroyed before dialog_manager_, otherwise a
|
||||
// crash would happen.
|
||||
scoped_ptr<brightray::InspectableWebContents> web_contents_;
|
||||
std::unique_ptr<brightray::InspectableWebContents> web_contents_;
|
||||
|
||||
// Maps url to file path, used by the file requests sent from devtools.
|
||||
typedef std::map<std::string, base::FilePath> PathsMap;
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
continueUserActivity:(NSUserActivity*)userActivity
|
||||
restorationHandler:(void (^)(NSArray*restorableObjects))restorationHandler {
|
||||
std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType));
|
||||
scoped_ptr<base::DictionaryValue> user_info =
|
||||
std::unique_ptr<base::DictionaryValue> user_info =
|
||||
atom::NSDictionaryToDictionaryValue(userActivity.userInfo);
|
||||
if (!user_info)
|
||||
return NO;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace atom {
|
|||
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::DictionaryValue& value);
|
||||
|
||||
scoped_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||
std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||
NSDictionary* dict);
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -12,11 +12,11 @@ namespace atom {
|
|||
|
||||
namespace {
|
||||
|
||||
scoped_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
|
||||
std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
|
||||
if (!arr)
|
||||
return nullptr;
|
||||
|
||||
scoped_ptr<base::ListValue> result(new base::ListValue);
|
||||
std::unique_ptr<base::ListValue> result(new base::ListValue);
|
||||
for (id value in arr) {
|
||||
if ([value isKindOfClass:[NSString class]]) {
|
||||
result->AppendString(base::SysNSStringToUTF8(value));
|
||||
|
@ -31,13 +31,13 @@ scoped_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
|
|||
else
|
||||
result->AppendInteger([value intValue]);
|
||||
} else if ([value isKindOfClass:[NSArray class]]) {
|
||||
scoped_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||
if (sub_arr)
|
||||
result->Append(std::move(sub_arr));
|
||||
else
|
||||
result->Append(base::Value::CreateNullValue());
|
||||
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
||||
scoped_ptr<base::DictionaryValue> sub_dict =
|
||||
std::unique_ptr<base::DictionaryValue> sub_dict =
|
||||
NSDictionaryToDictionaryValue(value);
|
||||
if (sub_dict)
|
||||
result->Append(std::move(sub_dict));
|
||||
|
@ -66,12 +66,12 @@ NSDictionary* DictionaryValueToNSDictionary(const base::DictionaryValue& value)
|
|||
return obj;
|
||||
}
|
||||
|
||||
scoped_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||
std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||
NSDictionary* dict) {
|
||||
if (!dict)
|
||||
return nullptr;
|
||||
|
||||
scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
|
||||
for (id key in dict) {
|
||||
std::string str_key = base::SysNSStringToUTF8(
|
||||
[key isKindOfClass:[NSString class]] ? key : [key description]);
|
||||
|
@ -91,14 +91,14 @@ scoped_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
else
|
||||
result->SetIntegerWithoutPathExpansion(str_key, [value intValue]);
|
||||
} else if ([value isKindOfClass:[NSArray class]]) {
|
||||
scoped_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||
if (sub_arr)
|
||||
result->SetWithoutPathExpansion(str_key, std::move(sub_arr));
|
||||
else
|
||||
result->SetWithoutPathExpansion(str_key,
|
||||
base::Value::CreateNullValue());
|
||||
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
||||
scoped_ptr<base::DictionaryValue> sub_dict =
|
||||
std::unique_ptr<base::DictionaryValue> sub_dict =
|
||||
NSDictionaryToDictionaryValue(value);
|
||||
if (sub_dict)
|
||||
result->SetWithoutPathExpansion(str_key, std::move(sub_dict));
|
||||
|
|
|
@ -527,9 +527,9 @@ void NativeWindow::NotifyWindowMessage(
|
|||
}
|
||||
#endif
|
||||
|
||||
scoped_ptr<SkRegion> NativeWindow::DraggableRegionsToSkRegion(
|
||||
std::unique_ptr<SkRegion> NativeWindow::DraggableRegionsToSkRegion(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
scoped_ptr<SkRegion> sk_region(new SkRegion);
|
||||
std::unique_ptr<SkRegion> sk_region(new SkRegion);
|
||||
for (const DraggableRegion& region : regions) {
|
||||
sk_region->op(
|
||||
region.bounds.x(),
|
||||
|
|
|
@ -263,7 +263,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
|
||||
// Convert draggable regions in raw format to SkRegion format. Caller is
|
||||
// responsible for deleting the returned SkRegion instance.
|
||||
scoped_ptr<SkRegion> DraggableRegionsToSkRegion(
|
||||
std::unique_ptr<SkRegion> DraggableRegionsToSkRegion(
|
||||
const std::vector<DraggableRegion>& regions);
|
||||
|
||||
// Converts between content size to window size.
|
||||
|
@ -299,7 +299,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
|
||||
// For custom drag, the whole window is non-draggable and the draggable region
|
||||
// has to been explicitly provided.
|
||||
scoped_ptr<SkRegion> draggable_region_; // used in custom drag.
|
||||
std::unique_ptr<SkRegion> draggable_region_; // used in custom drag.
|
||||
|
||||
// Minimum and maximum size, stored as content size.
|
||||
extensions::SizeConstraints size_constraints_;
|
||||
|
|
|
@ -942,8 +942,8 @@ std::vector<gfx::Rect> NativeWindowMac::CalculateNonDraggableRegions(
|
|||
if (regions.empty()) {
|
||||
result.push_back(gfx::Rect(0, 0, width, height));
|
||||
} else {
|
||||
scoped_ptr<SkRegion> draggable(DraggableRegionsToSkRegion(regions));
|
||||
scoped_ptr<SkRegion> non_draggable(new SkRegion);
|
||||
std::unique_ptr<SkRegion> draggable(DraggableRegionsToSkRegion(regions));
|
||||
std::unique_ptr<SkRegion> non_draggable(new SkRegion);
|
||||
non_draggable->op(0, 0, width, height, SkRegion::kUnion_Op);
|
||||
non_draggable->op(*draggable, SkRegion::kDifference_Op);
|
||||
for (SkRegion::Iterator it(*non_draggable); !it.done(); it.next()) {
|
||||
|
|
|
@ -170,19 +170,19 @@ class NativeWindowViews : public NativeWindow,
|
|||
// Returns the restore state for the window.
|
||||
ui::WindowShowState GetRestoredState();
|
||||
|
||||
scoped_ptr<views::Widget> window_;
|
||||
std::unique_ptr<views::Widget> window_;
|
||||
views::View* web_view_; // Managed by inspectable_web_contents_.
|
||||
|
||||
scoped_ptr<MenuBar> menu_bar_;
|
||||
std::unique_ptr<MenuBar> menu_bar_;
|
||||
bool menu_bar_autohide_;
|
||||
bool menu_bar_visible_;
|
||||
bool menu_bar_alt_pressed_;
|
||||
|
||||
#if defined(USE_X11)
|
||||
scoped_ptr<GlobalMenuBarX11> global_menu_bar_;
|
||||
std::unique_ptr<GlobalMenuBarX11> global_menu_bar_;
|
||||
|
||||
// Handles window state events.
|
||||
scoped_ptr<WindowStateWatcher> window_state_watcher_;
|
||||
std::unique_ptr<WindowStateWatcher> window_state_watcher_;
|
||||
|
||||
// The "resizable" flag on Linux is implemented by setting size constraints,
|
||||
// we need to make sure size constraints are restored when window becomes
|
||||
|
@ -208,7 +208,7 @@ class NativeWindowViews : public NativeWindow,
|
|||
#endif
|
||||
|
||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||
scoped_ptr<views::UnhandledKeyboardEventHandler> keyboard_event_handler_;
|
||||
std::unique_ptr<views::UnhandledKeyboardEventHandler> keyboard_event_handler_;
|
||||
|
||||
// Map from accelerator to menu item's command id.
|
||||
accelerator_util::AcceleratorTable accelerator_table_;
|
||||
|
|
|
@ -112,7 +112,7 @@ class URLRequestAsarJob : public net::URLRequestJob {
|
|||
base::FilePath file_path_;
|
||||
Archive::FileInfo file_info_;
|
||||
|
||||
scoped_ptr<net::FileStream> stream_;
|
||||
std::unique_ptr<net::FileStream> stream_;
|
||||
FileMetaInfo meta_info_;
|
||||
scoped_refptr<base::TaskRunner> file_task_runner_;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ int AtomCertVerifier::Verify(
|
|||
net::CRLSet* crl_set,
|
||||
net::CertVerifyResult* verify_result,
|
||||
const net::CompletionCallback& callback,
|
||||
scoped_ptr<Request>* out_req,
|
||||
std::unique_ptr<Request>* out_req,
|
||||
const net::BoundNetLog& net_log) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@ class AtomCertVerifier : public net::CertVerifier {
|
|||
net::CRLSet* crl_set,
|
||||
net::CertVerifyResult* verify_result,
|
||||
const net::CompletionCallback& callback,
|
||||
scoped_ptr<Request>* out_req,
|
||||
std::unique_ptr<Request>* out_req,
|
||||
const net::BoundNetLog& net_log) override;
|
||||
bool SupportsOCSPStapling() override;
|
||||
|
||||
private:
|
||||
base::Lock lock_;
|
||||
VerifyProc verify_proc_;
|
||||
scoped_ptr<net::CertVerifier> default_cert_verifier_;
|
||||
std::unique_ptr<net::CertVerifier> default_cert_verifier_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomCertVerifier);
|
||||
};
|
||||
|
|
|
@ -45,13 +45,13 @@ using ResponseHeadersContainer =
|
|||
std::pair<scoped_refptr<net::HttpResponseHeaders>*, const std::string&>;
|
||||
|
||||
void RunSimpleListener(const AtomNetworkDelegate::SimpleListener& listener,
|
||||
scoped_ptr<base::DictionaryValue> details) {
|
||||
std::unique_ptr<base::DictionaryValue> details) {
|
||||
return listener.Run(*(details.get()));
|
||||
}
|
||||
|
||||
void RunResponseListener(
|
||||
const AtomNetworkDelegate::ResponseListener& listener,
|
||||
scoped_ptr<base::DictionaryValue> details,
|
||||
std::unique_ptr<base::DictionaryValue> details,
|
||||
const AtomNetworkDelegate::ResponseCallback& callback) {
|
||||
return listener.Run(*(details.get()), callback);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void ToDictionary(base::DictionaryValue* details, net::URLRequest* request) {
|
|||
details->SetString("resourceType",
|
||||
info ? ResourceTypeToString(info->GetResourceType())
|
||||
: "other");
|
||||
scoped_ptr<base::ListValue> list(new base::ListValue);
|
||||
std::unique_ptr<base::ListValue> list(new base::ListValue);
|
||||
GetUploadData(list.get(), request);
|
||||
if (!list->empty())
|
||||
details->Set("uploadData", std::move(list));
|
||||
|
@ -87,7 +87,7 @@ void ToDictionary(base::DictionaryValue* details, net::URLRequest* request) {
|
|||
|
||||
void ToDictionary(base::DictionaryValue* details,
|
||||
const net::HttpRequestHeaders& headers) {
|
||||
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
net::HttpRequestHeaders::Iterator it(headers);
|
||||
while (it.GetNext())
|
||||
dict->SetString(it.name(), it.value());
|
||||
|
@ -99,7 +99,7 @@ void ToDictionary(base::DictionaryValue* details,
|
|||
if (!headers)
|
||||
return;
|
||||
|
||||
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
size_t iter = 0;
|
||||
std::string key;
|
||||
std::string value;
|
||||
|
@ -109,7 +109,7 @@ void ToDictionary(base::DictionaryValue* details,
|
|||
if (dict->GetList(key, &values))
|
||||
values->AppendString(value);
|
||||
} else {
|
||||
scoped_ptr<base::ListValue> values(new base::ListValue);
|
||||
std::unique_ptr<base::ListValue> values(new base::ListValue);
|
||||
values->AppendString(value);
|
||||
dict->Set(key, std::move(values));
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ int AtomNetworkDelegate::HandleResponseEvent(
|
|||
if (!MatchesFilterCondition(request, info.url_patterns))
|
||||
return net::OK;
|
||||
|
||||
scoped_ptr<base::DictionaryValue> details(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue);
|
||||
FillDetailsObject(details.get(), request, args...);
|
||||
|
||||
// The |request| could be destroyed before the |callback| is called.
|
||||
|
@ -392,7 +392,7 @@ void AtomNetworkDelegate::HandleSimpleEvent(
|
|||
if (!MatchesFilterCondition(request, info.url_patterns))
|
||||
return;
|
||||
|
||||
scoped_ptr<base::DictionaryValue> details(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue);
|
||||
FillDetailsObject(details.get(), request, args...);
|
||||
|
||||
BrowserThread::PostTask(
|
||||
|
@ -402,7 +402,7 @@ void AtomNetworkDelegate::HandleSimpleEvent(
|
|||
|
||||
template<typename T>
|
||||
void AtomNetworkDelegate::OnListenerResultInIO(
|
||||
uint64_t id, T out, scoped_ptr<base::DictionaryValue> response) {
|
||||
uint64_t id, T out, std::unique_ptr<base::DictionaryValue> response) {
|
||||
// The request has been destroyed.
|
||||
if (!ContainsKey(callbacks_, id))
|
||||
return;
|
||||
|
@ -417,7 +417,7 @@ void AtomNetworkDelegate::OnListenerResultInIO(
|
|||
template<typename T>
|
||||
void AtomNetworkDelegate::OnListenerResultInUI(
|
||||
uint64_t id, T out, const base::DictionaryValue& response) {
|
||||
scoped_ptr<base::DictionaryValue> copy = response.CreateDeepCopy();
|
||||
std::unique_ptr<base::DictionaryValue> copy = response.CreateDeepCopy();
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&AtomNetworkDelegate::OnListenerResultInIO<T>,
|
||||
|
|
|
@ -111,7 +111,7 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
|
|||
// Deal with the results of Listener.
|
||||
template<typename T>
|
||||
void OnListenerResultInIO(
|
||||
uint64_t id, T out, scoped_ptr<base::DictionaryValue> response);
|
||||
uint64_t id, T out, std::unique_ptr<base::DictionaryValue> response);
|
||||
template<typename T>
|
||||
void OnListenerResultInUI(
|
||||
uint64_t id, T out, const base::DictionaryValue& response);
|
||||
|
|
|
@ -23,7 +23,7 @@ AtomURLRequestJobFactory::~AtomURLRequestJobFactory() {
|
|||
}
|
||||
|
||||
bool AtomURLRequestJobFactory::SetProtocolHandler(
|
||||
const std::string& scheme, scoped_ptr<ProtocolHandler> protocol_handler) {
|
||||
const std::string& scheme, std::unique_ptr<ProtocolHandler> protocol_handler) {
|
||||
if (!protocol_handler) {
|
||||
ProtocolHandlerMap::iterator it = protocol_handler_map_.find(scheme);
|
||||
if (it == protocol_handler_map_.end())
|
||||
|
@ -40,8 +40,8 @@ bool AtomURLRequestJobFactory::SetProtocolHandler(
|
|||
return true;
|
||||
}
|
||||
|
||||
scoped_ptr<ProtocolHandler> AtomURLRequestJobFactory::ReplaceProtocol(
|
||||
const std::string& scheme, scoped_ptr<ProtocolHandler> protocol_handler) {
|
||||
std::unique_ptr<ProtocolHandler> AtomURLRequestJobFactory::ReplaceProtocol(
|
||||
const std::string& scheme, std::unique_ptr<ProtocolHandler> protocol_handler) {
|
||||
if (!ContainsKey(protocol_handler_map_, scheme))
|
||||
return nullptr;
|
||||
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
|
||||
|
|
|
@ -25,12 +25,12 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
|||
// failure (a ProtocolHandler already exists for |scheme|). On success,
|
||||
// URLRequestJobFactory takes ownership of |protocol_handler|.
|
||||
bool SetProtocolHandler(
|
||||
const std::string& scheme, scoped_ptr<ProtocolHandler> protocol_handler);
|
||||
const std::string& scheme, std::unique_ptr<ProtocolHandler> protocol_handler);
|
||||
|
||||
// Intercepts the ProtocolHandler for a scheme. Returns the original protocol
|
||||
// handler on success, otherwise returns NULL.
|
||||
scoped_ptr<ProtocolHandler> ReplaceProtocol(
|
||||
const std::string& scheme, scoped_ptr<ProtocolHandler> protocol_handler);
|
||||
std::unique_ptr<ProtocolHandler> ReplaceProtocol(
|
||||
const std::string& scheme, std::unique_ptr<ProtocolHandler> protocol_handler);
|
||||
|
||||
// Returns the protocol handler registered with scheme.
|
||||
ProtocolHandler* GetProtocolHandler(const std::string& scheme) const;
|
||||
|
|
|
@ -34,7 +34,7 @@ void HandlerCallback(const BeforeStartCallback& before_start,
|
|||
// Pass whatever user passed to the actaul request job.
|
||||
V8ValueConverter converter;
|
||||
v8::Local<v8::Context> context = args->isolate()->GetCurrentContext();
|
||||
scoped_ptr<base::Value> options(converter.FromV8Value(value, context));
|
||||
std::unique_ptr<base::Value> options(converter.FromV8Value(value, context));
|
||||
content::BrowserThread::PostTask(
|
||||
content::BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(callback, true, base::Passed(&options)));
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace internal {
|
|||
using BeforeStartCallback =
|
||||
base::Callback<void(v8::Isolate*, v8::Local<v8::Value>)>;
|
||||
using ResponseCallback =
|
||||
base::Callback<void(bool, scoped_ptr<base::Value> options)>;
|
||||
base::Callback<void(bool, std::unique_ptr<base::Value> options)>;
|
||||
|
||||
// Ask handler for options in UI thread.
|
||||
void AskForOptions(v8::Isolate* isolate,
|
||||
|
@ -58,7 +58,7 @@ class JsAsker : public RequestJob {
|
|||
|
||||
// Subclass should do initailze work here.
|
||||
virtual void BeforeStartInUI(v8::Isolate*, v8::Local<v8::Value>) {}
|
||||
virtual void StartAsync(scoped_ptr<base::Value> options) = 0;
|
||||
virtual void StartAsync(std::unique_ptr<base::Value> options) = 0;
|
||||
|
||||
net::URLRequestContextGetter* request_context_getter() const {
|
||||
return request_context_getter_;
|
||||
|
@ -84,7 +84,7 @@ class JsAsker : public RequestJob {
|
|||
|
||||
// Called when the JS handler has sent the response, we need to decide whether
|
||||
// to start, or fail the job.
|
||||
void OnResponse(bool success, scoped_ptr<base::Value> value) {
|
||||
void OnResponse(bool success, std::unique_ptr<base::Value> value) {
|
||||
int error = net::ERR_NOT_IMPLEMENTED;
|
||||
if (success && value && !internal::IsErrorOptions(value.get(), &error)) {
|
||||
StartAsync(std::move(value));
|
||||
|
|
|
@ -16,7 +16,7 @@ URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
|
|||
: JsAsker<asar::URLRequestAsarJob>(request, network_delegate) {
|
||||
}
|
||||
|
||||
void URLRequestAsyncAsarJob::StartAsync(scoped_ptr<base::Value> options) {
|
||||
void URLRequestAsyncAsarJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
base::FilePath::StringType file_path;
|
||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
static_cast<base::DictionaryValue*>(options.get())->GetString(
|
||||
|
|
|
@ -16,7 +16,7 @@ class URLRequestAsyncAsarJob : public JsAsker<asar::URLRequestAsarJob> {
|
|||
URLRequestAsyncAsarJob(net::URLRequest*, net::NetworkDelegate*);
|
||||
|
||||
// JsAsker:
|
||||
void StartAsync(scoped_ptr<base::Value> options) override;
|
||||
void StartAsync(std::unique_ptr<base::Value> options) override;
|
||||
|
||||
// URLRequestJob:
|
||||
void GetResponseInfo(net::HttpResponseInfo* info) override;
|
||||
|
|
|
@ -18,7 +18,7 @@ URLRequestBufferJob::URLRequestBufferJob(
|
|||
status_code_(net::HTTP_NOT_IMPLEMENTED) {
|
||||
}
|
||||
|
||||
void URLRequestBufferJob::StartAsync(scoped_ptr<base::Value> options) {
|
||||
void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
const base::BinaryValue* binary = nullptr;
|
||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
base::DictionaryValue* dict =
|
||||
|
|
|
@ -19,7 +19,7 @@ class URLRequestBufferJob : public JsAsker<net::URLRequestSimpleJob> {
|
|||
URLRequestBufferJob(net::URLRequest*, net::NetworkDelegate*);
|
||||
|
||||
// JsAsker:
|
||||
void StartAsync(scoped_ptr<base::Value> options) override;
|
||||
void StartAsync(std::unique_ptr<base::Value> options) override;
|
||||
|
||||
// URLRequestJob:
|
||||
void GetResponseInfo(net::HttpResponseInfo* info) override;
|
||||
|
|
|
@ -99,7 +99,7 @@ void URLRequestFetchJob::BeforeStartInUI(
|
|||
}
|
||||
}
|
||||
|
||||
void URLRequestFetchJob::StartAsync(scoped_ptr<base::Value> options) {
|
||||
void URLRequestFetchJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
if (!options->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
NotifyStartError(net::URLRequestStatus(
|
||||
net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED));
|
||||
|
|
|
@ -30,7 +30,7 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
|
|||
protected:
|
||||
// JsAsker:
|
||||
void BeforeStartInUI(v8::Isolate*, v8::Local<v8::Value>) override;
|
||||
void StartAsync(scoped_ptr<base::Value> options) override;
|
||||
void StartAsync(std::unique_ptr<base::Value> options) override;
|
||||
|
||||
// net::URLRequestJob:
|
||||
void Kill() override;
|
||||
|
@ -44,10 +44,10 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
|
|||
|
||||
private:
|
||||
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
|
||||
scoped_ptr<net::URLFetcher> fetcher_;
|
||||
std::unique_ptr<net::URLFetcher> fetcher_;
|
||||
scoped_refptr<net::IOBuffer> pending_buffer_;
|
||||
int pending_buffer_size_;
|
||||
scoped_ptr<net::HttpResponseInfo> response_info_;
|
||||
std::unique_ptr<net::HttpResponseInfo> response_info_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestFetchJob);
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ URLRequestStringJob::URLRequestStringJob(
|
|||
: JsAsker<net::URLRequestSimpleJob>(request, network_delegate) {
|
||||
}
|
||||
|
||||
void URLRequestStringJob::StartAsync(scoped_ptr<base::Value> options) {
|
||||
void URLRequestStringJob::StartAsync(std::unique_ptr<base::Value> options) {
|
||||
if (options->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
base::DictionaryValue* dict =
|
||||
static_cast<base::DictionaryValue*>(options.get());
|
||||
|
|
|
@ -17,7 +17,7 @@ class URLRequestStringJob : public JsAsker<net::URLRequestSimpleJob> {
|
|||
URLRequestStringJob(net::URLRequest*, net::NetworkDelegate*);
|
||||
|
||||
// JsAsker:
|
||||
void StartAsync(scoped_ptr<base::Value> options) override;
|
||||
void StartAsync(std::unique_ptr<base::Value> options) override;
|
||||
|
||||
// URLRequestJob:
|
||||
void GetResponseInfo(net::HttpResponseInfo* info) override;
|
||||
|
|
|
@ -145,7 +145,7 @@ void NodeDebugger::DebugMessageHandler(const v8::Debug::Message& message) {
|
|||
|
||||
void NodeDebugger::DidAccept(
|
||||
net::test_server::StreamListenSocket* server,
|
||||
scoped_ptr<net::test_server::StreamListenSocket> socket) {
|
||||
std::unique_ptr<net::test_server::StreamListenSocket> socket) {
|
||||
// Only accept one session.
|
||||
if (accepted_socket_) {
|
||||
socket->Send(std::string("Remote debugging session already active"), true);
|
||||
|
|
|
@ -38,7 +38,7 @@ class NodeDebugger : public net::test_server::StreamListenSocket::Delegate {
|
|||
// net::test_server::StreamListenSocket::Delegate:
|
||||
void DidAccept(
|
||||
net::test_server::StreamListenSocket* server,
|
||||
scoped_ptr<net::test_server::StreamListenSocket> socket) override;
|
||||
std::unique_ptr<net::test_server::StreamListenSocket> socket) override;
|
||||
void DidRead(net::test_server::StreamListenSocket* socket,
|
||||
const char* data,
|
||||
int len) override;
|
||||
|
@ -49,8 +49,8 @@ class NodeDebugger : public net::test_server::StreamListenSocket::Delegate {
|
|||
uv_async_t weak_up_ui_handle_;
|
||||
|
||||
base::Thread thread_;
|
||||
scoped_ptr<net::test_server::StreamListenSocket> server_;
|
||||
scoped_ptr<net::test_server::StreamListenSocket> accepted_socket_;
|
||||
std::unique_ptr<net::test_server::StreamListenSocket> server_;
|
||||
std::unique_ptr<net::test_server::StreamListenSocket> accepted_socket_;
|
||||
|
||||
std::string buffer_;
|
||||
int content_length_;
|
||||
|
|
|
@ -32,7 +32,7 @@ void SetPlatformAccelerator(ui::Accelerator* accelerator) {
|
|||
NSString* characters =
|
||||
[[[NSString alloc] initWithCharacters:&character length:1] autorelease];
|
||||
|
||||
scoped_ptr<ui::PlatformAccelerator> platform_accelerator(
|
||||
std::unique_ptr<ui::PlatformAccelerator> platform_accelerator(
|
||||
new ui::PlatformAcceleratorCocoa(characters, modifiers));
|
||||
accelerator->set_platform_accelerator(std::move(platform_accelerator));
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ void FileChooserDialog::AddFilters(const Filters& filters) {
|
|||
GtkFileFilter* gtk_filter = gtk_file_filter_new();
|
||||
|
||||
for (size_t j = 0; j < filter.second.size(); ++j) {
|
||||
scoped_ptr<std::string> file_extension(
|
||||
std::unique_ptr<std::string> file_extension(
|
||||
new std::string("." + filter.second[j]));
|
||||
gtk_file_filter_add_custom(
|
||||
gtk_filter,
|
||||
|
|
|
@ -134,7 +134,7 @@ class FileDialog {
|
|||
GetPtr()->SetFolder(folder_item);
|
||||
}
|
||||
|
||||
scoped_ptr<T> dialog_;
|
||||
std::unique_ptr<T> dialog_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FileDialog);
|
||||
};
|
||||
|
@ -145,7 +145,7 @@ struct RunState {
|
|||
};
|
||||
|
||||
bool CreateDialogThread(RunState* run_state) {
|
||||
scoped_ptr<base::Thread> thread(
|
||||
std::unique_ptr<base::Thread> thread(
|
||||
new base::Thread(ATOM_PRODUCT_NAME "FileDialogThread"));
|
||||
thread->init_com_with_mta(false);
|
||||
if (!thread->Start())
|
||||
|
|
|
@ -222,7 +222,7 @@ void ShowMessageBox(NativeWindow* parent,
|
|||
const std::string& detail,
|
||||
const gfx::ImageSkia& icon,
|
||||
const MessageBoxCallback& callback) {
|
||||
scoped_ptr<base::Thread> thread(
|
||||
std::unique_ptr<base::Thread> thread(
|
||||
new base::Thread(ATOM_PRODUCT_NAME "MessageBoxThread"));
|
||||
thread->init_com_with_mta(false);
|
||||
if (!thread->Start()) {
|
||||
|
|
|
@ -32,7 +32,7 @@ class TrayIconGtk : public TrayIcon,
|
|||
void OnClick() override;
|
||||
bool HasClickAction() override;
|
||||
|
||||
scoped_ptr<views::StatusIconLinux> icon_;
|
||||
std::unique_ptr<views::StatusIconLinux> icon_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);
|
||||
};
|
||||
|
|
|
@ -52,8 +52,8 @@ class MenuDelegate : public views::MenuDelegate {
|
|||
private:
|
||||
MenuBar* menu_bar_;
|
||||
int id_;
|
||||
scoped_ptr<views::MenuDelegate> adapter_;
|
||||
scoped_ptr<views::MenuRunner> menu_runner_;
|
||||
std::unique_ptr<views::MenuDelegate> adapter_;
|
||||
std::unique_ptr<views::MenuRunner> menu_runner_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MenuDelegate);
|
||||
};
|
||||
|
|
|
@ -51,7 +51,7 @@ void SetWindowType(::Window xwindow, const std::string& type) {
|
|||
}
|
||||
|
||||
bool ShouldUseGlobalMenuBar() {
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (env->HasVar("ELECTRON_FORCE_WINDOW_MENU_BAR"))
|
||||
return false;
|
||||
|
||||
|
@ -61,7 +61,7 @@ bool ShouldUseGlobalMenuBar() {
|
|||
dbus::ObjectProxy* object_proxy =
|
||||
bus->GetObjectProxy(DBUS_SERVICE_DBUS, dbus::ObjectPath(DBUS_PATH_DBUS));
|
||||
dbus::MethodCall method_call(DBUS_INTERFACE_DBUS, "ListNames");
|
||||
scoped_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock(
|
||||
std::unique_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock(
|
||||
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT));
|
||||
if (!response) {
|
||||
bus->ShutdownAndBlock();
|
||||
|
|
|
@ -24,10 +24,10 @@ struct SetSizeParams {
|
|||
SetSizeParams() {}
|
||||
~SetSizeParams() {}
|
||||
|
||||
scoped_ptr<bool> enable_auto_size;
|
||||
scoped_ptr<gfx::Size> min_size;
|
||||
scoped_ptr<gfx::Size> max_size;
|
||||
scoped_ptr<gfx::Size> normal_size;
|
||||
std::unique_ptr<bool> enable_auto_size;
|
||||
std::unique_ptr<gfx::Size> min_size;
|
||||
std::unique_ptr<gfx::Size> max_size;
|
||||
std::unique_ptr<gfx::Size> normal_size;
|
||||
};
|
||||
|
||||
class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
||||
|
|
|
@ -22,7 +22,7 @@ class Archive : public mate::Wrappable<Archive> {
|
|||
public:
|
||||
static v8::Local<v8::Value> Create(v8::Isolate* isolate,
|
||||
const base::FilePath& path) {
|
||||
scoped_ptr<asar::Archive> archive(new asar::Archive(path));
|
||||
std::unique_ptr<asar::Archive> archive(new asar::Archive(path));
|
||||
if (!archive->Init())
|
||||
return v8::False(isolate);
|
||||
return (new Archive(isolate, std::move(archive)))->GetWrapper();
|
||||
|
@ -42,7 +42,7 @@ class Archive : public mate::Wrappable<Archive> {
|
|||
}
|
||||
|
||||
protected:
|
||||
Archive(v8::Isolate* isolate, scoped_ptr<asar::Archive> archive)
|
||||
Archive(v8::Isolate* isolate, std::unique_ptr<asar::Archive> archive)
|
||||
: archive_(std::move(archive)) {
|
||||
Init(isolate);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ class Archive : public mate::Wrappable<Archive> {
|
|||
}
|
||||
|
||||
private:
|
||||
scoped_ptr<asar::Archive> archive_;
|
||||
std::unique_ptr<asar::Archive> archive_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Archive);
|
||||
};
|
||||
|
|
|
@ -76,7 +76,7 @@ bool AddImageSkiaRep(gfx::ImageSkia* image,
|
|||
const unsigned char* data,
|
||||
size_t size,
|
||||
double scale_factor) {
|
||||
scoped_ptr<SkBitmap> decoded(new SkBitmap());
|
||||
std::unique_ptr<SkBitmap> decoded(new SkBitmap());
|
||||
|
||||
// Try PNG first.
|
||||
if (!gfx::PNGCodec::Decode(data, size, decoded.get()))
|
||||
|
@ -162,7 +162,7 @@ base::win::ScopedHICON ReadICOFromPath(int size, const base::FilePath& path) {
|
|||
|
||||
void ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {
|
||||
// Convert the icon from the Windows specific HICON to gfx::ImageSkia.
|
||||
scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
|
||||
std::unique_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
|
||||
image->AddRepresentation(gfx::ImageSkiaRep(*bitmap, 1.0f));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,7 @@ v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
|
|||
v8::Local<v8::Object> obj,
|
||||
ValueVector* args) {
|
||||
// Perform microtask checkpoint after running JavaScript.
|
||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
std::unique_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr : new blink::WebScopedRunV8Script);
|
||||
// Use node::MakeCallback to call the callback, and it will also run pending
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#ifndef ATOM_COMMON_API_LOCKER_H_
|
||||
#define ATOM_COMMON_API_LOCKER_H_
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace mate {
|
||||
|
@ -24,7 +26,7 @@ class Locker {
|
|||
void* operator new(size_t size);
|
||||
void operator delete(void*, size_t);
|
||||
|
||||
scoped_ptr<v8::Locker> locker_;
|
||||
std::unique_ptr<v8::Locker> locker_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Locker);
|
||||
};
|
||||
|
|
|
@ -180,7 +180,7 @@ bool Archive::Init() {
|
|||
|
||||
std::string error;
|
||||
base::JSONReader reader;
|
||||
scoped_ptr<base::Value> value(reader.ReadToValue(header));
|
||||
std::unique_ptr<base::Value> value(reader.ReadToValue(header));
|
||||
if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
LOG(ERROR) << "Failed to parse header: " << error;
|
||||
return false;
|
||||
|
@ -283,7 +283,7 @@ bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
|
|||
return true;
|
||||
}
|
||||
|
||||
scoped_ptr<ScopedTemporaryFile> temp_file(new ScopedTemporaryFile);
|
||||
std::unique_ptr<ScopedTemporaryFile> temp_file(new ScopedTemporaryFile);
|
||||
base::FilePath::StringType ext = path.Extension();
|
||||
if (!temp_file->InitFromFile(&file_, ext, info.offset, info.size))
|
||||
return false;
|
||||
|
|
|
@ -72,10 +72,10 @@ class Archive {
|
|||
base::File file_;
|
||||
int fd_;
|
||||
uint32_t header_size_;
|
||||
scoped_ptr<base::DictionaryValue> header_;
|
||||
std::unique_ptr<base::DictionaryValue> header_;
|
||||
|
||||
// Cached external temporary files.
|
||||
base::ScopedPtrHashMap<base::FilePath, scoped_ptr<ScopedTemporaryFile>>
|
||||
base::ScopedPtrHashMap<base::FilePath, std::unique_ptr<ScopedTemporaryFile>>
|
||||
external_files_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Archive);
|
||||
|
|
|
@ -47,7 +47,7 @@ class CrashReporterLinux : public CrashReporter {
|
|||
void* context,
|
||||
const bool succeeded);
|
||||
|
||||
scoped_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||
CrashKeyStorage crash_keys_;
|
||||
|
||||
uint64_t process_start_time_;
|
||||
|
|
|
@ -45,7 +45,7 @@ class CrashReporterMac : public CrashReporter {
|
|||
std::vector<UploadReportResult> GetUploadedReports(
|
||||
const std::string& path) override;
|
||||
|
||||
scoped_ptr<crashpad::SimpleStringDictionary> simple_string_dictionary_;
|
||||
std::unique_ptr<crashpad::SimpleStringDictionary> simple_string_dictionary_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CrashReporterMac);
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ class CrashReporterWin : public CrashReporter {
|
|||
google_breakpad::CustomClientInfo custom_info_;
|
||||
|
||||
bool skip_system_crash_handler_;
|
||||
scoped_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);
|
||||
};
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "base/memory/weak_ptr.h"
|
||||
#include "native_mate/function_template.h"
|
||||
#include "native_mate/scoped_persistent.h"
|
||||
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
|
@ -49,9 +48,11 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
|||
v8::EscapableHandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return v8::Null(isolate);
|
||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr : new blink::WebScopedRunV8Script);
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
@ -70,9 +71,11 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
|||
v8::HandleScope handle_scope(isolate);
|
||||
if (!function.IsAlive())
|
||||
return;
|
||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr : new blink::WebScopedRunV8Script);
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
@ -91,9 +94,11 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
|
|||
ReturnType ret = ReturnType();
|
||||
if (!function.IsAlive())
|
||||
return ret;
|
||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr : new blink::WebScopedRunV8Script);
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||
v8::Local<v8::Context> context = holder->CreationContext();
|
||||
v8::Context::Scope context_scope(context);
|
||||
|
|
|
@ -121,18 +121,18 @@ v8::Local<v8::Value> Converter<ContextMenuParamsWithWebContents>::ToV8(
|
|||
}
|
||||
|
||||
// static
|
||||
bool Converter<content::PermissionStatus>::FromV8(
|
||||
bool Converter<blink::mojom::PermissionStatus>::FromV8(
|
||||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
content::PermissionStatus* out) {
|
||||
blink::mojom::PermissionStatus* out) {
|
||||
bool result;
|
||||
if (!ConvertFromV8(isolate, val, &result))
|
||||
return false;
|
||||
|
||||
if (result)
|
||||
*out = content::PermissionStatus::GRANTED;
|
||||
*out = blink::mojom::PermissionStatus::GRANTED;
|
||||
else
|
||||
*out = content::PermissionStatus::DENIED;
|
||||
*out = blink::mojom::PermissionStatus::DENIED;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
#include "content/public/browser/permission_type.h"
|
||||
#include "content/public/common/menu_item.h"
|
||||
#include "content/public/common/permission_status.mojom.h"
|
||||
#include "content/public/common/stop_find_action.h"
|
||||
#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
|
||||
#include "native_mate/converter.h"
|
||||
|
||||
namespace content {
|
||||
|
@ -36,9 +36,9 @@ struct Converter<ContextMenuParamsWithWebContents> {
|
|||
};
|
||||
|
||||
template<>
|
||||
struct Converter<content::PermissionStatus> {
|
||||
struct Converter<blink::mojom::PermissionStatus> {
|
||||
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
||||
content::PermissionStatus* out);
|
||||
blink::mojom::PermissionStatus* out);
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -25,13 +25,13 @@ namespace mate {
|
|||
// static
|
||||
v8::Local<v8::Value> Converter<const net::URLRequest*>::ToV8(
|
||||
v8::Isolate* isolate, const net::URLRequest* val) {
|
||||
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
dict->SetString("method", val->method());
|
||||
std::string url;
|
||||
if (!val->url_chain().empty()) url = val->url().spec();
|
||||
dict->SetStringWithoutPathExpansion("url", url);
|
||||
dict->SetString("referrer", val->referrer());
|
||||
scoped_ptr<base::ListValue> list(new base::ListValue);
|
||||
std::unique_ptr<base::ListValue> list(new base::ListValue);
|
||||
atom::GetUploadData(list.get(), val);
|
||||
if (!list->empty())
|
||||
dict->Set("uploadData", std::move(list));
|
||||
|
@ -74,15 +74,15 @@ void GetUploadData(base::ListValue* upload_data_list,
|
|||
const net::UploadDataStream* upload_data = request->get_upload();
|
||||
if (!upload_data)
|
||||
return;
|
||||
const std::vector<scoped_ptr<net::UploadElementReader>>* readers =
|
||||
const std::vector<std::unique_ptr<net::UploadElementReader>>* readers =
|
||||
upload_data->GetElementReaders();
|
||||
for (const auto& reader : *readers) {
|
||||
scoped_ptr<base::DictionaryValue> upload_data_dict(
|
||||
std::unique_ptr<base::DictionaryValue> upload_data_dict(
|
||||
new base::DictionaryValue);
|
||||
if (reader->AsBytesReader()) {
|
||||
const net::UploadBytesElementReader* bytes_reader =
|
||||
reader->AsBytesReader();
|
||||
scoped_ptr<base::Value> bytes(
|
||||
std::unique_ptr<base::Value> bytes(
|
||||
base::BinaryValue::CreateWithCopiedBuffer(bytes_reader->bytes(),
|
||||
bytes_reader->length()));
|
||||
upload_data_dict->Set("bytes", std::move(bytes));
|
||||
|
|
|
@ -288,7 +288,7 @@ base::Value* V8ValueConverter::FromV8Array(
|
|||
if (!state->UpdateAndCheckUniqueness(val))
|
||||
return base::Value::CreateNullValue().release();
|
||||
|
||||
scoped_ptr<v8::Context::Scope> scope;
|
||||
std::unique_ptr<v8::Context::Scope> scope;
|
||||
// If val was created in a different context than our current one, change to
|
||||
// that context, but change back after val is converted.
|
||||
if (!val->CreationContext().IsEmpty() &&
|
||||
|
@ -335,14 +335,14 @@ base::Value* V8ValueConverter::FromV8Object(
|
|||
if (!state->UpdateAndCheckUniqueness(val))
|
||||
return base::Value::CreateNullValue().release();
|
||||
|
||||
scoped_ptr<v8::Context::Scope> scope;
|
||||
std::unique_ptr<v8::Context::Scope> scope;
|
||||
// If val was created in a different context than our current one, change to
|
||||
// that context, but change back after val is converted.
|
||||
if (!val->CreationContext().IsEmpty() &&
|
||||
val->CreationContext() != isolate->GetCurrentContext())
|
||||
scope.reset(new v8::Context::Scope(val->CreationContext()));
|
||||
|
||||
scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
||||
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
||||
v8::Local<v8::Array> property_names(val->GetOwnPropertyNames());
|
||||
|
||||
for (uint32_t i = 0; i < property_names->Length(); ++i) {
|
||||
|
@ -371,7 +371,7 @@ base::Value* V8ValueConverter::FromV8Object(
|
|||
child_v8 = v8::Null(isolate);
|
||||
}
|
||||
|
||||
scoped_ptr<base::Value> child(FromV8ValueImpl(state, child_v8, isolate));
|
||||
std::unique_ptr<base::Value> child(FromV8ValueImpl(state, child_v8, isolate));
|
||||
if (!child.get())
|
||||
// JSON.stringify skips properties whose values don't serialize, for
|
||||
// example undefined and functions. Emulate that behavior.
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace mate {
|
|||
bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::DictionaryValue* out) {
|
||||
scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
scoped_ptr<base::Value> value(converter->FromV8Value(
|
||||
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
std::unique_ptr<base::Value> value(converter->FromV8Value(
|
||||
val, isolate->GetCurrentContext()));
|
||||
if (value && value->IsType(base::Value::TYPE_DICTIONARY)) {
|
||||
out->Swap(static_cast<base::DictionaryValue*>(value.get()));
|
||||
|
@ -26,15 +26,15 @@ bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate,
|
|||
v8::Local<v8::Value> Converter<base::DictionaryValue>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const base::DictionaryValue& val) {
|
||||
scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
return converter->ToV8Value(&val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::ListValue* out) {
|
||||
scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
scoped_ptr<base::Value> value(converter->FromV8Value(
|
||||
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
std::unique_ptr<base::Value> value(converter->FromV8Value(
|
||||
val, isolate->GetCurrentContext()));
|
||||
if (value->IsType(base::Value::TYPE_LIST)) {
|
||||
out->Swap(static_cast<base::ListValue*>(value.get()));
|
||||
|
@ -47,7 +47,7 @@ bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
|||
v8::Local<v8::Value> Converter<base::ListValue>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const base::ListValue& val) {
|
||||
scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
std::unique_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
|
||||
return converter->ToV8Value(&val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
|
|
|
@ -79,9 +79,9 @@ void UvNoOp(uv_async_t* handle) {
|
|||
// Convert the given vector to an array of C-strings. The strings in the
|
||||
// returned vector are only guaranteed valid so long as the vector of strings
|
||||
// is not modified.
|
||||
scoped_ptr<const char*[]> StringVectorToArgArray(
|
||||
std::unique_ptr<const char*[]> StringVectorToArgArray(
|
||||
const std::vector<std::string>& vector) {
|
||||
scoped_ptr<const char*[]> array(new const char*[vector.size()]);
|
||||
std::unique_ptr<const char*[]> array(new const char*[vector.size()]);
|
||||
for (size_t i = 0; i < vector.size(); ++i) {
|
||||
array[i] = vector[i].c_str();
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void NodeBindings::Initialize() {
|
|||
#if defined(OS_WIN)
|
||||
// uv_init overrides error mode to suppress the default crash dialog, bring
|
||||
// it back if user wants to show it.
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (env->HasVar("ELECTRON_DEFAULT_ERROR_MODE"))
|
||||
SetErrorMode(0);
|
||||
#endif
|
||||
|
@ -167,7 +167,7 @@ node::Environment* NodeBindings::CreateEnvironment(
|
|||
std::string script_path_str = script_path.AsUTF8Unsafe();
|
||||
args.insert(args.begin() + 1, script_path_str.c_str());
|
||||
|
||||
scoped_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
|
||||
std::unique_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
|
||||
node::Environment* env = node::CreateEnvironment(
|
||||
context->GetIsolate(), uv_default_loop(), context,
|
||||
args.size(), c_argv.get(), 0, nullptr);
|
||||
|
@ -226,7 +226,7 @@ void NodeBindings::UvRunOnce() {
|
|||
v8::Context::Scope context_scope(env->context());
|
||||
|
||||
// Perform microtask checkpoint after running JavaScript.
|
||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
std::unique_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||
is_browser_ ? nullptr : new blink::WebScopedRunV8Script);
|
||||
|
||||
// Deal with uv events.
|
||||
|
|
|
@ -158,7 +158,7 @@ void WebFrame::ExecuteJavaScript(const base::string16& code,
|
|||
args->GetNext(&has_user_gesture);
|
||||
ScriptExecutionCallback::CompletionCallback completion_callback;
|
||||
args->GetNext(&completion_callback);
|
||||
scoped_ptr<blink::WebScriptExecutionCallback> callback(
|
||||
std::unique_ptr<blink::WebScriptExecutionCallback> callback(
|
||||
new ScriptExecutionCallback(completion_callback));
|
||||
web_frame_->requestExecuteScriptAndReturnValue(
|
||||
blink::WebScriptSource(code),
|
||||
|
|
|
@ -74,7 +74,7 @@ class WebFrame : public mate::Wrappable<WebFrame> {
|
|||
blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
|
||||
void ClearCache(v8::Isolate* isolate);
|
||||
|
||||
scoped_ptr<SpellCheckClient> spell_check_client_;
|
||||
std::unique_ptr<SpellCheckClient> spell_check_client_;
|
||||
|
||||
blink::WebLocalFrame* web_frame_;
|
||||
|
||||
|
|
|
@ -95,15 +95,11 @@ AtomRendererClient::AtomRendererClient()
|
|||
AtomRendererClient::~AtomRendererClient() {
|
||||
}
|
||||
|
||||
void AtomRendererClient::WebKitInitialized() {
|
||||
void AtomRendererClient::RenderThreadStarted() {
|
||||
blink::WebCustomElement::addEmbedderCustomElementName("webview");
|
||||
blink::WebCustomElement::addEmbedderCustomElementName("browserplugin");
|
||||
|
||||
OverrideNodeArrayBuffer();
|
||||
}
|
||||
|
||||
void AtomRendererClient::RenderThreadStarted() {
|
||||
content::RenderThread::Get()->AddObserver(this);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Set ApplicationUserModelID in renderer process.
|
||||
|
|
|
@ -9,15 +9,13 @@
|
|||
#include <vector>
|
||||
|
||||
#include "content/public/renderer/content_renderer_client.h"
|
||||
#include "content/public/renderer/render_process_observer.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
class AtomBindings;
|
||||
class NodeBindings;
|
||||
|
||||
class AtomRendererClient : public content::ContentRendererClient,
|
||||
public content::RenderProcessObserver {
|
||||
class AtomRendererClient : public content::ContentRendererClient {
|
||||
public:
|
||||
AtomRendererClient();
|
||||
virtual ~AtomRendererClient();
|
||||
|
@ -33,9 +31,6 @@ class AtomRendererClient : public content::ContentRendererClient,
|
|||
DISABLE,
|
||||
};
|
||||
|
||||
// content::RenderProcessObserver:
|
||||
void WebKitInitialized() override;
|
||||
|
||||
// content::ContentRendererClient:
|
||||
void RenderThreadStarted() override;
|
||||
void RenderFrameCreated(content::RenderFrame*) override;
|
||||
|
@ -64,8 +59,8 @@ class AtomRendererClient : public content::ContentRendererClient,
|
|||
std::string* error_html,
|
||||
base::string16* error_description) override;
|
||||
|
||||
scoped_ptr<NodeBindings> node_bindings_;
|
||||
scoped_ptr<AtomBindings> atom_bindings_;
|
||||
std::unique_ptr<NodeBindings> node_bindings_;
|
||||
std::unique_ptr<AtomBindings> atom_bindings_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomRendererClient);
|
||||
};
|
||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 477290bfa105053719a2de5f42089eb8ba261713
|
||||
Subproject commit 3f18ef50c26a6cea42845292abe076fb627f5ef1
|
Loading…
Reference in a new issue