Remove DISALLOW_ macro from libcef_dll/ (see issue #3234)
Also perform related C++ cleanup: - Use =default instead of {} for default implementations of constructors/destructors. - Replace typedef with using.
This commit is contained in:
parent
9484d6528c
commit
1eb55cbba8
|
@ -38,7 +38,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_lock.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
|
@ -57,6 +56,9 @@ class CefByteReadHandler : public CefReadHandler {
|
|||
size_t size,
|
||||
CefRefPtr<CefBaseRefCounted> source);
|
||||
|
||||
CefByteReadHandler(const CefByteReadHandler&) = delete;
|
||||
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
|
||||
|
||||
// CefReadHandler methods.
|
||||
virtual size_t Read(void* ptr, size_t size, size_t n) override;
|
||||
virtual int Seek(int64 offset, int whence) override;
|
||||
|
@ -73,7 +75,6 @@ class CefByteReadHandler : public CefReadHandler {
|
|||
base::Lock lock_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefByteReadHandler);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefByteReadHandler);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_callback_forward.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_task.h"
|
||||
|
||||
///
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
#include "include/base/cef_bind.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_task.h"
|
||||
|
||||
#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI));
|
||||
|
@ -140,6 +139,10 @@ class CefScopedArgArray {
|
|||
}
|
||||
array_[argc] = NULL;
|
||||
}
|
||||
|
||||
CefScopedArgArray(const CefScopedArgArray&) = delete;
|
||||
CefScopedArgArray& operator=(const CefScopedArgArray&) = delete;
|
||||
|
||||
~CefScopedArgArray() { delete[] array_; }
|
||||
|
||||
char** array() const { return array_; }
|
||||
|
@ -150,8 +153,6 @@ class CefScopedArgArray {
|
|||
// Keep values in a vector separate from |array_| because various users may
|
||||
// modify |array_| and we still want to clean up memory properly.
|
||||
std::vector<std::string> values_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#ifdef __cplusplus
|
||||
#include <string>
|
||||
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
|
@ -99,6 +97,10 @@ int cef_unload_library();
|
|||
class CefScopedLibraryLoader {
|
||||
public:
|
||||
CefScopedLibraryLoader();
|
||||
|
||||
CefScopedLibraryLoader(const CefScopedLibraryLoader&) = delete;
|
||||
CefScopedLibraryLoader& operator=(const CefScopedLibraryLoader&) = delete;
|
||||
|
||||
~CefScopedLibraryLoader();
|
||||
|
||||
///
|
||||
|
@ -119,7 +121,6 @@ class CefScopedLibraryLoader {
|
|||
bool Load(bool helper);
|
||||
|
||||
bool loaded_;
|
||||
DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader);
|
||||
};
|
||||
|
||||
#endif // defined(OS_MAC)
|
||||
|
|
|
@ -245,7 +245,7 @@ class CefMessageRouterBrowserSide
|
|||
///
|
||||
class Handler {
|
||||
public:
|
||||
typedef CefMessageRouterBrowserSide::Callback Callback;
|
||||
using Callback = CefMessageRouterBrowserSide::Callback;
|
||||
|
||||
///
|
||||
// Executed when a new query is received. |query_id| uniquely identifies the
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#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_weak_ptr.h"
|
||||
#include "include/cef_request_handler.h"
|
||||
|
@ -101,6 +100,9 @@ class CefResourceManager
|
|||
///
|
||||
class Request : public base::RefCountedThreadSafe<Request> {
|
||||
public:
|
||||
Request(const Request&) = delete;
|
||||
Request& operator=(const Request&) = delete;
|
||||
|
||||
///
|
||||
// Returns the URL associated with this request. The returned value will be
|
||||
// fully qualified but will not contain query or fragment components. It
|
||||
|
@ -176,11 +178,9 @@ class CefResourceManager
|
|||
|
||||
// Params that stay with this request object. Safe to access on any thread.
|
||||
RequestParams params_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Request);
|
||||
};
|
||||
|
||||
typedef std::list<scoped_refptr<Request>> RequestList;
|
||||
using RequestList = std::list<scoped_refptr<Request>>;
|
||||
|
||||
///
|
||||
// Interface implemented by resource providers. A provider may be created on
|
||||
|
@ -210,6 +210,9 @@ class CefResourceManager
|
|||
|
||||
CefResourceManager();
|
||||
|
||||
CefResourceManager(const CefResourceManager&) = delete;
|
||||
CefResourceManager& operator=(const CefResourceManager&) = delete;
|
||||
|
||||
///
|
||||
// Add a provider that maps requests for |url| to |content|. |url| should be
|
||||
// fully qualified but not include a query or fragment component. If
|
||||
|
@ -316,7 +319,7 @@ class CefResourceManager
|
|||
|
||||
// Provider and associated information.
|
||||
struct ProviderEntry;
|
||||
typedef std::list<ProviderEntry*> ProviderEntryList;
|
||||
using ProviderEntryList = std::list<ProviderEntry*>;
|
||||
|
||||
// Values associated with the pending request only. Ownership will be passed
|
||||
// between requests and the resource manager as request handling proceeds.
|
||||
|
@ -357,7 +360,7 @@ class CefResourceManager
|
|||
ProviderEntryList providers_;
|
||||
|
||||
// Map of response ID to pending CefResourceHandler object.
|
||||
typedef std::map<uint64, CefRefPtr<CefResourceHandler>> PendingHandlersMap;
|
||||
using PendingHandlersMap = std::map<uint64, CefRefPtr<CefResourceHandler>>;
|
||||
PendingHandlersMap pending_handlers_;
|
||||
|
||||
UrlFilter url_filter_;
|
||||
|
@ -365,8 +368,6 @@ class CefResourceManager
|
|||
|
||||
// Must be the last member. Created and accessed on the IO thread.
|
||||
std::unique_ptr<base::WeakPtrFactory<CefResourceManager>> weak_ptr_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefResourceManager);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_RESOURCE_MANAGER_H_
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_build.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
|
@ -60,6 +59,9 @@ class CefScopedTempDir {
|
|||
///
|
||||
CefScopedTempDir();
|
||||
|
||||
CefScopedTempDir(const CefScopedTempDir&) = delete;
|
||||
CefScopedTempDir& operator=(const CefScopedTempDir&) = delete;
|
||||
|
||||
///
|
||||
// Recursively delete path.
|
||||
///
|
||||
|
@ -111,8 +113,6 @@ class CefScopedTempDir {
|
|||
|
||||
private:
|
||||
CefString path_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefScopedTempDir);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_SCOPED_TEMP_DIR_H_
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_resource_handler.h"
|
||||
#include "include/cef_response.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
@ -61,6 +60,9 @@ class CefStreamResourceHandler : public CefResourceHandler {
|
|||
CefResponse::HeaderMap header_map,
|
||||
CefRefPtr<CefStreamReader> stream);
|
||||
|
||||
CefStreamResourceHandler(const CefStreamResourceHandler&) = delete;
|
||||
CefStreamResourceHandler& operator=(const CefStreamResourceHandler&) = delete;
|
||||
|
||||
// CefResourceHandler methods.
|
||||
bool Open(CefRefPtr<CefRequest> request,
|
||||
bool& handle_request,
|
||||
|
@ -82,7 +84,6 @@ class CefStreamResourceHandler : public CefResourceHandler {
|
|||
const CefRefPtr<CefStreamReader> stream_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefStreamResourceHandler);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "include/base/cef_lock.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_ref_counted.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_xml_reader.h"
|
||||
|
@ -73,8 +72,8 @@ class CefStreamReader;
|
|||
///
|
||||
class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
|
||||
public:
|
||||
typedef std::vector<CefRefPtr<CefXmlObject>> ObjectVector;
|
||||
typedef std::map<CefString, CefString> AttributeMap;
|
||||
using ObjectVector = std::vector<CefRefPtr<CefXmlObject>>;
|
||||
using AttributeMap = std::map<CefString, CefString>;
|
||||
|
||||
///
|
||||
// Create a new object with the specified name. An object name must always be
|
||||
|
@ -82,6 +81,9 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
|
|||
///
|
||||
explicit CefXmlObject(const CefString& name);
|
||||
|
||||
CefXmlObject(const CefXmlObject&) = delete;
|
||||
CefXmlObject& operator=(const CefXmlObject&) = delete;
|
||||
|
||||
///
|
||||
// Load the contents of the specified XML stream into this object. The
|
||||
// existing children and attributes, if any, will first be cleared.
|
||||
|
@ -190,8 +192,6 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
|
|||
ObjectVector children_;
|
||||
|
||||
base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefXmlObject);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <map>
|
||||
|
||||
#include "include/base/cef_lock.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_ref_counted.h"
|
||||
#include "include/cef_base.h"
|
||||
|
||||
|
@ -80,13 +79,16 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
|
|||
virtual CefRefPtr<CefStreamReader> GetStreamReader() const = 0;
|
||||
};
|
||||
|
||||
typedef std::map<CefString, CefRefPtr<File>> FileMap;
|
||||
using FileMap = std::map<CefString, CefRefPtr<File>>;
|
||||
|
||||
///
|
||||
// Create a new object.
|
||||
///
|
||||
CefZipArchive();
|
||||
|
||||
CefZipArchive(const CefZipArchive&) = delete;
|
||||
CefZipArchive& operator=(const CefZipArchive&) = delete;
|
||||
|
||||
///
|
||||
// Load the contents of the specified zip archive stream into this object.
|
||||
// If the zip archive requires a password then provide it via |password|.
|
||||
|
@ -136,8 +138,6 @@ class CefZipArchive : public base::RefCountedThreadSafe<CefZipArchive> {
|
|||
FileMap contents_;
|
||||
|
||||
mutable base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefZipArchive);
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_
|
||||
|
|
|
@ -191,7 +191,7 @@ LogMessage::~LogMessage() {
|
|||
// This has already been defined in the header, but defining it again as DWORD
|
||||
// ensures that the type used in the header is equivalent to DWORD. If not,
|
||||
// the redefinition is a compile error.
|
||||
typedef DWORD SystemErrorCode;
|
||||
using SystemErrorCode = DWORD;
|
||||
#endif
|
||||
|
||||
SystemErrorCode GetLastSystemErrorCode() {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef_dll/wrapper_types.h"
|
||||
|
@ -18,6 +17,9 @@
|
|||
template <class ClassName, class BaseName, class StructName>
|
||||
class CefCppToCRefCounted : public CefBaseRefCounted {
|
||||
public:
|
||||
CefCppToCRefCounted(const CefCppToCRefCounted&) = delete;
|
||||
CefCppToCRefCounted& operator=(const CefCppToCRefCounted&) = delete;
|
||||
|
||||
// Create a new wrapper instance and associated structure reference for
|
||||
// passing an object instance the other side.
|
||||
static StructName* Wrap(CefRefPtr<BaseName> c) {
|
||||
|
@ -105,7 +107,7 @@ class CefCppToCRefCounted : public CefBaseRefCounted {
|
|||
base->has_at_least_one_ref = struct_has_at_least_one_ref;
|
||||
}
|
||||
|
||||
virtual ~CefCppToCRefCounted() {}
|
||||
virtual ~CefCppToCRefCounted() = default;
|
||||
|
||||
private:
|
||||
// Used to associate this wrapper object, the underlying object instance and
|
||||
|
@ -196,8 +198,6 @@ class CefCppToCRefCounted : public CefBaseRefCounted {
|
|||
CefRefCount ref_count_;
|
||||
|
||||
static CefWrapperType kWrapperType;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCppToCRefCounted);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_REF_COUNTED_H_
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef_dll/wrapper_types.h"
|
||||
|
@ -18,6 +17,9 @@
|
|||
template <class ClassName, class BaseName, class StructName>
|
||||
class CefCppToCScoped : public CefBaseScoped {
|
||||
public:
|
||||
CefCppToCScoped(const CefCppToCScoped&) = delete;
|
||||
CefCppToCScoped& operator=(const CefCppToCScoped&) = delete;
|
||||
|
||||
// Create a new wrapper instance and associated structure reference for
|
||||
// passing an object instance the other side. The wrapper object will be
|
||||
// deleted when |del| is called on the associated structure. The wrapped
|
||||
|
@ -220,8 +222,6 @@ class CefCppToCScoped : public CefBaseScoped {
|
|||
bool owned_;
|
||||
|
||||
static CefWrapperType kWrapperType;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCppToCScoped);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_SCOPED_H_
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef_dll/wrapper_types.h"
|
||||
|
@ -18,6 +17,9 @@
|
|||
template <class ClassName, class BaseName, class StructName>
|
||||
class CefCToCppRefCounted : public BaseName {
|
||||
public:
|
||||
CefCToCppRefCounted(const CefCToCppRefCounted&) = delete;
|
||||
CefCToCppRefCounted& operator=(const CefCToCppRefCounted&) = delete;
|
||||
|
||||
// Create a new wrapper instance for a structure reference received from the
|
||||
// other side.
|
||||
static CefRefPtr<BaseName> Wrap(StructName* s);
|
||||
|
@ -37,8 +39,8 @@ class CefCToCppRefCounted : public BaseName {
|
|||
bool HasAtLeastOneRef() const { return UnderlyingHasAtLeastOneRef(); }
|
||||
|
||||
protected:
|
||||
CefCToCppRefCounted() {}
|
||||
virtual ~CefCToCppRefCounted() {}
|
||||
CefCToCppRefCounted() = default;
|
||||
virtual ~CefCToCppRefCounted() = default;
|
||||
|
||||
// If returning the structure across the DLL boundary use Unwrap() instead.
|
||||
StructName* GetStruct() const {
|
||||
|
@ -97,8 +99,6 @@ class CefCToCppRefCounted : public BaseName {
|
|||
CefRefCount ref_count_;
|
||||
|
||||
static CefWrapperType kWrapperType;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCToCppRefCounted);
|
||||
};
|
||||
|
||||
template <class ClassName, class BaseName, class StructName>
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "libcef_dll/wrapper_types.h"
|
||||
|
@ -18,6 +17,9 @@
|
|||
template <class ClassName, class BaseName, class StructName>
|
||||
class CefCToCppScoped : public BaseName {
|
||||
public:
|
||||
CefCToCppScoped(const CefCToCppScoped&) = delete;
|
||||
CefCToCppScoped& operator=(const CefCToCppScoped&) = delete;
|
||||
|
||||
// Create a new wrapper instance for a structure reference received from the
|
||||
// other side. The caller owns the CToCpp wrapper instance but not necessarily
|
||||
// the underling object on the CppToC side (depends if s->del is non-NULL).
|
||||
|
@ -67,8 +69,8 @@ class CefCToCppScoped : public BaseName {
|
|||
static void operator delete(void* ptr);
|
||||
|
||||
protected:
|
||||
CefCToCppScoped() {}
|
||||
virtual ~CefCToCppScoped() {}
|
||||
CefCToCppScoped() = default;
|
||||
virtual ~CefCToCppScoped() = default;
|
||||
|
||||
// If returning the structure across the DLL boundary use Unwrap() instead.
|
||||
StructName* GetStruct() const {
|
||||
|
@ -92,8 +94,6 @@ class CefCToCppScoped : public BaseName {
|
|||
CefRawPtr<BaseName> c);
|
||||
|
||||
static CefWrapperType kWrapperType;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefCToCppScoped);
|
||||
};
|
||||
|
||||
template <class ClassName, class BaseName, class StructName>
|
||||
|
|
|
@ -14,20 +14,20 @@
|
|||
#include "include/internal/cef_string_multimap.h"
|
||||
|
||||
// Copy contents from one list type to another.
|
||||
typedef std::vector<CefString> StringList;
|
||||
using StringList = std::vector<CefString>;
|
||||
void transfer_string_list_contents(cef_string_list_t fromList,
|
||||
StringList& toList);
|
||||
void transfer_string_list_contents(const StringList& fromList,
|
||||
cef_string_list_t toList);
|
||||
|
||||
// Copy contents from one map type to another.
|
||||
typedef std::map<CefString, CefString> StringMap;
|
||||
using StringMap = std::map<CefString, CefString>;
|
||||
void transfer_string_map_contents(cef_string_map_t fromMap, StringMap& toMap);
|
||||
void transfer_string_map_contents(const StringMap& fromMap,
|
||||
cef_string_map_t toMap);
|
||||
|
||||
// Copy contents from one map type to another.
|
||||
typedef std::multimap<CefString, CefString> StringMultimap;
|
||||
using StringMultimap = std::multimap<CefString, CefString>;
|
||||
void transfer_string_multimap_contents(cef_string_multimap_t fromMap,
|
||||
StringMultimap& toMap);
|
||||
void transfer_string_multimap_contents(const StringMultimap& fromMap,
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <map>
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
// Default traits for CefBrowserInfoMap. Override to provide different object
|
||||
// destruction behavior.
|
||||
|
@ -27,8 +26,8 @@ class CefBrowserInfoMap {
|
|||
// Implement this interface to visit and optionally delete objects in the map.
|
||||
class Visitor {
|
||||
public:
|
||||
typedef IdType InfoIdType;
|
||||
typedef ObjectType InfoObjectType;
|
||||
using InfoIdType = IdType;
|
||||
using InfoObjectType = ObjectType;
|
||||
|
||||
// Called once for each info object. Set |remove| to true to remove the
|
||||
// object from the map. It is safe to destruct removed objects in this
|
||||
|
@ -42,7 +41,10 @@ class CefBrowserInfoMap {
|
|||
virtual ~Visitor() {}
|
||||
};
|
||||
|
||||
CefBrowserInfoMap() {}
|
||||
CefBrowserInfoMap() = default;
|
||||
|
||||
CefBrowserInfoMap(const CefBrowserInfoMap&) = delete;
|
||||
CefBrowserInfoMap& operator=(const CefBrowserInfoMap&) = delete;
|
||||
|
||||
~CefBrowserInfoMap() { clear(); }
|
||||
|
||||
|
@ -248,13 +250,11 @@ class CefBrowserInfoMap {
|
|||
|
||||
private:
|
||||
// Map IdType to ObjectType instance.
|
||||
typedef std::map<IdType, ObjectType> InfoMap;
|
||||
using InfoMap = std::map<IdType, ObjectType>;
|
||||
// Map browser ID to InfoMap instance.
|
||||
typedef std::map<int, InfoMap*> BrowserInfoMap;
|
||||
using BrowserInfoMap = std::map<int, InfoMap*>;
|
||||
|
||||
BrowserInfoMap browser_info_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoMap);
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_WRAPPER_CEF_BROWSER_INFO_MAP_H_
|
||||
|
|
|
@ -15,6 +15,9 @@ class CefOnceClosureTask : public CefTask {
|
|||
explicit CefOnceClosureTask(base::OnceClosure closure)
|
||||
: closure_(std::move(closure)) {}
|
||||
|
||||
CefOnceClosureTask(const CefOnceClosureTask&) = delete;
|
||||
CefOnceClosureTask& operator=(const CefOnceClosureTask&) = delete;
|
||||
|
||||
// CefTask method
|
||||
void Execute() override { std::move(closure_).Run(); }
|
||||
|
||||
|
@ -22,7 +25,6 @@ class CefOnceClosureTask : public CefTask {
|
|||
base::OnceClosure closure_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefOnceClosureTask);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefOnceClosureTask);
|
||||
};
|
||||
|
||||
class CefRepeatingClosureTask : public CefTask {
|
||||
|
@ -30,6 +32,9 @@ class CefRepeatingClosureTask : public CefTask {
|
|||
explicit CefRepeatingClosureTask(const base::RepeatingClosure& closure)
|
||||
: closure_(closure) {}
|
||||
|
||||
CefRepeatingClosureTask(const CefRepeatingClosureTask&) = delete;
|
||||
CefRepeatingClosureTask& operator=(const CefRepeatingClosureTask&) = delete;
|
||||
|
||||
// CefTask method
|
||||
void Execute() override {
|
||||
closure_.Run();
|
||||
|
@ -40,7 +45,6 @@ class CefRepeatingClosureTask : public CefTask {
|
|||
base::RepeatingClosure closure_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefRepeatingClosureTask);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefRepeatingClosureTask);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <set>
|
||||
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_task.h"
|
||||
#include "include/wrapper/cef_closure_task.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
|
@ -48,6 +47,9 @@ class IdGenerator {
|
|||
public:
|
||||
IdGenerator() : next_id_(kReservedId) {}
|
||||
|
||||
IdGenerator(const IdGenerator&) = delete;
|
||||
IdGenerator& operator=(const IdGenerator&) = delete;
|
||||
|
||||
T GetNextId() {
|
||||
T id = ++next_id_;
|
||||
if (id == kReservedId) // In case the integer value wraps.
|
||||
|
@ -57,8 +59,6 @@ class IdGenerator {
|
|||
|
||||
private:
|
||||
T next_id_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(IdGenerator);
|
||||
};
|
||||
|
||||
// Browser-side router implementation.
|
||||
|
@ -75,6 +75,10 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||
browser_id_(browser_id),
|
||||
query_id_(query_id),
|
||||
persistent_(persistent) {}
|
||||
|
||||
CallbackImpl(const CallbackImpl&) = delete;
|
||||
CallbackImpl& operator=(const CallbackImpl&) = delete;
|
||||
|
||||
virtual ~CallbackImpl() {
|
||||
// Hitting this DCHECK means that you didn't call Success or Failure
|
||||
// on the Callback after returning true from Handler::OnQuery. You must
|
||||
|
@ -144,6 +148,11 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||
cancel_message_name_(config.js_cancel_function.ToString() +
|
||||
kMessageSuffix) {}
|
||||
|
||||
CefMessageRouterBrowserSideImpl(const CefMessageRouterBrowserSideImpl&) =
|
||||
delete;
|
||||
CefMessageRouterBrowserSideImpl& operator=(
|
||||
const CefMessageRouterBrowserSideImpl&) = delete;
|
||||
|
||||
virtual ~CefMessageRouterBrowserSideImpl() {
|
||||
// There should be no pending queries when the router is deleted.
|
||||
DCHECK(browser_query_info_map_.empty());
|
||||
|
@ -573,17 +582,15 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||
|
||||
// Set of currently registered handlers. An entry is added when a handler is
|
||||
// registered and removed when a handler is unregistered.
|
||||
typedef std::set<Handler*> HandlerSet;
|
||||
using HandlerSet = std::set<Handler*>;
|
||||
HandlerSet handler_set_;
|
||||
|
||||
// Map of query ID to QueryInfo instance. An entry is added when a Handler
|
||||
// indicates that it will handle the query and removed when either the query
|
||||
// is completed via the Callback, the query is explicitly canceled from the
|
||||
// renderer process, or the associated context is (or will be) released.
|
||||
typedef CefBrowserInfoMap<int64, QueryInfo*> BrowserQueryInfoMap;
|
||||
using BrowserQueryInfoMap = CefBrowserInfoMap<int64, QueryInfo*>;
|
||||
BrowserQueryInfoMap browser_query_info_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefMessageRouterBrowserSideImpl);
|
||||
};
|
||||
|
||||
// Renderer-side router implementation.
|
||||
|
@ -595,6 +602,9 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||
const CefMessageRouterConfig& config)
|
||||
: router_(router), config_(config), context_id_(kReservedId) {}
|
||||
|
||||
V8HandlerImpl(const V8HandlerImpl&) = delete;
|
||||
V8HandlerImpl& operator=(const V8HandlerImpl&) = delete;
|
||||
|
||||
bool Execute(const CefString& name,
|
||||
CefRefPtr<CefV8Value> object,
|
||||
const CefV8ValueList& arguments,
|
||||
|
@ -704,7 +714,10 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||
cancel_message_name_(config.js_cancel_function.ToString() +
|
||||
kMessageSuffix) {}
|
||||
|
||||
virtual ~CefMessageRouterRendererSideImpl() {}
|
||||
CefMessageRouterRendererSideImpl(const CefMessageRouterRendererSideImpl&) =
|
||||
delete;
|
||||
CefMessageRouterRendererSideImpl& operator=(
|
||||
const CefMessageRouterRendererSideImpl&) = delete;
|
||||
|
||||
int GetPendingCount(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefV8Context> context) override {
|
||||
|
@ -1090,17 +1103,15 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||
// entry is added when a request is initiated via the bound function and
|
||||
// removed when either the request completes, is canceled via the bound
|
||||
// function, or the associated context is released.
|
||||
typedef CefBrowserInfoMap<std::pair<int, int>, RequestInfo*>
|
||||
BrowserRequestInfoMap;
|
||||
using BrowserRequestInfoMap =
|
||||
CefBrowserInfoMap<std::pair<int, int>, RequestInfo*>;
|
||||
BrowserRequestInfoMap browser_request_info_map_;
|
||||
|
||||
// Map of context ID to CefV8Context for existing contexts. An entry is added
|
||||
// when a bound function is executed for the first time in the context and
|
||||
// removed when the context is released.
|
||||
typedef std::map<int, CefRefPtr<CefV8Context>> ContextMap;
|
||||
using ContextMap = std::map<int, CefRefPtr<CefV8Context>>;
|
||||
ContextMap context_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefMessageRouterRendererSideImpl);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "include/base/cef_callback.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_weak_ptr.h"
|
||||
#include "include/cef_parser.h"
|
||||
#include "include/wrapper/cef_stream_resource_handler.h"
|
||||
|
@ -61,6 +60,9 @@ class ContentProvider : public CefResourceManager::Provider {
|
|||
DCHECK(!content.empty());
|
||||
}
|
||||
|
||||
ContentProvider(const ContentProvider&) = delete;
|
||||
ContentProvider& operator=(const ContentProvider&) = delete;
|
||||
|
||||
bool OnRequest(scoped_refptr<CefResourceManager::Request> request) override {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
|
@ -86,8 +88,6 @@ class ContentProvider : public CefResourceManager::Provider {
|
|||
std::string url_;
|
||||
std::string content_;
|
||||
std::string mime_type_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ContentProvider);
|
||||
};
|
||||
|
||||
// Provider of contents loaded from a directory on the file system.
|
||||
|
@ -106,6 +106,9 @@ class DirectoryProvider : public CefResourceManager::Provider {
|
|||
directory_path_ += PATH_SEP;
|
||||
}
|
||||
|
||||
DirectoryProvider(const DirectoryProvider&) = delete;
|
||||
DirectoryProvider& operator=(const DirectoryProvider&) = delete;
|
||||
|
||||
bool OnRequest(scoped_refptr<CefResourceManager::Request> request) override {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
|
@ -162,8 +165,6 @@ class DirectoryProvider : public CefResourceManager::Provider {
|
|||
|
||||
std::string url_path_;
|
||||
std::string directory_path_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DirectoryProvider);
|
||||
};
|
||||
|
||||
// Provider of contents loaded from an archive file.
|
||||
|
@ -186,6 +187,9 @@ class ArchiveProvider : public CefResourceManager::Provider {
|
|||
url_path_ += '/';
|
||||
}
|
||||
|
||||
ArchiveProvider(const ArchiveProvider&) = delete;
|
||||
ArchiveProvider& operator=(const ArchiveProvider&) = delete;
|
||||
|
||||
bool OnRequest(scoped_refptr<CefResourceManager::Request> request) override {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
|
@ -287,14 +291,12 @@ class ArchiveProvider : public CefResourceManager::Provider {
|
|||
CefRefPtr<CefZipArchive> archive_;
|
||||
|
||||
// List of requests that are pending while the archive is being loaded.
|
||||
typedef std::vector<scoped_refptr<CefResourceManager::Request>>
|
||||
PendingRequests;
|
||||
using PendingRequests =
|
||||
std::vector<scoped_refptr<CefResourceManager::Request>>;
|
||||
PendingRequests pending_requests_;
|
||||
|
||||
// Must be the last member.
|
||||
base::WeakPtrFactory<ArchiveProvider> weak_ptr_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ArchiveProvider);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <sstream>
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_stream.h"
|
||||
|
||||
namespace {
|
||||
|
@ -17,6 +16,9 @@ class CefXmlObjectLoader {
|
|||
explicit CefXmlObjectLoader(CefRefPtr<CefXmlObject> root_object)
|
||||
: root_object_(root_object) {}
|
||||
|
||||
CefXmlObjectLoader(const CefXmlObjectLoader&) = delete;
|
||||
CefXmlObjectLoader& operator=(const CefXmlObjectLoader&) = delete;
|
||||
|
||||
bool Load(CefRefPtr<CefStreamReader> stream,
|
||||
CefXmlReader::EncodingType encodingType,
|
||||
const CefString& URI) {
|
||||
|
@ -151,8 +153,6 @@ class CefXmlObjectLoader {
|
|||
private:
|
||||
CefString load_error_;
|
||||
CefRefPtr<CefXmlObject> root_object_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefXmlObjectLoader);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <memory>
|
||||
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/cef_stream.h"
|
||||
#include "include/cef_zip_reader.h"
|
||||
#include "include/wrapper/cef_byte_read_handler.h"
|
||||
|
@ -30,6 +29,9 @@ class CefZipFile : public CefZipArchive::File {
|
|||
public:
|
||||
CefZipFile() : data_size_(0) {}
|
||||
|
||||
CefZipFile(const CefZipFile&) = delete;
|
||||
CefZipFile& operator=(const CefZipFile&) = delete;
|
||||
|
||||
bool Initialize(size_t data_size) {
|
||||
data_.reset(new unsigned char[data_size]);
|
||||
if (data_) {
|
||||
|
@ -59,7 +61,6 @@ class CefZipFile : public CefZipArchive::File {
|
|||
std::unique_ptr<unsigned char[]> data_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefZipFile);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefZipFile);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Reference in New Issue