Modernize to C++11: NULL => nullptr.
No functional change.
This commit is contained in:
parent
9c74ea4bf4
commit
fab02809c6
29 changed files with 82 additions and 82 deletions
|
@ -21,7 +21,7 @@ namespace api {
|
||||||
|
|
||||||
Menu::Menu(v8::Isolate* isolate)
|
Menu::Menu(v8::Isolate* isolate)
|
||||||
: model_(new AtomMenuModel(this)),
|
: model_(new AtomMenuModel(this)),
|
||||||
parent_(NULL) {
|
parent_(nullptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu::~Menu() {
|
Menu::~Menu() {
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
Event::Event(v8::Isolate* isolate)
|
Event::Event(v8::Isolate* isolate)
|
||||||
: sender_(NULL),
|
: sender_(nullptr),
|
||||||
message_(NULL) {
|
message_(nullptr) {
|
||||||
Init(isolate);
|
Init(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ void Event::SetSenderAndMessage(content::WebContents* sender,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::WebContentsDestroyed() {
|
void Event::WebContentsDestroyed() {
|
||||||
sender_ = NULL;
|
sender_ = nullptr;
|
||||||
message_ = NULL;
|
message_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::PreventDefault(v8::Isolate* isolate) {
|
void Event::PreventDefault(v8::Isolate* isolate) {
|
||||||
|
@ -41,13 +41,13 @@ void Event::PreventDefault(v8::Isolate* isolate) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Event::SendReply(const base::string16& json) {
|
bool Event::SendReply(const base::string16& json) {
|
||||||
if (message_ == NULL || sender_ == NULL)
|
if (message_ == nullptr || sender_ == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
|
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
|
||||||
bool success = sender_->Send(message_);
|
bool success = sender_->Send(message_);
|
||||||
message_ = NULL;
|
message_ = nullptr;
|
||||||
sender_ = NULL;
|
sender_ = nullptr;
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ void Erase(T* container, typename T::iterator iter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
AtomBrowserMainParts* AtomBrowserMainParts::self_ = NULL;
|
AtomBrowserMainParts* AtomBrowserMainParts::self_ = nullptr;
|
||||||
|
|
||||||
AtomBrowserMainParts::AtomBrowserMainParts()
|
AtomBrowserMainParts::AtomBrowserMainParts()
|
||||||
: fake_browser_process_(new BrowserProcess),
|
: fake_browser_process_(new BrowserProcess),
|
||||||
|
|
|
@ -43,7 +43,7 @@ void GracefulShutdownHandler(int signal) {
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
memset(&action, 0, sizeof(action));
|
memset(&action, 0, sizeof(action));
|
||||||
action.sa_handler = SIG_DFL;
|
action.sa_handler = SIG_DFL;
|
||||||
RAW_CHECK(sigaction(signal, &action, NULL) == 0);
|
RAW_CHECK(sigaction(signal, &action, nullptr) == 0);
|
||||||
|
|
||||||
RAW_CHECK(g_pipe_pid == getpid());
|
RAW_CHECK(g_pipe_pid == getpid());
|
||||||
RAW_CHECK(g_shutdown_pipe_write_fd != -1);
|
RAW_CHECK(g_shutdown_pipe_write_fd != -1);
|
||||||
|
@ -171,7 +171,7 @@ void AtomBrowserMainParts::HandleSIGCHLD() {
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
memset(&action, 0, sizeof(action));
|
memset(&action, 0, sizeof(action));
|
||||||
action.sa_handler = SIGCHLDHandler;
|
action.sa_handler = SIGCHLDHandler;
|
||||||
CHECK_EQ(sigaction(SIGCHLD, &action, NULL), 0);
|
CHECK_EQ(sigaction(SIGCHLD, &action, nullptr), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomBrowserMainParts::HandleShutdownSignals() {
|
void AtomBrowserMainParts::HandleShutdownSignals() {
|
||||||
|
@ -211,15 +211,15 @@ void AtomBrowserMainParts::HandleShutdownSignals() {
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
memset(&action, 0, sizeof(action));
|
memset(&action, 0, sizeof(action));
|
||||||
action.sa_handler = SIGTERMHandler;
|
action.sa_handler = SIGTERMHandler;
|
||||||
CHECK_EQ(sigaction(SIGTERM, &action, NULL), 0);
|
CHECK_EQ(sigaction(SIGTERM, &action, nullptr), 0);
|
||||||
// Also handle SIGINT - when the user terminates the browser via Ctrl+C. If
|
// Also handle SIGINT - when the user terminates the browser via Ctrl+C. If
|
||||||
// the browser process is being debugged, GDB will catch the SIGINT first.
|
// the browser process is being debugged, GDB will catch the SIGINT first.
|
||||||
action.sa_handler = SIGINTHandler;
|
action.sa_handler = SIGINTHandler;
|
||||||
CHECK_EQ(sigaction(SIGINT, &action, NULL), 0);
|
CHECK_EQ(sigaction(SIGINT, &action, nullptr), 0);
|
||||||
// And SIGHUP, for when the terminal disappears. On shutdown, many Linux
|
// And SIGHUP, for when the terminal disappears. On shutdown, many Linux
|
||||||
// distros send SIGHUP, SIGTERM, and then SIGKILL.
|
// distros send SIGHUP, SIGTERM, and then SIGKILL.
|
||||||
action.sa_handler = SIGHUPHandler;
|
action.sa_handler = SIGHUPHandler;
|
||||||
CHECK_EQ(sigaction(SIGHUP, &action, NULL), 0);
|
CHECK_EQ(sigaction(SIGHUP, &action, nullptr), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -183,7 +183,7 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location,
|
||||||
net::Filter* URLRequestAsarJob::SetupFilter() const {
|
net::Filter* URLRequestAsarJob::SetupFilter() const {
|
||||||
// Bug 9936 - .svgz files needs to be decompressed.
|
// Bug 9936 - .svgz files needs to be decompressed.
|
||||||
return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
|
return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
|
||||||
? net::Filter::GZipFactory() : NULL;
|
? net::Filter::GZipFactory() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool URLRequestAsarJob::GetMimeType(std::string* mime_type) const {
|
bool URLRequestAsarJob::GetMimeType(std::string* mime_type) const {
|
||||||
|
@ -338,7 +338,7 @@ void URLRequestAsarJob::DidRead(scoped_refptr<net::IOBuffer> buf, int result) {
|
||||||
DCHECK_GE(remaining_bytes_, 0);
|
DCHECK_GE(remaining_bytes_, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = NULL;
|
buf = nullptr;
|
||||||
|
|
||||||
ReadRawDataComplete(result);
|
ReadRawDataComplete(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ void RelauncherSynchronizeWithParent() {
|
||||||
|
|
||||||
struct kevent change = { 0 };
|
struct kevent change = { 0 };
|
||||||
EV_SET(&change, parent_pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
|
EV_SET(&change, parent_pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
|
||||||
if (kevent(kq.get(), &change, 1, NULL, 0, NULL) == -1) {
|
if (kevent(kq.get(), &change, 1, nullptr, 0, nullptr) == -1) {
|
||||||
PLOG(ERROR) << "kevent (add)";
|
PLOG(ERROR) << "kevent (add)";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ void RelauncherSynchronizeWithParent() {
|
||||||
// write above to complete. The parent process is now free to exit. Wait for
|
// write above to complete. The parent process is now free to exit. Wait for
|
||||||
// that to happen.
|
// that to happen.
|
||||||
struct kevent event;
|
struct kevent event;
|
||||||
int events = kevent(kq.get(), NULL, 0, &event, 1, NULL);
|
int events = kevent(kq.get(), nullptr, 0, &event, 1, nullptr);
|
||||||
if (events != 1) {
|
if (events != 1) {
|
||||||
if (events < 0) {
|
if (events < 0) {
|
||||||
PLOG(ERROR) << "kevent (monitor)";
|
PLOG(ERROR) << "kevent (monitor)";
|
||||||
|
|
|
@ -17,7 +17,7 @@ base::LazyInstance<base::ObserverList<WindowListObserver>>::Leaky
|
||||||
WindowList::observers_ = LAZY_INSTANCE_INITIALIZER;
|
WindowList::observers_ = LAZY_INSTANCE_INITIALIZER;
|
||||||
|
|
||||||
// static
|
// static
|
||||||
WindowList* WindowList::instance_ = NULL;
|
WindowList* WindowList::instance_ = nullptr;
|
||||||
|
|
||||||
// static
|
// static
|
||||||
WindowList* WindowList::GetInstance() {
|
WindowList* WindowList::GetInstance() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace {
|
||||||
struct DummyClass { bool crash; };
|
struct DummyClass { bool crash; };
|
||||||
|
|
||||||
void Crash() {
|
void Crash() {
|
||||||
static_cast<DummyClass*>(NULL)->crash = true;
|
static_cast<DummyClass*>(nullptr)->crash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hang() {
|
void Hang() {
|
||||||
|
|
|
@ -41,7 +41,7 @@ bool GetFilesNode(const base::DictionaryValue* root,
|
||||||
// Test for symbol linked directory.
|
// Test for symbol linked directory.
|
||||||
std::string link;
|
std::string link;
|
||||||
if (dir->GetStringWithoutPathExpansion("link", &link)) {
|
if (dir->GetStringWithoutPathExpansion("link", &link)) {
|
||||||
const base::DictionaryValue* linked_node = NULL;
|
const base::DictionaryValue* linked_node = nullptr;
|
||||||
if (!GetNodeFromPath(link, root, &linked_node))
|
if (!GetNodeFromPath(link, root, &linked_node))
|
||||||
return false;
|
return false;
|
||||||
dir = linked_node;
|
dir = linked_node;
|
||||||
|
@ -60,7 +60,7 @@ bool GetChildNode(const base::DictionaryValue* root,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const base::DictionaryValue* files = NULL;
|
const base::DictionaryValue* files = nullptr;
|
||||||
return GetFilesNode(root, dir, &files) &&
|
return GetFilesNode(root, dir, &files) &&
|
||||||
files->GetDictionaryWithoutPathExpansion(name, out);
|
files->GetDictionaryWithoutPathExpansion(name, out);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ bool GetNodeFromPath(std::string path,
|
||||||
for (size_t delimiter_position = path.find_first_of(kSeparators);
|
for (size_t delimiter_position = path.find_first_of(kSeparators);
|
||||||
delimiter_position != std::string::npos;
|
delimiter_position != std::string::npos;
|
||||||
delimiter_position = path.find_first_of(kSeparators)) {
|
delimiter_position = path.find_first_of(kSeparators)) {
|
||||||
const base::DictionaryValue* child = NULL;
|
const base::DictionaryValue* child = nullptr;
|
||||||
if (!GetChildNode(root, path.substr(0, delimiter_position), dir, &child))
|
if (!GetChildNode(root, path.substr(0, delimiter_position), dir, &child))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Array(
|
||||||
v8::Local<v8::Array> result(v8::Array::New(isolate, val->GetSize()));
|
v8::Local<v8::Array> result(v8::Array::New(isolate, val->GetSize()));
|
||||||
|
|
||||||
for (size_t i = 0; i < val->GetSize(); ++i) {
|
for (size_t i = 0; i < val->GetSize(); ++i) {
|
||||||
const base::Value* child = NULL;
|
const base::Value* child = nullptr;
|
||||||
CHECK(val->Get(i, &child));
|
CHECK(val->Get(i, &child));
|
||||||
|
|
||||||
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child);
|
v8::Local<v8::Value> child_v8 = ToV8ValueImpl(isolate, child);
|
||||||
|
@ -214,7 +214,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
|
||||||
|
|
||||||
FromV8ValueState::Level state_level(state);
|
FromV8ValueState::Level state_level(state);
|
||||||
if (state->HasReachedMaxRecursionDepth())
|
if (state->HasReachedMaxRecursionDepth())
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (val->IsNull())
|
if (val->IsNull())
|
||||||
return base::Value::CreateNullValue().release();
|
return base::Value::CreateNullValue().release();
|
||||||
|
@ -235,7 +235,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
|
||||||
|
|
||||||
if (val->IsUndefined())
|
if (val->IsUndefined())
|
||||||
// JSON.stringify ignores undefined.
|
// JSON.stringify ignores undefined.
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (val->IsDate()) {
|
if (val->IsDate()) {
|
||||||
v8::Date* date = v8::Date::Cast(*val);
|
v8::Date* date = v8::Date::Cast(*val);
|
||||||
|
@ -265,7 +265,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
|
||||||
if (val->IsFunction()) {
|
if (val->IsFunction()) {
|
||||||
if (!function_allowed_)
|
if (!function_allowed_)
|
||||||
// JSON.stringify refuses to convert function(){}.
|
// JSON.stringify refuses to convert function(){}.
|
||||||
return NULL;
|
return nullptr;
|
||||||
return FromV8Object(val->ToObject(), state, isolate);
|
return FromV8Object(val->ToObject(), state, isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(ERROR) << "Unexpected v8 value type encountered.";
|
LOG(ERROR) << "Unexpected v8 value type encountered.";
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::Value* V8ValueConverter::FromV8Array(
|
base::Value* V8ValueConverter::FromV8Array(
|
||||||
|
|
|
@ -54,7 +54,7 @@ void NodeBindingsMac::PollEvents() {
|
||||||
// Wait for new libuv events.
|
// Wait for new libuv events.
|
||||||
int r;
|
int r;
|
||||||
do {
|
do {
|
||||||
r = select(fd + 1, &readset, NULL, NULL, timeout == -1 ? NULL : &tv);
|
r = select(fd + 1, &readset, nullptr, nullptr, timeout == -1 ? nullptr : &tv);
|
||||||
} while (r == -1 && errno == EINTR);
|
} while (r == -1 && errno == EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ namespace {
|
||||||
RenderView* GetCurrentRenderView() {
|
RenderView* GetCurrentRenderView() {
|
||||||
WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext();
|
WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext();
|
||||||
if (!frame)
|
if (!frame)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
WebView* view = frame->view();
|
WebView* view = frame->view();
|
||||||
if (!view)
|
if (!view)
|
||||||
return NULL; // can happen during closing.
|
return nullptr; // can happen during closing.
|
||||||
|
|
||||||
return RenderView::FromWebView(view);
|
return RenderView::FromWebView(view);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ void Send(mate::Arguments* args,
|
||||||
const base::string16& channel,
|
const base::string16& channel,
|
||||||
const base::ListValue& arguments) {
|
const base::ListValue& arguments) {
|
||||||
RenderView* render_view = GetCurrentRenderView();
|
RenderView* render_view = GetCurrentRenderView();
|
||||||
if (render_view == NULL)
|
if (render_view == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool success = render_view->Send(new AtomViewHostMsg_Message(
|
bool success = render_view->Send(new AtomViewHostMsg_Message(
|
||||||
|
@ -49,7 +49,7 @@ base::string16 SendSync(mate::Arguments* args,
|
||||||
base::string16 json;
|
base::string16 json;
|
||||||
|
|
||||||
RenderView* render_view = GetCurrentRenderView();
|
RenderView* render_view = GetCurrentRenderView();
|
||||||
if (render_view == NULL)
|
if (render_view == nullptr)
|
||||||
return json;
|
return json;
|
||||||
|
|
||||||
IPC::SyncMessage* message = new AtomViewHostMsg_Message_Sync(
|
IPC::SyncMessage* message = new AtomViewHostMsg_Message_Sync(
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "chrome/browser/printing/print_job_manager.h"
|
#include "chrome/browser/printing/print_job_manager.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
|
|
||||||
BrowserProcess* g_browser_process = NULL;
|
BrowserProcess* g_browser_process = nullptr;
|
||||||
|
|
||||||
BrowserProcess::BrowserProcess() {
|
BrowserProcess::BrowserProcess() {
|
||||||
g_browser_process = this;
|
g_browser_process = this;
|
||||||
|
@ -16,7 +16,7 @@ BrowserProcess::BrowserProcess() {
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserProcess::~BrowserProcess() {
|
BrowserProcess::~BrowserProcess() {
|
||||||
g_browser_process = NULL;
|
g_browser_process = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string BrowserProcess::GetApplicationLocale() {
|
std::string BrowserProcess::GetApplicationLocale() {
|
||||||
|
|
|
@ -220,7 +220,7 @@ void NativeDesktopMediaList::Worker::Refresh(
|
||||||
|
|
||||||
webrtc::SharedMemory* NativeDesktopMediaList::Worker::CreateSharedMemory(
|
webrtc::SharedMemory* NativeDesktopMediaList::Worker::CreateSharedMemory(
|
||||||
size_t size) {
|
size_t size) {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeDesktopMediaList::Worker::OnCaptureCompleted(
|
void NativeDesktopMediaList::Worker::OnCaptureCompleted(
|
||||||
|
@ -236,7 +236,7 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
||||||
update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
|
update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
|
||||||
thumbnail_size_(100, 100),
|
thumbnail_size_(100, 100),
|
||||||
view_dialog_id_(-1),
|
view_dialog_id_(-1),
|
||||||
observer_(NULL),
|
observer_(nullptr),
|
||||||
weak_factory_(this) {
|
weak_factory_(this) {
|
||||||
base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool();
|
base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool();
|
||||||
capture_task_runner_ = worker_pool->GetSequencedTaskRunner(
|
capture_task_runner_ = worker_pool->GetSequencedTaskRunner(
|
||||||
|
|
|
@ -38,7 +38,7 @@ void HoldRefCallback(const scoped_refptr<printing::PrintJobWorkerOwner>& owner,
|
||||||
namespace printing {
|
namespace printing {
|
||||||
|
|
||||||
PrintJob::PrintJob()
|
PrintJob::PrintJob()
|
||||||
: source_(NULL),
|
: source_(nullptr),
|
||||||
worker_(),
|
worker_(),
|
||||||
settings_(),
|
settings_(),
|
||||||
is_job_pending_(false),
|
is_job_pending_(false),
|
||||||
|
@ -106,7 +106,7 @@ void PrintJob::GetSettingsDone(const PrintSettings& new_settings,
|
||||||
|
|
||||||
PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) {
|
PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PrintSettings& PrintJob::settings() const {
|
const PrintSettings& PrintJob::settings() const {
|
||||||
|
@ -139,7 +139,7 @@ void PrintJob::StartPrinting() {
|
||||||
|
|
||||||
// Tell everyone!
|
// Tell everyone!
|
||||||
scoped_refptr<JobEventDetails> details(
|
scoped_refptr<JobEventDetails> details(
|
||||||
new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), NULL));
|
new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), nullptr));
|
||||||
content::NotificationService::current()->Notify(
|
content::NotificationService::current()->Notify(
|
||||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||||
content::Source<PrintJob>(this),
|
content::Source<PrintJob>(this),
|
||||||
|
@ -163,7 +163,7 @@ void PrintJob::Stop() {
|
||||||
ControlledWorkerShutdown();
|
ControlledWorkerShutdown();
|
||||||
} else {
|
} else {
|
||||||
// Flush the cached document.
|
// Flush the cached document.
|
||||||
UpdatePrintedDocument(NULL);
|
UpdatePrintedDocument(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ void PrintJob::Cancel() {
|
||||||
}
|
}
|
||||||
// Make sure a Cancel() is broadcast.
|
// Make sure a Cancel() is broadcast.
|
||||||
scoped_refptr<JobEventDetails> details(
|
scoped_refptr<JobEventDetails> details(
|
||||||
new JobEventDetails(JobEventDetails::FAILED, NULL, NULL));
|
new JobEventDetails(JobEventDetails::FAILED, nullptr, nullptr));
|
||||||
content::NotificationService::current()->Notify(
|
content::NotificationService::current()->Notify(
|
||||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||||
content::Source<PrintJob>(this),
|
content::Source<PrintJob>(this),
|
||||||
|
@ -207,7 +207,7 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJob::DisconnectSource() {
|
void PrintJob::DisconnectSource() {
|
||||||
source_ = NULL;
|
source_ = nullptr;
|
||||||
if (document_.get())
|
if (document_.get())
|
||||||
document_->DisconnectSource();
|
document_->DisconnectSource();
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ void PrintJob::OnDocumentDone() {
|
||||||
Stop();
|
Stop();
|
||||||
|
|
||||||
scoped_refptr<JobEventDetails> details(
|
scoped_refptr<JobEventDetails> details(
|
||||||
new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), NULL));
|
new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), nullptr));
|
||||||
content::NotificationService::current()->Notify(
|
content::NotificationService::current()->Notify(
|
||||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||||
content::Source<PrintJob>(this),
|
content::Source<PrintJob>(this),
|
||||||
|
@ -434,7 +434,7 @@ void PrintJob::ControlledWorkerShutdown() {
|
||||||
|
|
||||||
is_job_pending_ = false;
|
is_job_pending_ = false;
|
||||||
registrar_.RemoveAll();
|
registrar_.RemoveAll();
|
||||||
UpdatePrintedDocument(NULL);
|
UpdatePrintedDocument(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJob::HoldUntilStopIsCalled() {
|
void PrintJob::HoldUntilStopIsCalled() {
|
||||||
|
|
|
@ -41,7 +41,7 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::PopPrinterQuery(
|
||||||
return current_query;
|
return current_query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
|
scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
|
||||||
|
@ -90,7 +90,7 @@ void PrintJobManager::Shutdown() {
|
||||||
StopJobs(true);
|
StopJobs(true);
|
||||||
if (queue_.get())
|
if (queue_.get())
|
||||||
queue_->Shutdown();
|
queue_->Shutdown();
|
||||||
queue_ = NULL;
|
queue_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJobManager::StopJobs(bool wait_for_finish) {
|
void PrintJobManager::StopJobs(bool wait_for_finish) {
|
||||||
|
|
|
@ -62,9 +62,9 @@ gfx::NativeView PrintingContextDelegate::GetParentView() {
|
||||||
content::RenderViewHost* view =
|
content::RenderViewHost* view =
|
||||||
content::RenderViewHost::FromID(render_process_id_, render_view_id_);
|
content::RenderViewHost::FromID(render_process_id_, render_view_id_);
|
||||||
if (!view)
|
if (!view)
|
||||||
return NULL;
|
return nullptr;
|
||||||
content::WebContents* wc = content::WebContents::FromRenderViewHost(view);
|
content::WebContents* wc = content::WebContents::FromRenderViewHost(view);
|
||||||
return wc ? wc->GetNativeView() : NULL;
|
return wc ? wc->GetNativeView() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string PrintingContextDelegate::GetAppLocale() {
|
std::string PrintingContextDelegate::GetAppLocale() {
|
||||||
|
@ -343,7 +343,7 @@ void PrintJobWorker::OnDocumentDone() {
|
||||||
base::RetainedRef(document_), nullptr));
|
base::RetainedRef(document_), nullptr));
|
||||||
|
|
||||||
// Makes sure the variables are reinitialized.
|
// Makes sure the variables are reinitialized.
|
||||||
document_ = NULL;
|
document_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintJobWorker::SpoolPage(PrintedPage* page) {
|
void PrintJobWorker::SpoolPage(PrintedPage* page) {
|
||||||
|
@ -397,7 +397,7 @@ void PrintJobWorker::OnFailure() {
|
||||||
Cancel();
|
Cancel();
|
||||||
|
|
||||||
// Makes sure the variables are reinitialized.
|
// Makes sure the variables are reinitialized.
|
||||||
document_ = NULL;
|
document_ = nullptr;
|
||||||
page_number_ = PageNumber::npos();
|
page_number_ = PageNumber::npos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||||
content::Source<PrintJob>(print_job_.get()));
|
content::Source<PrintJob>(print_job_.get()));
|
||||||
print_job_->DisconnectSource();
|
print_job_->DisconnectSource();
|
||||||
// Don't close the worker thread.
|
// Don't close the worker thread.
|
||||||
print_job_ = NULL;
|
print_job_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrintViewManagerBase::RunInnerMessageLoop() {
|
bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||||
|
|
|
@ -122,7 +122,7 @@ bool PrinterQuery::is_callback_pending() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrinterQuery::is_valid() const {
|
bool PrinterQuery::is_valid() const {
|
||||||
return worker_.get() != NULL;
|
return worker_.get() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace printing
|
} // namespace printing
|
||||||
|
|
|
@ -246,7 +246,7 @@ content::WebContents* PrintingMessageFilter::GetWebContentsForRenderView(
|
||||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||||
content::RenderViewHost* view = content::RenderViewHost::FromID(
|
content::RenderViewHost* view = content::RenderViewHost::FromID(
|
||||||
render_process_id_, render_view_id);
|
render_process_id_, render_view_id);
|
||||||
return view ? content::WebContents::FromRenderViewHost(view) : NULL;
|
return view ? content::WebContents::FromRenderViewHost(view) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
|
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
|
||||||
|
|
|
@ -171,7 +171,7 @@ int WaitSocketForRead(int fd, const base::TimeDelta& timeout) {
|
||||||
FD_ZERO(&read_fds);
|
FD_ZERO(&read_fds);
|
||||||
FD_SET(fd, &read_fds);
|
FD_SET(fd, &read_fds);
|
||||||
|
|
||||||
return HANDLE_EINTR(select(fd + 1, &read_fds, NULL, NULL, &tv));
|
return HANDLE_EINTR(select(fd + 1, &read_fds, nullptr, nullptr, &tv));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read a message from a socket fd, with an optional timeout.
|
// Read a message from a socket fd, with an optional timeout.
|
||||||
|
|
|
@ -26,7 +26,7 @@ PepperIsolatedFileSystemMessageFilter::Create(PP_Instance instance,
|
||||||
int unused_render_frame_id;
|
int unused_render_frame_id;
|
||||||
if (!host->GetRenderFrameIDsForInstance(
|
if (!host->GetRenderFrameIDsForInstance(
|
||||||
instance, &render_process_id, &unused_render_frame_id)) {
|
instance, &render_process_id, &unused_render_frame_id)) {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new PepperIsolatedFileSystemMessageFilter(
|
return new PepperIsolatedFileSystemMessageFilter(
|
||||||
render_process_id,
|
render_process_id,
|
||||||
|
|
|
@ -115,10 +115,10 @@ TtsControllerImpl* TtsControllerImpl::GetInstance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
TtsControllerImpl::TtsControllerImpl()
|
TtsControllerImpl::TtsControllerImpl()
|
||||||
: current_utterance_(NULL),
|
: current_utterance_(nullptr),
|
||||||
paused_(false),
|
paused_(false),
|
||||||
platform_impl_(NULL),
|
platform_impl_(nullptr),
|
||||||
tts_engine_delegate_(NULL) {
|
tts_engine_delegate_(nullptr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TtsControllerImpl::~TtsControllerImpl() {
|
TtsControllerImpl::~TtsControllerImpl() {
|
||||||
|
@ -206,7 +206,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) {
|
||||||
if (!sends_end_event) {
|
if (!sends_end_event) {
|
||||||
utterance->Finish();
|
utterance->Finish();
|
||||||
delete utterance;
|
delete utterance;
|
||||||
current_utterance_ = NULL;
|
current_utterance_ = nullptr;
|
||||||
SpeakNextUtterance();
|
SpeakNextUtterance();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -222,7 +222,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) {
|
||||||
voice,
|
voice,
|
||||||
utterance->continuous_parameters());
|
utterance->continuous_parameters());
|
||||||
if (!success)
|
if (!success)
|
||||||
current_utterance_ = NULL;
|
current_utterance_ = nullptr;
|
||||||
|
|
||||||
// If the native voice wasn't able to process this speech, see if
|
// If the native voice wasn't able to process this speech, see if
|
||||||
// the browser has built-in TTS that isn't loaded yet.
|
// the browser has built-in TTS that isn't loaded yet.
|
||||||
|
@ -323,7 +323,7 @@ void TtsControllerImpl::GetVoices(content::BrowserContext* browser_context,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TtsControllerImpl::IsSpeaking() {
|
bool TtsControllerImpl::IsSpeaking() {
|
||||||
return current_utterance_ != NULL || GetPlatformImpl()->IsSpeaking();
|
return current_utterance_ != nullptr || GetPlatformImpl()->IsSpeaking();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TtsControllerImpl::FinishCurrentUtterance() {
|
void TtsControllerImpl::FinishCurrentUtterance() {
|
||||||
|
@ -332,7 +332,7 @@ void TtsControllerImpl::FinishCurrentUtterance() {
|
||||||
current_utterance_->OnTtsEvent(TTS_EVENT_INTERRUPTED, kInvalidCharIndex,
|
current_utterance_->OnTtsEvent(TTS_EVENT_INTERRUPTED, kInvalidCharIndex,
|
||||||
std::string());
|
std::string());
|
||||||
delete current_utterance_;
|
delete current_utterance_;
|
||||||
current_utterance_ = NULL;
|
current_utterance_ = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ void PepperFlashMenuHost::OnMenuClosed(int request_id) {
|
||||||
void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) {
|
void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) {
|
||||||
ppapi::host::ReplyMessageContext reply_context(
|
ppapi::host::ReplyMessageContext reply_context(
|
||||||
ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0),
|
ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0),
|
||||||
NULL,
|
nullptr,
|
||||||
MSG_ROUTING_NONE);
|
MSG_ROUTING_NONE);
|
||||||
reply_context.params.set_result(result);
|
reply_context.params.set_result(result);
|
||||||
host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action));
|
host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action));
|
||||||
|
|
|
@ -115,7 +115,7 @@ bool IsSimpleHeader(const std::string& lower_case_header_name,
|
||||||
&lower_case_mime_type,
|
&lower_case_mime_type,
|
||||||
&lower_case_charset,
|
&lower_case_charset,
|
||||||
&had_charset,
|
&had_charset,
|
||||||
NULL);
|
nullptr);
|
||||||
return lower_case_mime_type == "application/x-www-form-urlencoded" ||
|
return lower_case_mime_type == "application/x-www-form-urlencoded" ||
|
||||||
lower_case_mime_type == "multipart/form-data" ||
|
lower_case_mime_type == "multipart/form-data" ||
|
||||||
lower_case_mime_type == "text/plain";
|
lower_case_mime_type == "text/plain";
|
||||||
|
|
|
@ -110,8 +110,8 @@ PrintMsg_Print_Params GetCssPrintParams(
|
||||||
|
|
||||||
// Invalid page size and/or margins. We just use the default setting.
|
// Invalid page size and/or margins. We just use the default setting.
|
||||||
if (new_content_width < 1 || new_content_height < 1) {
|
if (new_content_width < 1 || new_content_height < 1) {
|
||||||
CHECK(frame != NULL);
|
CHECK(frame != nullptr);
|
||||||
page_css_params = GetCssPrintParams(NULL, page_index, page_params);
|
page_css_params = GetCssPrintParams(nullptr, page_index, page_params);
|
||||||
return page_css_params;
|
return page_css_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ void ComputeWebKitPrintParamsInDesiredDpi(
|
||||||
|
|
||||||
blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) {
|
blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) {
|
||||||
return frame->document().isPluginDocument() ?
|
return frame->document().isPluginDocument() ?
|
||||||
frame->document().to<blink::WebPluginDocument>().plugin() : NULL;
|
frame->document().to<blink::WebPluginDocument>().plugin() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrintingNodeOrPdfFrame(const blink::WebFrame* frame,
|
bool PrintingNodeOrPdfFrame(const blink::WebFrame* frame,
|
||||||
|
@ -323,7 +323,7 @@ FrameReference::FrameReference(blink::WebLocalFrame* frame) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameReference::FrameReference() {
|
FrameReference::FrameReference() {
|
||||||
Reset(NULL);
|
Reset(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameReference::~FrameReference() {
|
FrameReference::~FrameReference() {
|
||||||
|
@ -334,20 +334,20 @@ void FrameReference::Reset(blink::WebLocalFrame* frame) {
|
||||||
view_ = frame->view();
|
view_ = frame->view();
|
||||||
frame_ = frame;
|
frame_ = frame;
|
||||||
} else {
|
} else {
|
||||||
view_ = NULL;
|
view_ = nullptr;
|
||||||
frame_ = NULL;
|
frame_ = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blink::WebLocalFrame* FrameReference::GetFrame() {
|
blink::WebLocalFrame* FrameReference::GetFrame() {
|
||||||
if (view_ == NULL || frame_ == NULL)
|
if (view_ == nullptr || frame_ == nullptr)
|
||||||
return NULL;
|
return nullptr;
|
||||||
for (blink::WebFrame* frame = view_->mainFrame(); frame != NULL;
|
for (blink::WebFrame* frame = view_->mainFrame(); frame != nullptr;
|
||||||
frame = frame->traverseNext(false)) {
|
frame = frame->traverseNext(false)) {
|
||||||
if (frame == frame_)
|
if (frame == frame_)
|
||||||
return frame_;
|
return frame_;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
blink::WebView* FrameReference::view() {
|
blink::WebView* FrameReference::view() {
|
||||||
|
@ -477,7 +477,7 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint(
|
||||||
frame->printBegin(web_print_params_, node_to_print_);
|
frame->printBegin(web_print_params_, node_to_print_);
|
||||||
print_params = CalculatePrintParamsForCss(frame, 0, print_params,
|
print_params = CalculatePrintParamsForCss(frame, 0, print_params,
|
||||||
ignore_css_margins, fit_to_page,
|
ignore_css_margins, fit_to_page,
|
||||||
NULL);
|
nullptr);
|
||||||
frame->printEnd();
|
frame->printEnd();
|
||||||
}
|
}
|
||||||
ComputeWebKitPrintParamsInDesiredDpi(print_params, &web_print_params_);
|
ComputeWebKitPrintParamsInDesiredDpi(print_params, &web_print_params_);
|
||||||
|
@ -623,7 +623,7 @@ void PrepareFrameAndViewForPrint::FinishPrinting() {
|
||||||
web_view->close();
|
web_view->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
frame_.Reset(NULL);
|
frame_.Reset(nullptr);
|
||||||
on_ready_.Reset();
|
on_ready_.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,8 +301,8 @@ bool SpellcheckCharAttribute::OutputDefault(UChar c,
|
||||||
// SpellcheckWordIterator implementation:
|
// SpellcheckWordIterator implementation:
|
||||||
|
|
||||||
SpellcheckWordIterator::SpellcheckWordIterator()
|
SpellcheckWordIterator::SpellcheckWordIterator()
|
||||||
: text_(NULL),
|
: text_(nullptr),
|
||||||
attribute_(NULL),
|
attribute_(nullptr),
|
||||||
iterator_() {
|
iterator_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ bool URLPattern::SetPort(const std::string& port) {
|
||||||
|
|
||||||
bool URLPattern::MatchesURL(const GURL& test) const {
|
bool URLPattern::MatchesURL(const GURL& test) const {
|
||||||
const GURL* test_url = &test;
|
const GURL* test_url = &test;
|
||||||
bool has_inner_url = test.inner_url() != NULL;
|
bool has_inner_url = test.inner_url() != nullptr;
|
||||||
|
|
||||||
if (has_inner_url) {
|
if (has_inner_url) {
|
||||||
if (!test.SchemeIsFileSystem())
|
if (!test.SchemeIsFileSystem())
|
||||||
|
@ -370,7 +370,7 @@ bool URLPattern::MatchesURL(const GURL& test) const {
|
||||||
|
|
||||||
bool URLPattern::MatchesSecurityOrigin(const GURL& test) const {
|
bool URLPattern::MatchesSecurityOrigin(const GURL& test) const {
|
||||||
const GURL* test_url = &test;
|
const GURL* test_url = &test;
|
||||||
bool has_inner_url = test.inner_url() != NULL;
|
bool has_inner_url = test.inner_url() != nullptr;
|
||||||
|
|
||||||
if (has_inner_url) {
|
if (has_inner_url) {
|
||||||
if (!test.SchemeIsFileSystem())
|
if (!test.SchemeIsFileSystem())
|
||||||
|
|
|
@ -123,7 +123,7 @@ int StreamListenSocket::GetPeerAddress(IPEndPoint* address) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketDescriptor StreamListenSocket::AcceptSocket() {
|
SocketDescriptor StreamListenSocket::AcceptSocket() {
|
||||||
SocketDescriptor conn = HANDLE_EINTR(accept(socket_, NULL, NULL));
|
SocketDescriptor conn = HANDLE_EINTR(accept(socket_, nullptr, nullptr));
|
||||||
if (conn == kInvalidSocket)
|
if (conn == kInvalidSocket)
|
||||||
LOG(ERROR) << "Error accepting connection.";
|
LOG(ERROR) << "Error accepting connection.";
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue