summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 16:16:56 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 16:16:56 +0000
commitc01b9b5ba4bb2d97518399fa74c2c384384f052f (patch)
tree65a3e606e0804636fe5d169929a981ddb5c0ec06 /chrome
parenta120891ec61a84cbcde5489ce26f92583689ff4e (diff)
downloadchromium_src-c01b9b5ba4bb2d97518399fa74c2c384384f052f.zip
chromium_src-c01b9b5ba4bb2d97518399fa74c2c384384f052f.tar.gz
chromium_src-c01b9b5ba4bb2d97518399fa74c2c384384f052f.tar.bz2
Misc. tidy up of various comments found whilst learning the codebase.
Fix a lint warning in render_messages.h (supersedes http://codereview.chromium.org/464072/show) Also implement a couple comments in geolocaiton/ in follow up to http://codereview.chromium.org/604019 BUG=none TEST=none Review URL: http://codereview.chromium.org/600128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cancelable_request.h10
-rw-r--r--chrome/browser/geolocation/wifi_data_provider_common.cc2
-rw-r--r--chrome/browser/geolocation/wifi_data_provider_common.h1
-rw-r--r--chrome/browser/net/url_fetcher_protect.h6
-rw-r--r--chrome/common/pref_service.h2
-rw-r--r--chrome/common/render_messages.h6
-rw-r--r--chrome/test/in_process_browser_test.h4
7 files changed, 19 insertions, 12 deletions
diff --git a/chrome/browser/cancelable_request.h b/chrome/browser/cancelable_request.h
index f771d02..514a0d7 100644
--- a/chrome/browser/cancelable_request.h
+++ b/chrome/browser/cancelable_request.h
@@ -18,8 +18,11 @@
//
// class MyClass {
// void MakeRequest() {
-// frontend_service->StartRequest(some_input1, some_input2, this,
+// frontend_service->StartRequest(some_input1, some_input2,
+// &callback_consumer_,
// NewCallback(this, &MyClass:RequestComplete));
+// // StartRequest() returns a Handle which may be retained for use with
+// // CancelRequest() if required, e.g. in MyClass's destructor.
// }
//
// void RequestComplete(int status) {
@@ -27,7 +30,7 @@
// }
//
// private:
-// CallbackConsumer callback_consumer_;
+// CancelableRequestConsumer callback_consumer_;
// };
//
//
@@ -38,7 +41,7 @@
// typedef Callback1<int>::Type RequestCallbackType;
//
// Handle StartRequest(int some_input1, int some_input2,
-// CallbackConsumer* consumer,
+// CancelableRequestConsumer* consumer,
// RequestCallbackType* callback) {
// scoped_refptr<CancelableRequest<RequestCallbackType> > request(
// new CancelableRequest<RequestCallbackType>(callback));
@@ -117,6 +120,7 @@ class CancelableRequestProvider {
// Called by the enduser of the request to cancel it. This MUST be called on
// the same thread that originally issued the request (which is also the same
// thread that would have received the callback if it was not canceled).
+ // handle must be for a valid pending (not yet complete or cancelled) request.
void CancelRequest(Handle handle);
protected:
diff --git a/chrome/browser/geolocation/wifi_data_provider_common.cc b/chrome/browser/geolocation/wifi_data_provider_common.cc
index 2091e38..2aba3ab 100644
--- a/chrome/browser/geolocation/wifi_data_provider_common.cc
+++ b/chrome/browser/geolocation/wifi_data_provider_common.cc
@@ -17,7 +17,7 @@ string16 MacAddressAsString16(const uint8 mac_as_int[6]) {
}
WifiDataProviderCommon::WifiDataProviderCommon()
- : Thread(__FILE__),
+ : Thread("Geolocation_wifi_provider"),
is_first_scan_complete_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) {
}
diff --git a/chrome/browser/geolocation/wifi_data_provider_common.h b/chrome/browser/geolocation/wifi_data_provider_common.h
index 9d428f3..ac8befa 100644
--- a/chrome/browser/geolocation/wifi_data_provider_common.h
+++ b/chrome/browser/geolocation/wifi_data_provider_common.h
@@ -118,5 +118,4 @@ class WifiDataProviderCommon
DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommon);
};
-
#endif // CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_
diff --git a/chrome/browser/net/url_fetcher_protect.h b/chrome/browser/net/url_fetcher_protect.h
index 25015ac..f47e0d6 100644
--- a/chrome/browser/net/url_fetcher_protect.h
+++ b/chrome/browser/net/url_fetcher_protect.h
@@ -123,9 +123,11 @@ class URLFetcherProtectManager {
static URLFetcherProtectManager* GetInstance();
// Registers a new entry in this service. If the entry already exists,
- // just returns it.
+ // just returns it. Ownership of the return object remains with the manager.
URLFetcherProtectEntry* Register(const std::string& id);
- // Always registers the entry even when it exists.
+ // Always registers the entry even when it exists; any existing entry for this
+ // id will be deleted and existing references to it will become invalid.
+ // Ownership of the return object remains with the manager.
URLFetcherProtectEntry* Register(const std::string& id,
URLFetcherProtectEntry* entry);
diff --git a/chrome/common/pref_service.h b/chrome/common/pref_service.h
index d9c948b..9d9b6d2 100644
--- a/chrome/common/pref_service.h
+++ b/chrome/common/pref_service.h
@@ -126,7 +126,7 @@ class PrefService : public NonThreadSafe,
FilePath GetFilePath(const wchar_t* path) const;
// Returns the branch if it exists. If it's not a branch or the branch does
- // not exist, returns NULL. This does
+ // not exist, returns NULL.
const DictionaryValue* GetDictionary(const wchar_t* path) const;
const ListValue* GetList(const wchar_t* path) const;
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 07b91a9..257d87e 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1970,11 +1970,11 @@ struct ParamTraits<ViewMsg_DatabaseOpenFileResponse_Params> {
#endif
}
static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->file_handle)
+ bool ret = ReadParam(m, iter, &p->file_handle);
#if defined(OS_POSIX)
- && ReadParam(m, iter, &p->dir_handle)
+ ret = ret && ReadParam(m, iter, &p->dir_handle);
#endif
- ;
+ return ret;
}
static void Log(const param_type& p, std::wstring* l) {
l->append(L"(");
diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h
index a142626..6e922d9 100644
--- a/chrome/test/in_process_browser_test.h
+++ b/chrome/test/in_process_browser_test.h
@@ -26,7 +26,9 @@ class RuleBasedHostResolverProc;
// is shown, invoke MessageLoop::current()->Quit() to return control back to
// your test method.
// . If you subclass and override SetUp, be sure and invoke
-// InProcessBrowserTest::SetUp.
+// InProcessBrowserTest::SetUp. (But see also
+// SetUpInProcessBrowserTestFixture and related hook methods for a cleaner
+// alternative).
//
// By default InProcessBrowserTest creates a single Browser (as returned from
// the CreateBrowser method). You can obviously create more as needed.