cefclient: Convert NULL to nullptr (see issue #2861)
This commit is contained in:
parent
b785d34d29
commit
d02d252690
|
@ -50,11 +50,11 @@ void BrowserWindow::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||
REQUIRE_MAIN_THREAD();
|
||||
if (browser_.get()) {
|
||||
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
||||
browser_ = NULL;
|
||||
browser_ = nullptr;
|
||||
}
|
||||
|
||||
client_handler_->DetachDelegate();
|
||||
client_handler_ = NULL;
|
||||
client_handler_ = nullptr;
|
||||
|
||||
// |this| may be deleted.
|
||||
delegate_->OnBrowserWindowDestroyed();
|
||||
|
|
|
@ -965,10 +965,10 @@ BrowserWindowOsrGtk::BrowserWindowOsrGtk(BrowserWindow::Delegate* delegate,
|
|||
painting_popup_(false),
|
||||
hidden_(false),
|
||||
glarea_(NULL),
|
||||
drag_trigger_event_(NULL),
|
||||
drag_data_(NULL),
|
||||
drag_trigger_event_(nullptr),
|
||||
drag_data_(nullptr),
|
||||
drag_operation_(DRAG_OPERATION_NONE),
|
||||
drag_context_(NULL),
|
||||
drag_context_(nullptr),
|
||||
drag_targets_(gtk_target_list_new(NULL, 0)),
|
||||
drag_leave_(false),
|
||||
drag_drop_(false),
|
||||
|
@ -1900,13 +1900,13 @@ void BrowserWindowOsrGtk::DragReset() {
|
|||
CEF_REQUIRE_UI_THREAD();
|
||||
if (drag_trigger_event_) {
|
||||
gdk_event_free(drag_trigger_event_);
|
||||
drag_trigger_event_ = NULL;
|
||||
drag_trigger_event_ = nullptr;
|
||||
}
|
||||
drag_data_ = NULL;
|
||||
drag_data_ = nullptr;
|
||||
drag_operation_ = DRAG_OPERATION_NONE;
|
||||
if (drag_context_) {
|
||||
g_object_unref(drag_context_);
|
||||
drag_context_ = NULL;
|
||||
drag_context_ = nullptr;
|
||||
}
|
||||
drag_leave_ = false;
|
||||
drag_drop_ = false;
|
||||
|
@ -1943,12 +1943,12 @@ void BrowserWindowOsrGtk::DragBegin(GtkWidget* widget,
|
|||
size_t image_size = image_binary->GetSize();
|
||||
guint8* image_buffer = (guint8*)malloc(image_size); // must free
|
||||
image_binary->GetData((void*)image_buffer, image_size, 0);
|
||||
GdkPixbufLoader* loader = NULL; // must unref
|
||||
GError* error = NULL; // must free
|
||||
GdkPixbuf* pixbuf = NULL; // owned by loader
|
||||
GdkPixbufLoader* loader = nullptr; // must unref
|
||||
GError* error = nullptr; // must free
|
||||
GdkPixbuf* pixbuf = nullptr; // owned by loader
|
||||
gboolean success = FALSE;
|
||||
loader = gdk_pixbuf_loader_new_with_type("png", &error);
|
||||
if (error == NULL && loader) {
|
||||
if (error == nullptr && loader) {
|
||||
success = gdk_pixbuf_loader_write(loader, image_buffer, image_size, NULL);
|
||||
if (success) {
|
||||
success = gdk_pixbuf_loader_close(loader, NULL);
|
||||
|
|
|
@ -112,7 +112,7 @@ void BrowserWindowOsrWin::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||
REQUIRE_MAIN_THREAD();
|
||||
|
||||
// Release the OSR window reference. It will be deleted on the UI thread.
|
||||
osr_window_ = NULL;
|
||||
osr_window_ = nullptr;
|
||||
|
||||
BrowserWindow::OnBrowserClosed(browser);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ BytesWriteHandler::BytesWriteHandler(size_t grow)
|
|||
: grow_(grow), datasize_(grow), offset_(0) {
|
||||
DCHECK_GT(grow, 0U);
|
||||
data_ = malloc(grow);
|
||||
DCHECK(data_ != NULL);
|
||||
DCHECK(data_ != nullptr);
|
||||
}
|
||||
|
||||
BytesWriteHandler::~BytesWriteHandler() {
|
||||
|
@ -81,7 +81,7 @@ size_t BytesWriteHandler::Grow(size_t size) {
|
|||
size_t rv;
|
||||
size_t s = (size > grow_ ? size : grow_);
|
||||
void* tmp = realloc(data_, datasize_ + s);
|
||||
DCHECK(tmp != NULL);
|
||||
DCHECK(tmp != nullptr);
|
||||
if (tmp) {
|
||||
data_ = tmp;
|
||||
datasize_ += s;
|
||||
|
|
|
@ -22,7 +22,7 @@ CefRefPtr<CefPrintHandler> ClientAppBrowser::CreatePrintHandler() {
|
|||
#if defined(OS_LINUX)
|
||||
return new ClientPrintHandlerGtk();
|
||||
#else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ void ClientHandler::DetachDelegate() {
|
|||
}
|
||||
|
||||
DCHECK(delegate_);
|
||||
delegate_ = NULL;
|
||||
delegate_ = nullptr;
|
||||
}
|
||||
|
||||
bool ClientHandler::OnProcessMessageReceived(
|
||||
|
@ -615,7 +615,7 @@ void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
|||
delete *(it);
|
||||
}
|
||||
message_handler_set_.clear();
|
||||
message_router_ = NULL;
|
||||
message_router_ = nullptr;
|
||||
}
|
||||
|
||||
NotifyBrowserClosed(browser);
|
||||
|
@ -784,7 +784,7 @@ bool ClientHandler::OnSelectClientCertificate(
|
|||
command_line->GetSwitchValue(switches::kSslClientCertificate);
|
||||
|
||||
if (cert_name.empty()) {
|
||||
callback->Select(NULL);
|
||||
callback->Select(nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ void ClientHandlerOsr::DetachOsrDelegate() {
|
|||
}
|
||||
|
||||
DCHECK(osr_delegate_);
|
||||
osr_delegate_ = NULL;
|
||||
osr_delegate_ = nullptr;
|
||||
}
|
||||
|
||||
void ClientHandlerOsr::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||
|
|
|
@ -140,7 +140,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||
LOG(ERROR) << "No GtkWindow for browser";
|
||||
return window;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
||||
|
@ -149,7 +149,7 @@ void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
|||
|
||||
} // namespace
|
||||
|
||||
ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(NULL) {}
|
||||
ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(nullptr) {}
|
||||
|
||||
bool ClientDialogHandlerGtk::OnFileDialog(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
|
@ -221,8 +221,8 @@ void ClientDialogHandlerGtk::OnResetDialogState(CefRefPtr<CefBrowser> browser) {
|
|||
return;
|
||||
|
||||
gtk_widget_destroy(gtk_dialog_);
|
||||
gtk_dialog_ = NULL;
|
||||
js_dialog_callback_ = NULL;
|
||||
gtk_dialog_ = nullptr;
|
||||
js_dialog_callback_ = nullptr;
|
||||
}
|
||||
|
||||
void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
||||
|
@ -331,7 +331,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
|||
GSList* filenames =
|
||||
gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
|
||||
if (filenames) {
|
||||
for (GSList* iter = filenames; iter != NULL;
|
||||
for (GSList* iter = filenames; iter != nullptr;
|
||||
iter = g_slist_next(iter)) {
|
||||
std::string path(static_cast<char*>(iter->data));
|
||||
g_free(iter->data);
|
||||
|
@ -347,7 +347,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
|||
if (success) {
|
||||
GtkFileFilter* selected_filter =
|
||||
gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog));
|
||||
if (selected_filter != NULL) {
|
||||
if (selected_filter != nullptr) {
|
||||
for (size_t x = 0; x < filters.size(); ++x) {
|
||||
if (filters[x] == selected_filter) {
|
||||
filter_index = x;
|
||||
|
@ -466,7 +466,7 @@ void ClientDialogHandlerGtk::OnDialogResponse(GtkDialog* dialog,
|
|||
NOTREACHED();
|
||||
}
|
||||
|
||||
handler->OnResetDialogState(NULL);
|
||||
handler->OnResetDialogState(nullptr);
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -75,10 +75,10 @@ class DialogCallback : public CefRunFileDialogCallback {
|
|||
}
|
||||
|
||||
router_callback_->Success(response);
|
||||
router_callback_ = NULL;
|
||||
router_callback_ = nullptr;
|
||||
|
||||
dialog_state_->pending_ = false;
|
||||
dialog_state_ = NULL;
|
||||
dialog_state_ = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -91,7 +91,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||
return value->GetDictionary();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
||||
|
|
|
@ -108,7 +108,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info,
|
|||
|
||||
if (info.id_ == kEmptyId) {
|
||||
// Image intentionally left empty.
|
||||
images.push_back(NULL);
|
||||
images.push_back(nullptr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info,
|
|||
}
|
||||
|
||||
// Load the image.
|
||||
images.push_back(NULL);
|
||||
images.push_back(nullptr);
|
||||
if (!missing_images)
|
||||
missing_images = true;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ CefRefPtr<CefImage> ImageCache::GetCachedImage(const std::string& image_id) {
|
|||
if (it != image_map_.end())
|
||||
return it->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -273,7 +273,7 @@ CefRefPtr<CefImage> ImageCache::CreateImage(const std::string& image_id,
|
|||
DCHECK(!content.image_);
|
||||
|
||||
if (content.contents_.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
CefRefPtr<CefImage> image = CefImage::CreateImage();
|
||||
|
||||
|
@ -285,18 +285,18 @@ CefRefPtr<CefImage> ImageCache::CreateImage(const std::string& image_id,
|
|||
rep.contents_.size())) {
|
||||
LOG(ERROR) << "Failed to create image " << image_id << " for PNG@"
|
||||
<< rep.scale_factor_;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} else if (rep.type_ == TYPE_JPEG) {
|
||||
if (!image->AddJPEG(rep.scale_factor_, rep.contents_.c_str(),
|
||||
rep.contents_.size())) {
|
||||
LOG(ERROR) << "Failed to create image " << image_id << " for JPG@"
|
||||
<< rep.scale_factor_;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
NOTREACHED();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace client {
|
|||
|
||||
namespace {
|
||||
|
||||
MainContext* g_main_context = NULL;
|
||||
MainContext* g_main_context = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -26,7 +26,7 @@ MainContext::MainContext() {
|
|||
}
|
||||
|
||||
MainContext::~MainContext() {
|
||||
g_main_context = NULL;
|
||||
g_main_context = nullptr;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -133,7 +133,7 @@ MainContextImpl::MainContextImpl(CefRefPtr<CefCommandLine> command_line,
|
|||
// cef_web_plugin.h for details. It's safe to call this method before
|
||||
// CefInitialize(), and calling it before CefInitialize() is required on
|
||||
// Linux.
|
||||
CefRegisterWidevineCdm(cdm_path, NULL);
|
||||
CefRegisterWidevineCdm(cdm_path, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) {
|
|||
|
||||
std::string MainContextImpl::GetAppWorkingDirectory() {
|
||||
char szWorkingDir[256];
|
||||
if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == NULL) {
|
||||
if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == nullptr) {
|
||||
szWorkingDir[0] = 0;
|
||||
} else {
|
||||
// Add trailing path separator.
|
||||
|
|
|
@ -25,7 +25,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) {
|
|||
|
||||
std::string MainContextImpl::GetAppWorkingDirectory() {
|
||||
char szWorkingDir[MAX_PATH + 1];
|
||||
if (_getcwd(szWorkingDir, MAX_PATH) == NULL) {
|
||||
if (_getcwd(szWorkingDir, MAX_PATH) == nullptr) {
|
||||
szWorkingDir[0] = 0;
|
||||
} else {
|
||||
// Add trailing path separator.
|
||||
|
|
|
@ -14,7 +14,7 @@ OsrAXNode* OsrAXTree::GetNode(int nodeId) const {
|
|||
if (result != node_map_.end()) {
|
||||
return result->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void OsrAXTree::EraseNode(int nodeId) {
|
||||
|
@ -127,7 +127,7 @@ OsrAXNode* OsrAccessibilityHelper::GetFocusedNode() const {
|
|||
return tree->second.GetNode(focused_node_id_);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const {
|
||||
|
@ -136,7 +136,7 @@ OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const {
|
|||
return tree->second.GetNode(tree->second.GetRootNodeId());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void OsrAccessibilityHelper::UpdateLayout(
|
||||
|
@ -205,7 +205,7 @@ void OsrAccessibilityHelper::UpdateLayout(
|
|||
if (update->HasKey("root_id")) {
|
||||
int nodeId = CastToInt(update->GetValue("root_id"));
|
||||
OsrAXNode* node = GetNode(treeId, nodeId);
|
||||
if (node != NULL) {
|
||||
if (node != nullptr) {
|
||||
auto& tree = accessibility_node_map_[treeId];
|
||||
tree.SetRootNodeId(nodeId);
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void OsrAccessibilityHelper::DestroyNode(OsrAXNode* node) {
|
|||
if (!childNode) {
|
||||
continue;
|
||||
}
|
||||
childNode->SetParent(NULL);
|
||||
childNode->SetParent(nullptr);
|
||||
if (childNode->OsrAXTreeId() == treeId) {
|
||||
DestroyNode(childNode);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ OsrAXNode* OsrAccessibilityHelper::GetNode(int treeId, int nodeId) const {
|
|||
return tree->second.GetNode(nodeId);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -18,8 +18,8 @@ OsrAXNode::OsrAXNode(int treeId,
|
|||
: tree_id_(treeId),
|
||||
node_id_(nodeId),
|
||||
child_tree_id_(-1),
|
||||
platform_accessibility_(NULL),
|
||||
parent_(NULL),
|
||||
platform_accessibility_(nullptr),
|
||||
parent_(nullptr),
|
||||
offset_container_id_(-1),
|
||||
accessibility_helper_(helper) {
|
||||
UpdateValue(value);
|
||||
|
@ -105,7 +105,7 @@ CefWindowHandle OsrAXNode::GetWindowHandle() const {
|
|||
CefRefPtr<CefBrowser> OsrAXNode::GetBrowser() const {
|
||||
if (accessibility_helper_)
|
||||
return accessibility_helper_->GetBrowser();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void OsrAXNode::SetParent(OsrAXNode* parent) {
|
||||
|
@ -161,7 +161,7 @@ OsrAXNode* OsrAXNode::ChildAtIndex(int index) const {
|
|||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Create and return the platform specific OsrAXNode Object
|
||||
|
|
|
@ -63,7 +63,7 @@ class OsrAXNode {
|
|||
CefNativeAccessible* GetNativeAccessibleObject(OsrAXNode* parent);
|
||||
|
||||
CefNativeAccessible* GetParentAccessibleObject() const {
|
||||
return parent_ ? parent_->platform_accessibility_ : NULL;
|
||||
return parent_ ? parent_->platform_accessibility_ : nullptr;
|
||||
}
|
||||
|
||||
OsrAccessibilityHelper* GetAccessibilityHelper() const {
|
||||
|
|
|
@ -218,7 +218,7 @@ struct CefIAccessible : public IAccessible {
|
|||
|
||||
// Remove the node reference when OsrAXNode is destroyed, so that
|
||||
// MSAA clients get CO_E_OBJNOTCONNECTED
|
||||
void MarkDestroyed() { node_ = NULL; }
|
||||
void MarkDestroyed() { node_ = nullptr; }
|
||||
|
||||
protected:
|
||||
virtual ~CefIAccessible() {}
|
||||
|
@ -242,7 +242,7 @@ STDMETHODIMP CefIAccessible::QueryInterface(REFIID riid, void** ppvObject) {
|
|||
else if (riid == IID_IUnknown)
|
||||
*ppvObject = static_cast<IUnknown*>(this);
|
||||
else
|
||||
*ppvObject = NULL;
|
||||
*ppvObject = nullptr;
|
||||
|
||||
if (*ppvObject)
|
||||
reinterpret_cast<IUnknown*>(*ppvObject)->AddRef();
|
||||
|
@ -317,7 +317,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild,
|
|||
int numChilds = node_->GetChildCount();
|
||||
// Mark Leaf node if there are no child
|
||||
if (numChilds <= 0) {
|
||||
*ppdispChild = NULL;
|
||||
*ppdispChild = nullptr;
|
||||
return S_FALSE;
|
||||
} else {
|
||||
if (ppdispChild && VALID_CHILDID(varChild)) {
|
||||
|
@ -332,7 +332,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild,
|
|||
|
||||
*ppdispChild = child->GetNativeAccessibleObject(node_);
|
||||
}
|
||||
if (*ppdispChild == NULL)
|
||||
if (*ppdispChild == nullptr)
|
||||
retCode = S_FALSE;
|
||||
else
|
||||
(*ppdispChild)->AddRef();
|
||||
|
@ -449,9 +449,9 @@ STDMETHODIMP CefIAccessible::get_accFocus(VARIANT* pFocusChild) {
|
|||
HRESULT retCode = DATACHECK(node_);
|
||||
if (SUCCEEDED(retCode)) {
|
||||
OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode();
|
||||
CefNativeAccessible* nativeObj = NULL;
|
||||
CefNativeAccessible* nativeObj = nullptr;
|
||||
if (focusedNode)
|
||||
nativeObj = focusedNode->GetNativeAccessibleObject(NULL);
|
||||
nativeObj = focusedNode->GetNativeAccessibleObject(nullptr);
|
||||
|
||||
if (nativeObj) {
|
||||
if (nativeObj == this) {
|
||||
|
@ -663,7 +663,7 @@ void OsrAXNode::Destroy() {
|
|||
CefIAccessible* ptr = static_cast<CefIAccessible*>(platform_accessibility_);
|
||||
if (ptr)
|
||||
ptr->MarkDestroyed();
|
||||
platform_accessibility_ = NULL;
|
||||
platform_accessibility_ = nullptr;
|
||||
}
|
||||
|
||||
// Create and return NSAccessibility Implementation Object for Window
|
||||
|
@ -687,7 +687,7 @@ void OsrAXNode::NotifyAccessibilityEvent(std::string event_type) const {}
|
|||
void OsrAXNode::Destroy() {}
|
||||
|
||||
CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -277,7 +277,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
|
|||
|
||||
CefRefPtr<CefDragData> DataObjectToDragData(IDataObject* data_object) {
|
||||
CefRefPtr<CefDragData> drag_data = CefDragData::Create();
|
||||
IEnumFORMATETC* enumFormats = NULL;
|
||||
IEnumFORMATETC* enumFormats = nullptr;
|
||||
HRESULT res = data_object->EnumFormatEtc(DATADIR_GET, &enumFormats);
|
||||
if (res != S_OK)
|
||||
return drag_data;
|
||||
|
@ -396,7 +396,7 @@ CefBrowserHost::DragOperationsMask DropTargetWin::StartDragging(
|
|||
HRESULT res = DoDragDrop(dataObject, dropSource, effect, &resEffect);
|
||||
if (res != DRAGDROP_S_DROP)
|
||||
resEffect = DROPEFFECT_NONE;
|
||||
current_drag_data_ = NULL;
|
||||
current_drag_data_ = nullptr;
|
||||
}
|
||||
return DropEffectToDragOperation(resEffect);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace client {
|
|||
|
||||
#define DEFAULT_QUERY_INTERFACE(__Class) \
|
||||
HRESULT __stdcall QueryInterface(const IID& iid, void** object) { \
|
||||
*object = NULL; \
|
||||
*object = nullptr; \
|
||||
if (IsEqualIID(iid, IID_IUnknown)) { \
|
||||
IUnknown* obj = this; \
|
||||
*object = obj; \
|
||||
|
|
|
@ -307,7 +307,7 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) {
|
|||
SetUserDataPtr(hwnd_, this);
|
||||
|
||||
#if defined(CEF_USE_ATL)
|
||||
accessibility_root_ = NULL;
|
||||
accessibility_root_ = nullptr;
|
||||
|
||||
// Create/register the drag&drop handler.
|
||||
drop_target_ = DropTargetWin::Create(this, hwnd_);
|
||||
|
@ -332,7 +332,7 @@ void OsrWindowWin::Destroy() {
|
|||
#if defined(CEF_USE_ATL)
|
||||
// Revoke/delete the drag&drop handler.
|
||||
RevokeDragDrop(hwnd_);
|
||||
drop_target_ = NULL;
|
||||
drop_target_ = nullptr;
|
||||
#endif
|
||||
|
||||
render_handler_.reset();
|
||||
|
@ -807,7 +807,7 @@ void OsrWindowWin::OnPaint() {
|
|||
|
||||
bool OsrWindowWin::OnEraseBkgnd() {
|
||||
// Erase the background when the browser does not exist.
|
||||
return (browser_ == NULL);
|
||||
return (browser_ == nullptr);
|
||||
}
|
||||
|
||||
bool OsrWindowWin::OnTouchEvent(UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
|
@ -911,8 +911,8 @@ void OsrWindowWin::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
|||
// Detach |this| from the ClientHandlerOsr.
|
||||
static_cast<ClientHandlerOsr*>(browser_->GetHost()->GetClient().get())
|
||||
->DetachOsrDelegate();
|
||||
browser_ = NULL;
|
||||
render_handler_->SetBrowser(NULL);
|
||||
browser_ = nullptr;
|
||||
render_handler_->SetBrowser(nullptr);
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
@ -1092,7 +1092,8 @@ void OsrWindowWin::UpdateAccessibilityTree(CefRefPtr<CefValue> value) {
|
|||
// Update |accessibility_root_| because UpdateAccessibilityTree may have
|
||||
// cleared it.
|
||||
OsrAXNode* root = accessibility_handler_->GetRootNode();
|
||||
accessibility_root_ = root ? root->GetNativeAccessibleObject(NULL) : NULL;
|
||||
accessibility_root_ =
|
||||
root ? root->GetNativeAccessibleObject(nullptr) : nullptr;
|
||||
#endif // defined(CEF_USE_ATL)
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||
return value->GetDictionary();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Convert a dictionary value to a JSON string.
|
||||
|
|
|
@ -85,7 +85,7 @@ class StickyPrintSettingGtk {
|
|||
|
||||
// Lazily initialize the singleton instance.
|
||||
StickyPrintSettingGtk* GetLastUsedSettings() {
|
||||
static StickyPrintSettingGtk* settings = NULL;
|
||||
static StickyPrintSettingGtk* settings = nullptr;
|
||||
if (!settings)
|
||||
settings = new StickyPrintSettingGtk();
|
||||
return settings;
|
||||
|
@ -94,7 +94,7 @@ StickyPrintSettingGtk* GetLastUsedSettings() {
|
|||
// Helper class to track GTK printers.
|
||||
class GtkPrinterList {
|
||||
public:
|
||||
GtkPrinterList() : default_printer_(NULL) {
|
||||
GtkPrinterList() : default_printer_(nullptr) {
|
||||
gtk_enumerate_printers(SetPrinter, this, NULL, TRUE);
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ class GtkPrinterList {
|
|||
// - Querying for non-existant printers like 'Print to PDF'.
|
||||
GtkPrinter* GetPrinterWithName(const std::string& name) {
|
||||
if (name.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
for (std::vector<GtkPrinter*>::iterator it = printers_.begin();
|
||||
it < printers_.end(); ++it) {
|
||||
|
@ -123,7 +123,7 @@ class GtkPrinterList {
|
|||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -279,7 +279,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||
RootWindow::GetForBrowser(browser->GetIdentifier());
|
||||
if (root_window)
|
||||
return GTK_WINDOW(root_window->GetWindowHandle());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
||||
|
@ -304,29 +304,29 @@ void GetWindowAndContinue(CefRefPtr<CefBrowser> browser,
|
|||
struct ClientPrintHandlerGtk::PrintHandler {
|
||||
PrintHandler(CefRefPtr<CefBrowser> browser)
|
||||
: browser_(browser),
|
||||
dialog_(NULL),
|
||||
gtk_settings_(NULL),
|
||||
page_setup_(NULL),
|
||||
printer_(NULL) {}
|
||||
dialog_(nullptr),
|
||||
gtk_settings_(nullptr),
|
||||
page_setup_(nullptr),
|
||||
printer_(nullptr) {}
|
||||
|
||||
~PrintHandler() {
|
||||
ScopedGdkThreadsEnter scoped_gdk_threads;
|
||||
|
||||
if (dialog_) {
|
||||
gtk_widget_destroy(dialog_);
|
||||
dialog_ = NULL;
|
||||
dialog_ = nullptr;
|
||||
}
|
||||
if (gtk_settings_) {
|
||||
g_object_unref(gtk_settings_);
|
||||
gtk_settings_ = NULL;
|
||||
gtk_settings_ = nullptr;
|
||||
}
|
||||
if (page_setup_) {
|
||||
g_object_unref(page_setup_);
|
||||
page_setup_ = NULL;
|
||||
page_setup_ = nullptr;
|
||||
}
|
||||
if (printer_) {
|
||||
g_object_unref(printer_);
|
||||
printer_ = NULL;
|
||||
printer_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||
color_value.c_str());
|
||||
|
||||
if (settings->GetDuplexMode() != DUPLEX_MODE_UNKNOWN) {
|
||||
const char* cups_duplex_mode = NULL;
|
||||
const char* cups_duplex_mode = nullptr;
|
||||
switch (settings->GetDuplexMode()) {
|
||||
case DUPLEX_MODE_LONG_EDGE:
|
||||
cups_duplex_mode = kDuplexNoTumble;
|
||||
|
@ -523,17 +523,19 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||
settings->SetSelectionOnly(print_selection_only);
|
||||
InitPrintSettings(gtk_settings_, page_setup_, settings);
|
||||
dialog_callback_->Continue(settings);
|
||||
dialog_callback_ = NULL;
|
||||
dialog_callback_ = nullptr;
|
||||
return;
|
||||
}
|
||||
case GTK_RESPONSE_DELETE_EVENT: // Fall through.
|
||||
case GTK_RESPONSE_CANCEL: {
|
||||
dialog_callback_->Cancel();
|
||||
dialog_callback_ = NULL;
|
||||
dialog_callback_ = nullptr;
|
||||
return;
|
||||
}
|
||||
case GTK_RESPONSE_APPLY:
|
||||
default: { NOTREACHED(); }
|
||||
default: {
|
||||
NOTREACHED();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,7 +545,7 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||
// chance to unwind.
|
||||
CefPostTask(TID_UI, base::Bind(&CefPrintJobCallback::Continue,
|
||||
job_callback_.get()));
|
||||
job_callback_ = NULL;
|
||||
job_callback_ = nullptr;
|
||||
}
|
||||
|
||||
static void OnDialogResponseThunk(GtkDialog* dialog,
|
||||
|
|
|
@ -234,7 +234,7 @@ CefRefPtr<CefResponseFilter> GetResourceResponseFilter(
|
|||
if (MatchesFilterURL(url))
|
||||
return new PassThruResponseFilter();
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace response_filter_test
|
||||
|
|
|
@ -17,7 +17,7 @@ RootWindowConfig::RootWindowConfig()
|
|||
initially_hidden(false),
|
||||
url(MainContext::Get()->GetMainURL()) {}
|
||||
|
||||
RootWindow::RootWindow() : delegate_(NULL) {}
|
||||
RootWindow::RootWindow() : delegate_(nullptr) {}
|
||||
|
||||
RootWindow::~RootWindow() {}
|
||||
|
||||
|
@ -37,7 +37,7 @@ void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
|
|||
|
||||
ExtensionSet::const_iterator it = extensions.begin();
|
||||
for (; it != extensions.end(); ++it) {
|
||||
delegate_->CreateExtensionWindow(*it, CefRect(), NULL, base::Closure(),
|
||||
delegate_->CreateExtensionWindow(*it, CefRect(), nullptr, base::Closure(),
|
||||
WithWindowlessRendering());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ scoped_refptr<RootWindow> RootWindow::Create(bool use_views) {
|
|||
return new RootWindowMac();
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -56,12 +56,12 @@ RootWindowGtk::RootWindowGtk()
|
|||
with_extension_(false),
|
||||
is_popup_(false),
|
||||
initialized_(false),
|
||||
window_(NULL),
|
||||
back_button_(NULL),
|
||||
forward_button_(NULL),
|
||||
reload_button_(NULL),
|
||||
stop_button_(NULL),
|
||||
url_entry_(NULL),
|
||||
window_(nullptr),
|
||||
back_button_(nullptr),
|
||||
forward_button_(nullptr),
|
||||
reload_button_(nullptr),
|
||||
stop_button_(nullptr),
|
||||
url_entry_(nullptr),
|
||||
toolbar_height_(0),
|
||||
menubar_height_(0),
|
||||
window_destroyed_(false),
|
||||
|
@ -225,7 +225,7 @@ CefRefPtr<CefBrowser> RootWindowGtk::GetBrowser() const {
|
|||
|
||||
if (browser_window_)
|
||||
return browser_window_->GetBrowser();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ClientWindowHandle RootWindowGtk::GetWindowHandle() const {
|
||||
|
@ -380,7 +380,7 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings,
|
|||
|
||||
if (!is_popup_) {
|
||||
// Create the browser window.
|
||||
browser_window_->CreateBrowser(parent, browser_bounds_, settings, NULL,
|
||||
browser_window_->CreateBrowser(parent, browser_bounds_, settings, nullptr,
|
||||
delegate_->GetRequestContext(this));
|
||||
} else {
|
||||
// With popups we already have a browser window. Parent the browser window
|
||||
|
|
|
@ -174,7 +174,7 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsExtension(
|
|||
const std::string& extension_url = extension_util::GetExtensionURL(extension);
|
||||
if (extension_url.empty()) {
|
||||
NOTREACHED() << "Extension cannot be loaded directly.";
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Create an initially hidden browser window that loads the extension URL.
|
||||
|
@ -226,7 +226,7 @@ scoped_refptr<RootWindow> RootWindowManager::GetWindowForBrowser(
|
|||
if (browser.get() && browser->GetIdentifier() == browser_id)
|
||||
return *it;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
scoped_refptr<RootWindow> RootWindowManager::GetActiveRootWindow() const {
|
||||
|
@ -382,10 +382,10 @@ void RootWindowManager::OnRootWindowDestroyed(RootWindow* root_window) {
|
|||
root_windows_.erase(it);
|
||||
|
||||
if (root_window == active_root_window_) {
|
||||
active_root_window_ = NULL;
|
||||
active_root_window_ = nullptr;
|
||||
|
||||
base::AutoLock lock_scope(active_browser_lock_);
|
||||
active_browser_ = NULL;
|
||||
active_browser_ = nullptr;
|
||||
}
|
||||
|
||||
if (terminate_when_all_windows_closed_ && root_windows_.empty()) {
|
||||
|
|
|
@ -251,7 +251,7 @@ void RootWindowViews::OnViewsWindowCreated(CefRefPtr<ViewsWindow> window) {
|
|||
|
||||
void RootWindowViews::OnViewsWindowDestroyed(CefRefPtr<ViewsWindow> window) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
window_ = NULL;
|
||||
window_ = nullptr;
|
||||
|
||||
// Continue on the main thread.
|
||||
MAIN_POST_CLOSURE(
|
||||
|
@ -333,11 +333,11 @@ void RootWindowViews::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||
REQUIRE_MAIN_THREAD();
|
||||
if (browser_) {
|
||||
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
||||
browser_ = NULL;
|
||||
browser_ = nullptr;
|
||||
}
|
||||
|
||||
client_handler_->DetachDelegate();
|
||||
client_handler_ = NULL;
|
||||
client_handler_ = nullptr;
|
||||
|
||||
browser_destroyed_ = true;
|
||||
NotifyDestroyedIfDone();
|
||||
|
|
|
@ -286,7 +286,7 @@ CefRefPtr<CefBrowser> RootWindowWin::GetBrowser() const {
|
|||
|
||||
if (browser_window_)
|
||||
return browser_window_->GetBrowser();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ClientWindowHandle RootWindowWin::GetWindowHandle() const {
|
||||
|
@ -489,7 +489,7 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd,
|
|||
LPARAM lParam) {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
|
||||
RootWindowWin* self = NULL;
|
||||
RootWindowWin* self = nullptr;
|
||||
if (message != WM_NCCREATE) {
|
||||
self = GetUserDataPtr<RootWindowWin*>(hWnd);
|
||||
if (!self)
|
||||
|
@ -749,7 +749,7 @@ void RootWindowWin::OnDpiChanged(WPARAM wParam, LPARAM lParam) {
|
|||
|
||||
bool RootWindowWin::OnEraseBkgnd() {
|
||||
// Erase the background when the browser does not exist.
|
||||
return (GetBrowser() == NULL);
|
||||
return (GetBrowser() == nullptr);
|
||||
}
|
||||
|
||||
bool RootWindowWin::OnCommand(UINT id) {
|
||||
|
@ -949,7 +949,7 @@ void RootWindowWin::OnCreate(LPCREATESTRUCT lpCreateStruct) {
|
|||
// Create the browser window.
|
||||
CefRect cef_rect(rect.left, rect.top, rect.right - rect.left,
|
||||
rect.bottom - rect.top);
|
||||
browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, NULL,
|
||||
browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, nullptr,
|
||||
delegate_->GetRequestContext(this));
|
||||
} else {
|
||||
// With popups we already have a browser window. Parent the browser window
|
||||
|
|
|
@ -39,7 +39,7 @@ class ClientSchemeHandler : public CefResourceHandler {
|
|||
bool handled = false;
|
||||
|
||||
std::string url = request->GetURL();
|
||||
if (strstr(url.c_str(), "handler.html") != NULL) {
|
||||
if (strstr(url.c_str(), "handler.html") != nullptr) {
|
||||
// Build the response html
|
||||
data_ =
|
||||
"<html><head><title>Client Scheme Handler</title></head>"
|
||||
|
@ -65,7 +65,7 @@ class ClientSchemeHandler : public CefResourceHandler {
|
|||
|
||||
// Set the resulting mime type
|
||||
mime_type_ = "text/html";
|
||||
} else if (strstr(url.c_str(), "logo.png") != NULL) {
|
||||
} else if (strstr(url.c_str(), "logo.png") != nullptr) {
|
||||
// Load the response image
|
||||
if (LoadBinaryResource("logo.png", data_)) {
|
||||
handled = true;
|
||||
|
|
|
@ -352,7 +352,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||
return value->GetDictionary();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
||||
|
|
|
@ -30,7 +30,7 @@ HWND CreateTempWindow() {
|
|||
1, 1, NULL, NULL, hInstance, NULL);
|
||||
}
|
||||
|
||||
TempWindowWin* g_temp_window = NULL;
|
||||
TempWindowWin* g_temp_window = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -43,7 +43,7 @@ TempWindowWin::TempWindowWin() : hwnd_(NULL) {
|
|||
}
|
||||
|
||||
TempWindowWin::~TempWindowWin() {
|
||||
g_temp_window = NULL;
|
||||
g_temp_window = nullptr;
|
||||
DCHECK(hwnd_);
|
||||
DestroyWindow(hwnd_);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void CloseTempWindow(::Window xwindow) {
|
|||
XDestroyWindow(xdisplay, xwindow);
|
||||
}
|
||||
|
||||
TempWindowX11* g_temp_window = NULL;
|
||||
TempWindowX11* g_temp_window = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -51,7 +51,7 @@ TempWindowX11::TempWindowX11() : xwindow_(kNullWindowHandle) {
|
|||
}
|
||||
|
||||
TempWindowX11::~TempWindowX11() {
|
||||
g_temp_window = NULL;
|
||||
g_temp_window = nullptr;
|
||||
DCHECK(xwindow_);
|
||||
|
||||
CloseTempWindow(xwindow_);
|
||||
|
|
|
@ -323,7 +323,7 @@ void BeginTracing() {
|
|||
return;
|
||||
}
|
||||
|
||||
CefBeginTracing(CefString(), NULL);
|
||||
CefBeginTracing(CefString(), nullptr);
|
||||
}
|
||||
|
||||
void EndTracing(CefRefPtr<CefBrowser> browser) {
|
||||
|
@ -364,7 +364,7 @@ void EndTracing(CefRefPtr<CefBrowser> browser) {
|
|||
CefEndTracing(file_paths.front(), this);
|
||||
} else {
|
||||
// No file selected. Discard the trace data.
|
||||
CefEndTracing(CefString(), NULL);
|
||||
CefEndTracing(CefString(), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -147,13 +147,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||
static_cast<RequestClient*>(urlrequest_->GetClient().get())->Detach();
|
||||
|
||||
urlrequest_->Cancel();
|
||||
urlrequest_ = NULL;
|
||||
urlrequest_ = nullptr;
|
||||
}
|
||||
|
||||
if (callback_.get()) {
|
||||
// Must always execute |callback_| before deleting it.
|
||||
callback_->Failure(ERR_ABORTED, test_runner::GetErrorString(ERR_ABORTED));
|
||||
callback_ = NULL;
|
||||
callback_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,8 +166,8 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||
else
|
||||
callback_->Failure(error_code, test_runner::GetErrorString(error_code));
|
||||
|
||||
callback_ = NULL;
|
||||
urlrequest_ = NULL;
|
||||
callback_ = nullptr;
|
||||
urlrequest_ = nullptr;
|
||||
}
|
||||
|
||||
CefRefPtr<Callback> callback_;
|
||||
|
|
|
@ -99,7 +99,7 @@ CefRefPtr<CefMenuModel> ViewsMenuBar::CreateMenuModel(const CefString& label,
|
|||
CefRefPtr<CefMenuModel> ViewsMenuBar::GetMenuModel(int menu_id) const {
|
||||
if (HasMenuId(menu_id))
|
||||
return models_[menu_id - id_start_];
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ViewsMenuBar::SetMenuFocusable(bool focusable) {
|
||||
|
@ -141,7 +141,7 @@ bool ViewsMenuBar::OnKeyEvent(const CefKeyEvent& event) {
|
|||
}
|
||||
|
||||
void ViewsMenuBar::Reset() {
|
||||
panel_ = NULL;
|
||||
panel_ = nullptr;
|
||||
models_.clear();
|
||||
mnemonics_.clear();
|
||||
id_next_ = id_start_;
|
||||
|
@ -239,7 +239,7 @@ void ViewsMenuBar::EnsureMenuPanel() {
|
|||
if (panel_)
|
||||
return;
|
||||
|
||||
panel_ = CefPanel::CreatePanel(NULL);
|
||||
panel_ = CefPanel::CreatePanel(nullptr);
|
||||
views_style::ApplyTo(panel_);
|
||||
|
||||
// Use a horizontal box layout.
|
||||
|
|
|
@ -112,11 +112,11 @@ CefRefPtr<ViewsWindow> ViewsWindow::Create(
|
|||
DCHECK(delegate);
|
||||
|
||||
// Create a new ViewsWindow.
|
||||
CefRefPtr<ViewsWindow> views_window = new ViewsWindow(delegate, NULL);
|
||||
CefRefPtr<ViewsWindow> views_window = new ViewsWindow(delegate, nullptr);
|
||||
|
||||
// Create a new BrowserView.
|
||||
CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
|
||||
client, url, settings, NULL, request_context, views_window);
|
||||
client, url, settings, nullptr, request_context, views_window);
|
||||
|
||||
// Associate the BrowserView with the ViewsWindow.
|
||||
views_window->SetBrowserView(browser_view);
|
||||
|
@ -334,7 +334,7 @@ CefRefPtr<CefBrowserViewDelegate> ViewsWindow::GetDelegateForPopupBrowserView(
|
|||
DCHECK(popup_delegate && popup_delegate != delegate_);
|
||||
|
||||
// Create a new ViewsWindow for the popup BrowserView.
|
||||
return new ViewsWindow(popup_delegate, NULL);
|
||||
return new ViewsWindow(popup_delegate, nullptr);
|
||||
}
|
||||
|
||||
bool ViewsWindow::OnPopupBrowserViewCreated(
|
||||
|
@ -525,14 +525,14 @@ void ViewsWindow::OnWindowDestroyed(CefRefPtr<CefWindow> window) {
|
|||
|
||||
delegate_->OnViewsWindowDestroyed(this);
|
||||
|
||||
browser_view_ = NULL;
|
||||
button_menu_model_ = NULL;
|
||||
browser_view_ = nullptr;
|
||||
button_menu_model_ = nullptr;
|
||||
if (top_menu_bar_) {
|
||||
top_menu_bar_->Reset();
|
||||
top_menu_bar_ = NULL;
|
||||
top_menu_bar_ = nullptr;
|
||||
}
|
||||
extensions_panel_ = NULL;
|
||||
window_ = NULL;
|
||||
extensions_panel_ = nullptr;
|
||||
window_ = nullptr;
|
||||
}
|
||||
|
||||
bool ViewsWindow::CanClose(CefRefPtr<CefWindow> window) {
|
||||
|
@ -711,8 +711,8 @@ void ViewsWindow::CreateMenuModel() {
|
|||
|
||||
if (top_menu_bar_) {
|
||||
// Add the menus to the top menu bar.
|
||||
AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", NULL));
|
||||
AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", NULL));
|
||||
AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", nullptr));
|
||||
AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -762,7 +762,7 @@ void ViewsWindow::AddControls() {
|
|||
menu_button->SetMinimumSize(CefSize(0, 0));
|
||||
|
||||
// Create the top panel.
|
||||
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(NULL);
|
||||
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(nullptr);
|
||||
|
||||
// Use a horizontal box layout for |top_panel|.
|
||||
CefBoxLayoutSettings top_panel_layout_settings;
|
||||
|
@ -876,7 +876,7 @@ void ViewsWindow::UpdateExtensionControls() {
|
|||
return;
|
||||
|
||||
if (!extensions_panel_) {
|
||||
extensions_panel_ = CefPanel::CreatePanel(NULL);
|
||||
extensions_panel_ = CefPanel::CreatePanel(nullptr);
|
||||
|
||||
// Use a horizontal box layout for |top_panel|.
|
||||
CefBoxLayoutSettings top_panel_layout_settings;
|
||||
|
@ -946,7 +946,7 @@ void ViewsWindow::OnExtensionWindowClosed() {
|
|||
}
|
||||
|
||||
// Restore the button state.
|
||||
extension_button_pressed_lock_ = NULL;
|
||||
extension_button_pressed_lock_ = nullptr;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -25,7 +25,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||
LOG(ERROR) << "No GtkWindow for browser";
|
||||
return window;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool IsMaximized(GtkWindow* window) {
|
||||
|
|
|
@ -79,7 +79,7 @@ int RunMain(int argc, char* argv[]) {
|
|||
}
|
||||
|
||||
// Execute the secondary process, if any.
|
||||
int exit_code = CefExecuteProcess(main_args, app, NULL);
|
||||
int exit_code = CefExecuteProcess(main_args, app, nullptr);
|
||||
if (exit_code >= 0)
|
||||
return exit_code;
|
||||
|
||||
|
@ -108,7 +108,7 @@ int RunMain(int argc, char* argv[]) {
|
|||
message_loop.reset(new MainMessageLoopStd);
|
||||
|
||||
// Initialize CEF.
|
||||
context->Initialize(main_args, settings, app, NULL);
|
||||
context->Initialize(main_args, settings, app, nullptr);
|
||||
|
||||
// The Chromium sandbox requires that there only be a single thread during
|
||||
// initialization. Therefore initialize GTK after CEF.
|
||||
|
|
|
@ -39,7 +39,7 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) {
|
|||
|
||||
CefMainArgs main_args(hInstance);
|
||||
|
||||
void* sandbox_info = NULL;
|
||||
void* sandbox_info = nullptr;
|
||||
|
||||
#if defined(CEF_USE_SANDBOX)
|
||||
// Manage the life span of the sandbox information object. This is necessary
|
||||
|
|
|
@ -103,7 +103,7 @@ class V8Handler : public CefV8Handler {
|
|||
retval = CefV8Value::CreateString("Hello, world!");
|
||||
break;
|
||||
case 8:
|
||||
retval = CefV8Value::CreateObject(NULL, NULL);
|
||||
retval = CefV8Value::CreateObject(nullptr, nullptr);
|
||||
break;
|
||||
case 9:
|
||||
retval = CefV8Value::CreateArray(8);
|
||||
|
|
|
@ -160,7 +160,7 @@ PERF_TEST_FUNC(V8FunctionExecuteWithContext) {
|
|||
|
||||
PERF_TEST_FUNC(V8ObjectCreate) {
|
||||
PERF_ITERATIONS_START()
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL, NULL);
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(nullptr, nullptr);
|
||||
PERF_ITERATIONS_END()
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ PERF_TEST_FUNC(V8ObjectCreateWithAccessor) {
|
|||
CefRefPtr<CefV8Accessor> accessor = new Accessor();
|
||||
|
||||
PERF_ITERATIONS_START()
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(accessor, NULL);
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(accessor, nullptr);
|
||||
PERF_ITERATIONS_END()
|
||||
}
|
||||
|
||||
|
@ -224,14 +224,14 @@ PERF_TEST_FUNC(V8ObjectCreateWithInterceptor) {
|
|||
CefRefPtr<CefV8Interceptor> interceptor = new Interceptor();
|
||||
|
||||
PERF_ITERATIONS_START()
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL, interceptor);
|
||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(nullptr, interceptor);
|
||||
PERF_ITERATIONS_END()
|
||||
}
|
||||
|
||||
PERF_TEST_FUNC(V8ObjectSetValue) {
|
||||
CefString name = "name";
|
||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(nullptr, nullptr);
|
||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
PERF_ITERATIONS_START()
|
||||
|
@ -242,7 +242,7 @@ PERF_TEST_FUNC(V8ObjectSetValue) {
|
|||
PERF_TEST_FUNC(V8ObjectGetValue) {
|
||||
CefString name = "name";
|
||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(nullptr, nullptr);
|
||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
PERF_ITERATIONS_START()
|
||||
|
@ -275,7 +275,7 @@ PERF_TEST_FUNC(V8ObjectSetValueWithAccessor) {
|
|||
|
||||
CefString name = "name";
|
||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, NULL);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, nullptr);
|
||||
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
|
@ -309,7 +309,7 @@ PERF_TEST_FUNC(V8ObjectGetValueWithAccessor) {
|
|||
|
||||
CefString name = "name";
|
||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, NULL);
|
||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, nullptr);
|
||||
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@ void ClientAppBrowser::OnContextInitialized() {
|
|||
if (!cookieable_schemes_.empty()) {
|
||||
// Register cookieable schemes with the global cookie manager.
|
||||
CefRefPtr<CefCookieManager> manager =
|
||||
CefCookieManager::GetGlobalManager(NULL);
|
||||
CefCookieManager::GetGlobalManager(nullptr);
|
||||
DCHECK(manager.get());
|
||||
manager->SetSupportedSchemes(cookieable_schemes_, true, NULL);
|
||||
manager->SetSupportedSchemes(cookieable_schemes_, true, nullptr);
|
||||
}
|
||||
|
||||
print_handler_ = CreatePrintHandler();
|
||||
|
|
|
@ -83,7 +83,7 @@ void GetInternalManifest(const std::string& extension_path,
|
|||
if (!LoadBinaryResource(manifest_path.c_str(), manifest_contents) ||
|
||||
manifest_contents.empty()) {
|
||||
LOG(ERROR) << "Failed to load manifest from " << manifest_path;
|
||||
RunManifestCallback(callback, NULL);
|
||||
RunManifestCallback(callback, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ void GetInternalManifest(const std::string& extension_path,
|
|||
error_msg = "Incorrectly formatted dictionary contents.";
|
||||
LOG(ERROR) << "Failed to parse manifest from " << manifest_path << "; "
|
||||
<< error_msg.ToString();
|
||||
RunManifestCallback(callback, NULL);
|
||||
RunManifestCallback(callback, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ void LoadExtension(CefRefPtr<CefRequestContext> request_context,
|
|||
extension_path, handler));
|
||||
} else {
|
||||
// Load the extension from disk.
|
||||
request_context->LoadExtension(extension_path, NULL, handler);
|
||||
request_context->LoadExtension(extension_path, nullptr, handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace client {
|
|||
|
||||
namespace {
|
||||
|
||||
MainMessageLoop* g_main_message_loop = NULL;
|
||||
MainMessageLoop* g_main_message_loop = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -21,7 +21,7 @@ MainMessageLoop::MainMessageLoop() {
|
|||
}
|
||||
|
||||
MainMessageLoop::~MainMessageLoop() {
|
||||
g_main_message_loop = NULL;
|
||||
g_main_message_loop = nullptr;
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -88,7 +88,7 @@ class MainMessageLoop {
|
|||
//
|
||||
// base::scoped_refptr<Foo> foo = new Foo();
|
||||
// foo->DoSomething();
|
||||
// foo = NULL; // Deletion of |foo| will occur on the main thread.
|
||||
// foo = nullptr; // Deletion of |foo| will occur on the main thread.
|
||||
//
|
||||
struct DeleteOnMainThread {
|
||||
template <typename T>
|
||||
|
|
|
@ -22,7 +22,7 @@ const int32 kTimerDelayPlaceholder = INT_MAX;
|
|||
// DoWork().
|
||||
const int64 kMaxTimerDelay = 1000 / 30; // 30fps
|
||||
|
||||
client::MainMessageLoopExternalPump* g_external_message_pump = NULL;
|
||||
client::MainMessageLoopExternalPump* g_external_message_pump = nullptr;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -33,7 +33,7 @@ MainMessageLoopExternalPump::MainMessageLoopExternalPump()
|
|||
}
|
||||
|
||||
MainMessageLoopExternalPump::~MainMessageLoopExternalPump() {
|
||||
g_external_message_pump = NULL;
|
||||
g_external_message_pump = nullptr;
|
||||
}
|
||||
|
||||
MainMessageLoopExternalPump* MainMessageLoopExternalPump::Get() {
|
||||
|
|
|
@ -50,13 +50,13 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) {
|
|||
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
||||
std::string path;
|
||||
if (!GetResourceDir(path))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
path.append("/");
|
||||
path.append(resource_name);
|
||||
|
||||
if (!FileExists(path.c_str()))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return CefStreamReader::CreateForFile(path);
|
||||
}
|
||||
|
|
|
@ -103,18 +103,18 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) {
|
|||
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
||||
int resource_id = GetResourceId(resource_name);
|
||||
if (resource_id == 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
DWORD dwSize;
|
||||
LPBYTE pBytes;
|
||||
|
||||
if (LoadBinaryResource(resource_id, dwSize, pBytes)) {
|
||||
return CefStreamReader::CreateForHandler(
|
||||
new CefByteReadHandler(pBytes, dwSize, NULL));
|
||||
new CefByteReadHandler(pBytes, dwSize, nullptr));
|
||||
}
|
||||
|
||||
NOTREACHED(); // The resource should be found.
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CefResourceManager::Provider* CreateBinaryResourceProvider(
|
||||
|
|
|
@ -46,7 +46,7 @@ int RunMain(int argc, char* argv[]) {
|
|||
app = new ClientAppOther();
|
||||
|
||||
// Execute the secondary process.
|
||||
return CefExecuteProcess(main_args, app, NULL);
|
||||
return CefExecuteProcess(main_args, app, nullptr);
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -34,7 +34,7 @@ class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler {
|
|||
|
||||
virtual CefRefPtr<CefLoadHandler> GetLoadHandler(
|
||||
CefRefPtr<ClientAppRenderer> app) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual void OnContextCreated(CefRefPtr<ClientAppRenderer> app,
|
||||
|
|
Loading…
Reference in New Issue