Modernize to C++11 : use auto.
This commit is contained in:
parent
7474e5ec28
commit
0cf7454d4b
6 changed files with 10 additions and 10 deletions
|
@ -121,7 +121,7 @@ class DispatcherImpl : public DevToolsEmbedderMessageDispatcher {
|
||||||
bool Dispatch(const DispatchCallback& callback,
|
bool Dispatch(const DispatchCallback& callback,
|
||||||
const std::string& method,
|
const std::string& method,
|
||||||
const base::ListValue* params) override {
|
const base::ListValue* params) override {
|
||||||
HandlerMap::iterator it = handlers_.find(method);
|
auto it = handlers_.find(method);
|
||||||
return it != handlers_.end() && it->second.Run(callback, *params);
|
return it != handlers_.end() && it->second.Run(callback, *params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ class DispatcherImpl : public DevToolsEmbedderMessageDispatcher {
|
||||||
DevToolsEmbedderMessageDispatcher*
|
DevToolsEmbedderMessageDispatcher*
|
||||||
DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
|
DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
|
||||||
Delegate* delegate) {
|
Delegate* delegate) {
|
||||||
DispatcherImpl* d = new DispatcherImpl();
|
auto* d = new DispatcherImpl();
|
||||||
|
|
||||||
d->RegisterHandler("bringToFront", &Delegate::ActivateWindow, delegate);
|
d->RegisterHandler("bringToFront", &Delegate::ActivateWindow, delegate);
|
||||||
d->RegisterHandler("closeWindow", &Delegate::CloseWindow, delegate);
|
d->RegisterHandler("closeWindow", &Delegate::CloseWindow, delegate);
|
||||||
|
|
|
@ -160,7 +160,7 @@ void Index::SetTrigramsForFile(const FilePath& file_path,
|
||||||
const Time& time) {
|
const Time& time) {
|
||||||
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
|
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
|
||||||
FileId file_id = GetFileId(file_path);
|
FileId file_id = GetFileId(file_path);
|
||||||
vector<Trigram>::const_iterator it = index.begin();
|
auto it = index.begin();
|
||||||
for (; it != index.end(); ++it) {
|
for (; it != index.end(); ++it) {
|
||||||
Trigram trigram = *it;
|
Trigram trigram = *it;
|
||||||
index_[trigram].push_back(file_id);
|
index_[trigram].push_back(file_id);
|
||||||
|
|
|
@ -167,7 +167,7 @@ int ResponseWriter::Initialize(const net::CompletionCallback& callback) {
|
||||||
int ResponseWriter::Write(net::IOBuffer* buffer,
|
int ResponseWriter::Write(net::IOBuffer* buffer,
|
||||||
int num_bytes,
|
int num_bytes,
|
||||||
const net::CompletionCallback& callback) {
|
const net::CompletionCallback& callback) {
|
||||||
base::FundamentalValue* id = new base::FundamentalValue(stream_id_);
|
auto* id = new base::FundamentalValue(stream_id_);
|
||||||
base::StringValue* chunk =
|
base::StringValue* chunk =
|
||||||
new base::StringValue(std::string(buffer->data(), num_bytes));
|
new base::StringValue(std::string(buffer->data(), num_bytes));
|
||||||
|
|
||||||
|
@ -683,11 +683,11 @@ void InspectableWebContentsImpl::DidStartNavigationToPendingEntry(
|
||||||
|
|
||||||
void InspectableWebContentsImpl::OnURLFetchComplete(const net::URLFetcher* source) {
|
void InspectableWebContentsImpl::OnURLFetchComplete(const net::URLFetcher* source) {
|
||||||
DCHECK(source);
|
DCHECK(source);
|
||||||
PendingRequestsMap::iterator it = pending_requests_.find(source);
|
auto it = pending_requests_.find(source);
|
||||||
DCHECK(it != pending_requests_.end());
|
DCHECK(it != pending_requests_.end());
|
||||||
|
|
||||||
base::DictionaryValue response;
|
base::DictionaryValue response;
|
||||||
base::DictionaryValue* headers = new base::DictionaryValue();
|
auto* headers = new base::DictionaryValue();
|
||||||
net::HttpResponseHeaders* rh = source->GetResponseHeaders();
|
net::HttpResponseHeaders* rh = source->GetResponseHeaders();
|
||||||
response.SetInteger("statusCode", rh ? rh->response_code() : 200);
|
response.SetInteger("statusCode", rh ? rh->response_code() : 200);
|
||||||
response.Set("headers", headers);
|
response.Set("headers", headers);
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace {
|
||||||
const content::MediaStreamDevice* FindDeviceWithId(
|
const content::MediaStreamDevice* FindDeviceWithId(
|
||||||
const content::MediaStreamDevices& devices,
|
const content::MediaStreamDevices& devices,
|
||||||
const std::string& device_id) {
|
const std::string& device_id) {
|
||||||
content::MediaStreamDevices::const_iterator iter = devices.begin();
|
auto iter = devices.begin();
|
||||||
for (; iter != devices.end(); ++iter) {
|
for (; iter != devices.end(); ++iter) {
|
||||||
if (iter->id == device_id) {
|
if (iter->id == device_id) {
|
||||||
return &(*iter);
|
return &(*iter);
|
||||||
|
@ -30,7 +30,7 @@ const content::MediaStreamDevice* FindDeviceWithId(
|
||||||
}
|
}
|
||||||
|
|
||||||
const MediaStreamDevices& EmptyDevices() {
|
const MediaStreamDevices& EmptyDevices() {
|
||||||
static MediaStreamDevices* devices = new MediaStreamDevices;
|
static auto* devices = new MediaStreamDevices;
|
||||||
return *devices;
|
return *devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ void DevToolsNetworkController::SetNetworkState(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has_offline_interceptors = false;
|
bool has_offline_interceptors = false;
|
||||||
InterceptorMap::iterator it = interceptors_.begin();
|
auto it = interceptors_.begin();
|
||||||
for (; it != interceptors_.end(); ++it) {
|
for (; it != interceptors_.end(); ++it) {
|
||||||
if (it->second->IsOffline()) {
|
if (it->second->IsOffline()) {
|
||||||
has_offline_interceptors = true;
|
has_offline_interceptors = true;
|
||||||
|
|
|
@ -18,7 +18,7 @@ std::unique_ptr<base::DictionaryValue> GetConstants() {
|
||||||
std::unique_ptr<base::DictionaryValue> constants = net::GetNetConstants();
|
std::unique_ptr<base::DictionaryValue> constants = net::GetNetConstants();
|
||||||
|
|
||||||
// Adding client information to constants dictionary.
|
// Adding client information to constants dictionary.
|
||||||
base::DictionaryValue* client_info = new base::DictionaryValue();
|
auto* client_info = new base::DictionaryValue();
|
||||||
client_info->SetString(
|
client_info->SetString(
|
||||||
"command_line",
|
"command_line",
|
||||||
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
|
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue