Don't change chromium_src files.
This commit is contained in:
parent
55b3f1936f
commit
2717b96310
22 changed files with 131 additions and 110 deletions
|
@ -7,7 +7,7 @@
|
|||
#include "chrome/browser/printing/print_job_manager.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
BrowserProcess* g_browser_process = nullptr;
|
||||
BrowserProcess* g_browser_process = NULL;
|
||||
|
||||
BrowserProcess::BrowserProcess() {
|
||||
g_browser_process = this;
|
||||
|
@ -16,7 +16,7 @@ BrowserProcess::BrowserProcess() {
|
|||
}
|
||||
|
||||
BrowserProcess::~BrowserProcess() {
|
||||
g_browser_process = nullptr;
|
||||
g_browser_process = NULL;
|
||||
}
|
||||
|
||||
std::string BrowserProcess::GetApplicationLocale() {
|
||||
|
|
|
@ -53,7 +53,7 @@ void GlobalShortcutListener::UnregisterAccelerator(
|
|||
if (IsShortcutHandlingSuspended())
|
||||
return;
|
||||
|
||||
auto it = accelerator_map_.find(accelerator);
|
||||
AcceleratorMap::iterator it = accelerator_map_.find(accelerator);
|
||||
// We should never get asked to unregister something that we didn't register.
|
||||
DCHECK(it != accelerator_map_.end());
|
||||
// The caller should call this function with the right observer.
|
||||
|
@ -70,10 +70,10 @@ void GlobalShortcutListener::UnregisterAccelerators(Observer* observer) {
|
|||
if (IsShortcutHandlingSuspended())
|
||||
return;
|
||||
|
||||
auto it = accelerator_map_.begin();
|
||||
AcceleratorMap::iterator it = accelerator_map_.begin();
|
||||
while (it != accelerator_map_.end()) {
|
||||
if (it->second == observer) {
|
||||
auto to_remove = it++;
|
||||
AcceleratorMap::iterator to_remove = it++;
|
||||
UnregisterAccelerator(to_remove->first, observer);
|
||||
} else {
|
||||
++it;
|
||||
|
@ -87,16 +87,18 @@ void GlobalShortcutListener::SetShortcutHandlingSuspended(bool suspended) {
|
|||
return;
|
||||
|
||||
shortcut_handling_suspended_ = suspended;
|
||||
for (auto& it : accelerator_map_) {
|
||||
for (AcceleratorMap::iterator it = accelerator_map_.begin();
|
||||
it != accelerator_map_.end();
|
||||
++it) {
|
||||
// On Linux, when shortcut handling is suspended we cannot simply early
|
||||
// return in NotifyKeyPressed (similar to what we do for non-global
|
||||
// shortcuts) because we'd eat the keyboard event thereby preventing the
|
||||
// user from setting the shortcut. Therefore we must unregister while
|
||||
// handling is suspended and register when handling resumes.
|
||||
if (shortcut_handling_suspended_)
|
||||
UnregisterAcceleratorImpl(it.first);
|
||||
UnregisterAcceleratorImpl(it->first);
|
||||
else
|
||||
RegisterAcceleratorImpl(it.first);
|
||||
RegisterAcceleratorImpl(it->first);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +108,7 @@ bool GlobalShortcutListener::IsShortcutHandlingSuspended() const {
|
|||
|
||||
void GlobalShortcutListener::NotifyKeyPressed(
|
||||
const ui::Accelerator& accelerator) {
|
||||
auto iter = accelerator_map_.find(accelerator);
|
||||
AcceleratorMap::iterator iter = accelerator_map_.find(accelerator);
|
||||
if (iter == accelerator_map_.end()) {
|
||||
// This should never occur, because if it does, we have failed to unregister
|
||||
// or failed to clean up the map after unregistering the shortcut.
|
||||
|
|
|
@ -152,12 +152,13 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
if (window_capturer_) {
|
||||
webrtc::WindowCapturer::WindowList windows;
|
||||
if (window_capturer_->GetWindowList(&windows)) {
|
||||
for (auto& window : windows) {
|
||||
for (webrtc::WindowCapturer::WindowList::iterator it = windows.begin();
|
||||
it != windows.end(); ++it) {
|
||||
// Skip the picker dialog window.
|
||||
if (window.id != view_dialog_id) {
|
||||
if (it->id != view_dialog_id) {
|
||||
sources.push_back(SourceDescription(
|
||||
DesktopMediaID(DesktopMediaID::TYPE_WINDOW, window.id),
|
||||
base::UTF8ToUTF16(window.title)));
|
||||
DesktopMediaID(DesktopMediaID::TYPE_WINDOW, it->id),
|
||||
base::UTF8ToUTF16(it->title)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +199,7 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
new_image_hashes[source.id] = frame_hash;
|
||||
|
||||
// Scale the image only if it has changed.
|
||||
auto it = image_hashes_.find(source.id);
|
||||
ImageHashesMap::iterator it = image_hashes_.find(source.id);
|
||||
if (it == image_hashes_.end() || it->second != frame_hash) {
|
||||
gfx::ImageSkia thumbnail =
|
||||
ScaleDesktopFrame(std::move(current_frame_), thumbnail_size);
|
||||
|
@ -219,7 +220,7 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
|
||||
webrtc::SharedMemory* NativeDesktopMediaList::Worker::CreateSharedMemory(
|
||||
size_t size) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::Worker::OnCaptureCompleted(
|
||||
|
@ -235,7 +236,7 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
|||
update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
|
||||
thumbnail_size_(100, 100),
|
||||
view_dialog_id_(-1),
|
||||
observer_(nullptr),
|
||||
observer_(NULL),
|
||||
weak_factory_(this) {
|
||||
base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool();
|
||||
capture_task_runner_ = worker_pool->GetSequencedTaskRunner(
|
||||
|
@ -296,8 +297,8 @@ void NativeDesktopMediaList::OnSourcesList(
|
|||
const std::vector<SourceDescription>& new_sources) {
|
||||
typedef std::set<content::DesktopMediaID> SourceSet;
|
||||
SourceSet new_source_set;
|
||||
for (const auto& new_source : new_sources) {
|
||||
new_source_set.insert(new_source.id);
|
||||
for (size_t i = 0; i < new_sources.size(); ++i) {
|
||||
new_source_set.insert(new_sources[i].id);
|
||||
}
|
||||
// Iterate through the old sources to find the removed sources.
|
||||
for (size_t i = 0; i < sources_.size(); ++i) {
|
||||
|
@ -310,8 +311,8 @@ void NativeDesktopMediaList::OnSourcesList(
|
|||
// Iterate through the new sources to find the added sources.
|
||||
if (new_sources.size() > sources_.size()) {
|
||||
SourceSet old_source_set;
|
||||
for (auto& source : sources_) {
|
||||
old_source_set.insert(source.id);
|
||||
for (size_t i = 0; i < sources_.size(); ++i) {
|
||||
old_source_set.insert(sources_[i].id);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < new_sources.size(); ++i) {
|
||||
|
|
|
@ -38,7 +38,7 @@ void HoldRefCallback(const scoped_refptr<printing::PrintJobWorkerOwner>& owner,
|
|||
namespace printing {
|
||||
|
||||
PrintJob::PrintJob()
|
||||
: source_(nullptr),
|
||||
: source_(NULL),
|
||||
worker_(),
|
||||
settings_(),
|
||||
is_job_pending_(false),
|
||||
|
@ -71,8 +71,10 @@ void PrintJob::Initialize(PrintJobWorkerOwner* job,
|
|||
worker_.reset(job->DetachWorker(this));
|
||||
settings_ = job->settings();
|
||||
|
||||
auto* new_doc =
|
||||
new PrintedDocument(settings_, source_, job->cookie(),
|
||||
PrintedDocument* new_doc =
|
||||
new PrintedDocument(settings_,
|
||||
source_,
|
||||
job->cookie(),
|
||||
content::BrowserThread::GetBlockingPool());
|
||||
new_doc->set_page_count(page_count);
|
||||
UpdatePrintedDocument(new_doc);
|
||||
|
@ -104,7 +106,7 @@ void PrintJob::GetSettingsDone(const PrintSettings& new_settings,
|
|||
|
||||
PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) {
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const PrintSettings& PrintJob::settings() const {
|
||||
|
@ -137,7 +139,7 @@ void PrintJob::StartPrinting() {
|
|||
|
||||
// Tell everyone!
|
||||
scoped_refptr<JobEventDetails> details(
|
||||
new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), nullptr));
|
||||
new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), NULL));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
content::Source<PrintJob>(this),
|
||||
|
@ -161,7 +163,7 @@ void PrintJob::Stop() {
|
|||
ControlledWorkerShutdown();
|
||||
} else {
|
||||
// Flush the cached document.
|
||||
UpdatePrintedDocument(nullptr);
|
||||
UpdatePrintedDocument(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +183,7 @@ void PrintJob::Cancel() {
|
|||
}
|
||||
// Make sure a Cancel() is broadcast.
|
||||
scoped_refptr<JobEventDetails> details(
|
||||
new JobEventDetails(JobEventDetails::FAILED, nullptr, nullptr));
|
||||
new JobEventDetails(JobEventDetails::FAILED, NULL, NULL));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
content::Source<PrintJob>(this),
|
||||
|
@ -205,7 +207,7 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) {
|
|||
}
|
||||
|
||||
void PrintJob::DisconnectSource() {
|
||||
source_ = nullptr;
|
||||
source_ = NULL;
|
||||
if (document_.get())
|
||||
document_->DisconnectSource();
|
||||
}
|
||||
|
@ -386,7 +388,7 @@ void PrintJob::OnDocumentDone() {
|
|||
Stop();
|
||||
|
||||
scoped_refptr<JobEventDetails> details(
|
||||
new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), nullptr));
|
||||
new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), NULL));
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
content::Source<PrintJob>(this),
|
||||
|
@ -432,7 +434,7 @@ void PrintJob::ControlledWorkerShutdown() {
|
|||
|
||||
is_job_pending_ = false;
|
||||
registrar_.RemoveAll();
|
||||
UpdatePrintedDocument(nullptr);
|
||||
UpdatePrintedDocument(NULL);
|
||||
}
|
||||
|
||||
void PrintJob::HoldUntilStopIsCalled() {
|
||||
|
|
|
@ -32,8 +32,8 @@ void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) {
|
|||
scoped_refptr<PrinterQuery> PrintQueriesQueue::PopPrinterQuery(
|
||||
int document_cookie) {
|
||||
base::AutoLock lock(lock_);
|
||||
for (auto itr = queued_queries_.begin(); itr != queued_queries_.end();
|
||||
++itr) {
|
||||
for (PrinterQueries::iterator itr = queued_queries_.begin();
|
||||
itr != queued_queries_.end(); ++itr) {
|
||||
if ((*itr)->cookie() == document_cookie && !(*itr)->is_callback_pending()) {
|
||||
scoped_refptr<printing::PrinterQuery> current_query(*itr);
|
||||
queued_queries_.erase(itr);
|
||||
|
@ -41,7 +41,7 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::PopPrinterQuery(
|
|||
return current_query;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
|
||||
|
@ -61,8 +61,9 @@ void PrintQueriesQueue::Shutdown() {
|
|||
// Stop all pending queries, requests to generate print preview do not have
|
||||
// corresponding PrintJob, so any pending preview requests are not covered
|
||||
// by PrintJobManager::StopJobs and should be stopped explicitly.
|
||||
for (auto& itr : queries_to_stop) {
|
||||
itr->PostTask(FROM_HERE, base::Bind(&PrinterQuery::StopWorker, itr));
|
||||
for (PrinterQueries::iterator itr = queries_to_stop.begin();
|
||||
itr != queries_to_stop.end(); ++itr) {
|
||||
(*itr)->PostTask(FROM_HERE, base::Bind(&PrinterQuery::StopWorker, *itr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,7 @@ void PrintJobManager::Shutdown() {
|
|||
StopJobs(true);
|
||||
if (queue_.get())
|
||||
queue_->Shutdown();
|
||||
queue_ = nullptr;
|
||||
queue_ = NULL;
|
||||
}
|
||||
|
||||
void PrintJobManager::StopJobs(bool wait_for_finish) {
|
||||
|
@ -98,11 +99,12 @@ void PrintJobManager::StopJobs(bool wait_for_finish) {
|
|||
PrintJobs to_stop;
|
||||
to_stop.swap(current_jobs_);
|
||||
|
||||
for (const auto& job : to_stop) {
|
||||
for (PrintJobs::const_iterator job = to_stop.begin(); job != to_stop.end();
|
||||
++job) {
|
||||
// Wait for two minutes for the print job to be spooled.
|
||||
if (wait_for_finish)
|
||||
job->FlushJob(base::TimeDelta::FromMinutes(2));
|
||||
job->Stop();
|
||||
(*job)->FlushJob(base::TimeDelta::FromMinutes(2));
|
||||
(*job)->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ void HoldRefCallback(const scoped_refptr<printing::PrintJobWorkerOwner>& owner,
|
|||
class PrintingContextDelegate : public PrintingContext::Delegate {
|
||||
public:
|
||||
PrintingContextDelegate(int render_process_id, int render_view_id);
|
||||
~PrintingContextDelegate() override;
|
||||
virtual ~PrintingContextDelegate();
|
||||
|
||||
gfx::NativeView GetParentView() override;
|
||||
std::string GetAppLocale() override;
|
||||
virtual gfx::NativeView GetParentView() override;
|
||||
virtual std::string GetAppLocale() override;
|
||||
|
||||
private:
|
||||
int render_process_id_;
|
||||
|
@ -62,9 +62,9 @@ gfx::NativeView PrintingContextDelegate::GetParentView() {
|
|||
content::RenderViewHost* view =
|
||||
content::RenderViewHost::FromID(render_process_id_, render_view_id_);
|
||||
if (!view)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
content::WebContents* wc = content::WebContents::FromRenderViewHost(view);
|
||||
return wc ? wc->GetNativeView() : nullptr;
|
||||
return wc ? wc->GetNativeView() : NULL;
|
||||
}
|
||||
|
||||
std::string PrintingContextDelegate::GetAppLocale() {
|
||||
|
@ -75,7 +75,7 @@ void NotificationCallback(PrintJobWorkerOwner* print_job,
|
|||
JobEventDetails::Type detail_type,
|
||||
PrintedDocument* document,
|
||||
PrintedPage* page) {
|
||||
auto* details = new JobEventDetails(detail_type, document, page);
|
||||
JobEventDetails* details = new JobEventDetails(detail_type, document, page);
|
||||
content::NotificationService::current()->Notify(
|
||||
chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
// We know that is is a PrintJob object in this circumstance.
|
||||
|
@ -343,7 +343,7 @@ void PrintJobWorker::OnDocumentDone() {
|
|||
base::RetainedRef(document_), nullptr));
|
||||
|
||||
// Makes sure the variables are reinitialized.
|
||||
document_ = nullptr;
|
||||
document_ = NULL;
|
||||
}
|
||||
|
||||
void PrintJobWorker::SpoolPage(PrintedPage* page) {
|
||||
|
@ -397,7 +397,7 @@ void PrintJobWorker::OnFailure() {
|
|||
Cancel();
|
||||
|
||||
// Makes sure the variables are reinitialized.
|
||||
document_ = nullptr;
|
||||
document_ = NULL;
|
||||
page_number_ = PageNumber::npos();
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ char* CopyPDFDataOnIOThread(
|
|||
if (!shared_buf->Map(params.data_size))
|
||||
return nullptr;
|
||||
char* memory_pdf_data = static_cast<char*>(shared_buf->memory());
|
||||
auto* pdf_data = new char[params.data_size];
|
||||
char* pdf_data = new char[params.data_size];
|
||||
memcpy(pdf_data, memory_pdf_data, params.data_size);
|
||||
return pdf_data;
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
|||
content::Source<PrintJob>(print_job_.get()));
|
||||
print_job_->DisconnectSource();
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
print_job_ = NULL;
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
|
|
|
@ -122,7 +122,7 @@ bool PrinterQuery::is_callback_pending() const {
|
|||
}
|
||||
|
||||
bool PrinterQuery::is_valid() const {
|
||||
return worker_.get() != nullptr;
|
||||
return worker_.get() != NULL;
|
||||
}
|
||||
|
||||
} // namespace printing
|
||||
|
|
|
@ -246,7 +246,7 @@ content::WebContents* PrintingMessageFilter::GetWebContentsForRenderView(
|
|||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
content::RenderViewHost* view = content::RenderViewHost::FromID(
|
||||
render_process_id_, render_view_id);
|
||||
return view ? content::WebContents::FromRenderViewHost(view) : nullptr;
|
||||
return view ? content::WebContents::FromRenderViewHost(view) : NULL;
|
||||
}
|
||||
|
||||
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
|
||||
|
|
|
@ -171,7 +171,7 @@ int WaitSocketForRead(int fd, const base::TimeDelta& timeout) {
|
|||
FD_ZERO(&read_fds);
|
||||
FD_SET(fd, &read_fds);
|
||||
|
||||
return HANDLE_EINTR(select(fd + 1, &read_fds, nullptr, nullptr, &tv));
|
||||
return HANDLE_EINTR(select(fd + 1, &read_fds, NULL, NULL, &tv));
|
||||
}
|
||||
|
||||
// Read a message from a socket fd, with an optional timeout.
|
||||
|
@ -579,7 +579,9 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) {
|
|||
}
|
||||
int rv = base::SetNonBlocking(connection_socket);
|
||||
DCHECK_EQ(0, rv) << "Failed to make non-blocking socket.";
|
||||
auto* reader = new SocketReader(this, ui_message_loop_, connection_socket);
|
||||
SocketReader* reader = new SocketReader(this,
|
||||
ui_message_loop_,
|
||||
connection_socket);
|
||||
readers_.insert(reader);
|
||||
}
|
||||
|
||||
|
@ -820,9 +822,10 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
|||
to_send.append(current_dir.value());
|
||||
|
||||
const std::vector<std::string>& argv = atom::AtomCommandLine::argv();
|
||||
for (const auto& it : argv) {
|
||||
for (std::vector<std::string>::const_iterator it = argv.begin();
|
||||
it != argv.end(); ++it) {
|
||||
to_send.push_back(kTokenDelimiter);
|
||||
to_send.append(it);
|
||||
to_send.append(*it);
|
||||
}
|
||||
|
||||
// Send the message
|
||||
|
|
|
@ -86,10 +86,12 @@ std::string ReadDataFromPickle(const base::string16& format,
|
|||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteUInt32(data.size());
|
||||
for (const auto& it : data) {
|
||||
if (!pickle->WriteString16(it.first))
|
||||
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
||||
it != data.end();
|
||||
++it) {
|
||||
if (!pickle->WriteString16(it->first))
|
||||
return false;
|
||||
if (!pickle->WriteString(it.second))
|
||||
if (!pickle->WriteString(it->second))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -26,7 +26,7 @@ PepperIsolatedFileSystemMessageFilter::Create(PP_Instance instance,
|
|||
int unused_render_frame_id;
|
||||
if (!host->GetRenderFrameIDsForInstance(
|
||||
instance, &render_process_id, &unused_render_frame_id)) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return new PepperIsolatedFileSystemMessageFilter(
|
||||
render_process_id,
|
||||
|
|
|
@ -43,14 +43,16 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
|||
std::vector<WebPluginInfo> plugins;
|
||||
PluginService::GetInstance()->GetInternalPlugins(&plugins);
|
||||
|
||||
for (auto& plugin : plugins) {
|
||||
for (size_t i = 0; i < plugins.size(); ++i) {
|
||||
const WebPluginInfo& plugin = plugins[i];
|
||||
const std::vector<content::WebPluginMimeType>& mime_types =
|
||||
plugin.mime_types;
|
||||
for (const auto& j : mime_types) {
|
||||
if (j.mime_type == mime_type) {
|
||||
for (size_t j = 0; j < mime_types.size(); ++j) {
|
||||
|
||||
if (mime_types[j].mime_type == mime_type) {
|
||||
*is_available = true;
|
||||
*additional_param_names = j.additional_param_names;
|
||||
*additional_param_values = j.additional_param_values;
|
||||
*additional_param_names = mime_types[j].additional_param_names;
|
||||
*additional_param_values = mime_types[j].additional_param_values;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,10 +115,10 @@ TtsControllerImpl* TtsControllerImpl::GetInstance() {
|
|||
}
|
||||
|
||||
TtsControllerImpl::TtsControllerImpl()
|
||||
: current_utterance_(nullptr),
|
||||
: current_utterance_(NULL),
|
||||
paused_(false),
|
||||
platform_impl_(nullptr),
|
||||
tts_engine_delegate_(nullptr) {
|
||||
platform_impl_(NULL),
|
||||
tts_engine_delegate_(NULL) {
|
||||
}
|
||||
|
||||
TtsControllerImpl::~TtsControllerImpl() {
|
||||
|
@ -206,7 +206,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) {
|
|||
if (!sends_end_event) {
|
||||
utterance->Finish();
|
||||
delete utterance;
|
||||
current_utterance_ = nullptr;
|
||||
current_utterance_ = NULL;
|
||||
SpeakNextUtterance();
|
||||
}
|
||||
#endif
|
||||
|
@ -222,7 +222,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) {
|
|||
voice,
|
||||
utterance->continuous_parameters());
|
||||
if (!success)
|
||||
current_utterance_ = nullptr;
|
||||
current_utterance_ = NULL;
|
||||
|
||||
// If the native voice wasn't able to process this speech, see if
|
||||
// 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() {
|
||||
return current_utterance_ != nullptr || GetPlatformImpl()->IsSpeaking();
|
||||
return current_utterance_ != NULL || GetPlatformImpl()->IsSpeaking();
|
||||
}
|
||||
|
||||
void TtsControllerImpl::FinishCurrentUtterance() {
|
||||
|
@ -332,7 +332,7 @@ void TtsControllerImpl::FinishCurrentUtterance() {
|
|||
current_utterance_->OnTtsEvent(TTS_EVENT_INTERRUPTED, kInvalidCharIndex,
|
||||
std::string());
|
||||
delete current_utterance_;
|
||||
current_utterance_ = nullptr;
|
||||
current_utterance_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -415,8 +415,11 @@ int TtsControllerImpl::GetMatchingVoice(
|
|||
|
||||
if (utterance->required_event_types().size() > 0) {
|
||||
bool has_all_required_event_types = true;
|
||||
for (auto iter : utterance->required_event_types()) {
|
||||
if (voice.events.find(iter) == voice.events.end()) {
|
||||
for (std::set<TtsEventType>::const_iterator iter =
|
||||
utterance->required_event_types().begin();
|
||||
iter != utterance->required_event_types().end();
|
||||
++iter) {
|
||||
if (voice.events.find(*iter) == voice.events.end()) {
|
||||
has_all_required_event_types = false;
|
||||
break;
|
||||
}
|
||||
|
@ -433,8 +436,10 @@ int TtsControllerImpl::GetMatchingVoice(
|
|||
}
|
||||
|
||||
void TtsControllerImpl::VoicesChanged() {
|
||||
for (auto voices_changed_delegate : voices_changed_delegates_) {
|
||||
voices_changed_delegate->OnVoicesChanged();
|
||||
for (std::set<VoicesChangedDelegate*>::iterator iter =
|
||||
voices_changed_delegates_.begin();
|
||||
iter != voices_changed_delegates_.end(); ++iter) {
|
||||
(*iter)->OnVoicesChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -112,13 +112,13 @@ static void AddPepperBasedWidevine(
|
|||
supported_codecs |= media::EME_CODEC_MP4_AAC;
|
||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
||||
|
||||
for (auto& codec : codecs) {
|
||||
if (codec == kCdmSupportedCodecVp8)
|
||||
for (size_t i = 0; i < codecs.size(); ++i) {
|
||||
if (codecs[i] == kCdmSupportedCodecVp8)
|
||||
supported_codecs |= media::EME_CODEC_WEBM_VP8;
|
||||
if (codec == kCdmSupportedCodecVp9)
|
||||
if (codecs[i] == kCdmSupportedCodecVp9)
|
||||
supported_codecs |= media::EME_CODEC_WEBM_VP9;
|
||||
#if defined(USE_PROPRIETARY_CODECS)
|
||||
if (codec == kCdmSupportedCodecAvc1)
|
||||
if (codecs[i] == kCdmSupportedCodecAvc1)
|
||||
supported_codecs |= media::EME_CODEC_MP4_AVC1;
|
||||
#endif // defined(USE_PROPRIETARY_CODECS)
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ void PepperFlashMenuHost::OnMenuClosed(int request_id) {
|
|||
void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) {
|
||||
ppapi::host::ReplyMessageContext reply_context(
|
||||
ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0),
|
||||
nullptr,
|
||||
NULL,
|
||||
MSG_ROUTING_NONE);
|
||||
reply_context.params.set_result(result);
|
||||
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_charset,
|
||||
&had_charset,
|
||||
nullptr);
|
||||
NULL);
|
||||
return lower_case_mime_type == "application/x-www-form-urlencoded" ||
|
||||
lower_case_mime_type == "multipart/form-data" ||
|
||||
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.
|
||||
if (new_content_width < 1 || new_content_height < 1) {
|
||||
CHECK(frame != nullptr);
|
||||
page_css_params = GetCssPrintParams(nullptr, page_index, page_params);
|
||||
CHECK(frame != NULL);
|
||||
page_css_params = GetCssPrintParams(NULL, page_index, page_params);
|
||||
return page_css_params;
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ void ComputeWebKitPrintParamsInDesiredDpi(
|
|||
|
||||
blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) {
|
||||
return frame->document().isPluginDocument() ?
|
||||
frame->document().to<blink::WebPluginDocument>().plugin() : nullptr;
|
||||
frame->document().to<blink::WebPluginDocument>().plugin() : NULL;
|
||||
}
|
||||
|
||||
bool PrintingNodeOrPdfFrame(const blink::WebFrame* frame,
|
||||
|
@ -323,7 +323,7 @@ FrameReference::FrameReference(blink::WebLocalFrame* frame) {
|
|||
}
|
||||
|
||||
FrameReference::FrameReference() {
|
||||
Reset(nullptr);
|
||||
Reset(NULL);
|
||||
}
|
||||
|
||||
FrameReference::~FrameReference() {
|
||||
|
@ -334,20 +334,20 @@ void FrameReference::Reset(blink::WebLocalFrame* frame) {
|
|||
view_ = frame->view();
|
||||
frame_ = frame;
|
||||
} else {
|
||||
view_ = nullptr;
|
||||
frame_ = nullptr;
|
||||
view_ = NULL;
|
||||
frame_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
blink::WebLocalFrame* FrameReference::GetFrame() {
|
||||
if (view_ == nullptr || frame_ == nullptr)
|
||||
return nullptr;
|
||||
for (blink::WebFrame* frame = view_->mainFrame(); frame != nullptr;
|
||||
if (view_ == NULL || frame_ == NULL)
|
||||
return NULL;
|
||||
for (blink::WebFrame* frame = view_->mainFrame(); frame != NULL;
|
||||
frame = frame->traverseNext(false)) {
|
||||
if (frame == frame_)
|
||||
return frame_;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
blink::WebView* FrameReference::view() {
|
||||
|
@ -477,7 +477,7 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint(
|
|||
frame->printBegin(web_print_params_, node_to_print_);
|
||||
print_params = CalculatePrintParamsForCss(frame, 0, print_params,
|
||||
ignore_css_margins, fit_to_page,
|
||||
nullptr);
|
||||
NULL);
|
||||
frame->printEnd();
|
||||
}
|
||||
ComputeWebKitPrintParamsInDesiredDpi(print_params, &web_print_params_);
|
||||
|
@ -623,7 +623,7 @@ void PrepareFrameAndViewForPrint::FinishPrinting() {
|
|||
web_view->close();
|
||||
}
|
||||
}
|
||||
frame_.Reset(nullptr);
|
||||
frame_.Reset(NULL);
|
||||
on_ready_.Reset();
|
||||
}
|
||||
|
||||
|
@ -980,10 +980,10 @@ bool PrintWebViewHelper::PrintPagesNative(blink::WebFrame* frame,
|
|||
PrintPageInternal(page_params, frame);
|
||||
}
|
||||
} else {
|
||||
for (int page : params.pages) {
|
||||
if (page >= page_count)
|
||||
for (size_t i = 0; i < params.pages.size(); ++i) {
|
||||
if (params.pages[i] >= page_count)
|
||||
break;
|
||||
page_params.page_number = page;
|
||||
page_params.page_number = params.pages[i];
|
||||
PrintPageInternal(page_params, frame);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,8 +301,8 @@ bool SpellcheckCharAttribute::OutputDefault(UChar c,
|
|||
// SpellcheckWordIterator implementation:
|
||||
|
||||
SpellcheckWordIterator::SpellcheckWordIterator()
|
||||
: text_(nullptr),
|
||||
attribute_(nullptr),
|
||||
: text_(NULL),
|
||||
attribute_(NULL),
|
||||
iterator_() {
|
||||
}
|
||||
|
||||
|
|
|
@ -118,8 +118,8 @@ std::string StripTrailingWildcard(const std::string& path) {
|
|||
namespace extensions {
|
||||
// static
|
||||
bool URLPattern::IsValidSchemeForExtensions(const std::string& scheme) {
|
||||
for (auto& kValidScheme : kValidSchemes) {
|
||||
if (scheme == kValidScheme)
|
||||
for (size_t i = 0; i < arraysize(kValidSchemes); ++i) {
|
||||
if (scheme == kValidSchemes[i])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -346,7 +346,7 @@ bool URLPattern::SetPort(const std::string& port) {
|
|||
|
||||
bool URLPattern::MatchesURL(const GURL& test) const {
|
||||
const GURL* test_url = &test;
|
||||
bool has_inner_url = test.inner_url() != nullptr;
|
||||
bool has_inner_url = test.inner_url() != NULL;
|
||||
|
||||
if (has_inner_url) {
|
||||
if (!test.SchemeIsFileSystem())
|
||||
|
@ -370,7 +370,7 @@ bool URLPattern::MatchesURL(const GURL& test) const {
|
|||
|
||||
bool URLPattern::MatchesSecurityOrigin(const GURL& test) const {
|
||||
const GURL* test_url = &test;
|
||||
bool has_inner_url = test.inner_url() != nullptr;
|
||||
bool has_inner_url = test.inner_url() != NULL;
|
||||
|
||||
if (has_inner_url) {
|
||||
if (!test.SchemeIsFileSystem())
|
||||
|
@ -543,8 +543,9 @@ bool URLPattern::Contains(const URLPattern& other) const {
|
|||
|
||||
bool URLPattern::MatchesAnyScheme(
|
||||
const std::vector<std::string>& schemes) const {
|
||||
for (const auto& scheme : schemes) {
|
||||
if (MatchesScheme(scheme))
|
||||
for (std::vector<std::string>::const_iterator i = schemes.begin();
|
||||
i != schemes.end(); ++i) {
|
||||
if (MatchesScheme(*i))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -553,8 +554,9 @@ bool URLPattern::MatchesAnyScheme(
|
|||
|
||||
bool URLPattern::MatchesAllSchemes(
|
||||
const std::vector<std::string>& schemes) const {
|
||||
for (const auto& scheme : schemes) {
|
||||
if (!MatchesScheme(scheme))
|
||||
for (std::vector<std::string>::const_iterator i = schemes.begin();
|
||||
i != schemes.end(); ++i) {
|
||||
if (!MatchesScheme(*i))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -584,9 +586,9 @@ std::vector<std::string> URLPattern::GetExplicitSchemes() const {
|
|||
return result;
|
||||
}
|
||||
|
||||
for (auto& kValidScheme : kValidSchemes) {
|
||||
if (MatchesScheme(kValidScheme)) {
|
||||
result.push_back(kValidScheme);
|
||||
for (size_t i = 0; i < arraysize(kValidSchemes); ++i) {
|
||||
if (MatchesScheme(kValidSchemes[i])) {
|
||||
result.push_back(kValidSchemes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ int StreamListenSocket::GetPeerAddress(IPEndPoint* address) const {
|
|||
}
|
||||
|
||||
SocketDescriptor StreamListenSocket::AcceptSocket() {
|
||||
SocketDescriptor conn = HANDLE_EINTR(accept(socket_, nullptr, nullptr));
|
||||
SocketDescriptor conn = HANDLE_EINTR(accept(socket_, NULL, NULL));
|
||||
if (conn == kInvalidSocket)
|
||||
LOG(ERROR) << "Error accepting connection.";
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue