diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index e04d6042b..2e8f0d5fa 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '167921', + 'chromium_revision': '170167', } diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 69ca13c74..b914c04b1 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -183,10 +183,10 @@ CefBrowserContext::CefBrowserContext() } CefBrowserContext::~CefBrowserContext() { - // Clear the download manager delegate here because otherwise we'll crash + // Delete the download manager delegate here because otherwise we'll crash // when it's accessed from the content::BrowserContext destructor. if (download_manager_delegate_.get()) - BrowserContext::GetDownloadManager(this)->SetDelegate(NULL); + download_manager_delegate_.reset(NULL); if (resource_context_.get()) { BrowserThread::DeleteSoon( @@ -206,7 +206,8 @@ content::DownloadManagerDelegate* CefBrowserContext::GetDownloadManagerDelegate() { DCHECK(!download_manager_delegate_.get()); - download_manager_delegate_ = new CefDownloadManagerDelegate(); + content::DownloadManager* manager = BrowserContext::GetDownloadManager(this); + download_manager_delegate_.reset(new CefDownloadManagerDelegate(manager)); return download_manager_delegate_.get(); } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index e3ff34d62..7b8316e46 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -59,7 +59,7 @@ class CefBrowserContext : public content::BrowserContext { private: scoped_ptr resource_context_; - scoped_refptr download_manager_delegate_; + scoped_ptr download_manager_delegate_; scoped_refptr url_request_getter_; scoped_refptr geolocation_permission_context_; diff --git a/libcef/browser/browser_urlrequest_impl.cc b/libcef/browser/browser_urlrequest_impl.cc index f25349d85..ac1fbf596 100644 --- a/libcef/browser/browser_urlrequest_impl.cc +++ b/libcef/browser/browser_urlrequest_impl.cc @@ -18,6 +18,7 @@ #include "base/string_util.h" #include "content/public/common/url_fetcher.h" #include "net/base/load_flags.h" +#include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 837e1715e..dc7d2e3dd 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -233,6 +233,10 @@ class CefMediaObserver : public content::MediaObserver { int render_process_id, int render_view_id, const content::MediaStreamDevices& devices) OVERRIDE {} + virtual void OnAudioCaptureDevicesChanged( + const content::MediaStreamDevices& devices) OVERRIDE {} + virtual void OnVideoCaptureDevicesChanged( + const content::MediaStreamDevices& devices) OVERRIDE {} virtual void OnMediaRequestStateChanged( int render_process_id, int render_view_id, diff --git a/libcef/browser/context.h b/libcef/browser/context.h index 657801f01..e99dc2460 100644 --- a/libcef/browser/context.h +++ b/libcef/browser/context.h @@ -15,8 +15,8 @@ #include "base/atomic_sequence_num.h" #include "base/file_path.h" +#include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/scoped_temp_dir.h" #include "base/threading/platform_thread.h" namespace base { @@ -93,7 +93,7 @@ class CefContext : public CefBase { CefSettings settings_; FilePath cache_path_; - ScopedTempDir cache_temp_dir_; + base::ScopedTempDir cache_temp_dir_; // Map of browsers that currently exist. BrowserList browserlist_; diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 280dccbe0..3aa6107a2 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -18,7 +18,6 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "content/public/browser/browser_context.h" -#include "content/public/browser/download_manager.h" #include "content/public/browser/web_contents.h" #include "content/public/common/file_chooser_params.h" #include "net/base/net_util.h" @@ -48,22 +47,19 @@ CefRefPtr GetDownloadHandler( return NULL; } -// Helper function to retrieve the DownloadManager. -scoped_refptr GetDownloadManager() { - return content::BrowserContext::GetDownloadManager( - _Context->browser_context()); -} - // CefBeforeDownloadCallback implementation. class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { public: - CefBeforeDownloadCallbackImpl(int32 download_id, - const FilePath& suggested_name, - const content::DownloadTargetCallback& callback) - : download_id_(download_id), - suggested_name_(suggested_name), - callback_(callback) { + CefBeforeDownloadCallbackImpl( + const base::WeakPtr& manager, + int32 download_id, + const FilePath& suggested_name, + const content::DownloadTargetCallback& callback) + : manager_(manager), + download_id_(download_id), + suggested_name_(suggested_name), + callback_(callback) { } virtual void Continue(const CefString& download_path, @@ -72,13 +68,12 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { if (download_id_ <= 0) return; - scoped_refptr manager = GetDownloadManager(); - if (manager) { + if (manager_) { FilePath path = FilePath(download_path); CEF_POST_TASK(CEF_FILET, base::Bind(&CefBeforeDownloadCallbackImpl::GenerateFilename, - download_id_, suggested_name_, path, show_dialog, - callback_)); + manager_, download_id_, suggested_name_, path, + show_dialog, callback_)); } download_id_ = 0; @@ -92,6 +87,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { private: static void GenerateFilename( + base::WeakPtr manager, int32 download_id, const FilePath& suggested_name, const FilePath& download_path, @@ -120,15 +116,16 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { CEF_POST_TASK(CEF_UIT, base::Bind(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, - download_id, suggested_path, show_dialog, callback)); + manager, download_id, suggested_path, show_dialog, + callback)); } static void ChooseDownloadPath( + base::WeakPtr manager, int32 download_id, const FilePath& suggested_path, bool show_dialog, const content::DownloadTargetCallback& callback) { - scoped_refptr manager = GetDownloadManager(); if (!manager) return; @@ -186,6 +183,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { path); } + base::WeakPtr manager_; int32 download_id_; FilePath suggested_name_; content::DownloadTargetCallback callback_; @@ -198,8 +196,11 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { // CefDownloadItemCallback implementation. class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { public: - explicit CefDownloadItemCallbackImpl(int32 download_id) - : download_id_(download_id) { + explicit CefDownloadItemCallbackImpl( + const base::WeakPtr& manager, + int32 download_id) + : manager_(manager), + download_id_(download_id) { } virtual void Cancel() OVERRIDE { @@ -212,9 +213,8 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { if (download_id_ <= 0) return; - scoped_refptr manager = GetDownloadManager(); - if (manager) { - DownloadItem* item = manager->GetDownload(download_id_); + if (manager_) { + DownloadItem* item = manager_->GetDownload(download_id_); if (item && item->IsInProgress()) item->Cancel(true); } @@ -222,6 +222,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { download_id_ = 0; } + base::WeakPtr manager_; int32 download_id_; IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl); @@ -231,20 +232,78 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { } // namespace -CefDownloadManagerDelegate::CefDownloadManagerDelegate() { - // Balanced in Shutdown(); - AddRef(); +CefDownloadManagerDelegate::CefDownloadManagerDelegate( + DownloadManager* manager) + : manager_(manager), + manager_ptr_factory_(manager) { + DCHECK(manager); + manager->AddObserver(this); + + DownloadManager::DownloadVector items; + manager->GetAllDownloads(&items); + DownloadManager::DownloadVector::const_iterator it = items.begin(); + for (; it != items.end(); ++it) { + (*it)->AddObserver(this); + observing_.insert(*it); + } } CefDownloadManagerDelegate::~CefDownloadManagerDelegate() { + if (manager_) { + manager_->SetDelegate(NULL); + manager_->RemoveObserver(this); + } + + std::set::const_iterator it = observing_.begin(); + for (; it != observing_.end(); ++it) + (*it)->RemoveObserver(this); + observing_.clear(); } -void CefDownloadManagerDelegate::Shutdown() { - Release(); +void CefDownloadManagerDelegate::OnDownloadUpdated( + DownloadItem* download) { + CefRefPtr browser = GetBrowser(download); + CefRefPtr handler; + if (browser.get()) + handler = GetDownloadHandler(browser); + + if (handler.get()) { + CefRefPtr download_item( + new CefDownloadItemImpl(download)); + CefRefPtr callback( + new CefDownloadItemCallbackImpl(manager_ptr_factory_.GetWeakPtr(), + download->GetId())); + + handler->OnDownloadUpdated(browser.get(), download_item.get(), callback); + + download_item->Detach(NULL); + } +} + +void CefDownloadManagerDelegate::OnDownloadDestroyed( + DownloadItem* download) { + download->RemoveObserver(this); + observing_.erase(download); +} + +void CefDownloadManagerDelegate::OnDownloadCreated( + DownloadManager* manager, + DownloadItem* item) { + item->AddObserver(this); + observing_.insert(item); +} + +void CefDownloadManagerDelegate::ManagerGoingDown( + DownloadManager* manager) { + DCHECK_EQ(manager, manager_); + manager->SetDelegate(NULL); + manager->RemoveObserver(this); + manager_ptr_factory_.InvalidateWeakPtrs(); + manager_ = NULL; } bool CefDownloadManagerDelegate::DetermineDownloadTarget( - content::DownloadItem* item, + DownloadItem* item, const content::DownloadTargetCallback& callback) { if (!item->GetForcedFilePath().empty()) { callback.Run(item->GetForcedFilePath(), @@ -270,7 +329,8 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( CefRefPtr download_item(new CefDownloadItemImpl(item)); CefRefPtr callbackObj( - new CefBeforeDownloadCallbackImpl(item->GetId(), suggested_name, + new CefBeforeDownloadCallbackImpl(manager_ptr_factory_.GetWeakPtr(), + item->GetId(), suggested_name, callback)); handler->OnBeforeDownload(browser.get(), download_item.get(), @@ -281,28 +341,3 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( return true; } - -void CefDownloadManagerDelegate::AddItemToPersistentStore( - DownloadItem* item) { - static int next_id; - scoped_refptr manager = GetDownloadManager(); - manager->OnItemAddedToPersistentStore(item->GetId(), ++next_id); -} - -void CefDownloadManagerDelegate::UpdateItemInPersistentStore( - DownloadItem* item) { - CefRefPtr browser = GetBrowser(item); - CefRefPtr handler; - if (browser.get()) - handler = GetDownloadHandler(browser); - - if (handler.get()) { - CefRefPtr download_item(new CefDownloadItemImpl(item)); - CefRefPtr callback( - new CefDownloadItemCallbackImpl(item->GetId())); - - handler->OnDownloadUpdated(browser.get(), download_item.get(), callback); - - download_item->Detach(NULL); - } -} diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 8827fdb86..272dc4f64 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -6,35 +6,40 @@ #define CEF_LIBCEF_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ #pragma once +#include + #include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" +#include "content/public/browser/download_item.h" +#include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager_delegate.h" -struct DownloadStateInfo; - -namespace content { -class DownloadManager; -} - class CefDownloadManagerDelegate - : public content::DownloadManagerDelegate, - public base::RefCountedThreadSafe { + : public content::DownloadItem::Observer, + public content::DownloadManager::Observer, + public content::DownloadManagerDelegate { public: - CefDownloadManagerDelegate(); + explicit CefDownloadManagerDelegate(content::DownloadManager* manager); + ~CefDownloadManagerDelegate(); + + private: + // DownloadItem::Observer methods. + virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; + virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; + + // DownloadManager::Observer methods. + virtual void OnDownloadCreated(content::DownloadManager* manager, + content::DownloadItem* item) OVERRIDE; + virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; // DownloadManagerDelegate methods. - virtual void Shutdown() OVERRIDE; virtual bool DetermineDownloadTarget( content::DownloadItem* item, const content::DownloadTargetCallback& callback) OVERRIDE; - virtual void AddItemToPersistentStore(content::DownloadItem* item) OVERRIDE; - virtual void UpdateItemInPersistentStore( - content::DownloadItem* item) OVERRIDE; - private: - friend class base::RefCountedThreadSafe; - - virtual ~CefDownloadManagerDelegate(); + content::DownloadManager* manager_; + base::WeakPtrFactory manager_ptr_factory_; + std::set observing_; DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate); }; diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index fe37a39ac..6bc889795 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -151,6 +151,10 @@ class CefSimpleMenuModel : public ui::MenuModel { menu_model_delegate_ = menu_model_delegate; } + virtual ui::MenuModelDelegate* GetMenuModelDelegate() const OVERRIDE { + return menu_model_delegate_; + } + private: CefMenuModelImpl* impl_; ui::MenuModelDelegate* menu_model_delegate_; diff --git a/libcef/browser/url_request_interceptor.cc b/libcef/browser/url_request_interceptor.cc index 8d61f6715..becb553bf 100644 --- a/libcef/browser/url_request_interceptor.cc +++ b/libcef/browser/url_request_interceptor.cc @@ -73,9 +73,11 @@ net::URLRequestJob* CefRequestInterceptor::MaybeInterceptRedirect( newUrlStr); if (newUrlStr != location.spec()) { GURL new_url = GURL(std::string(newUrlStr)); - if (!new_url.is_empty() && new_url.is_valid()) - return new net::URLRequestRedirectJob(request, network_delegate, - new_url); + if (!new_url.is_empty() && new_url.is_valid()) { + return new net::URLRequestRedirectJob( + request, network_delegate, new_url, + net::URLRequestRedirectJob::REDIRECT_302_FOUND); + } } } } diff --git a/libcef/browser/web_contents_view_osr.cc b/libcef/browser/web_contents_view_osr.cc index 2b2db89d1..56dfa0640 100644 --- a/libcef/browser/web_contents_view_osr.cc +++ b/libcef/browser/web_contents_view_osr.cc @@ -33,6 +33,10 @@ content::RenderWidgetHostView* CefWebContentsViewOSR::CreateViewForWidget( return view_; } +void CefWebContentsViewOSR::SetView(content::RenderWidgetHostView* view) { + view_ = view; +} + gfx::NativeView CefWebContentsViewOSR::GetNativeView() const { return gfx::NativeView(); } diff --git a/libcef/browser/web_contents_view_osr.h b/libcef/browser/web_contents_view_osr.h index c17d969e6..f0996f7ea 100644 --- a/libcef/browser/web_contents_view_osr.h +++ b/libcef/browser/web_contents_view_osr.h @@ -12,12 +12,11 @@ #include "content/public/browser/web_contents_view.h" namespace content { - class WebContents; - class WebContentsViewDelegate; +class WebContents; +class WebContentsViewDelegate; } class CefBrowserHostImpl; -class CefRenderWidgetHostViewOSR; // An implementation of WebContentsView for off-screen rendering. class CefWebContentsViewOSR : public content::WebContentsView, @@ -31,6 +30,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, virtual void CreateView(const gfx::Size& initial_size) OVERRIDE; virtual content::RenderWidgetHostView* CreateViewForWidget( content::RenderWidgetHost* render_widget_host) OVERRIDE; + virtual void SetView(content::RenderWidgetHostView* view) OVERRIDE; virtual gfx::NativeView GetNativeView() const OVERRIDE; virtual gfx::NativeView GetContentNativeView() const OVERRIDE; virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE; @@ -65,7 +65,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, private: content::WebContents* web_contents_; - CefRenderWidgetHostViewOSR* view_; + content::RenderWidgetHostView* view_; DISALLOW_COPY_AND_ASSIGN(CefWebContentsViewOSR); }; diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 7f240316d..b7cc365c1 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -9,6 +9,12 @@ #include "libcef/common/request_impl.h" #include "base/logging.h" +#include "net/base/upload_data.h" +#include "net/base/upload_data_stream.h" +#include "net/base/upload_element_reader.h" +#include "net/base/upload_bytes_element_reader.h" +#include "net/base/upload_file_element_reader.h" +#include "net/http/http_request_headers.h" #include "net/url_request/url_request.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPHeaderVisitor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" @@ -155,7 +161,7 @@ void CefRequestImpl::Set(net::URLRequest* request) { GetHeaderMap(headers, headermap_); // Transfer post data, if any - const net::UploadData* data = request->get_upload(); + const net::UploadDataStream* data = request->get_upload(); if (data) { postdata_ = CefPostData::Create(); static_cast(postdata_.get())->Set(*data); @@ -416,6 +422,22 @@ void CefPostDataImpl::Set(const net::UploadData& data) { } } +void CefPostDataImpl::Set(const net::UploadDataStream& data_stream) { + AutoLock lock_scope(this); + CHECK_READONLY_RETURN_VOID(); + + CefRefPtr postelem; + + const ScopedVector& elements = + data_stream.element_readers(); + ScopedVector::const_iterator it = elements.begin(); + for (; it != elements.end(); ++it) { + postelem = CefPostDataElement::Create(); + static_cast(postelem.get())->Set(**it); + AddElement(postelem); + } +} + void CefPostDataImpl::Get(net::UploadData& data) { AutoLock lock_scope(this); @@ -587,6 +609,28 @@ void CefPostDataElementImpl::Set(const net::UploadElement& element) { } } +void CefPostDataElementImpl::Set( + const net::UploadElementReader& element_reader) { + AutoLock lock_scope(this); + CHECK_READONLY_RETURN_VOID(); + + const net::UploadBytesElementReader* bytes_reader = + element_reader.AsBytesReader(); + if (bytes_reader) { + SetToBytes(bytes_reader->length(), bytes_reader->bytes()); + return; + } + + const net::UploadFileElementReader* file_reader = + element_reader.AsFileReader(); + if (file_reader) { + SetToFile(file_reader->path().value()); + return; + } + + NOTREACHED(); +} + void CefPostDataElementImpl::Get(net::UploadElement& element) { AutoLock lock_scope(this); diff --git a/libcef/common/request_impl.h b/libcef/common/request_impl.h index f4b150804..309c208f7 100644 --- a/libcef/common/request_impl.h +++ b/libcef/common/request_impl.h @@ -7,11 +7,14 @@ #pragma once #include "include/cef_request.h" -#include "net/base/upload_data.h" -#include "net/http/http_request_headers.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.h" namespace net { +class HttpRequestHeaders; +class UploadData; +class UploadDataStream; +class UploadElement; +class UploadElementReader; class URLRequest; }; @@ -95,6 +98,7 @@ class CefPostDataImpl : public CefPostData { virtual void RemoveElements(); void Set(const net::UploadData& data); + void Set(const net::UploadDataStream& data_stream); void Get(net::UploadData& data); void Set(const WebKit::WebHTTPBody& data); void Get(WebKit::WebHTTPBody& data); @@ -129,6 +133,7 @@ class CefPostDataElementImpl : public CefPostDataElement { void* GetBytes() { return data_.bytes.bytes; } void Set(const net::UploadElement& element); + void Set(const net::UploadElementReader& element_reader); void Get(net::UploadElement& element); void Set(const WebKit::WebHTTPBody::Element& element); void Get(WebKit::WebHTTPBody::Element& element); diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 713e643cb..0e4daa952 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -88,8 +88,10 @@ class CefV8TrackManager { v8::Handle object = context->Global(); v8::Handle value = object->GetHiddenValue(context_state_key_); - if (!value.IsEmpty()) - return static_cast(v8::External::Unwrap(value)); + if (!value.IsEmpty()) { + return static_cast( + v8::External::Cast(*value)->Value()); + } scoped_refptr state = new CefV8ContextState(); object->SetHiddenValue(context_state_key_, @@ -123,7 +125,7 @@ class CefV8TrackManager { return; scoped_refptr state = - static_cast(v8::External::Unwrap(value)); + static_cast(v8::External::Cast(*value)->Value()); state->Detach(); object->DeleteHiddenValue(context_state_key_); @@ -220,7 +222,7 @@ class V8TrackObject : public CefTrackNode { // Attach this track object to the specified V8 object. void AttachTo(v8::Handle object) { object->SetHiddenValue(v8::String::New(kCefTrackObject), - v8::External::Wrap(this)); + v8::External::New(this)); } // Retrieve the track object for the specified V8 object. @@ -228,7 +230,7 @@ class V8TrackObject : public CefTrackNode { v8::Local value = object->GetHiddenValue(v8::String::New(kCefTrackObject)); if (!value.IsEmpty()) - return static_cast(v8::External::Unwrap(value)); + return static_cast(v8::External::Cast(*value)->Value()); return NULL; } @@ -383,7 +385,7 @@ v8::Handle FunctionCallbackImpl(const v8::Arguments& args) { WebCore::toScriptExecutionContext(v8::Context::GetCurrent())); CefV8Handler* handler = - static_cast(v8::External::Unwrap(args.Data())); + static_cast(v8::External::Cast(*args.Data())->Value()); CefV8ValueList params; for (int i = 0; i < args.Length(); i++) @@ -494,7 +496,7 @@ class ExtensionWrapper : public v8::Extension { return v8::Handle(); return v8::FunctionTemplate::New(FunctionCallbackImpl, - v8::External::Wrap(handler_)); + v8::External::New(handler_)); } private: @@ -952,7 +954,7 @@ CefRefPtr CefV8Value::CreateFunction( // Create a new V8 function template. v8::Local tmpl = v8::FunctionTemplate::New(); - v8::Local data = v8::External::Wrap(handler.get()); + v8::Local data = v8::External::New(handler.get()); // Set the function handler callback. tmpl->SetCallHandler(FunctionCallbackImpl, data); diff --git a/tests/unittests/cookie_unittest.cc b/tests/unittests/cookie_unittest.cc index 9b2ca26f5..62a2b4ff0 100644 --- a/tests/unittests/cookie_unittest.cc +++ b/tests/unittests/cookie_unittest.cc @@ -8,7 +8,7 @@ #include "include/cef_scheme.h" #include "tests/unittests/test_handler.h" #include "tests/unittests/test_suite.h" -#include "base/scoped_temp_dir.h" +#include "base/files/scoped_temp_dir.h" #include "base/synchronization/waitable_event.h" #include "testing/gtest/include/gtest/gtest.h" @@ -379,7 +379,7 @@ void TestChangeDirectory(CefRefPtr manager, base::WaitableEvent event(false, false); CefCookie cookie; - ScopedTempDir temp_dir; + base::ScopedTempDir temp_dir; // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -448,7 +448,7 @@ TEST(CookieTest, DomainCookieInMemory) { // Test creation of a domain cookie. TEST(CookieTest, DomainCookieOnDisk) { - ScopedTempDir temp_dir; + base::ScopedTempDir temp_dir; // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -479,7 +479,7 @@ TEST(CookieTest, HostCookieInMemory) { // Test creation of a host cookie. TEST(CookieTest, HostCookieOnDisk) { - ScopedTempDir temp_dir; + base::ScopedTempDir temp_dir; // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -510,7 +510,7 @@ TEST(CookieTest, MultipleCookiesInMemory) { // Test creation of multiple cookies. TEST(CookieTest, MultipleCookiesOnDisk) { - ScopedTempDir temp_dir; + base::ScopedTempDir temp_dir; // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -538,7 +538,7 @@ TEST(CookieTest, AllCookiesInMemory) { } TEST(CookieTest, AllCookiesOnDisk) { - ScopedTempDir temp_dir; + base::ScopedTempDir temp_dir; // Create a new temporary directory. EXPECT_TRUE(temp_dir.CreateUniqueTempDir());