Various fixes related to the C++11/14 update (see issue #3140)

- Convert scoped_ptr to std::unique_ptr from <memory>
- Convert arraysize to base::size from include/base/cef_cxx17_backports.h
- Convert NULL to nullptr
- Include include/base/cef_callback.h instead of include/base/cef_bind.h
- Implicit conversion of CefRefPtr<T> or scoped_refptr<T> to T* is gone;
  use .get() instead

See the issue for additional details.
This commit is contained in:
Marshall Greenblatt
2021-06-17 16:08:01 -04:00
parent 5d438ced79
commit 17fc2b3e3b
141 changed files with 580 additions and 627 deletions

View File

@ -136,7 +136,6 @@
'libcef_dll/cpptoc/cpptoc_scoped.h',
'libcef_dll/ctocpp/ctocpp_ref_counted.h',
'libcef_dll/ctocpp/ctocpp_scoped.h',
'libcef_dll/ptr_util.h',
'libcef_dll/shutdown_checker.cc',
'libcef_dll/shutdown_checker.h',
'libcef_dll/transfer_util.cc',

View File

@ -38,11 +38,11 @@
#pragma once
#include <list>
#include <memory>
#include "include/base/cef_callback.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_ref_counted.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/base/cef_weak_ptr.h"
#include "include/cef_request_handler.h"
#include "include/wrapper/cef_closure_task.h"
@ -160,18 +160,18 @@ class CefResourceManager
// The below methods are called on the browser process IO thread.
explicit Request(scoped_ptr<RequestState> state);
explicit Request(std::unique_ptr<RequestState> state);
scoped_ptr<RequestState> SendRequest();
std::unique_ptr<RequestState> SendRequest();
bool HasState();
static void ContinueOnIOThread(scoped_ptr<RequestState> state,
static void ContinueOnIOThread(std::unique_ptr<RequestState> state,
CefRefPtr<CefResourceHandler> handler);
static void StopOnIOThread(scoped_ptr<RequestState> state);
static void StopOnIOThread(std::unique_ptr<RequestState> state);
// Will be non-NULL while the request is pending. Only accessed on the
// browser process IO thread.
scoped_ptr<RequestState> state_;
std::unique_ptr<RequestState> state_;
// Params that stay with this request object. Safe to access on any thread.
RequestParams params_;
@ -342,10 +342,10 @@ class CefResourceManager
// Methods that manage request state between requests. Called on the browser
// process IO thread.
bool SendRequest(scoped_ptr<RequestState> state);
void ContinueRequest(scoped_ptr<RequestState> state,
bool SendRequest(std::unique_ptr<RequestState> state);
void ContinueRequest(std::unique_ptr<RequestState> state,
CefRefPtr<CefResourceHandler> handler);
void StopRequest(scoped_ptr<RequestState> state);
void StopRequest(std::unique_ptr<RequestState> state);
bool IncrementProvider(RequestState* state);
void DetachRequestFromProvider(RequestState* state);
void GetNextValidProvider(ProviderEntryList::iterator& iterator);
@ -364,7 +364,7 @@ class CefResourceManager
MimeTypeResolver mime_type_resolver_;
// Must be the last member. Created and accessed on the IO thread.
scoped_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_;
std::unique_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefResourceManager);
};

View File

@ -356,7 +356,7 @@ class CefBrowserPlatformDelegate {
virtual void StopFinding(bool clearSelection);
protected:
// Allow deletion via scoped_ptr only.
// Allow deletion via std::unique_ptr only.
friend std::default_delete<CefBrowserPlatformDelegate>;
CefBrowserPlatformDelegate();

View File

@ -39,7 +39,7 @@ class CefFileDialogRunner {
RunFileChooserCallback callback) = 0;
protected:
// Allow deletion via scoped_ptr only.
// Allow deletion via std::unique_ptr only.
friend std::default_delete<CefFileDialogRunner>;
CefFileDialogRunner() {}

View File

@ -30,7 +30,7 @@ class CefJavaScriptDialogRunner {
virtual void Cancel() = 0;
protected:
// Allow deletion via scoped_ptr only.
// Allow deletion via std::unique_ptr only.
friend std::default_delete<CefJavaScriptDialogRunner>;
CefJavaScriptDialogRunner() {}

View File

@ -27,7 +27,7 @@ class CefMenuRunner {
virtual bool FormatLabel(std::u16string& label) { return false; }
protected:
// Allow deletion via scoped_ptr only.
// Allow deletion via std::unique_ptr only.
friend std::default_delete<CefMenuRunner>;
CefMenuRunner() {}

View File

@ -1615,7 +1615,7 @@ void CefRenderWidgetHostViewOSR::CancelWidget() {
if (render_widget_host_ && !is_destroyed_) {
is_destroyed_ = true;
// Don't delete the RWHI manually while owned by a scoped_ptr in RVHI.
// Don't delete the RWHI manually while owned by a std::unique_ptr in RVHI.
// This matches a CHECK() in RenderWidgetHostImpl::Destroy().
const bool also_delete = !render_widget_host_->owner_delegate();

View File

@ -10,7 +10,6 @@
#include "include/base/cef_macros.h"
#include "include/capi/cef_base_capi.h"
#include "include/cef_base.h"
#include "libcef_dll/ptr_util.h"
#include "libcef_dll/wrapper_types.h"
// Wrap a C++ class with a C structure. This is used when the class

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a102f383e3ecac5237310b2e5aa5b2fd37474188$
// $hash=982f16fd8ec5c6a195f24f6aaeac41b2e1373f68$
//
#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h"
@ -1152,7 +1152,7 @@ translator_test_get_own_ptr_library(struct _cef_translator_test_t* self,
CefTranslatorTestCppToC::Get(self)->GetOwnPtrLibrary(val);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_own_ptr_library(
@ -1200,7 +1200,7 @@ translator_test_set_own_ptr_library_and_return(
CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_child_own_ptr_library(
@ -1248,7 +1248,7 @@ translator_test_set_child_own_ptr_library_and_return_parent(
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_own_ptr_client(
@ -1272,7 +1272,7 @@ int CEF_CALLBACK translator_test_set_own_ptr_client(
// Execute
int _retval =
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(OWN_PASS(valPtr));
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(std::move(valPtr));
// Return type: simple
return _retval;
@ -1301,10 +1301,10 @@ translator_test_set_own_ptr_client_and_return(
// Execute
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClientAndReturn(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_child_own_ptr_client(
@ -1328,7 +1328,7 @@ int CEF_CALLBACK translator_test_set_child_own_ptr_client(
// Execute
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClient(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: simple
return _retval;
@ -1357,10 +1357,10 @@ translator_test_set_child_own_ptr_client_and_return_parent(
// Execute
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClientAndReturnParent(
OWN_PASS(valPtr));
std::move(valPtr));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(std::move(_retval));
}
int CEF_CALLBACK translator_test_set_raw_ptr_library(

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=7fbfdb7d8fd3b7e41ba55f2138e9752f301a2438$
// $hash=fe3ba17a673de7d4051eb0ed4c83eb7d40f6d4b6$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
@ -54,10 +54,8 @@ CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_client_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedClientChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s)),
CefTranslatorTestScopedClient);
return CefTranslatorTestScopedClientChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedClient>();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=2f64a37b4735c7d91035aec2fffa263d7d27942b$
// $hash=1fa64c4f005a9ce3af83148fa5eeccaf45706200$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
@ -29,7 +29,7 @@ cef_translator_test_scoped_library_child_child_create(int value,
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryChildChildCppToC::WrapOwn(
OWN_PASS(_retval));
std::move(_retval));
}
namespace {

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=cd7a42714195bed68aef8a200c7e1a38681558f2$
// $hash=a5c43bc178aa01efbf560be47b1429fd4540d27f$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
@ -26,7 +26,7 @@ cef_translator_test_scoped_library_child_create(int value, int other_value) {
CefTranslatorTestScopedLibraryChild::Create(value, other_value);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(std::move(_retval));
}
namespace {
@ -122,11 +122,8 @@ CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_library_child_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
s)),
CefTranslatorTestScopedLibraryChild);
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedLibraryChild>();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9e0c499cc30e7e762de3d5969ab6795ec50ffc08$
// $hash=4f28d789be1549022af70417a8d2f711d688f3b7$
//
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
@ -27,7 +27,7 @@ cef_translator_test_scoped_library_create(int value) {
CefTranslatorTestScopedLibrary::Create(value);
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
}
namespace {
@ -83,17 +83,12 @@ CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
UnwrapDerivedOwn(CefWrapperType type,
cef_translator_test_scoped_library_t* s) {
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s)),
CefTranslatorTestScopedLibrary);
return CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
}
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
return OWN_RETURN_AS(
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
s)),
CefTranslatorTestScopedLibrary);
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
}
NOTREACHED() << "Unexpected class type: " << type;
return CefOwnPtr<CefTranslatorTestScopedLibrary>();

View File

@ -10,7 +10,6 @@
#include "include/base/cef_macros.h"
#include "include/capi/cef_base_capi.h"
#include "include/cef_base.h"
#include "libcef_dll/ptr_util.h"
#include "libcef_dll/wrapper_types.h"
// Wrap a C structure with a C++ class. This is used when the implementation
@ -49,7 +48,7 @@ class CefCToCppScoped : public BaseName {
//
// void MyMethod(CefOwnPtr<MyType> obj) {
// // Ownership of the underlying MyType object is passed to my_method().
// my_method(MyTypeCToCpp::UnwrapOwn(obj.Pass()));
// my_method(MyTypeCToCpp::UnwrapOwn(std::move(obj)));
// // |obj| is now NULL.
// }
static StructName* UnwrapOwn(CefOwnPtr<BaseName> c);
@ -129,7 +128,7 @@ StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapOwn(
// If the type does not match this object then we need to unwrap as the
// derived type.
if (wrapperStruct->type_ != kWrapperType)
return UnwrapDerivedOwn(wrapperStruct->type_, OWN_PASS(c));
return UnwrapDerivedOwn(wrapperStruct->type_, std::move(c));
StructName* orig_struct = wrapperStruct->struct_;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=ff27c226ced0b2651b858eadea688d164dfa777e$
// $hash=210590ae794f6690729538f2e6ca59d264cb1dc9$
//
#include "libcef_dll/ctocpp/test/translator_test_ctocpp.h"
@ -1161,7 +1161,7 @@ int CefTranslatorTestCToCpp::SetOwnPtrLibrary(
// Execute
int _retval = _struct->set_own_ptr_library(
_struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val)));
_struct, CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(std::move(val)));
// Return type: simple
return _retval;
@ -1187,7 +1187,7 @@ CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::
cef_translator_test_scoped_library_t* _retval =
_struct->set_own_ptr_library_and_return(
_struct,
CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val)));
CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(std::move(val)));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
@ -1212,7 +1212,7 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary(
// Execute
int _retval = _struct->set_child_own_ptr_library(
_struct,
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val)));
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(std::move(val)));
// Return type: simple
return _retval;
@ -1239,7 +1239,7 @@ CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::
cef_translator_test_scoped_library_t* _retval =
_struct->set_child_own_ptr_library_and_return_parent(
_struct,
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val)));
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(std::move(val)));
// Return type: ownptr_same
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
@ -1263,7 +1263,7 @@ int CefTranslatorTestCToCpp::SetOwnPtrClient(
// Execute
int _retval = _struct->set_own_ptr_client(
_struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val)));
_struct, CefTranslatorTestScopedClientCppToC::WrapOwn(std::move(val)));
// Return type: simple
return _retval;
@ -1288,7 +1288,8 @@ CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::
// Execute
cef_translator_test_scoped_client_t* _retval =
_struct->set_own_ptr_client_and_return(
_struct, CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val)));
_struct,
CefTranslatorTestScopedClientCppToC::WrapOwn(std::move(val)));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval);
@ -1313,7 +1314,7 @@ int CefTranslatorTestCToCpp::SetChildOwnPtrClient(
// Execute
int _retval = _struct->set_child_own_ptr_client(
_struct,
CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val)));
CefTranslatorTestScopedClientChildCppToC::WrapOwn(std::move(val)));
// Return type: simple
return _retval;
@ -1340,7 +1341,7 @@ CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::
cef_translator_test_scoped_client_t* _retval =
_struct->set_child_own_ptr_client_and_return_parent(
_struct,
CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val)));
CefTranslatorTestScopedClientChildCppToC::WrapOwn(std::move(val)));
// Return type: ownptr_diff
return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval);

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=bfa7d52202c1d09dfa86e05df4f60f3b9264e19c$
// $hash=3768f0baca452bd0aa50e298dcc2166efd11f3db$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h"
@ -68,8 +68,7 @@ CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
return reinterpret_cast<cef_translator_test_scoped_client_t*>(
CefTranslatorTestScopedClientChildCToCpp::UnwrapRaw(
CefRawPtr<CefTranslatorTestScopedClientChild>(
reinterpret_cast<CefTranslatorTestScopedClientChild*>(
CEF_RAW_PTR_GET(c)))));
reinterpret_cast<CefTranslatorTestScopedClientChild*>(c))));
}
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=3218861c702d3419a97a3a49b87898e1afc3d55e$
// $hash=e259f697e1edef88f12eae86d7161a4807438ef7$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
@ -18,9 +18,8 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
CefOwnPtr<
CefTranslatorTestScopedLibraryChild> CefTranslatorTestScopedLibraryChild::
Create(int value, int other_value) {
CefOwnPtr<CefTranslatorTestScopedLibraryChild>
CefTranslatorTestScopedLibraryChild::Create(int value, int other_value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
@ -129,7 +128,7 @@ CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw(
CefRawPtr<CefTranslatorTestScopedLibraryChildChild>(
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(
CEF_RAW_PTR_GET(c)))));
c))));
}
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=93bec9c1c78c75b71ca887b790977d027f197a79$
// $hash=589f29aab564ddcd4eaf69e116e2854a46b8048d$
//
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h"
@ -19,8 +19,8 @@
// STATIC METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestScopedLibrary::
Create(int value) {
CefOwnPtr<CefTranslatorTestScopedLibrary>
CefTranslatorTestScopedLibrary::Create(int value) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
@ -103,15 +103,14 @@ CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(
CefRawPtr<CefTranslatorTestScopedLibraryChild>(
reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(
CEF_RAW_PTR_GET(c)))));
reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(c))));
}
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw(
CefRawPtr<CefTranslatorTestScopedLibraryChildChild>(
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(
CEF_RAW_PTR_GET(c)))));
c))));
}
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;

View File

@ -1,18 +0,0 @@
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_LIBCEF_DLL_PTR_UTIL_H_
#define CEF_LIBCEF_DLL_PTR_UTIL_H_
#pragma once
// Helpers for CefOwnPtr<>.
#if defined(USING_CHROMIUM_INCLUDES)
#define OWN_PASS(p) std::move(p)
#define OWN_RETURN_AS(p, t) (p)
#else
#define OWN_PASS(p) (p).Pass()
#define OWN_RETURN_AS(p, t) (p).PassAs<t>()
#endif
#endif // CEF_LIBCEF_DLL_PTR_UTIL_H_

View File

@ -4,13 +4,7 @@
#include "libcef_dll/shutdown_checker.h"
// For compatibility with older client compiler versions only use std::atomic
// on the library side.
#if defined(BUILDING_CEF_SHARED)
#include <atomic>
#else
#include "include/base/cef_atomic_ref_count.h"
#endif
#include "include/base/cef_logging.h"
@ -20,8 +14,6 @@ namespace shutdown_checker {
namespace {
#if defined(BUILDING_CEF_SHARED)
std::atomic_bool g_cef_shutdown{false};
bool IsCefShutdown() {
@ -32,20 +24,6 @@ void SetCefShutdown() {
g_cef_shutdown.store(true);
}
#else // !defined(BUILDING_CEF_SHARED)
base::AtomicRefCount g_cef_shutdown ATOMIC_DECLARATION;
bool IsCefShutdown() {
return !base::AtomicRefCountIsZero(&g_cef_shutdown);
}
void SetCefShutdown() {
base::AtomicRefCountInc(&g_cef_shutdown);
}
#endif // !defined(BUILDING_CEF_SHARED)
} // namespace
void AssertNotShutdown() {

View File

@ -175,7 +175,7 @@ class ArchiveProvider : public CefResourceManager::Provider {
password_(password),
archive_load_started_(false),
archive_load_ended_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
weak_ptr_factory_(this) {
DCHECK(!url_path_.empty());
DCHECK(!archive_path_.empty());
@ -306,7 +306,7 @@ struct CefResourceManager::ProviderEntry {
identifier_(identifier),
deletion_pending_(false) {}
scoped_ptr<Provider> provider_;
std::unique_ptr<Provider> provider_;
int order_;
std::string identifier_;
@ -362,8 +362,8 @@ void CefResourceManager::Request::Stop() {
base::Passed(&state_)));
}
CefResourceManager::Request::Request(scoped_ptr<RequestState> state)
: state_(state.Pass()), params_(state_->params_) {
CefResourceManager::Request::Request(std::unique_ptr<RequestState> state)
: state_(std::move(state)), params_(state_->params_) {
CEF_REQUIRE_IO_THREAD();
ProviderEntry* entry = *(state_->current_entry_pos_);
@ -379,13 +379,13 @@ CefResourceManager::Request::Request(scoped_ptr<RequestState> state)
// handle the request. Note that |state_| may already be NULL if OnRequest
// executes a callback before returning, in which case execution will continue
// asynchronously in any case.
scoped_ptr<CefResourceManager::RequestState>
std::unique_ptr<CefResourceManager::RequestState>
CefResourceManager::Request::SendRequest() {
CEF_REQUIRE_IO_THREAD();
Provider* provider = (*state_->current_entry_pos_)->provider_.get();
if (!provider->OnRequest(this))
return state_.Pass();
return scoped_ptr<RequestState>();
return std::move(state_);
return std::unique_ptr<RequestState>();
}
bool CefResourceManager::Request::HasState() {
@ -395,23 +395,23 @@ bool CefResourceManager::Request::HasState() {
// static
void CefResourceManager::Request::ContinueOnIOThread(
scoped_ptr<RequestState> state,
std::unique_ptr<RequestState> state,
CefRefPtr<CefResourceHandler> handler) {
CEF_REQUIRE_IO_THREAD();
// The manager may already have been deleted.
base::WeakPtr<CefResourceManager> manager = state->manager_;
if (manager)
manager->ContinueRequest(state.Pass(), handler);
manager->ContinueRequest(std::move(state), handler);
}
// static
void CefResourceManager::Request::StopOnIOThread(
scoped_ptr<RequestState> state) {
std::unique_ptr<RequestState> state) {
CEF_REQUIRE_IO_THREAD();
// The manager may already have been deleted.
base::WeakPtr<CefResourceManager> manager = state->manager_;
if (manager)
manager->StopRequest(state.Pass());
manager->StopRequest(std::move(state));
}
// CefResourceManager implementation.
@ -472,7 +472,7 @@ void CefResourceManager::AddProvider(Provider* provider,
return;
}
scoped_ptr<ProviderEntry> new_entry(
std::unique_ptr<ProviderEntry> new_entry(
new ProviderEntry(provider, order, identifier));
if (providers_.empty()) {
@ -566,7 +566,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad(
return RV_CONTINUE;
}
scoped_ptr<RequestState> state(new RequestState);
std::unique_ptr<RequestState> state(new RequestState);
if (!weak_ptr_factory_.get()) {
// WeakPtrFactory instances need to be created and destroyed on the same
@ -590,7 +590,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad(
state->current_entry_pos_ = current_entry_pos;
// If the request is potentially handled we need to continue asynchronously.
return SendRequest(state.Pass()) ? RV_CONTINUE_ASYNC : RV_CONTINUE;
return SendRequest(std::move(state)) ? RV_CONTINUE_ASYNC : RV_CONTINUE;
}
CefRefPtr<CefResourceHandler> CefResourceManager::GetResourceHandler(
@ -616,13 +616,13 @@ CefRefPtr<CefResourceHandler> CefResourceManager::GetResourceHandler(
// Send the request to providers in order until one potentially handles it or we
// run out of providers. Returns true if the request is potentially handled.
bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
bool CefResourceManager::SendRequest(std::unique_ptr<RequestState> state) {
bool potentially_handled = false;
do {
// Should not be on the last provider entry.
DCHECK(state->current_entry_pos_ != providers_.end());
scoped_refptr<Request> request = new Request(state.Pass());
scoped_refptr<Request> request = new Request(std::move(state));
// Give the provider an opportunity to handle the request.
state = request->SendRequest();
@ -630,7 +630,7 @@ bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
// The provider will not handle the request. Move to the next provider if
// any.
if (!IncrementProvider(state.get()))
StopRequest(state.Pass());
StopRequest(std::move(state));
} else {
potentially_handled = true;
}
@ -640,7 +640,7 @@ bool CefResourceManager::SendRequest(scoped_ptr<RequestState> state) {
}
void CefResourceManager::ContinueRequest(
scoped_ptr<RequestState> state,
std::unique_ptr<RequestState> state,
CefRefPtr<CefResourceHandler> handler) {
CEF_REQUIRE_IO_THREAD();
@ -648,17 +648,17 @@ void CefResourceManager::ContinueRequest(
// The request has been handled. Associate the request ID with the handler.
pending_handlers_.insert(
std::make_pair(state->params_.request_->GetIdentifier(), handler));
StopRequest(state.Pass());
StopRequest(std::move(state));
} else {
// Move to the next provider if any.
if (IncrementProvider(state.get()))
SendRequest(state.Pass());
SendRequest(std::move(state));
else
StopRequest(state.Pass());
StopRequest(std::move(state));
}
}
void CefResourceManager::StopRequest(scoped_ptr<RequestState> state) {
void CefResourceManager::StopRequest(std::unique_ptr<RequestState> state) {
CEF_REQUIRE_IO_THREAD();
// Detach from the current provider.

View File

@ -5,10 +5,10 @@
#include "include/wrapper/cef_zip_archive.h"
#include <algorithm>
#include <memory>
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/cef_stream.h"
#include "include/cef_zip_reader.h"
#include "include/wrapper/cef_byte_read_handler.h"
@ -56,7 +56,7 @@ class CefZipFile : public CefZipArchive::File {
private:
size_t data_size_;
scoped_ptr<unsigned char[]> data_;
std::unique_ptr<unsigned char[]> data_;
IMPLEMENT_REFCOUNTING(CefZipFile);
DISALLOW_COPY_AND_ASSIGN(CefZipFile);

View File

@ -9,12 +9,13 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9fbe1de9cf7f32c551c535e190d4c82b4947765d$
// $hash=85426bf2da9016443939636319265fff616f1cb4$
//
#include <dlfcn.h>
#include <stdio.h>
#include "include/base/cef_compiler_specific.h"
#include "include/capi/cef_app_capi.h"
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_command_line_capi.h"

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/browser_window.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "tests/shared/browser/main_message_loop.h"
namespace client {

View File

@ -6,7 +6,8 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_H_
#pragma once
#include "include/base/cef_scoped_ptr.h"
#include <memory>
#include "include/cef_browser.h"
#include "tests/cefclient/browser/client_handler.h"
#include "tests/cefclient/browser/client_types.h"
@ -110,8 +111,8 @@ class BrowserWindow : public ClientHandler::Delegate {
bool IsClosing() const;
protected:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<BrowserWindow>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<BrowserWindow>;
// Constructor may be called on any thread.
// |delegate| must outlive this object.

View File

@ -16,6 +16,7 @@
#include <X11/Xcursor/Xcursor.h>
#include <X11/keysym.h>
#include "include/base/cef_cxx17_backports.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/wrapper/cef_closure_task.h"
@ -788,7 +789,7 @@ KeyboardCode GdkEventToWindowsKeyCode(const GdkEventKey* event) {
if (windows_key_code)
return windows_key_code;
if (event->hardware_keycode < arraysize(kHardwareCodeToGDKKeyval)) {
if (event->hardware_keycode < base::size(kHardwareCodeToGDKKeyval)) {
int keyval = kHardwareCodeToGDKKeyval[event->hardware_keycode];
if (keyval)
return KeyboardCodeFromXKeysym(keyval);
@ -907,7 +908,7 @@ class ScopedGLContext {
ScopedGLContext(GtkWidget* widget, bool swap_buffers)
: swap_buffers_(swap_buffers), widget_(widget) {
gtk_gl_area_make_current(GTK_GL_AREA(widget));
is_valid_ = gtk_gl_area_get_error(GTK_GL_AREA(widget)) == NULL;
is_valid_ = gtk_gl_area_get_error(GTK_GL_AREA(widget)) == nullptr;
if (swap_buffers_ && is_valid_) {
gtk_gl_area_queue_render(GTK_GL_AREA(widget_));
gtk_gl_area_attach_buffers(GTK_GL_AREA(widget));
@ -939,12 +940,12 @@ BrowserWindowOsrGtk::BrowserWindowOsrGtk(BrowserWindow::Delegate* delegate,
gl_enabled_(false),
painting_popup_(false),
hidden_(false),
glarea_(NULL),
glarea_(nullptr),
drag_trigger_event_(nullptr),
drag_data_(nullptr),
drag_operation_(DRAG_OPERATION_NONE),
drag_context_(nullptr),
drag_targets_(gtk_target_list_new(NULL, 0)),
drag_targets_(gtk_target_list_new(nullptr, 0)),
drag_leave_(false),
drag_drop_(false),
device_scale_factor_(1.0f) {
@ -1115,8 +1116,8 @@ void BrowserWindowOsrGtk::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
UnregisterDragDrop();
// Disconnect all signal handlers that reference |this|.
g_signal_handlers_disconnect_matched(glarea_, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
NULL, this);
g_signal_handlers_disconnect_matched(glarea_, G_SIGNAL_MATCH_DATA, 0, 0,
nullptr, nullptr, this);
DisableGL();
}
@ -1775,7 +1776,8 @@ void BrowserWindowOsrGtk::RegisterDragDrop() {
// Default values for drag threshold are set to 8 pixels in both GTK and
// Chromium, but doesn't work as expected.
// --OFF--
// gtk_drag_source_set(glarea_, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
// gtk_drag_source_set(glarea_, GDK_BUTTON1_MASK, nullptr, 0,
// GDK_ACTION_COPY);
// Source widget events.
g_signal_connect(G_OBJECT(glarea_), "drag_begin",
@ -1786,7 +1788,7 @@ void BrowserWindowOsrGtk::RegisterDragDrop() {
G_CALLBACK(&BrowserWindowOsrGtk::DragEnd), this);
// Destination widget and its events.
gtk_drag_dest_set(glarea_, (GtkDestDefaults)0, (GtkTargetEntry*)NULL, 0,
gtk_drag_dest_set(glarea_, (GtkDestDefaults)0, (GtkTargetEntry*)nullptr, 0,
(GdkDragAction)GDK_ACTION_COPY);
g_signal_connect(G_OBJECT(glarea_), "drag_motion",
G_CALLBACK(&BrowserWindowOsrGtk::DragMotion), this);
@ -1859,9 +1861,10 @@ void BrowserWindowOsrGtk::DragBegin(GtkWidget* widget,
gboolean success = FALSE;
loader = gdk_pixbuf_loader_new_with_type("png", &error);
if (error == nullptr && loader) {
success = gdk_pixbuf_loader_write(loader, image_buffer, image_size, NULL);
success =
gdk_pixbuf_loader_write(loader, image_buffer, image_size, nullptr);
if (success) {
success = gdk_pixbuf_loader_close(loader, NULL);
success = gdk_pixbuf_loader_close(loader, nullptr);
if (success) {
pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
if (pixbuf) {

View File

@ -91,7 +91,7 @@ class BrowserWindowOsrMac : public BrowserWindow,
void UpdateAccessibilityLocation(CefRefPtr<CefValue> value) override;
private:
scoped_ptr<BrowserWindowOsrMacImpl> impl_;
std::unique_ptr<BrowserWindowOsrMacImpl> impl_;
DISALLOW_COPY_AND_ASSIGN(BrowserWindowOsrMac);

View File

@ -142,8 +142,8 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
}
- (void)detach {
renderer_ = NULL;
browser_window_ = NULL;
renderer_ = nullptr;
browser_window_ = nullptr;
if (text_input_client_)
[text_input_client_ detach];
}
@ -151,7 +151,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
- (CefRefPtr<CefBrowser>)getBrowser {
if (browser_window_)
return browser_window_->GetBrowser();
return NULL;
return nullptr;
}
- (void)setFrame:(NSRect)frameRect {
@ -475,12 +475,12 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
- (BOOL)canBecomeKeyView {
CefRefPtr<CefBrowser> browser = [self getBrowser];
return (browser.get() != NULL);
return (browser.get() != nullptr);
}
- (BOOL)acceptsFirstResponder {
CefRefPtr<CefBrowser> browser = [self getBrowser];
return (browser.get() != NULL);
return (browser.get() != nullptr);
}
- (BOOL)becomeFirstResponder {
@ -836,7 +836,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
if (!current_drag_data_)
return nil;
size_t expected_size = current_drag_data_->GetFileContents(NULL);
size_t expected_size = current_drag_data_->GetFileContents(nullptr);
if (expected_size == 0)
return nil;
@ -969,7 +969,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
// File contents.
} else if ([type isEqualToString:fileUTI_]) {
size_t size = current_drag_data_->GetFileContents(NULL);
size_t size = current_drag_data_->GetFileContents(nullptr);
DCHECK_GT(size, 0U);
CefRefPtr<client::BytesWriteHandler> handler =
new client::BytesWriteHandler(size);
@ -1025,7 +1025,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
// Add Root as first Kid
NSMutableArray* kids = [NSMutableArray arrayWithCapacity:1];
NSObject* child = CAST_CEF_NATIVE_ACCESSIBLE_TO_NSOBJECT(
node->GetNativeAccessibleObject(NULL));
node->GetNativeAccessibleObject(nullptr));
[kids addObject:child];
return NSAccessibilityUnignoredChildren(kids);
} else {
@ -1037,7 +1037,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
if (accessibility_helper_) {
client::OsrAXNode* node = accessibility_helper_->GetFocusedNode();
return node ? CAST_CEF_NATIVE_ACCESSIBLE_TO_NSOBJECT(
node->GetNativeAccessibleObject(NULL))
node->GetNativeAccessibleObject(nullptr))
: nil;
}
return nil;
@ -1047,7 +1047,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
- (void)resetDragDrop {
current_drag_op_ = NSDragOperationNone;
current_allowed_ops_ = NSDragOperationNone;
current_drag_data_ = NULL;
current_drag_data_ = nullptr;
if (fileUTI_) {
#if !__has_feature(objc_arc)
[fileUTI_ release];
@ -1079,7 +1079,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
// MIME type.
CefString mimeType;
size_t contents_size = current_drag_data_->GetFileContents(NULL);
size_t contents_size = current_drag_data_->GetFileContents(nullptr);
CefString download_metadata = current_drag_data_->GetLinkMetadata();
CefString file_name = current_drag_data_->GetFileName();
@ -1097,7 +1097,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
mimeType.ToString().c_str(),
kCFStringEncodingUTF8);
fileUTI_ = (__bridge NSString*)UTTypeCreatePreferredIdentifierForTag(
kUTTagClassMIMEType, mimeTypeCF, NULL);
kUTTagClassMIMEType, mimeTypeCF, nullptr);
CFRelease(mimeTypeCF);
// File (HFS) promise.
NSArray* fileUTIList = @[ fileUTI_ ];

View File

@ -11,7 +11,7 @@ namespace client {
BrowserWindowOsrWin::BrowserWindowOsrWin(BrowserWindow::Delegate* delegate,
const std::string& startup_url,
const OsrRendererSettings& settings)
: BrowserWindow(delegate), osr_hwnd_(NULL), device_scale_factor_(0) {
: BrowserWindow(delegate), osr_hwnd_(nullptr), device_scale_factor_(0) {
osr_window_ = new OsrWindowWin(this, settings);
client_handler_ = new ClientHandlerOsr(this, osr_window_.get(), startup_url);
}

View File

@ -43,7 +43,7 @@ void SetXWindowVisible(XDisplay* xdisplay, ::Window xwindow, bool visible) {
if (!visible) {
// Set the hidden property state value.
scoped_ptr<Atom[]> data(new Atom[1]);
std::unique_ptr<Atom[]> data(new Atom[1]);
data[0] = atoms[2];
XChangeProperty(xdisplay, xwindow,
@ -59,7 +59,7 @@ void SetXWindowVisible(XDisplay* xdisplay, ::Window xwindow, bool visible) {
atoms[0], // name
atoms[1], // type
32, // size in bits of items in 'value'
PropModeReplace, NULL,
PropModeReplace, nullptr,
0); // num items
}
}
@ -182,7 +182,7 @@ ClientWindowHandle BrowserWindowStdGtk::GetWindowHandle() const {
// There is no GtkWidget* representation of this object.
NOTREACHED();
return NULL;
return nullptr;
}
} // namespace client

View File

@ -88,7 +88,7 @@ ClientWindowHandle BrowserWindowStdMac::GetWindowHandle() const {
if (browser_)
return browser_->GetHost()->GetWindowHandle();
return NULL;
return nullptr;
}
} // namespace client

View File

@ -62,7 +62,7 @@ void BrowserWindowStdWin::ShowPopup(ClientWindowHandle parent_handle,
HWND hwnd = GetWindowHandle();
if (hwnd) {
SetParent(hwnd, parent_handle);
SetWindowPos(hwnd, NULL, x, y, static_cast<int>(width),
SetWindowPos(hwnd, nullptr, x, y, static_cast<int>(width),
static_cast<int>(height), SWP_NOZORDER | SWP_NOACTIVATE);
const bool no_activate =
@ -86,7 +86,7 @@ void BrowserWindowStdWin::Hide() {
if (hwnd) {
// When the frame window is minimized set the browser window size to 0x0 to
// reduce resource usage.
SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
SetWindowPos(hwnd, nullptr, 0, 0, 0, 0,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
}
}
@ -97,7 +97,7 @@ void BrowserWindowStdWin::SetBounds(int x, int y, size_t width, size_t height) {
HWND hwnd = GetWindowHandle();
if (hwnd) {
// Set the browser window bounds.
SetWindowPos(hwnd, NULL, x, y, static_cast<int>(width),
SetWindowPos(hwnd, nullptr, x, y, static_cast<int>(width),
static_cast<int>(height), SWP_NOZORDER);
}
}
@ -114,7 +114,7 @@ ClientWindowHandle BrowserWindowStdWin::GetWindowHandle() const {
if (browser_)
return browser_->GetHost()->GetWindowHandle();
return NULL;
return nullptr;
}
} // namespace client

View File

@ -10,7 +10,7 @@
#include <sstream>
#include <string>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_browser.h"
#include "include/cef_frame.h"
#include "include/cef_parser.h"

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/client_handler_osr.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_helpers.h"

View File

@ -275,7 +275,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
GtkWidget* dialog = gtk_file_chooser_dialog_new(
title_str.c_str(), GTK_WINDOW(window), action, "_Cancel",
GTK_RESPONSE_CANCEL, accept_button, GTK_RESPONSE_ACCEPT, NULL);
GTK_RESPONSE_CANCEL, accept_button, GTK_RESPONSE_ACCEPT, nullptr);
if (mode_type == FILE_DIALOG_OPEN_MULTIPLE)
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);
@ -402,7 +402,7 @@ void ClientDialogHandlerGtk::OnJSDialogContinue(OnJSDialogParams params,
gtk_message_type, buttons, "%s",
params.message_text.ToString().c_str());
g_signal_connect(gtk_dialog_, "delete-event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
G_CALLBACK(gtk_widget_hide_on_delete), nullptr);
gtk_window_set_title(GTK_WINDOW(gtk_dialog_), title.c_str());

View File

@ -9,7 +9,7 @@
#include <map>
#include <vector>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_ref_counted.h"
#include "include/cef_image.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -6,7 +6,8 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_MAIN_CONTEXT_IMPL_H_
#pragma once
#include "include/base/cef_scoped_ptr.h"
#include <memory>
#include "include/base/cef_thread_checker.h"
#include "include/cef_app.h"
#include "include/cef_command_line.h"
@ -48,8 +49,8 @@ class MainContextImpl : public MainContext {
void Shutdown();
private:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<MainContextImpl>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<MainContextImpl>;
~MainContextImpl();
@ -75,7 +76,7 @@ class MainContextImpl : public MainContext {
bool use_views_;
bool touch_events_enabled_;
scoped_ptr<RootWindowManager> root_window_manager_;
std::unique_ptr<RootWindowManager> root_window_manager_;
#if defined(OS_WIN)
bool shared_texture_enabled_;

View File

@ -14,8 +14,8 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) {
std::string path;
// Save the file in the user's "My Documents" folder.
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL,
0, szFolderPath))) {
if (SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_PERSONAL | CSIDL_FLAG_CREATE,
nullptr, 0, szFolderPath))) {
path = CefString(szFolderPath);
path += "\\" + file_name;
}

View File

@ -7,7 +7,7 @@
#include <X11/Xlib.h>
#include <gtk/gtk.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/main_message_loop_multithreaded_win.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/cef_app.h"
#include "tests/cefclient/browser/resource.h"
@ -22,8 +22,8 @@ const wchar_t kTaskMessageName[] = L"Client_CustomTask";
MainMessageLoopMultithreadedWin::MainMessageLoopMultithreadedWin()
: thread_id_(base::PlatformThread::CurrentId()),
task_message_id_(RegisterWindowMessage(kTaskMessageName)),
dialog_hwnd_(NULL),
message_hwnd_(NULL) {}
dialog_hwnd_(nullptr),
message_hwnd_(nullptr) {}
MainMessageLoopMultithreadedWin::~MainMessageLoopMultithreadedWin() {
DCHECK(RunsTasksOnCurrentThread());
@ -34,7 +34,7 @@ MainMessageLoopMultithreadedWin::~MainMessageLoopMultithreadedWin() {
int MainMessageLoopMultithreadedWin::Run() {
DCHECK(RunsTasksOnCurrentThread());
HINSTANCE hInstance = ::GetModuleHandle(NULL);
HINSTANCE hInstance = ::GetModuleHandle(nullptr);
{
base::AutoLock lock_scope(lock_);
@ -59,7 +59,7 @@ int MainMessageLoopMultithreadedWin::Run() {
MSG msg;
// Run the application message loop.
while (GetMessage(&msg, NULL, 0, 0)) {
while (GetMessage(&msg, nullptr, 0, 0)) {
// Allow processing of dialog messages.
if (dialog_hwnd_ && IsDialogMessage(dialog_hwnd_, &msg))
continue;
@ -75,7 +75,7 @@ int MainMessageLoopMultithreadedWin::Run() {
// Destroy the message window.
DestroyWindow(message_hwnd_);
message_hwnd_ = NULL;
message_hwnd_ = nullptr;
}
return static_cast<int>(msg.wParam);
@ -142,7 +142,7 @@ MainMessageLoopMultithreadedWin::MessageWndProc(HWND hWnd,
switch (message) {
case WM_NCDESTROY:
// Clear the reference to |self|.
SetUserDataPtr(hWnd, NULL);
SetUserDataPtr(hWnd, nullptr);
break;
}
}

View File

@ -74,7 +74,7 @@ class MediaRouteCreateCallback : public CefMediaRouteCreateCallback {
} else {
SendFailure(create_callback_, kRequestFailedError + result, error);
}
create_callback_ = NULL;
create_callback_ = nullptr;
}
private:
@ -257,7 +257,7 @@ class MediaObserver : public CefMediaObserver {
CefRefPtr<CefMediaSource> GetSource(const std::string& source_urn) {
CefRefPtr<CefMediaSource> source = media_router_->GetSource(source_urn);
if (!source)
return NULL;
return nullptr;
return source;
}
@ -265,7 +265,7 @@ class MediaObserver : public CefMediaObserver {
SinkInfoMap::const_iterator it = sink_info_map_.find(sink_id);
if (it != sink_info_map_.end())
return it->second->sink;
return NULL;
return nullptr;
}
void ClearSinkInfoMap() {
@ -299,7 +299,7 @@ class MediaObserver : public CefMediaObserver {
RouteMap::const_iterator it = route_map_.find(route_id);
if (it != route_map_.end())
return it->second;
return NULL;
return nullptr;
}
void SendResponse(const std::string& name,
@ -574,7 +574,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
if (it != subscription_state_map_.end()) {
return it->second->observer;
}
return NULL;
return nullptr;
}
// Map of browser ID to SubscriptionState object.

View File

@ -97,7 +97,7 @@ void OsrAXNode::UpdateValue(CefRefPtr<CefDictionaryValue> value) {
CefWindowHandle OsrAXNode::GetWindowHandle() const {
if (accessibility_helper_)
return accessibility_helper_->GetWindowHandle();
return NULL;
return nullptr;
}
CefRefPtr<CefBrowser> OsrAXNode::GetBrowser() const {

View File

@ -62,7 +62,7 @@ void GetStorageForBytes(STGMEDIUM* storage, const void* data, size_t bytes) {
storage->hGlobal = handle;
storage->tymed = TYMED_HGLOBAL;
storage->pUnkForRelease = NULL;
storage->pUnkForRelease = nullptr;
}
template <typename T>
@ -86,7 +86,7 @@ void GetStorageForFileDescriptor(STGMEDIUM* storage,
storage->tymed = TYMED_HGLOBAL;
storage->hGlobal = hdata;
storage->pUnkForRelease = NULL;
storage->pUnkForRelease = nullptr;
}
// Helper method for converting from text/html to MS CF_HTML.
@ -202,7 +202,7 @@ void CFHtmlToHtml(const std::string& cf_html,
size_t frag_start = std::string::npos;
size_t frag_end = std::string::npos;
CFHtmlExtractMetadata(cf_html, base_url, NULL, &frag_start, &frag_end);
CFHtmlExtractMetadata(cf_html, base_url, nullptr, &frag_start, &frag_end);
if (html && frag_start != std::string::npos &&
frag_end != std::string::npos) {
@ -221,7 +221,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
const int kMaxDataObjects = 10;
FORMATETC fmtetcs[kMaxDataObjects];
STGMEDIUM stgmeds[kMaxDataObjects];
FORMATETC fmtetc = {0, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
FORMATETC fmtetc = {0, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
int curr_index = 0;
CefString text = drag_data->GetFragmentText();
if (!text.empty()) {
@ -249,7 +249,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
curr_index++;
}
size_t bufferSize = drag_data->GetFileContents(NULL);
size_t bufferSize = drag_data->GetFileContents(nullptr);
if (bufferSize) {
CefRefPtr<BytesWriteHandler> handler = new BytesWriteHandler(bufferSize);
CefRefPtr<CefStreamWriter> writer =
@ -559,7 +559,7 @@ HRESULT DataObjectWin::QueryGetData(FORMATETC* pFormatEtc) {
HRESULT DataObjectWin::GetCanonicalFormatEtc(FORMATETC* pFormatEct,
FORMATETC* pFormatEtcOut) {
pFormatEtcOut->ptd = NULL;
pFormatEtcOut->ptd = nullptr;
return E_NOTIMPL;
}

View File

@ -14,9 +14,11 @@
#include "tests/shared/browser/main_message_loop.h"
#include "tests/shared/browser/util_win.h"
#define ColorUNDERLINE 0xFF000000 // Black SkColor value for underline,
#define ColorUNDERLINE \
0xFF000000 // Black SkColor value for underline,
// same as Blink.
#define ColorBKCOLOR 0x00000000 // White SkColor value for background,
#define ColorBKCOLOR \
0x00000000 // White SkColor value for background,
// same as Blink.
namespace client {
@ -35,7 +37,7 @@ bool IsSelectionAttribute(char attribute) {
void GetCompositionSelectionRange(HIMC imc,
int* target_start,
int* target_end) {
int attribute_size = ::ImmGetCompositionString(imc, GCS_COMPATTR, NULL, 0);
int attribute_size = ::ImmGetCompositionString(imc, GCS_COMPATTR, nullptr, 0);
if (attribute_size > 0) {
int start = 0;
int end = 0;
@ -64,7 +66,7 @@ void GetCompositionUnderlines(
int target_start,
int target_end,
std::vector<CefCompositionUnderline>& underlines) {
int clause_size = ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, NULL, 0);
int clause_size = ::ImmGetCompositionString(imc, GCS_COMPCLAUSE, nullptr, 0);
int clause_length = clause_size / sizeof(uint32);
if (clause_length) {
std::vector<uint32> clause_data(clause_length);
@ -131,7 +133,7 @@ void OsrImeHandlerWin::CreateImeWindow() {
if (PRIMARYLANGID(input_language_id_) == LANG_CHINESE ||
PRIMARYLANGID(input_language_id_) == LANG_JAPANESE) {
if (!system_caret_) {
if (::CreateCaret(hwnd_, NULL, 1, 1))
if (::CreateCaret(hwnd_, nullptr, 1, 1))
system_caret_ = true;
}
}
@ -262,7 +264,7 @@ void OsrImeHandlerWin::GetCompositionInfo(
if (!(lparam & CS_NOMOVECARET) && (lparam & GCS_CURSORPOS)) {
// IMM32 does not support non-zero-width selection in a composition. So
// always use the caret position as selection range.
int cursor = ::ImmGetCompositionString(imc, GCS_CURSORPOS, NULL, 0);
int cursor = ::ImmGetCompositionString(imc, GCS_CURSORPOS, nullptr, 0);
composition_start = cursor;
} else {
composition_start = 0;
@ -304,11 +306,11 @@ bool OsrImeHandlerWin::GetString(HIMC imc,
CefString& result) {
if (!(lparam & type))
return false;
LONG string_size = ::ImmGetCompositionString(imc, type, NULL, 0);
LONG string_size = ::ImmGetCompositionString(imc, type, nullptr, 0);
if (string_size <= 0)
return false;
// For trailing NULL - ImmGetCompositionString excludes that.
// For trailing nullptr - ImmGetCompositionString excludes that.
string_size += sizeof(WCHAR);
std::vector<wchar_t> buffer(string_size);
@ -354,7 +356,7 @@ bool OsrImeHandlerWin::GetComposition(
void OsrImeHandlerWin::DisableIME() {
CleanupComposition();
::ImmAssociateContextEx(hwnd_, NULL, 0);
::ImmAssociateContextEx(hwnd_, nullptr, 0);
}
void OsrImeHandlerWin::CancelIME() {
@ -370,7 +372,7 @@ void OsrImeHandlerWin::CancelIME() {
void OsrImeHandlerWin::EnableIME() {
// Load the default IME context.
::ImmAssociateContextEx(hwnd_, NULL, IACE_DEFAULT);
::ImmAssociateContextEx(hwnd_, nullptr, IACE_DEFAULT);
}
void OsrImeHandlerWin::UpdateCaretPosition(int index) {

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/osr_render_handler_win.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_helpers.h"
#include "tests/shared/browser/util_win.h"

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/osr_render_handler_win_d3d11.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_helpers.h"
#include "tests/shared/browser/util_win.h"

View File

@ -4,7 +4,7 @@
#include "tests/cefclient/browser/osr_render_handler_win_gl.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_helpers.h"
#include "tests/shared/browser/util_win.h"
@ -23,7 +23,7 @@ class ScopedGLContext {
DCHECK(result);
}
~ScopedGLContext() {
BOOL result = wglMakeCurrent(NULL, NULL);
BOOL result = wglMakeCurrent(nullptr, nullptr);
DCHECK(result);
if (swap_buffers_) {
result = SwapBuffers(hdc_);
@ -43,8 +43,8 @@ OsrRenderHandlerWinGL::OsrRenderHandlerWinGL(
HWND hwnd)
: OsrRenderHandlerWin(settings, hwnd),
renderer_(settings),
hdc_(NULL),
hrc_(NULL),
hdc_(nullptr),
hrc_(nullptr),
painting_popup_(false) {}
void OsrRenderHandlerWinGL::Initialize(CefRefPtr<CefBrowser> browser) {
@ -194,8 +194,8 @@ void OsrRenderHandlerWinGL::DisableGL() {
ReleaseDC(hwnd(), hdc_);
}
hdc_ = NULL;
hrc_ = NULL;
hdc_ = nullptr;
hrc_ = nullptr;
}
} // namespace client

View File

@ -85,7 +85,7 @@ OsrWindowWin::OsrWindowWin(Delegate* delegate,
const OsrRendererSettings& settings)
: delegate_(delegate),
settings_(settings),
hwnd_(NULL),
hwnd_(nullptr),
device_scale_factor_(0),
hidden_(false),
last_mouse_pos_(),
@ -235,7 +235,7 @@ void OsrWindowWin::SetBounds(int x, int y, size_t width, size_t height) {
if (hwnd_) {
// Set the browser window bounds.
::SetWindowPos(hwnd_, NULL, x, y, static_cast<int>(width),
::SetWindowPos(hwnd_, nullptr, x, y, static_cast<int>(width),
static_cast<int>(height), SWP_NOZORDER);
}
}
@ -277,7 +277,7 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) {
DCHECK(parent_hwnd);
DCHECK(!::IsRectEmpty(&rect));
HINSTANCE hInst = ::GetModuleHandle(NULL);
HINSTANCE hInst = ::GetModuleHandle(nullptr);
const cef_color_t background_color = MainContext::Get()->GetBackgroundColor();
const HBRUSH background_brush = CreateSolidBrush(
@ -327,7 +327,7 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) {
void OsrWindowWin::Destroy() {
CEF_REQUIRE_UI_THREAD();
DCHECK(hwnd_ != NULL);
DCHECK(hwnd_ != nullptr);
#if defined(CEF_USE_ATL)
// Revoke/delete the drag&drop handler.
@ -340,7 +340,7 @@ void OsrWindowWin::Destroy() {
// Destroy the native window.
::DestroyWindow(hwnd_);
ime_handler_.reset();
hwnd_ = NULL;
hwnd_ = nullptr;
}
void OsrWindowWin::NotifyNativeWindowCreated(HWND hwnd) {
@ -371,10 +371,10 @@ void OsrWindowWin::RegisterOsrClass(HINSTANCE hInstance,
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = NULL;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hIcon = nullptr;
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = background_brush;
wcex.lpszMenuName = NULL;
wcex.lpszMenuName = nullptr;
wcex.lpszClassName = kWndClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
@ -552,8 +552,8 @@ LRESULT CALLBACK OsrWindowWin::OsrWndProc(HWND hWnd,
case WM_NCDESTROY:
// Clear the reference to |self|.
SetUserDataPtr(hWnd, NULL);
self->hwnd_ = NULL;
SetUserDataPtr(hWnd, nullptr);
self->hwnd_ = nullptr;
break;
}

View File

@ -6,7 +6,7 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_OSR_WINDOW_WIN_H_
#pragma once
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_ref_counted.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_helpers.h"
@ -173,10 +173,10 @@ class OsrWindowWin
const OsrRendererSettings settings_;
HWND hwnd_;
scoped_ptr<OsrRenderHandlerWin> render_handler_;
std::unique_ptr<OsrRenderHandlerWin> render_handler_;
// Class that encapsulates IMM32 APIs and controls IMEs attached to a window.
scoped_ptr<OsrImeHandlerWin> ime_handler_;
std::unique_ptr<OsrImeHandlerWin> ime_handler_;
RECT client_rect_;
float device_scale_factor_;
@ -189,7 +189,7 @@ class OsrWindowWin
// Class that abstracts the accessibility information received from the
// renderer.
scoped_ptr<OsrAccessibilityHelper> accessibility_handler_;
std::unique_ptr<OsrAccessibilityHelper> accessibility_handler_;
IAccessible* accessibility_root_;
#endif

View File

@ -10,7 +10,7 @@
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/wrapper/cef_helpers.h"
@ -95,7 +95,7 @@ StickyPrintSettingGtk* GetLastUsedSettings() {
class GtkPrinterList {
public:
GtkPrinterList() : default_printer_(nullptr) {
gtk_enumerate_printers(SetPrinter, this, NULL, TRUE);
gtk_enumerate_printers(SetPrinter, this, nullptr, TRUE);
}
~GtkPrinterList() {
@ -105,11 +105,11 @@ class GtkPrinterList {
}
}
// Can return NULL if there's no default printer. E.g. Printer on a laptop
// Can return nullptr if there's no default printer. E.g. Printer on a laptop
// is "home_printer", but the laptop is at work.
GtkPrinter* default_printer() { return default_printer_; }
// Can return NULL if the printer cannot be found due to:
// Can return nullptr if the printer cannot be found due to:
// - Printer list out of sync with printer dialog UI.
// - Querying for non-existant printers like 'Print to PDF'.
GtkPrinter* GetPrinterWithName(const std::string& name) {
@ -272,8 +272,8 @@ void InitPrintSettings(GtkPrintSettings* settings,
printable_area_device_units, true);
}
// Returns the GtkWindow* for the browser. Will return NULL when using the Views
// framework.
// Returns the GtkWindow* for the browser. Will return nullptr when using the
// Views framework.
GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
scoped_refptr<RootWindow> root_window =
RootWindow::GetForBrowser(browser->GetIdentifier());
@ -410,9 +410,9 @@ struct ClientPrintHandlerGtk::PrintHandler {
ScopedGdkThreadsEnter scoped_gdk_threads;
// TODO(estade): We need a window title here.
dialog_ = gtk_print_unix_dialog_new(NULL, parent);
dialog_ = gtk_print_unix_dialog_new(nullptr, parent);
g_signal_connect(dialog_, "delete-event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
G_CALLBACK(gtk_widget_hide_on_delete), nullptr);
// Set modal so user cannot focus the same tab and press print again.
gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE);
@ -441,8 +441,8 @@ struct ClientPrintHandlerGtk::PrintHandler {
bool OnPrintJob(const CefString& document_name,
const CefString& pdf_file_path,
CefRefPtr<CefPrintJobCallback> callback) {
// If |printer_| is NULL then somehow the GTK printer list changed out under
// us. In which case, just bail out.
// If |printer_| is nullptr then somehow the GTK printer list changed out
// under us. In which case, just bail out.
if (!printer_)
return false;
@ -456,8 +456,8 @@ struct ClientPrintHandlerGtk::PrintHandler {
GtkPrintJob* print_job = gtk_print_job_new(
document_name.ToString().c_str(), printer_, gtk_settings_, page_setup_);
gtk_print_job_set_source_file(print_job, pdf_file_path.ToString().c_str(),
NULL);
gtk_print_job_send(print_job, OnJobCompletedThunk, this, NULL);
nullptr);
gtk_print_job_send(print_job, OnJobCompletedThunk, this, nullptr);
return true;
}

View File

@ -76,7 +76,7 @@ class RootWindow
class Delegate {
public:
// Called to retrieve the CefRequestContext for browser. Only called for
// non-popup browsers. May return NULL.
// non-popup browsers. May return nullptr.
virtual CefRefPtr<CefRequestContext> GetRequestContext(
RootWindow* root_window) = 0;
@ -129,7 +129,7 @@ class RootWindow
// Initialize as a normal window. This will create and show a native window
// hosting a single browser instance. This method may be called on any thread.
// |delegate| must be non-NULL and outlive this object.
// |delegate| must be non-nullptr and outlive this object.
// Use RootWindowManager::CreateRootWindow() instead of calling this method
// directly.
virtual void Init(RootWindow::Delegate* delegate,
@ -139,9 +139,9 @@ class RootWindow
// Initialize as a popup window. This is used to attach a new native window to
// a single browser instance that will be created later. The native window
// will be created and shown once the browser is available. This method may be
// called on any thread. |delegate| must be non-NULL and outlive this object.
// Use RootWindowManager::CreateRootWindowAsPopup() instead of calling this
// method directly. Called on the UI thread.
// called on any thread. |delegate| must be non-nullptr and outlive this
// object. Use RootWindowManager::CreateRootWindowAsPopup() instead of calling
// this method directly. Called on the UI thread.
virtual void InitAsPopup(RootWindow::Delegate* delegate,
bool with_controls,
bool with_osr,

View File

@ -11,7 +11,7 @@
#undef Success // Definition conflicts with cef_message_router.h
#undef RootWindow // Definition conflicts with root_window.h
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_app.h"
#include "tests/cefclient/browser/browser_window_osr_gtk.h"
#include "tests/cefclient/browser/browser_window_std_gtk.h"
@ -40,13 +40,13 @@ void UseDefaultX11VisualForGtk(GtkWidget* widget) {
GList* visuals = gdk_screen_list_visuals(screen);
GdkX11Screen* x11_screen = GDK_X11_SCREEN(screen);
if (x11_screen == NULL)
if (x11_screen == nullptr)
return;
Visual* default_xvisual = DefaultVisual(GDK_SCREEN_XDISPLAY(x11_screen),
GDK_SCREEN_XNUMBER(x11_screen));
GList* cursor = visuals;
while (cursor != NULL) {
while (cursor != nullptr) {
GdkVisual* visual = GDK_X11_VISUAL(cursor->data);
if (default_xvisual->visualid ==
gdk_x11_visual_get_xvisual(visual)->visualid) {
@ -357,25 +357,28 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings,
G_CALLBACK(&RootWindowGtk::ToolbarSizeAllocated), this);
back_button_ = gtk_tool_button_new(
gtk_image_new_from_icon_name("go-previous", GTK_ICON_SIZE_MENU), NULL);
gtk_image_new_from_icon_name("go-previous", GTK_ICON_SIZE_MENU),
nullptr);
g_signal_connect(back_button_, "clicked",
G_CALLBACK(&RootWindowGtk::BackButtonClicked), this);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), back_button_, -1 /* append */);
forward_button_ = gtk_tool_button_new(
gtk_image_new_from_icon_name("go-next", GTK_ICON_SIZE_MENU), NULL);
gtk_image_new_from_icon_name("go-next", GTK_ICON_SIZE_MENU), nullptr);
g_signal_connect(forward_button_, "clicked",
G_CALLBACK(&RootWindowGtk::ForwardButtonClicked), this);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), forward_button_, -1 /* append */);
reload_button_ = gtk_tool_button_new(
gtk_image_new_from_icon_name("view-refresh", GTK_ICON_SIZE_MENU), NULL);
gtk_image_new_from_icon_name("view-refresh", GTK_ICON_SIZE_MENU),
nullptr);
g_signal_connect(reload_button_, "clicked",
G_CALLBACK(&RootWindowGtk::ReloadButtonClicked), this);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), reload_button_, -1 /* append */);
stop_button_ = gtk_tool_button_new(
gtk_image_new_from_icon_name("process-stop", GTK_ICON_SIZE_MENU), NULL);
gtk_image_new_from_icon_name("process-stop", GTK_ICON_SIZE_MENU),
nullptr);
g_signal_connect(stop_button_, "clicked",
G_CALLBACK(&RootWindowGtk::StopButtonClicked), this);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), stop_button_, -1 /* append */);
@ -496,7 +499,7 @@ void RootWindowGtk::OnSetFullscreen(bool fullscreen) {
CefRefPtr<CefBrowser> browser = GetBrowser();
if (browser) {
scoped_ptr<window_test::WindowTestRunnerGtk> test_runner(
std::unique_ptr<window_test::WindowTestRunnerGtk> test_runner(
new window_test::WindowTestRunnerGtk());
if (fullscreen)
test_runner->Maximize(browser);

View File

@ -7,9 +7,9 @@
#pragma once
#include <gtk/gtk.h>
#include <memory>
#include <string>
#include "include/base/cef_scoped_ptr.h"
#include "tests/cefclient/browser/browser_window.h"
#include "tests/cefclient/browser/root_window.h"
@ -130,7 +130,7 @@ class RootWindowGtk : public RootWindow, public BrowserWindow::Delegate {
bool with_extension_;
bool is_popup_;
CefRect start_rect_;
scoped_ptr<BrowserWindow> browser_window_;
std::unique_ptr<BrowserWindow> browser_window_;
bool initialized_;
// Main window.

View File

@ -6,9 +6,9 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_ROOT_WINDOW_MAC_H_
#pragma once
#include <memory>
#include <string>
#include "include/base/cef_scoped_ptr.h"
#include "tests/cefclient/browser/browser_window.h"
#include "tests/cefclient/browser/root_window.h"

View File

@ -6,7 +6,7 @@
#include <Cocoa/Cocoa.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_app.h"
#include "include/cef_application_mac.h"
#include "tests/cefclient/browser/browser_window_osr_mac.h"
@ -126,7 +126,7 @@ class RootWindowMacImpl
bool with_extension_;
bool is_popup_;
CefRect start_rect_;
scoped_ptr<BrowserWindow> browser_window_;
std::unique_ptr<BrowserWindow> browser_window_;
bool initialized_;
// Main window.
@ -328,7 +328,7 @@ CefRefPtr<CefBrowser> RootWindowMacImpl::GetBrowser() const {
if (browser_window_)
return browser_window_->GetBrowser();
return NULL;
return nullptr;
}
ClientWindowHandle RootWindowMacImpl::GetWindowHandle() const {
@ -487,7 +487,7 @@ void RootWindowMacImpl::CreateRootWindow(const CefBrowserSettings& settings,
// Create the browser window.
browser_window_->CreateBrowser(
CAST_NSVIEW_TO_CEF_WINDOW_HANDLE(contentView),
CefRect(0, 0, width, height), settings, NULL,
CefRect(0, 0, width, height), settings, nullptr,
root_window_.delegate_->GetRequestContext(&root_window_));
} else {
// With popups we already have a browser window. Parent the browser window
@ -564,7 +564,7 @@ void RootWindowMacImpl::OnSetFullscreen(bool fullscreen) {
CefRefPtr<CefBrowser> browser = GetBrowser();
if (browser) {
scoped_ptr<window_test::WindowTestRunnerMac> test_runner(
std::unique_ptr<window_test::WindowTestRunnerMac> test_runner(
new window_test::WindowTestRunnerMac());
if (fullscreen)
test_runner->Maximize(browser);

View File

@ -6,7 +6,7 @@
#include <sstream>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/wrapper/cef_helpers.h"
#include "tests/cefclient/browser/main_context.h"
@ -196,9 +196,7 @@ bool RootWindowManager::HasRootWindowAsExtension(
CefRefPtr<CefExtension> extension) {
REQUIRE_MAIN_THREAD();
RootWindowSet::const_iterator it = root_windows_.begin();
for (; it != root_windows_.end(); ++it) {
const RootWindow* root_window = (*it);
for (auto root_window : root_windows_) {
if (!root_window->WithExtension())
continue;
@ -220,11 +218,10 @@ scoped_refptr<RootWindow> RootWindowManager::GetWindowForBrowser(
int browser_id) const {
REQUIRE_MAIN_THREAD();
RootWindowSet::const_iterator it = root_windows_.begin();
for (; it != root_windows_.end(); ++it) {
CefRefPtr<CefBrowser> browser = (*it)->GetBrowser();
for (auto root_window : root_windows_) {
CefRefPtr<CefBrowser> browser = root_window->GetBrowser();
if (browser.get() && browser->GetIdentifier() == browser_id)
return *it;
return root_window;
}
return nullptr;
}
@ -254,9 +251,9 @@ void RootWindowManager::CloseAllWindows(bool force) {
// in OnRootWindowDestroyed while iterating.
RootWindowSet root_windows = root_windows_;
RootWindowSet::const_iterator it = root_windows.begin();
for (; it != root_windows.end(); ++it)
(*it)->Close(force);
for (auto root_window : root_windows_) {
root_window->Close(force);
}
}
void RootWindowManager::AddExtension(CefRefPtr<CefExtension> extension) {
@ -298,7 +295,7 @@ void RootWindowManager::OnRootWindowCreated(
if (root_windows_.size() == 1U) {
// The first non-extension root window should be considered the active
// window.
OnRootWindowActivated(root_window);
OnRootWindowActivated(root_window.get());
}
}
}
@ -306,9 +303,7 @@ void RootWindowManager::OnRootWindowCreated(
void RootWindowManager::NotifyExtensionsChanged() {
REQUIRE_MAIN_THREAD();
RootWindowSet::const_iterator it = root_windows_.begin();
for (; it != root_windows_.end(); ++it) {
RootWindow* root_window = *it;
for (auto root_window : root_windows_) {
if (!root_window->WithExtension())
root_window->OnExtensionsChanged(extensions_);
}
@ -335,7 +330,7 @@ CefRefPtr<CefRequestContext> RootWindowManager::GetRequestContext(
// isolated context objects.
std::stringstream ss;
ss << command_line->GetSwitchValue(switches::kCachePath).ToString()
<< file_util::kPathSep << time(NULL);
<< file_util::kPathSep << time(nullptr);
CefString(&settings.cache_path) = ss.str();
}
}
@ -410,7 +405,7 @@ void RootWindowManager::OnRootWindowActivated(RootWindow* root_window) {
{
base::AutoLock lock_scope(active_browser_lock_);
// May be NULL at this point, in which case we'll make the association in
// May be nullptr at this point, in which case we'll make the association in
// OnBrowserCreated.
active_browser_ = active_root_window_->GetBrowser();
}

View File

@ -6,9 +6,9 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_ROOT_WINDOW_MANAGER_H_
#pragma once
#include <memory>
#include <set>
#include "include/base/cef_scoped_ptr.h"
#include "include/cef_command_line.h"
#include "include/cef_request_context_handler.h"
#include "tests/cefclient/browser/image_cache.h"
@ -62,12 +62,12 @@ class RootWindowManager : public RootWindow::Delegate {
// called on the main thread.
scoped_refptr<RootWindow> GetWindowForBrowser(int browser_id) const;
// Returns the currently active/foreground RootWindow. May return NULL. Must
// be called on the main thread.
// Returns the currently active/foreground RootWindow. May return nullptr.
// Must be called on the main thread.
scoped_refptr<RootWindow> GetActiveRootWindow() const;
// Returns the currently active/foreground browser. May return NULL. Safe to
// call from any thread.
// Returns the currently active/foreground browser. May return nullptr. Safe
// to call from any thread.
CefRefPtr<CefBrowser> GetActiveBrowser() const;
// Close all existing windows. If |force| is true onunload handlers will not
@ -83,8 +83,8 @@ class RootWindowManager : public RootWindow::Delegate {
}
private:
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<RootWindowManager>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<RootWindowManager>;
~RootWindowManager();
@ -127,7 +127,7 @@ class RootWindowManager : public RootWindow::Delegate {
CefRefPtr<CefBrowser> active_browser_;
// Singleton window used as the temporary parent for popup browsers.
scoped_ptr<TempWindow> temp_window_;
std::unique_ptr<TempWindow> temp_window_;
CefRefPtr<CefRequestContext> shared_request_context_;

View File

@ -4,8 +4,9 @@
#include "tests/cefclient/browser/root_window_views.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_cxx17_backports.h"
#include "include/cef_app.h"
#include "include/wrapper/cef_helpers.h"
#include "tests/cefclient/browser/client_handler_std.h"
@ -178,7 +179,7 @@ ClientWindowHandle RootWindowViews::GetWindowHandle() const {
REQUIRE_MAIN_THREAD();
#if defined(OS_LINUX)
// ClientWindowHandle is a GtkWidget* on Linux and we don't have one of those.
return NULL;
return nullptr;
#else
if (browser_)
return browser_->GetHost()->GetWindowHandle();
@ -490,7 +491,7 @@ void RootWindowViews::InitOnUIThread(
// Populate the default image cache.
ImageCache::ImageInfoSet image_set;
for (size_t i = 0U; i < arraysize(kDefaultImageCache); ++i)
for (size_t i = 0U; i < base::size(kDefaultImageCache); ++i)
image_set.push_back(ImageCache::ImageInfo::Create2x(kDefaultImageCache[i]));
image_cache_->LoadImages(
@ -508,8 +509,8 @@ void RootWindowViews::CreateViewsWindow(
#ifndef NDEBUG
// Make sure the default images loaded successfully.
DCHECK_EQ(images.size(), arraysize(kDefaultImageCache));
for (size_t i = 0U; i < arraysize(kDefaultImageCache); ++i) {
DCHECK_EQ(images.size(), base::size(kDefaultImageCache));
for (size_t i = 0U; i < base::size(kDefaultImageCache); ++i) {
DCHECK(images[i]) << "Default image " << i << " failed to load";
}
#endif

View File

@ -6,9 +6,9 @@
#define CEF_TESTS_CEFCLIENT_BROWSER_ROOT_WINDOW_VIEWS_H_
#pragma once
#include <memory>
#include <string>
#include "include/base/cef_scoped_ptr.h"
#include "tests/cefclient/browser/client_handler.h"
#include "tests/cefclient/browser/root_window.h"
#include "tests/cefclient/browser/views_window.h"

View File

@ -6,8 +6,8 @@
#include <shellscalingapi.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/cef_app.h"
#include "tests/cefclient/browser/browser_window_osr_win.h"
#include "tests/cefclient/browser/browser_window_std_win.h"
@ -109,19 +109,19 @@ RootWindowWin::RootWindowWin()
is_popup_(false),
start_rect_(),
initialized_(false),
hwnd_(NULL),
draggable_region_(NULL),
font_(NULL),
hwnd_(nullptr),
draggable_region_(nullptr),
font_(nullptr),
font_height_(0),
back_hwnd_(NULL),
forward_hwnd_(NULL),
reload_hwnd_(NULL),
stop_hwnd_(NULL),
edit_hwnd_(NULL),
edit_wndproc_old_(NULL),
find_hwnd_(NULL),
back_hwnd_(nullptr),
forward_hwnd_(nullptr),
reload_hwnd_(nullptr),
stop_hwnd_(nullptr),
edit_hwnd_(nullptr),
edit_wndproc_old_(nullptr),
find_hwnd_(nullptr),
find_message_id_(0),
find_wndproc_old_(NULL),
find_wndproc_old_(nullptr),
find_state_(),
find_next_(false),
find_match_case_last_(false),
@ -248,7 +248,7 @@ void RootWindowWin::SetBounds(int x, int y, size_t width, size_t height) {
REQUIRE_MAIN_THREAD();
if (hwnd_) {
SetWindowPos(hwnd_, NULL, x, y, static_cast<int>(width),
SetWindowPos(hwnd_, nullptr, x, y, static_cast<int>(width),
static_cast<int>(height), SWP_NOZORDER);
}
}
@ -319,7 +319,7 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings,
REQUIRE_MAIN_THREAD();
DCHECK(!hwnd_);
HINSTANCE hInstance = GetModuleHandle(NULL);
HINSTANCE hInstance = GetModuleHandle(nullptr);
// Load strings from the resource file.
const std::wstring& window_title = GetResourceString(IDS_APP_TITLE);
@ -367,7 +367,7 @@ void RootWindowWin::CreateRootWindow(const CefBrowserSettings& settings,
// Create the main window initially hidden.
CreateWindowEx(dwExStyle, window_class.c_str(), window_title.c_str(), dwStyle,
x, y, width, height, NULL, NULL, hInstance, this);
x, y, width, height, nullptr, nullptr, hInstance, this);
CHECK(hwnd_);
if (!called_enable_non_client_dpi_scaling_ && IsProcessPerMonitorDpiAware()) {
@ -408,7 +408,7 @@ void RootWindowWin::RegisterRootClass(HINSTANCE hInstance,
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CEFCLIENT));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = background_brush;
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CEFCLIENT);
wcex.lpszClassName = window_class.c_str();
@ -447,8 +447,8 @@ LRESULT CALLBACK RootWindowWin::EditWndProc(HWND hWnd,
break;
case WM_NCDESTROY:
// Clear the reference to |self|.
SetUserDataPtr(hWnd, NULL);
self->edit_hwnd_ = NULL;
SetUserDataPtr(hWnd, nullptr);
self->edit_hwnd_ = nullptr;
break;
}
@ -469,13 +469,13 @@ LRESULT CALLBACK RootWindowWin::FindWndProc(HWND hWnd,
switch (message) {
case WM_ACTIVATE:
// Set this dialog as current when activated.
MainMessageLoop::Get()->SetCurrentModelessDialog(wParam == 0 ? NULL
MainMessageLoop::Get()->SetCurrentModelessDialog(wParam == 0 ? nullptr
: hWnd);
return FALSE;
case WM_NCDESTROY:
// Clear the reference to |self|.
SetUserDataPtr(hWnd, NULL);
self->find_hwnd_ = NULL;
SetUserDataPtr(hWnd, nullptr);
self->find_hwnd_ = nullptr;
break;
}
@ -607,8 +607,8 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd,
case WM_NCDESTROY:
// Clear the reference to |self|.
SetUserDataPtr(hWnd, NULL);
self->hwnd_ = NULL;
SetUserDataPtr(hWnd, nullptr);
self->hwnd_ = nullptr;
self->OnDestroyed();
break;
}
@ -683,30 +683,30 @@ void RootWindowWin::OnSize(bool minimized) {
int x_offset = rect.left;
// |browser_hwnd| may be NULL if the browser has not yet been created.
HWND browser_hwnd = NULL;
// |browser_hwnd| may be nullptr if the browser has not yet been created.
HWND browser_hwnd = nullptr;
if (browser_window_)
browser_hwnd = browser_window_->GetWindowHandle();
// Resize all controls.
HDWP hdwp = BeginDeferWindowPos(browser_hwnd ? 6 : 5);
hdwp = DeferWindowPos(hdwp, back_hwnd_, NULL, x_offset, 0, button_width,
hdwp = DeferWindowPos(hdwp, back_hwnd_, nullptr, x_offset, 0, button_width,
urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, forward_hwnd_, NULL, x_offset, 0, button_width,
hdwp = DeferWindowPos(hdwp, forward_hwnd_, nullptr, x_offset, 0,
button_width, urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, reload_hwnd_, nullptr, x_offset, 0,
button_width, urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, stop_hwnd_, nullptr, x_offset, 0, button_width,
urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, reload_hwnd_, NULL, x_offset, 0, button_width,
urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, stop_hwnd_, NULL, x_offset, 0, button_width,
urlbar_height, SWP_NOZORDER);
x_offset += button_width;
hdwp = DeferWindowPos(hdwp, edit_hwnd_, NULL, x_offset, 0,
hdwp = DeferWindowPos(hdwp, edit_hwnd_, nullptr, x_offset, 0,
rect.right - x_offset, urlbar_height, SWP_NOZORDER);
if (browser_hwnd) {
hdwp = DeferWindowPos(hdwp, browser_hwnd, NULL, rect.left, rect.top,
hdwp = DeferWindowPos(hdwp, browser_hwnd, nullptr, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
SWP_NOZORDER);
}
@ -849,7 +849,7 @@ void RootWindowWin::OnFindEvent() {
void RootWindowWin::OnAbout() {
// Show the about box.
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd_,
DialogBox(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd_,
AboutWndProc);
}
@ -936,7 +936,7 @@ void RootWindowWin::OnCreate(LPCREATESTRUCT lpCreateStruct) {
}
} else {
// No controls so also remove the default menu.
::SetMenu(hwnd_, NULL);
::SetMenu(hwnd_, nullptr);
}
const float device_scale_factor = GetWindowScaleFactor(hwnd_);
@ -1032,7 +1032,7 @@ void RootWindowWin::OnSetFullscreen(bool fullscreen) {
CefRefPtr<CefBrowser> browser = GetBrowser();
if (browser) {
scoped_ptr<window_test::WindowTestRunnerWin> test_runner(
std::unique_ptr<window_test::WindowTestRunnerWin> test_runner(
new window_test::WindowTestRunnerWin());
if (fullscreen)
test_runner->Maximize(browser);
@ -1058,7 +1058,7 @@ void RootWindowWin::OnAutoResize(const CefSize& new_size) {
LogicalToDevice(new_size.height, device_scale_factor)};
DWORD style = GetWindowLong(hwnd_, GWL_STYLE);
DWORD ex_style = GetWindowLong(hwnd_, GWL_EXSTYLE);
bool has_menu = !(style & WS_CHILD) && (GetMenu(hwnd_) != NULL);
bool has_menu = !(style & WS_CHILD) && (GetMenu(hwnd_) != nullptr);
// The size value is for the client area. Calculate the whole window size
// based on the current style.
@ -1066,7 +1066,7 @@ void RootWindowWin::OnAutoResize(const CefSize& new_size) {
// Size the window. The left/top values may be negative.
// Also show the window if it's not currently visible.
SetWindowPos(hwnd_, NULL, 0, 0, rect.right - rect.left,
SetWindowPos(hwnd_, nullptr, 0, 0, rect.right - rect.left,
rect.bottom - rect.top,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}

View File

@ -10,9 +10,9 @@
#include <commdlg.h>
#include <memory>
#include <string>
#include "include/base/cef_scoped_ptr.h"
#include "tests/cefclient/browser/browser_window.h"
#include "tests/cefclient/browser/root_window.h"
@ -117,7 +117,7 @@ class RootWindowWin : public RootWindow, public BrowserWindow::Delegate {
bool with_extension_;
bool is_popup_;
RECT start_rect_;
scoped_ptr<BrowserWindow> browser_window_;
std::unique_ptr<BrowserWindow> browser_window_;
CefBrowserSettings browser_settings_;
bool initialized_;

View File

@ -7,7 +7,7 @@
#include <algorithm>
#include <string>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_weak_ptr.h"
#include "include/cef_parser.h"
#include "include/cef_server.h"

View File

@ -22,13 +22,13 @@ class TempWindowMac {
private:
// A single instance will be created/owned by RootWindowManager.
friend class RootWindowManager;
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<TempWindowMac>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<TempWindowMac>;
TempWindowMac();
~TempWindowMac();
scoped_ptr<TempWindowMacImpl> impl_;
std::unique_ptr<TempWindowMacImpl> impl_;
DISALLOW_COPY_AND_ASSIGN(TempWindowMac);
};

View File

@ -13,7 +13,7 @@ namespace client {
namespace {
TempWindowMac* g_temp_window = NULL;
TempWindowMac* g_temp_window = nullptr;
} // namespace
@ -46,7 +46,7 @@ TempWindowMac::TempWindowMac() {
TempWindowMac::~TempWindowMac() {
impl_.reset();
g_temp_window = NULL;
g_temp_window = nullptr;
}
// static

View File

@ -16,7 +16,7 @@ const wchar_t kWndClass[] = L"Client_TempWindow";
// Create the temp window.
HWND CreateTempWindow() {
HINSTANCE hInstance = ::GetModuleHandle(NULL);
HINSTANCE hInstance = ::GetModuleHandle(nullptr);
WNDCLASSEX wc = {0};
wc.cbSize = sizeof(wc);
@ -27,14 +27,14 @@ HWND CreateTempWindow() {
// Create a 1x1 pixel hidden window.
return CreateWindow(kWndClass, 0, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, 0, 0,
1, 1, NULL, NULL, hInstance, NULL);
1, 1, nullptr, nullptr, hInstance, nullptr);
}
TempWindowWin* g_temp_window = nullptr;
} // namespace
TempWindowWin::TempWindowWin() : hwnd_(NULL) {
TempWindowWin::TempWindowWin() : hwnd_(nullptr) {
DCHECK(!g_temp_window);
g_temp_window = this;

View File

@ -20,8 +20,8 @@ class TempWindowWin {
private:
// A single instance will be created/owned by RootWindowManager.
friend class RootWindowManager;
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<TempWindowWin>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<TempWindowWin>;
TempWindowWin();
~TempWindowWin();

View File

@ -20,8 +20,8 @@ class TempWindowX11 {
private:
// A single instance will be created/owned by RootWindowManager.
friend class RootWindowManager;
// Allow deletion via scoped_ptr only.
friend struct base::DefaultDeleter<TempWindowX11>;
// Allow deletion via std::unique_ptr only.
friend std::default_delete<TempWindowX11>;
TempWindowX11();
~TempWindowX11();

View File

@ -8,7 +8,7 @@
#include <set>
#include <sstream>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_parser.h"
#include "include/cef_task.h"
#include "include/cef_trace.h"

View File

@ -71,7 +71,7 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
}
- (void)detach {
browser_ = NULL;
browser_ = nullptr;
}
- (NSArray*)validAttributesForMarkedText {
@ -226,8 +226,8 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
- (NSRect)firstRectForCharacterRange:(NSRange)theRange
actualRange:(NSRangePointer)actualRange {
NSRect rect =
[self firstViewRectForCharacterRange:theRange actualRange:actualRange];
NSRect rect = [self firstViewRectForCharacterRange:theRange
actualRange:actualRange];
// Convert into screen coordinates for return.
rect = [self screenRectFromViewRect:rect];

View File

@ -6,7 +6,6 @@
#include <string>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/cef_urlrequest.h"

View File

@ -47,11 +47,11 @@ class ViewsMenuBar : public CefMenuButtonDelegate, public CefMenuModelDelegate {
// Returns the CefPanel that represents the menu bar.
CefRefPtr<CefPanel> GetMenuPanel();
// Create a new menu with the specified |label|. If |menu_id| is non-NULL it
// will be populated with the new menu ID.
// Create a new menu with the specified |label|. If |menu_id| is non-nullptr
// it will be populated with the new menu ID.
CefRefPtr<CefMenuModel> CreateMenuModel(const CefString& label, int* menu_id);
// Returns the menu with the specified |menu_id|, or NULL if no such menu
// Returns the menu with the specified |menu_id|, or nullptr if no such menu
// exists.
CefRefPtr<CefMenuModel> GetMenuModel(int menu_id) const;

View File

@ -6,8 +6,8 @@
#include <algorithm>
#include "include/base/cef_bind.h"
#include "include/base/cef_build.h"
#include "include/base/cef_callback.h"
#include "include/cef_app.h"
#include "include/views/cef_box_layout.h"
#include "include/wrapper/cef_helpers.h"
@ -313,7 +313,7 @@ void ViewsWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
image_set.push_back(
ImageCache::ImageInfo::Create1x(icon_path, icon_path, internal));
} else {
// Get a NULL image and use the default icon.
// Get a nullptr image and use the default icon.
image_set.push_back(ImageCache::ImageInfo::Empty());
}
}

View File

@ -174,7 +174,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
private:
// |delegate| is guaranteed to outlive this object.
// |browser_view| may be NULL, in which case SetBrowserView() will be called.
// |browser_view| may be nullptr, in which case SetBrowserView() will be
// called.
ViewsWindow(Delegate* delegate, CefRefPtr<CefBrowserView> browser_view);
void SetBrowserView(CefRefPtr<CefBrowserView> browser_view);

View File

@ -9,7 +9,7 @@
#include <string>
#include <vector>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "tests/cefclient/browser/main_context.h"
#include "tests/cefclient/browser/test_runner.h"
@ -39,18 +39,18 @@ const char kMessageMaximizeName[] = "WindowTest.Maximize";
const char kMessageRestoreName[] = "WindowTest.Restore";
// Create the appropriate platform test runner object.
scoped_ptr<WindowTestRunner> CreateWindowTestRunner() {
std::unique_ptr<WindowTestRunner> CreateWindowTestRunner() {
#if defined(OS_WIN) || defined(OS_LINUX)
if (MainContext::Get()->UseViews())
return scoped_ptr<WindowTestRunner>(new WindowTestRunnerViews());
return std::make_unique<WindowTestRunnerViews>();
#endif
#if defined(OS_WIN)
return scoped_ptr<WindowTestRunner>(new WindowTestRunnerWin());
return std::make_unique<WindowTestRunnerWin>();
#elif defined(OS_LINUX)
return scoped_ptr<WindowTestRunner>(new WindowTestRunnerGtk());
return std::make_unique<WindowTestRunnerGtk>();
#elif defined(OS_MAC)
return scoped_ptr<WindowTestRunner>(new WindowTestRunnerMac());
return std::make_unique<WindowTestRunnerMac>();
#else
#error "No implementation available for your platform."
#endif
@ -109,7 +109,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
}
private:
scoped_ptr<WindowTestRunner> runner_;
std::unique_ptr<WindowTestRunner> runner_;
};
} // namespace

View File

@ -65,7 +65,7 @@ void SetPosImpl(CefRefPtr<CefBrowser> browser,
::ShowWindow(root_hwnd, SW_RESTORE);
} else {
// Set the window position.
::SetWindowPos(root_hwnd, NULL, window_rect.x, window_rect.y,
::SetWindowPos(root_hwnd, nullptr, window_rect.x, window_rect.y,
window_rect.width, window_rect.height, SWP_NOZORDER);
}
}

View File

@ -10,10 +10,10 @@
#include <stdlib.h>
#include <unistd.h>
#include <memory>
#include <string>
#include "include/base/cef_logging.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/cef_app.h"
#include "include/cef_command_line.h"
#include "include/wrapper/cef_helpers.h"
@ -83,7 +83,7 @@ int RunMain(int argc, char* argv[]) {
return exit_code;
// Create the main context object.
scoped_ptr<MainContextImpl> context(new MainContextImpl(command_line, true));
auto context = std::make_unique<MainContextImpl>(command_line, true);
CefSettings settings;
@ -105,7 +105,7 @@ int RunMain(int argc, char* argv[]) {
}
// Create the main message loop object.
scoped_ptr<MainMessageLoop> message_loop;
std::unique_ptr<MainMessageLoop> message_loop;
if (settings.multi_threaded_message_loop)
message_loop.reset(new MainMessageLoopMultithreadedGtk);
else if (settings.external_message_pump)

View File

@ -381,7 +381,7 @@ int RunMain(int argc, char* argv[]) {
app = new ClientAppBrowser();
// Create the main context object.
scoped_ptr<MainContextImpl> context(
std::unique_ptr<MainContextImpl> context(
new MainContextImpl(command_line, true));
CefSettings settings;
@ -397,14 +397,14 @@ int RunMain(int argc, char* argv[]) {
context->PopulateSettings(&settings);
// Create the main message loop object.
scoped_ptr<MainMessageLoop> message_loop;
std::unique_ptr<MainMessageLoop> message_loop;
if (settings.external_message_pump)
message_loop = MainMessageLoopExternalPump::Create();
else
message_loop.reset(new MainMessageLoopStd);
// Initialize CEF.
context->Initialize(main_args, settings, app, NULL);
context->Initialize(main_args, settings, app, nullptr);
// Register scheme handlers.
test_runner::RegisterSchemeHandlers();

View File

@ -4,7 +4,8 @@
#include <windows.h>
#include "include/base/cef_scoped_ptr.h"
#include <memory>
#include "include/cef_command_line.h"
#include "include/cef_sandbox_win.h"
#include "tests/cefclient/browser/main_context_impl.h"
@ -68,7 +69,7 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) {
return exit_code;
// Create the main context object.
scoped_ptr<MainContextImpl> context(new MainContextImpl(command_line, true));
auto context = std::make_unique<MainContextImpl>(command_line, true);
CefSettings settings;
@ -84,7 +85,7 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) {
context->PopulateSettings(&settings);
// Create the main message loop object.
scoped_ptr<MainMessageLoop> message_loop;
std::unique_ptr<MainMessageLoop> message_loop;
if (settings.multi_threaded_message_loop)
message_loop.reset(new MainMessageLoopMultithreadedWin);
else if (settings.external_message_pump)

View File

@ -158,7 +158,7 @@ int main(int argc, char* argv[]) {
CefRefPtr<SimpleApp> app(new SimpleApp);
// Initialize CEF for the browser process.
CefInitialize(main_args, settings, app.get(), NULL);
CefInitialize(main_args, settings, app.get(), nullptr);
// Create the application delegate.
NSObject* delegate = [[SimpleAppDelegate alloc] init];

View File

@ -119,7 +119,7 @@ void SimpleApp::OnContextInitialized() {
#if defined(OS_WIN)
// On Windows we need to specify certain flags that will be passed to
// CreateWindowEx().
window_info.SetAsPopup(NULL, "cefsimple");
window_info.SetAsPopup(nullptr, "cefsimple");
#endif
// Create the first browser window.

View File

@ -7,7 +7,7 @@
#include <sstream>
#include <string>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_app.h"
#include "include/cef_parser.h"
#include "include/views/cef_browser_view.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/test_handler.h"
#include "tests/gtest/include/gtest/gtest.h"

View File

@ -4,7 +4,7 @@
#include <vector>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_ref_counted.h"
#include "include/cef_cookie.h"

View File

@ -6,7 +6,7 @@
#include <set>
#include <vector>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_callback.h"
#include "include/cef_origin_whitelist.h"
#include "include/cef_scheme.h"

View File

@ -5,7 +5,8 @@
#include <algorithm>
#include <sstream>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_callback_helpers.h"
#include "include/cef_callback.h"
#include "include/cef_devtools_message_observer.h"
#include "include/cef_parser.h"
@ -281,7 +282,7 @@ class DevToolsMessageTestHandler : public TestHandler {
// STEP 3: Page domain notifications are enabled. Now start a new
// navigation (but do nothing on method result) and wait for the
// "Page.frameNavigated" event.
ExecuteMethod("Page.navigate", params.str(), base::Bind(base::DoNothing),
ExecuteMethod("Page.navigate", params.str(), base::DoNothing(),
/*expected_result=*/"{\"frameId\":");
}

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/test_handler.h"
#include "tests/ceftests/test_util.h"

View File

@ -4,7 +4,7 @@
#include <list>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/routing_test_handler.h"
#include "tests/ceftests/test_handler.h"

View File

@ -8,7 +8,7 @@
#include <sstream>
#include <string>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/routing_test_handler.h"
#include "tests/ceftests/test_handler.h"
@ -1483,7 +1483,8 @@ class ParentOrderMainTestHandler : public OrderMainTestHandler {
CefRefPtr<PopupOrderMainTestHandler> popup_handler)
: OrderMainTestHandler(completion_state), popup_handler_(popup_handler) {}
bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
bool OnBeforePopup(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& target_url,
const CefString& target_frame_name,
@ -1541,8 +1542,8 @@ void RunOrderMainPopupTest(bool cross_origin) {
CefRefPtr<ParentOrderMainTestHandler> parent_handler =
new ParentOrderMainTestHandler(&completion_state, popup_handler);
collection.AddTestHandler(popup_handler);
collection.AddTestHandler(parent_handler);
collection.AddTestHandler(popup_handler.get());
collection.AddTestHandler(parent_handler.get());
collection.ExecuteTests();
ReleaseAndWaitForDestructor(parent_handler);

View File

@ -2,8 +2,9 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_scoped_ptr.h"
#include <memory>
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "tests/ceftests/test_handler.h"
@ -222,7 +223,7 @@ class FrameNavExpectationsFactoryBrowser : public FrameNavExpectationsFactory {
FrameNavExpectationsFactoryBrowser() {}
// Create a new factory instance of the specified type.
static scoped_ptr<FrameNavExpectationsFactoryBrowser> FromID(
static std::unique_ptr<FrameNavExpectationsFactoryBrowser> FromID(
FrameNavFactoryId id);
// Returns true if there will be more navigations in the browser process
@ -232,18 +233,17 @@ class FrameNavExpectationsFactoryBrowser : public FrameNavExpectationsFactory {
// Verify final expectations results.
virtual bool Finalize() = 0;
scoped_ptr<FrameNavExpectationsBrowser> Create(
std::unique_ptr<FrameNavExpectationsBrowser> Create(
int nav,
const FrameNavExpectations::CompletionCallback& completion_callback) {
scoped_ptr<FrameNavExpectationsBrowser> expectations;
expectations = Create(nav);
auto expectations = Create(nav);
expectations->set_completion_callback(completion_callback);
return expectations.Pass();
return expectations;
}
protected:
// Implement in the test-specific factory instance.
virtual scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) = 0;
virtual std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) = 0;
};
// Renderer process expectations factory abstact base class.
@ -252,21 +252,20 @@ class FrameNavExpectationsFactoryRenderer : public FrameNavExpectationsFactory {
FrameNavExpectationsFactoryRenderer() {}
// Create a new factory instance of the specified type.
static scoped_ptr<FrameNavExpectationsFactoryRenderer> FromID(
static std::unique_ptr<FrameNavExpectationsFactoryRenderer> FromID(
FrameNavFactoryId id);
scoped_ptr<FrameNavExpectationsRenderer> Create(
std::unique_ptr<FrameNavExpectationsRenderer> Create(
int nav,
const FrameNavExpectations::CompletionCallback& completion_callback) {
scoped_ptr<FrameNavExpectationsRenderer> expectations;
expectations = Create(nav);
auto expectations = Create(nav);
expectations->set_completion_callback(completion_callback);
return expectations.Pass();
return expectations;
}
protected:
// Implement in the test-specific factory instance.
virtual scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) = 0;
virtual std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) = 0;
};
// Renderer side handler.
@ -361,8 +360,8 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate,
bool run_test_;
int nav_;
scoped_ptr<FrameNavExpectationsFactoryRenderer> factory_;
scoped_ptr<FrameNavExpectationsRenderer> expectations_;
std::unique_ptr<FrameNavExpectationsFactoryRenderer> factory_;
std::unique_ptr<FrameNavExpectationsRenderer> expectations_;
IMPLEMENT_REFCOUNTING(FrameNavRendererTest);
};
@ -514,8 +513,8 @@ class FrameNavTestHandler : public TestHandler {
int nav_;
TrackCallback got_destroyed_;
scoped_ptr<FrameNavExpectationsFactoryBrowser> factory_;
scoped_ptr<FrameNavExpectationsBrowser> expectations_;
std::unique_ptr<FrameNavExpectationsFactoryBrowser> factory_;
std::unique_ptr<FrameNavExpectationsBrowser> expectations_;
IMPLEMENT_REFCOUNTING(FrameNavTestHandler);
};
@ -795,11 +794,11 @@ class FrameNavExpectationsFactoryBrowserTestSingleNavHarness
}
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
EXPECT_FALSE(got_create_);
got_create_.yes();
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestSingleNavHarness(nav));
return std::make_unique<FrameNavExpectationsBrowserTestSingleNavHarness>(
nav);
}
private:
@ -816,9 +815,9 @@ class FrameNavExpectationsFactoryRendererTestSingleNavHarness
FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV_HARNESS; }
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestSingleNavHarness(nav));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestSingleNavHarness>(
nav);
}
};
@ -1014,9 +1013,8 @@ class FrameNavExpectationsFactoryBrowserTestSingleNav
bool Finalize() override { return true; }
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestSingleNav(nav));
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
return std::make_unique<FrameNavExpectationsBrowserTestSingleNav>(nav);
}
};
@ -1028,9 +1026,8 @@ class FrameNavExpectationsFactoryRendererTestSingleNav
FrameNavFactoryId GetID() const override { return FNF_ID_SINGLE_NAV; }
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestSingleNav(nav));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestSingleNav>(nav);
}
};
@ -1340,10 +1337,10 @@ class FrameNavExpectationsFactoryBrowserTestMultiNavHarness
}
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
create_count_++;
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestMultiNavHarness(nav));
return std::make_unique<FrameNavExpectationsBrowserTestMultiNavHarness>(
nav);
}
private:
@ -1360,9 +1357,9 @@ class FrameNavExpectationsFactoryRendererTestMultiNavHarness
FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV_HARNESS; }
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestMultiNavHarness(nav));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestMultiNavHarness>(
nav);
}
};
@ -1570,10 +1567,9 @@ class FrameNavExpectationsFactoryBrowserTestMultiNav
}
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
nav_count_++;
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestMultiNav(nav));
return std::make_unique<FrameNavExpectationsBrowserTestMultiNav>(nav);
}
private:
@ -1588,9 +1584,8 @@ class FrameNavExpectationsFactoryRendererTestMultiNav
FrameNavFactoryId GetID() const override { return FNF_ID_MULTI_NAV; }
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestMultiNav(nav));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestMultiNav>(nav);
}
};
@ -2146,10 +2141,10 @@ class FrameNavExpectationsFactoryBrowserTestNestedIframesSameOrigin
}
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
create_count_++;
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestNestedIframes(nav, true));
return std::make_unique<FrameNavExpectationsBrowserTestNestedIframes>(nav,
true);
}
private:
@ -2166,9 +2161,9 @@ class FrameNavExpectationsFactoryRendererTestNestedIframesSameOrigin
}
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestNestedIframes(nav, true));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestNestedIframes>(
nav, true);
}
};
@ -2200,10 +2195,10 @@ class FrameNavExpectationsFactoryBrowserTestNestedIframesDiffOrigin
}
protected:
scoped_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
std::unique_ptr<FrameNavExpectationsBrowser> Create(int nav) override {
create_count_++;
return scoped_ptr<FrameNavExpectationsBrowser>(
new FrameNavExpectationsBrowserTestNestedIframes(nav, false));
return std::make_unique<FrameNavExpectationsBrowserTestNestedIframes>(
nav, false);
}
private:
@ -2220,9 +2215,9 @@ class FrameNavExpectationsFactoryRendererTestNestedIframesDiffOrigin
}
protected:
scoped_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return scoped_ptr<FrameNavExpectationsRenderer>(
new FrameNavExpectationsRendererTestNestedIframes(nav, false));
std::unique_ptr<FrameNavExpectationsRenderer> Create(int nav) override {
return std::make_unique<FrameNavExpectationsRendererTestNestedIframes>(
nav, false);
}
};
@ -2237,9 +2232,9 @@ namespace {
// must be listed here.
// static
scoped_ptr<FrameNavExpectationsFactoryBrowser>
std::unique_ptr<FrameNavExpectationsFactoryBrowser>
FrameNavExpectationsFactoryBrowser::FromID(FrameNavFactoryId id) {
scoped_ptr<FrameNavExpectationsFactoryBrowser> factory;
std::unique_ptr<FrameNavExpectationsFactoryBrowser> factory;
switch (id) {
case FNF_ID_SINGLE_NAV_HARNESS:
factory.reset(new FrameNavExpectationsFactoryBrowserTestSingleNavHarness);
@ -2266,13 +2261,13 @@ FrameNavExpectationsFactoryBrowser::FromID(FrameNavFactoryId id) {
}
EXPECT_TRUE(factory);
EXPECT_EQ(id, factory->GetID());
return factory.Pass();
return factory;
}
// static
scoped_ptr<FrameNavExpectationsFactoryRenderer>
std::unique_ptr<FrameNavExpectationsFactoryRenderer>
FrameNavExpectationsFactoryRenderer::FromID(FrameNavFactoryId id) {
scoped_ptr<FrameNavExpectationsFactoryRenderer> factory;
std::unique_ptr<FrameNavExpectationsFactoryRenderer> factory;
switch (id) {
case FNF_ID_SINGLE_NAV_HARNESS:
factory.reset(
@ -2300,7 +2295,7 @@ FrameNavExpectationsFactoryRenderer::FromID(FrameNavFactoryId id) {
}
EXPECT_TRUE(factory);
EXPECT_EQ(id, factory->GetID());
return factory.Pass();
return factory;
}
} // namespace

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/test/cef_test_helpers.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/test_handler.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/test/cef_test_helpers.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/routing_test_handler.h"

View File

@ -7,7 +7,7 @@
#include <sstream>
#include <vector>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_weak_ptr.h"
#include "include/cef_v8.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -5,7 +5,7 @@
#include <algorithm>
#include <list>
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_callback.h"
#include "include/cef_scheme.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/base/cef_logging.h"
#include "include/cef_parser.h"
#include "include/cef_v8.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_accessibility_handler.h"
#include "include/cef_parser.h"
#include "include/cef_waitable_event.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/wrapper/cef_closure_task.h"
#include "tests/ceftests/routing_test_handler.h"
@ -312,7 +312,7 @@ class OsrPopupJSOtherCefClient : public CefClient,
public CefLifeSpanHandler,
public CefRenderHandler {
public:
OsrPopupJSOtherCefClient() { handler_ = NULL; }
OsrPopupJSOtherCefClient() { handler_ = nullptr; }
void SetHandler(CefRefPtr<OsrPopupJSOtherClientTestHandler> handler) {
handler_ = handler;

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_pack_resources.h"
#include "include/cef_request_context_handler.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_request_context_handler.h"
#include "include/cef_waitable_event.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_process_message.h"
#include "include/cef_task.h"
#include "include/wrapper/cef_closure_task.h"

View File

@ -2,7 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/base/cef_bind.h"
#include "include/base/cef_callback.h"
#include "include/cef_request_context.h"
#include "include/cef_request_context_handler.h"
#include "include/wrapper/cef_closure_task.h"

Some files were not shown because too many files have changed in this diff Show More