summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 20:20:26 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-13 20:20:26 +0000
commit3368b54748ed06d61ddc35f0cce4190961ec950c (patch)
treeee870d17ac974a61b992bb63672db8c49b871b27
parent9058cb1af2c337afdb65640956662d51336c4f98 (diff)
downloadchromium_src-3368b54748ed06d61ddc35f0cce4190961ec950c.zip
chromium_src-3368b54748ed06d61ddc35f0cce4190961ec950c.tar.gz
chromium_src-3368b54748ed06d61ddc35f0cce4190961ec950c.tar.bz2
Minor refactor: rename "extra_parameters" --> "params".
(The "extra" was redundant. And "params" is a well understood abbreviation of "parameters"). Review URL: http://codereview.chromium.org/2110001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47183 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/dom_ui/net_internals_ui.cc14
-rw-r--r--chrome/browser/net/chrome_net_log.cc4
-rw-r--r--chrome/browser/net/chrome_net_log.h4
-rw-r--r--chrome/browser/net/passive_log_collector.cc14
-rw-r--r--chrome/browser/net/passive_log_collector.h8
-rw-r--r--chrome/browser/net/passive_log_collector_unittest.cc2
-rw-r--r--chrome/browser/resources/net_internals/logviewpainter.js10
-rw-r--r--chrome/browser/resources/net_internals/sourceentry.js6
-rw-r--r--net/base/net_log.h10
9 files changed, 35 insertions, 37 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc
index b74c264..c643af2 100644
--- a/chrome/browser/dom_ui/net_internals_ui.cc
+++ b/chrome/browser/dom_ui/net_internals_ui.cc
@@ -76,7 +76,7 @@ Value* EntryToDictionaryValue(net::NetLog::EventType type,
const base::TimeTicks& time,
const net::NetLog::Source& source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters) {
+ net::NetLog::EventParameters* params) {
DictionaryValue* entry_dict = new DictionaryValue();
// Set the entry time. (Note that we send it as a string since integers
@@ -94,8 +94,8 @@ Value* EntryToDictionaryValue(net::NetLog::EventType type,
entry_dict->SetInteger(L"phase", static_cast<int>(phase));
// Set the event-specific parameters.
- if (extra_parameters)
- entry_dict->Set(L"extra_parameters", extra_parameters->ToValue());
+ if (params)
+ entry_dict->Set(L"params", params->ToValue());
return entry_dict;
}
@@ -225,7 +225,7 @@ class NetInternalsMessageHandler::IOThreadImpl
const base::TimeTicks& time,
const net::NetLog::Source& source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters);
+ net::NetLog::EventParameters* params);
// ConnectionTester::Delegate implementation:
virtual void OnStartConnectionTestSuite();
@@ -705,7 +705,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetPassiveLogEntries(
e.time,
e.source,
e.phase,
- e.extra_parameters));
+ e.params));
}
CallJavascriptFunction(L"g_browser.receivedPassiveLogEntries", list);
@@ -767,12 +767,12 @@ void NetInternalsMessageHandler::IOThreadImpl::OnAddEntry(
const base::TimeTicks& time,
const net::NetLog::Source& source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters) {
+ net::NetLog::EventParameters* params) {
DCHECK(is_observing_log_);
CallJavascriptFunction(
L"g_browser.receivedLogEntry",
- EntryToDictionaryValue(type, time, source, phase, extra_parameters));
+ EntryToDictionaryValue(type, time, source, phase, params));
}
void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTestSuite() {
diff --git a/chrome/browser/net/chrome_net_log.cc b/chrome/browser/net/chrome_net_log.cc
index 34b9c12..efe801fc 100644
--- a/chrome/browser/net/chrome_net_log.cc
+++ b/chrome/browser/net/chrome_net_log.cc
@@ -27,12 +27,12 @@ void ChromeNetLog::AddEntry(EventType type,
const base::TimeTicks& time,
const Source& source,
EventPhase phase,
- EventParameters* extra_parameters) {
+ EventParameters* params) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
// Notify all of the log observers.
FOR_EACH_OBSERVER(Observer, observers_,
- OnAddEntry(type, time, source, phase, extra_parameters));
+ OnAddEntry(type, time, source, phase, params));
}
uint32 ChromeNetLog::NextID() {
diff --git a/chrome/browser/net/chrome_net_log.h b/chrome/browser/net/chrome_net_log.h
index b2f0d55..092be8d 100644
--- a/chrome/browser/net/chrome_net_log.h
+++ b/chrome/browser/net/chrome_net_log.h
@@ -29,7 +29,7 @@ class ChromeNetLog : public net::NetLog {
const base::TimeTicks& time,
const Source& source,
EventPhase phase,
- EventParameters* extra_parameters) = 0;
+ EventParameters* params) = 0;
};
ChromeNetLog();
@@ -40,7 +40,7 @@ class ChromeNetLog : public net::NetLog {
const base::TimeTicks& time,
const Source& source,
EventPhase phase,
- EventParameters* extra_parameters);
+ EventParameters* params);
virtual uint32 NextID();
virtual bool HasListener() const;
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc
index 59d848c..38f24ff 100644
--- a/chrome/browser/net/passive_log_collector.cc
+++ b/chrome/browser/net/passive_log_collector.cc
@@ -60,7 +60,7 @@ bool SortByOrderComparator(const PassiveLogCollector::Entry& a,
void SetSubordinateSource(PassiveLogCollector::RequestInfo* info,
const PassiveLogCollector::Entry& entry) {
info->subordinate_source.id = static_cast<net::NetLogIntegerParameter*>(
- entry.extra_parameters.get())->value();
+ entry.params.get())->value();
switch (entry.type) {
case net::NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID:
info->subordinate_source.type = net::NetLog::SOURCE_CONNECT_JOB;
@@ -94,9 +94,9 @@ void PassiveLogCollector::OnAddEntry(
const base::TimeTicks& time,
const net::NetLog::Source& source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters) {
+ net::NetLog::EventParameters* params) {
// Package the parameters into a single struct for convenience.
- Entry entry(num_events_seen_++, type, time, source, phase, extra_parameters);
+ Entry entry(num_events_seen_++, type, time, source, phase, params);
switch (entry.source.type) {
case net::NetLog::SOURCE_URL_REQUEST:
@@ -355,7 +355,7 @@ PassiveLogCollector::SocketTracker::DoAddEntry(const Entry& entry,
switch (entry.type) {
case net::NetLog::TYPE_SOCKET_BYTES_SENT:
int_arg = static_cast<net::NetLogIntegerParameter*>(
- entry.extra_parameters.get())->value();
+ entry.params.get())->value();
out_info->total_bytes_transmitted += int_arg;
out_info->bytes_transmitted += int_arg;
out_info->last_tx_rx_time = entry.time;
@@ -363,7 +363,7 @@ PassiveLogCollector::SocketTracker::DoAddEntry(const Entry& entry,
break;
case net::NetLog::TYPE_SOCKET_BYTES_RECEIVED:
int_arg = static_cast<net::NetLogIntegerParameter*>(
- entry.extra_parameters.get())->value();
+ entry.params.get())->value();
out_info->total_bytes_received += int_arg;
out_info->bytes_received += int_arg;
out_info->last_tx_rx_time = entry.time;
@@ -496,11 +496,11 @@ PassiveLogCollector::RequestTracker::DoAddEntry(const Entry& entry,
// Note: we look at the first *two* entries, since the outer REQUEST_ALIVE
// doesn't actually contain any data.
if (out_info->url.empty() && out_info->entries.size() <= 2 &&
- entry.phase == net::NetLog::PHASE_BEGIN && entry.extra_parameters &&
+ entry.phase == net::NetLog::PHASE_BEGIN && entry.params &&
(entry.type == net::NetLog::TYPE_URL_REQUEST_START ||
entry.type == net::NetLog::TYPE_SOCKET_STREAM_CONNECT)) {
out_info->url = static_cast<net::NetLogStringParameter*>(
- entry.extra_parameters.get())->value();
+ entry.params.get())->value();
}
// If the request has ended, move it to the graveyard.
diff --git a/chrome/browser/net/passive_log_collector.h b/chrome/browser/net/passive_log_collector.h
index 55b7279..bbcf7ca 100644
--- a/chrome/browser/net/passive_log_collector.h
+++ b/chrome/browser/net/passive_log_collector.h
@@ -25,9 +25,9 @@ class PassiveLogCollector : public ChromeNetLog::Observer {
const base::TimeTicks& time,
net::NetLog::Source source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters)
+ net::NetLog::EventParameters* params)
: order(order), type(type), time(time), source(source), phase(phase),
- extra_parameters(extra_parameters) {
+ params(params) {
}
uint32 order;
@@ -35,7 +35,7 @@ class PassiveLogCollector : public ChromeNetLog::Observer {
base::TimeTicks time;
net::NetLog::Source source;
net::NetLog::EventPhase phase;
- scoped_refptr<net::NetLog::EventParameters> extra_parameters;
+ scoped_refptr<net::NetLog::EventParameters> params;
};
typedef std::vector<Entry> EntryList;
@@ -208,7 +208,7 @@ class PassiveLogCollector : public ChromeNetLog::Observer {
const base::TimeTicks& time,
const net::NetLog::Source& source,
net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* extra_parameters);
+ net::NetLog::EventParameters* params);
// Clears all of the passively logged data.
void Clear();
diff --git a/chrome/browser/net/passive_log_collector_unittest.cc b/chrome/browser/net/passive_log_collector_unittest.cc
index 1fa5b8e..077597f 100644
--- a/chrome/browser/net/passive_log_collector_unittest.cc
+++ b/chrome/browser/net/passive_log_collector_unittest.cc
@@ -61,7 +61,7 @@ void AddEndURLRequestEntries(PassiveLogCollector* collector, uint32 id) {
std::string GetStringParam(const PassiveLogCollector::Entry& entry) {
return static_cast<net::NetLogStringParameter*>(
- entry.extra_parameters.get())->value();
+ entry.params.get())->value();
}
static const int kMaxNumLoadLogEntries = 1;
diff --git a/chrome/browser/resources/net_internals/logviewpainter.js b/chrome/browser/resources/net_internals/logviewpainter.js
index 2f8d916..d0dc90b 100644
--- a/chrome/browser/resources/net_internals/logviewpainter.js
+++ b/chrome/browser/resources/net_internals/logviewpainter.js
@@ -79,7 +79,7 @@ PrintSourceEntriesAsText = function(sourceEntries) {
}
// Output the extra parameters.
- if (entry.orig.extra_parameters != undefined) {
+ if (entry.orig.params != undefined) {
// Add a continuation row for each line of text from the extra parameters.
var extraParamsText = getTextForExtraParams(entry.orig);
var extraParamsTextLines = extraParamsText.split('\n');
@@ -115,9 +115,9 @@ function getTextForExtraParams(entry) {
default:
var out = [];
- for (var k in entry.extra_parameters) {
+ for (var k in entry.params) {
out.push(' --> ' + k + ' = ' +
- JSON.stringify(entry.extra_parameters[k]));
+ JSON.stringify(entry.params[k]));
}
return out.join('\n');
}
@@ -138,7 +138,7 @@ function indentLines(start, lines) {
}
function getTextForRequestHeadersExtraParam(entry) {
- var params = entry.extra_parameters;
+ var params = entry.params;
// Strip the trailing CRLF that params.line contains.
var lineWithoutCRLF = params.line.replace(/\r\n$/g, '');
@@ -147,7 +147,7 @@ function getTextForRequestHeadersExtraParam(entry) {
}
function getTextForResponseHeadersExtraParam(entry) {
- return indentLines(' --> ', entry.extra_parameters.headers);
+ return indentLines(' --> ', entry.params.headers);
}
function getTextForEvent(entry) {
diff --git a/chrome/browser/resources/net_internals/sourceentry.js b/chrome/browser/resources/net_internals/sourceentry.js
index 8c6e6b0..9937037 100644
--- a/chrome/browser/resources/net_internals/sourceentry.js
+++ b/chrome/browser/resources/net_internals/sourceentry.js
@@ -153,15 +153,15 @@ SourceEntry.prototype.createRow_ = function() {
SourceEntry.prototype.getDescription = function() {
var e = this.getStartEntry_();
- if (!e || e.extra_parameters == undefined)
+ if (!e || e.params == undefined)
return '';
switch (e.source.type) {
case LogSourceType.URL_REQUEST:
case LogSourceType.SOCKET_STREAM:
- return e.extra_parameters.url;
+ return e.params.url;
case LogSourceType.CONNECT_JOB:
- return e.extra_parameters.group_name;
+ return e.params.group_name;
}
return '';
diff --git a/net/base/net_log.h b/net/base/net_log.h
index 69676b7..a2a8df2 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -102,21 +102,19 @@ class NetLog {
// |source| - The source that generated the event.
// |phase| - An optional parameter indicating whether this is the start/end
// of an action.
- // |extra_parameters| - Optional (may be NULL) parameters for this event.
- // The specific subclass of EventParameters is defined
- // by the contract for events of this |type|.
+ // |params| - Optional (may be NULL) parameters for this event.
+ // The specific subclass of EventParameters is defined
+ // by the contract for events of this |type|.
virtual void AddEntry(EventType type,
const base::TimeTicks& time,
const Source& source,
EventPhase phase,
- EventParameters* extra_parameters) = 0;
+ EventParameters* params) = 0;
// Returns a unique ID which can be used as a source ID.
virtual uint32 NextID() = 0;
// Returns true if more complicated messages should be sent to the log.
- // TODO(eroman): This is a carry-over from refactoring; figure out
- // something better.
virtual bool HasListener() const = 0;
// Returns a C-String symbolic name for |event_type|.