Update to API changes of Chrome 51
authorCheng Zhao <zcbenz@gmail.com>
Mon, 23 May 2016 01:59:39 +0000 (10:59 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 23 May 2016 01:59:39 +0000 (10:59 +0900)
87 files changed:
atom/app/atom_main_delegate.cc
atom/app/atom_main_delegate.h
atom/browser/api/atom_api_app.cc
atom/browser/api/atom_api_app.h
atom/browser/api/atom_api_cookies.cc
atom/browser/api/atom_api_debugger.cc
atom/browser/api/atom_api_desktop_capturer.cc
atom/browser/api/atom_api_desktop_capturer.h
atom/browser/api/atom_api_menu.h
atom/browser/api/atom_api_power_save_blocker.cc
atom/browser/api/atom_api_power_save_blocker.h
atom/browser/api/atom_api_protocol.h
atom/browser/api/atom_api_session.cc
atom/browser/api/atom_api_system_preferences_mac.mm
atom/browser/api/atom_api_tray.h
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h
atom/browser/api/atom_api_window.h
atom/browser/api/trackable_object.h
atom/browser/atom_browser_client.cc
atom/browser/atom_browser_client.h
atom/browser/atom_browser_context.cc
atom/browser/atom_browser_context.h
atom/browser/atom_browser_main_parts.h
atom/browser/atom_javascript_dialog_manager.cc
atom/browser/atom_javascript_dialog_manager.h
atom/browser/atom_permission_manager.cc
atom/browser/atom_permission_manager.h
atom/browser/atom_security_state_model_client.h
atom/browser/browser_win.cc
atom/browser/common_web_contents_delegate.cc
atom/browser/common_web_contents_delegate.h
atom/browser/mac/atom_application_delegate.mm
atom/browser/mac/dict_util.h
atom/browser/mac/dict_util.mm
atom/browser/native_window.cc
atom/browser/native_window.h
atom/browser/native_window_mac.mm
atom/browser/native_window_views.h
atom/browser/net/asar/url_request_asar_job.h
atom/browser/net/atom_cert_verifier.cc
atom/browser/net/atom_cert_verifier.h
atom/browser/net/atom_network_delegate.cc
atom/browser/net/atom_network_delegate.h
atom/browser/net/atom_url_request_job_factory.cc
atom/browser/net/atom_url_request_job_factory.h
atom/browser/net/js_asker.cc
atom/browser/net/js_asker.h
atom/browser/net/url_request_async_asar_job.cc
atom/browser/net/url_request_async_asar_job.h
atom/browser/net/url_request_buffer_job.cc
atom/browser/net/url_request_buffer_job.h
atom/browser/net/url_request_fetch_job.cc
atom/browser/net/url_request_fetch_job.h
atom/browser/net/url_request_string_job.cc
atom/browser/net/url_request_string_job.h
atom/browser/node_debugger.cc
atom/browser/node_debugger.h
atom/browser/ui/accelerator_util_mac.mm
atom/browser/ui/file_dialog_gtk.cc
atom/browser/ui/file_dialog_win.cc
atom/browser/ui/message_box_win.cc
atom/browser/ui/tray_icon_gtk.h
atom/browser/ui/views/menu_delegate.h
atom/browser/ui/x/x_window_utils.cc
atom/browser/web_view_guest_delegate.h
atom/common/api/atom_api_asar.cc
atom/common/api/atom_api_native_image.cc
atom/common/api/event_emitter_caller.cc
atom/common/api/locker.h
atom/common/asar/archive.cc
atom/common/asar/archive.h
atom/common/crash_reporter/crash_reporter_linux.h
atom/common/crash_reporter/crash_reporter_mac.h
atom/common/crash_reporter/crash_reporter_win.h
atom/common/native_mate_converters/callback.h
atom/common/native_mate_converters/content_converter.cc
atom/common/native_mate_converters/content_converter.h
atom/common/native_mate_converters/net_converter.cc
atom/common/native_mate_converters/v8_value_converter.cc
atom/common/native_mate_converters/value_converter.cc
atom/common/node_bindings.cc
atom/renderer/api/atom_api_web_frame.cc
atom/renderer/api/atom_api_web_frame.h
atom/renderer/atom_renderer_client.cc
atom/renderer/atom_renderer_client.h
vendor/brightray

index 655ccce..82337dc 100644 (file)
@@ -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
index 8f2976a..2f9474c 100644 (file)
@@ -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);
 };
index d74dd67..b4c0fb6 100644 (file)
@@ -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()));
index edfd09c..1c6406c 100644 (file)
@@ -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);
index 22c57c9..6ee15a6 100644 (file)
@@ -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,
index 0349036..48b7a6f 100644 (file)
@@ -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;
 
index 9200a89..3cb29a9 100644 (file)
@@ -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)));
index e71141f..4d1755e 100644 (file)
@@ -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);
 };
index 5701985..9ba4d7a 100644 (file)
@@ -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:
index b8adcb7..67c9b6d 100644 (file)
@@ -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,
index c24ae0a..a20b493 100644 (file)
@@ -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_;
index 19fca9a..d33e63f 100644 (file)
@@ -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
index 58fd358..2e6ff44 100644 (file)
@@ -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(
index 1bc65a1..f0b48ad 100644 (file)
@@ -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(
index 3c3d02e..a6c3295 100644 (file)
@@ -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);
 };
index eac378b..2298a7b 100644 (file)
@@ -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));
   }
index 81d97df..f3661be 100644 (file)
@@ -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_;
index f174cdb..e698eaa 100644 (file)
@@ -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);
 };
index 2786261..a5ed593 100644 (file)
@@ -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
 
index 8ecd37a..5fab9c6 100644 (file)
@@ -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));
index ef5fd5a..5588f04 100644 (file)
@@ -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_;
index 04d5134..63da86f 100644 (file)
@@ -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_);
 }
 
index d959adb..b208ca9 100644 (file)
@@ -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_;
index e1053a2..0d8619f 100644 (file)
@@ -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_;
 
index c21d1fb..e129982 100644 (file)
@@ -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
index c0a0dcc..3844e41 100644 (file)
@@ -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(
index a102a1c..7fc5fa0 100644 (file)
@@ -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(
index 7361e6b..d0fcdc6 100644 (file)
@@ -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:
index cc943eb..0dd3aa6 100644 (file)
@@ -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);
 };
index 7b1402b..345e2bc 100644 (file)
@@ -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());
   }
index ea2bf86..c275d4a 100644 (file)
@@ -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());
index 095dad3..1746d63 100644 (file)
@@ -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;
index 7fa3b30..84caae9 100644 (file)
@@ -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;
index e5b2936..404636d 100644 (file)
@@ -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
index 1fb8401..43b629c 100644 (file)
@@ -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));
index 31567c1..651d9eb 100644 (file)
@@ -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(),
index 7bc432d..a9b5ffc 100644 (file)
@@ -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_;
index 333b282..10dd177 100644 (file)
@@ -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()) {
index 8a5d8ae..85c7ddb 100644 (file)
@@ -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_;
index 7103abc..56c5198 100644 (file)
@@ -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_;
 
index 3633d80..adfba70 100644 (file)
@@ -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);
 
index 796ae28..e00ba26 100644 (file)
@@ -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);
 };
index 39e0f73..fd0c52b 100644 (file)
@@ -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>,
index 701a953..62653df 100644 (file)
@@ -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);
index dbd8b41..3bf332d 100644 (file)
@@ -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];
index dde3622..ba7a479 100644 (file)
@@ -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;
index b11a69c..8362c1a 100644 (file)
@@ -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)));
index 8a70794..6301f4d 100644 (file)
@@ -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));
index 3578f3b..1234bcc 100644 (file)
@@ -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(
index d65142f..032f3d9 100644 (file)
@@ -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;
index aa273bf..c0c8e15 100644 (file)
@@ -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 =
index ab8de7e..356ca93 100644 (file)
@@ -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;
index 2f90731..b6aadc8 100644 (file)
@@ -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));
index 69067fd..65d73f2 100644 (file)
@@ -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);
 };
index 6067811..59945e6 100644 (file)
@@ -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());
index e40f0d9..474473c 100644 (file)
@@ -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;
index 50aa454..55025dd 100644 (file)
@@ -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);
index aedf7b2..f708de6 100644 (file)
@@ -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_;
index d339588..e244883 100644 (file)
@@ -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));
 }
index 2c8b785..1ad7ff5 100644 (file)
@@ -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,
index af699a1..5314b63 100644 (file)
@@ -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())
index 2c4ce54..b966ef9 100644 (file)
@@ -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()) {
index 2be3259..cfeb8ab 100644 (file)
@@ -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);
 };
index 211ddb5..ad7093b 100644 (file)
@@ -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);
 };
index db83753..48e8bc9 100644 (file)
@@ -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();
index 3dae1a1..d65eb14 100644 (file)
@@ -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,
index 1b0ea79..97c2e47 100644 (file)
@@ -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);
 };
index d5a75e3..c0b51ba 100644 (file)
@@ -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
index 4b44553..2b0de7a 100644 (file)
@@ -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
index 201217f..e64ef18 100644 (file)
@@ -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);
 };
index 4f04812..c2306c3 100644 (file)
@@ -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;
index 79b8486..5438776 100644 (file)
@@ -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);
index 165c288..b74103c 100644 (file)
@@ -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_;
index f031543..5556263 100644 (file)
@@ -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);
 };
index 181c9ea..0ab8f4b 100644 (file)
@@ -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);
 };
index 6ef8e74..43a1baf 100644 (file)
@@ -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);
index b672f94..8240658 100644 (file)
@@ -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;
 }
index f2e7211..522961a 100644 (file)
@@ -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<>
index 5223709..772ae6e 100644 (file)
@@ -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));
index 99873cd..13df524 100644 (file)
@@ -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.
index c9c1a86..c3c7ae0 100644 (file)
@@ -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());
 }
 
index b3c36fd..561f008 100644 (file)
@@ -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.
index d32b5f1..0b291d3 100644 (file)
@@ -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),
index 2e120ec..df0392a 100644 (file)
@@ -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_;
 
index aa93f63..5613f20 100644 (file)
@@ -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.
index 11d6028..16b975f 100644 (file)
@@ -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);
 };
index 477290b..3f18ef5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 477290bfa105053719a2de5f42089eb8ba261713
+Subproject commit 3f18ef50c26a6cea42845292abe076fb627f5ef1