mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
wrapper: Format with clang-tidy (see #3632)
This commit is contained in:
@ -60,16 +60,16 @@ class CefByteReadHandler : public CefReadHandler {
|
|||||||
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
|
CefByteReadHandler& operator=(const CefByteReadHandler&) = delete;
|
||||||
|
|
||||||
// CefReadHandler methods.
|
// CefReadHandler methods.
|
||||||
virtual size_t Read(void* ptr, size_t size, size_t n) override;
|
size_t Read(void* ptr, size_t size, size_t n) override;
|
||||||
virtual int Seek(int64_t offset, int whence) override;
|
int Seek(int64_t offset, int whence) override;
|
||||||
virtual int64_t Tell() override;
|
int64_t Tell() override;
|
||||||
virtual int Eof() override;
|
int Eof() override;
|
||||||
virtual bool MayBlock() override { return false; }
|
bool MayBlock() override { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const unsigned char* bytes_;
|
const unsigned char* bytes_;
|
||||||
int64_t size_;
|
int64_t size_;
|
||||||
int64_t offset_;
|
int64_t offset_ = 0;
|
||||||
CefRefPtr<CefBaseRefCounted> source_;
|
CefRefPtr<CefBaseRefCounted> source_;
|
||||||
|
|
||||||
base::Lock lock_;
|
base::Lock lock_;
|
||||||
|
@ -144,7 +144,7 @@ class CefScopedArgArray {
|
|||||||
values_[i] = argv[i];
|
values_[i] = argv[i];
|
||||||
array_[i] = const_cast<char*>(values_[i].c_str());
|
array_[i] = const_cast<char*>(values_[i].c_str());
|
||||||
}
|
}
|
||||||
array_[argc] = NULL;
|
array_[argc] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefScopedArgArray(const CefScopedArgArray&) = delete;
|
CefScopedArgArray(const CefScopedArgArray&) = delete;
|
||||||
|
@ -347,7 +347,7 @@ class CefMessageRouterBrowserSide
|
|||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
int64_t query_id) {}
|
int64_t query_id) {}
|
||||||
|
|
||||||
virtual ~Handler() {}
|
virtual ~Handler() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -435,7 +435,7 @@ class CefMessageRouterBrowserSide
|
|||||||
protected:
|
protected:
|
||||||
// Protect against accidental deletion of this object.
|
// Protect against accidental deletion of this object.
|
||||||
friend class base::RefCountedThreadSafe<CefMessageRouterBrowserSide>;
|
friend class base::RefCountedThreadSafe<CefMessageRouterBrowserSide>;
|
||||||
virtual ~CefMessageRouterBrowserSide() {}
|
virtual ~CefMessageRouterBrowserSide() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -491,7 +491,7 @@ class CefMessageRouterRendererSide
|
|||||||
protected:
|
protected:
|
||||||
// Protect against accidental deletion of this object.
|
// Protect against accidental deletion of this object.
|
||||||
friend class base::RefCountedThreadSafe<CefMessageRouterRendererSide>;
|
friend class base::RefCountedThreadSafe<CefMessageRouterRendererSide>;
|
||||||
virtual ~CefMessageRouterRendererSide() {}
|
virtual ~CefMessageRouterRendererSide() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_
|
#endif // CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_
|
||||||
|
@ -206,7 +206,7 @@ class CefResourceManager
|
|||||||
///
|
///
|
||||||
virtual void OnRequestCanceled(scoped_refptr<Request> request) {}
|
virtual void OnRequestCanceled(scoped_refptr<Request> request) {}
|
||||||
|
|
||||||
virtual ~Provider() {}
|
virtual ~Provider() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
CefResourceManager();
|
CefResourceManager();
|
||||||
|
@ -184,7 +184,7 @@ class CefXmlObject : public base::RefCountedThreadSafe<CefXmlObject> {
|
|||||||
void SetParent(CefXmlObject* parent);
|
void SetParent(CefXmlObject* parent);
|
||||||
|
|
||||||
CefString name_;
|
CefString name_;
|
||||||
CefXmlObject* parent_;
|
CefXmlObject* parent_ = nullptr;
|
||||||
CefString value_;
|
CefString value_;
|
||||||
AttributeMap attributes_;
|
AttributeMap attributes_;
|
||||||
ObjectVector children_;
|
ObjectVector children_;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes,
|
CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes,
|
||||||
size_t size,
|
size_t size,
|
||||||
CefRefPtr<CefBaseRefCounted> source)
|
CefRefPtr<CefBaseRefCounted> source)
|
||||||
: bytes_(bytes), size_(size), offset_(0), source_(source) {}
|
: bytes_(bytes), size_(size), source_(source) {}
|
||||||
|
|
||||||
size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) {
|
size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) {
|
||||||
base::AutoLock lock_scope(lock_);
|
base::AutoLock lock_scope(lock_);
|
||||||
|
@ -98,7 +98,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
CallbackImpl(const CallbackImpl&) = delete;
|
CallbackImpl(const CallbackImpl&) = delete;
|
||||||
CallbackImpl& operator=(const CallbackImpl&) = delete;
|
CallbackImpl& operator=(const CallbackImpl&) = delete;
|
||||||
|
|
||||||
virtual ~CallbackImpl() {
|
~CallbackImpl() override {
|
||||||
// Hitting this DCHECK means that you didn't call Success or Failure
|
// Hitting this DCHECK means that you didn't call Success or Failure
|
||||||
// on the Callback after returning true from Handler::OnQuery. You must
|
// on the Callback after returning true from Handler::OnQuery. You must
|
||||||
// call Failure to terminate persistent queries.
|
// call Failure to terminate persistent queries.
|
||||||
@ -191,7 +191,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
CefMessageRouterBrowserSideImpl& operator=(
|
CefMessageRouterBrowserSideImpl& operator=(
|
||||||
const CefMessageRouterBrowserSideImpl&) = delete;
|
const CefMessageRouterBrowserSideImpl&) = delete;
|
||||||
|
|
||||||
virtual ~CefMessageRouterBrowserSideImpl() {
|
~CefMessageRouterBrowserSideImpl() override {
|
||||||
// There should be no pending queries when the router is deleted.
|
// There should be no pending queries when the router is deleted.
|
||||||
DCHECK(browser_query_info_map_.empty());
|
DCHECK(browser_query_info_map_.empty());
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
// Need to iterate over each QueryInfo object to test the handler.
|
// Need to iterate over each QueryInfo object to test the handler.
|
||||||
class Visitor : public BrowserQueryInfoMap::Visitor {
|
class Visitor : public BrowserQueryInfoMap::Visitor {
|
||||||
public:
|
public:
|
||||||
explicit Visitor(Handler* handler) : handler_(handler), count_(0) {}
|
explicit Visitor(Handler* handler) : handler_(handler) {}
|
||||||
|
|
||||||
bool OnNextInfo(int browser_id,
|
bool OnNextInfo(int browser_id,
|
||||||
InfoIdType info_id,
|
InfoIdType info_id,
|
||||||
@ -247,7 +247,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Handler* handler_;
|
Handler* handler_;
|
||||||
int count_;
|
int count_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Visitor visitor(handler);
|
Visitor visitor(handler);
|
||||||
@ -398,8 +398,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
bool* removed) {
|
bool* removed) {
|
||||||
class Visitor : public BrowserQueryInfoMap::Visitor {
|
class Visitor : public BrowserQueryInfoMap::Visitor {
|
||||||
public:
|
public:
|
||||||
explicit Visitor(bool always_remove)
|
explicit Visitor(bool always_remove) : always_remove_(always_remove) {}
|
||||||
: always_remove_(always_remove), removed_(false) {}
|
|
||||||
|
|
||||||
bool OnNextInfo(int browser_id,
|
bool OnNextInfo(int browser_id,
|
||||||
InfoIdType info_id,
|
InfoIdType info_id,
|
||||||
@ -413,7 +412,7 @@ class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const bool always_remove_;
|
const bool always_remove_;
|
||||||
bool removed_;
|
bool removed_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Visitor visitor(always_remove);
|
Visitor visitor(always_remove);
|
||||||
@ -779,7 +778,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
// Need to iterate over each RequestInfo object to test the context.
|
// Need to iterate over each RequestInfo object to test the context.
|
||||||
class Visitor : public BrowserRequestInfoMap::Visitor {
|
class Visitor : public BrowserRequestInfoMap::Visitor {
|
||||||
public:
|
public:
|
||||||
explicit Visitor(int context_id) : context_id_(context_id), count_(0) {}
|
explicit Visitor(int context_id) : context_id_(context_id) {}
|
||||||
|
|
||||||
bool OnNextInfo(int browser_id,
|
bool OnNextInfo(int browser_id,
|
||||||
InfoIdType info_id,
|
InfoIdType info_id,
|
||||||
@ -795,7 +794,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int context_id_;
|
int context_id_;
|
||||||
int count_;
|
int count_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Visitor visitor(context_id);
|
Visitor visitor(context_id);
|
||||||
@ -908,8 +907,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
bool* removed) {
|
bool* removed) {
|
||||||
class Visitor : public BrowserRequestInfoMap::Visitor {
|
class Visitor : public BrowserRequestInfoMap::Visitor {
|
||||||
public:
|
public:
|
||||||
explicit Visitor(bool always_remove)
|
explicit Visitor(bool always_remove) : always_remove_(always_remove) {}
|
||||||
: always_remove_(always_remove), removed_(false) {}
|
|
||||||
|
|
||||||
bool OnNextInfo(int browser_id,
|
bool OnNextInfo(int browser_id,
|
||||||
InfoIdType info_id,
|
InfoIdType info_id,
|
||||||
@ -923,7 +921,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const bool always_remove_;
|
const bool always_remove_;
|
||||||
bool removed_;
|
bool removed_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Visitor visitor(always_remove);
|
Visitor visitor(always_remove);
|
||||||
@ -988,8 +986,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
// Cancel all requests with the specified context ID.
|
// Cancel all requests with the specified context ID.
|
||||||
class Visitor : public BrowserRequestInfoMap::Visitor {
|
class Visitor : public BrowserRequestInfoMap::Visitor {
|
||||||
public:
|
public:
|
||||||
explicit Visitor(int context_id)
|
explicit Visitor(int context_id) : context_id_(context_id) {}
|
||||||
: context_id_(context_id), cancel_count_(0) {}
|
|
||||||
|
|
||||||
bool OnNextInfo(int browser_id,
|
bool OnNextInfo(int browser_id,
|
||||||
InfoIdType info_id,
|
InfoIdType info_id,
|
||||||
@ -1007,7 +1004,7 @@ class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const int context_id_;
|
const int context_id_;
|
||||||
int cancel_count_;
|
int cancel_count_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Visitor visitor(context_id);
|
Visitor visitor(context_id);
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "include/wrapper/cef_resource_manager.h"
|
#include "include/wrapper/cef_resource_manager.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "include/base/cef_callback.h"
|
#include "include/base/cef_callback.h"
|
||||||
@ -181,8 +182,7 @@ class ArchiveProvider : public CefResourceManager::Provider {
|
|||||||
: url_path_(url_path),
|
: url_path_(url_path),
|
||||||
archive_path_(archive_path),
|
archive_path_(archive_path),
|
||||||
password_(password),
|
password_(password),
|
||||||
archive_load_started_(false),
|
|
||||||
archive_load_ended_(false),
|
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
DCHECK(!url_path_.empty());
|
DCHECK(!url_path_.empty());
|
||||||
DCHECK(!archive_path_.empty());
|
DCHECK(!archive_path_.empty());
|
||||||
@ -294,8 +294,8 @@ class ArchiveProvider : public CefResourceManager::Provider {
|
|||||||
std::string archive_path_;
|
std::string archive_path_;
|
||||||
std::string password_;
|
std::string password_;
|
||||||
|
|
||||||
bool archive_load_started_;
|
bool archive_load_started_ = false;
|
||||||
bool archive_load_ended_;
|
bool archive_load_ended_ = false;
|
||||||
CefRefPtr<CefZipArchive> archive_;
|
CefRefPtr<CefZipArchive> archive_;
|
||||||
|
|
||||||
// List of requests that are pending while the archive is being loaded.
|
// List of requests that are pending while the archive is being loaded.
|
||||||
@ -313,10 +313,7 @@ class ArchiveProvider : public CefResourceManager::Provider {
|
|||||||
|
|
||||||
struct CefResourceManager::ProviderEntry {
|
struct CefResourceManager::ProviderEntry {
|
||||||
ProviderEntry(Provider* provider, int order, const std::string& identifier)
|
ProviderEntry(Provider* provider, int order, const std::string& identifier)
|
||||||
: provider_(provider),
|
: provider_(provider), order_(order), identifier_(identifier) {}
|
||||||
order_(order),
|
|
||||||
identifier_(identifier),
|
|
||||||
deletion_pending_(false) {}
|
|
||||||
|
|
||||||
std::unique_ptr<Provider> provider_;
|
std::unique_ptr<Provider> provider_;
|
||||||
int order_;
|
int order_;
|
||||||
@ -326,7 +323,7 @@ struct CefResourceManager::ProviderEntry {
|
|||||||
RequestList pending_requests_;
|
RequestList pending_requests_;
|
||||||
|
|
||||||
// True if deletion of this provider is pending.
|
// True if deletion of this provider is pending.
|
||||||
bool deletion_pending_;
|
bool deletion_pending_ = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CefResourceManager::RequestState implementation.
|
// CefResourceManager::RequestState implementation.
|
||||||
@ -602,7 +599,8 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad(
|
|||||||
// thread. This object performs most of its work on the IO thread and will
|
// thread. This object performs most of its work on the IO thread and will
|
||||||
// be destroyed on the IO thread so, now that we're on the IO thread,
|
// be destroyed on the IO thread so, now that we're on the IO thread,
|
||||||
// properly initialize the WeakPtrFactory.
|
// properly initialize the WeakPtrFactory.
|
||||||
weak_ptr_factory_.reset(new base::WeakPtrFactory<CefResourceManager>(this));
|
weak_ptr_factory_ =
|
||||||
|
std::make_unique<base::WeakPtrFactory<CefResourceManager>>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
state->manager_ = weak_ptr_factory_->GetWeakPtr();
|
state->manager_ = weak_ptr_factory_->GetWeakPtr();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "include/base/cef_logging.h"
|
#include "include/base/cef_logging.h"
|
||||||
#include "include/cef_file_util.h"
|
#include "include/cef_file_util.h"
|
||||||
|
|
||||||
CefScopedTempDir::CefScopedTempDir() {}
|
CefScopedTempDir::CefScopedTempDir() = default;
|
||||||
|
|
||||||
CefScopedTempDir::~CefScopedTempDir() {
|
CefScopedTempDir::~CefScopedTempDir() {
|
||||||
if (!path_.empty() && !Delete()) {
|
if (!path_.empty() && !Delete()) {
|
||||||
|
@ -158,10 +158,9 @@ class CefXmlObjectLoader {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CefXmlObject::CefXmlObject(const CefString& name)
|
CefXmlObject::CefXmlObject(const CefString& name) : name_(name) {}
|
||||||
: name_(name), parent_(nullptr) {}
|
|
||||||
|
|
||||||
CefXmlObject::~CefXmlObject() {}
|
CefXmlObject::~CefXmlObject() = default;
|
||||||
|
|
||||||
bool CefXmlObject::Load(CefRefPtr<CefStreamReader> stream,
|
bool CefXmlObject::Load(CefRefPtr<CefStreamReader> stream,
|
||||||
CefXmlReader::EncodingType encodingType,
|
CefXmlReader::EncodingType encodingType,
|
||||||
|
@ -27,7 +27,7 @@ CefString ToLower(const CefString& str) {
|
|||||||
|
|
||||||
class CefZipFile : public CefZipArchive::File {
|
class CefZipFile : public CefZipArchive::File {
|
||||||
public:
|
public:
|
||||||
CefZipFile() : data_size_(0) {}
|
CefZipFile() = default;
|
||||||
|
|
||||||
CefZipFile(const CefZipFile&) = delete;
|
CefZipFile(const CefZipFile&) = delete;
|
||||||
CefZipFile& operator=(const CefZipFile&) = delete;
|
CefZipFile& operator=(const CefZipFile&) = delete;
|
||||||
@ -44,11 +44,11 @@ class CefZipFile : public CefZipArchive::File {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const unsigned char* GetData() const override { return data_.get(); }
|
const unsigned char* GetData() const override { return data_.get(); }
|
||||||
|
|
||||||
virtual size_t GetDataSize() const override { return data_size_; }
|
size_t GetDataSize() const override { return data_size_; }
|
||||||
|
|
||||||
virtual CefRefPtr<CefStreamReader> GetStreamReader() const override {
|
CefRefPtr<CefStreamReader> GetStreamReader() const override {
|
||||||
CefRefPtr<CefReadHandler> handler(new CefByteReadHandler(
|
CefRefPtr<CefReadHandler> handler(new CefByteReadHandler(
|
||||||
data_.get(), data_size_, const_cast<CefZipFile*>(this)));
|
data_.get(), data_size_, const_cast<CefZipFile*>(this)));
|
||||||
return CefStreamReader::CreateForHandler(handler);
|
return CefStreamReader::CreateForHandler(handler);
|
||||||
@ -57,7 +57,7 @@ class CefZipFile : public CefZipArchive::File {
|
|||||||
unsigned char* data() { return data_.get(); }
|
unsigned char* data() { return data_.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t data_size_;
|
size_t data_size_ = 0;
|
||||||
std::unique_ptr<unsigned char[]> data_;
|
std::unique_ptr<unsigned char[]> data_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefZipFile);
|
IMPLEMENT_REFCOUNTING(CefZipFile);
|
||||||
@ -67,9 +67,9 @@ class CefZipFile : public CefZipArchive::File {
|
|||||||
|
|
||||||
// CefZipArchive implementation
|
// CefZipArchive implementation
|
||||||
|
|
||||||
CefZipArchive::CefZipArchive() {}
|
CefZipArchive::CefZipArchive() = default;
|
||||||
|
|
||||||
CefZipArchive::~CefZipArchive() {}
|
CefZipArchive::~CefZipArchive() = default;
|
||||||
|
|
||||||
size_t CefZipArchive::Load(CefRefPtr<CefStreamReader> stream,
|
size_t CefZipArchive::Load(CefRefPtr<CefStreamReader> stream,
|
||||||
const CefString& password,
|
const CefString& password,
|
||||||
|
Reference in New Issue
Block a user