summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-12 05:18:03 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-12 05:18:03 +0000
commitdb7ed13e6ce3fb75e8556c0efad32c933ec1c768 (patch)
tree246981053aefe91ef7cbf082656746292b772e81 /chrome
parent7864eb83fbf52fdd80047a028ac6bda113567c69 (diff)
downloadchromium_src-db7ed13e6ce3fb75e8556c0efad32c933ec1c768.zip
chromium_src-db7ed13e6ce3fb75e8556c0efad32c933ec1c768.tar.gz
chromium_src-db7ed13e6ce3fb75e8556c0efad32c933ec1c768.tar.bz2
Misc cleanups in Drive code.
Typo fix, style fix, unused #include/forward-declarations clean up, adding const, reordering declarations properly, etc. BUG=none. TEST=it compiles. Review URL: https://codereview.chromium.org/12229002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/drive/drive_feed_loader_observer.h2
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_metadata.h2
-rw-r--r--chrome/browser/chromeos/drive/drive_file_system_util.h5
-rw-r--r--chrome/browser/chromeos/drive/drive_scheduler.cc4
-rw-r--r--chrome/browser/chromeos/drive/drive_scheduler.h7
-rw-r--r--chrome/browser/chromeos/drive/drive_system_service.cc1
-rw-r--r--chrome/browser/chromeos/drive/search_metadata.cc2
-rw-r--r--chrome/browser/chromeos/drive/search_metadata.h4
-rw-r--r--chrome/browser/google_apis/auth_service.cc2
-rw-r--r--chrome/browser/google_apis/auth_service.h3
-rw-r--r--chrome/browser/google_apis/auth_service_interface.h4
-rw-r--r--chrome/browser/google_apis/base_operations.h5
-rw-r--r--chrome/browser/google_apis/drive_api_operations.h2
-rw-r--r--chrome/browser/google_apis/drive_api_service.cc1
-rw-r--r--chrome/browser/google_apis/drive_api_service.h3
-rw-r--r--chrome/browser/google_apis/drive_api_url_generator.h2
-rw-r--r--chrome/browser/google_apis/gdata_wapi_parser.h2
-rw-r--r--chrome/browser/google_apis/gdata_wapi_service.h2
-rw-r--r--chrome/browser/google_apis/gdata_wapi_url_generator.cc2
-rw-r--r--chrome/browser/google_apis/test_util.h3
-rw-r--r--chrome/browser/google_apis/time_util.h2
21 files changed, 23 insertions, 37 deletions
diff --git a/chrome/browser/chromeos/drive/drive_feed_loader_observer.h b/chrome/browser/chromeos/drive/drive_feed_loader_observer.h
index 1d3e504..857c57b 100644
--- a/chrome/browser/chromeos/drive/drive_feed_loader_observer.h
+++ b/chrome/browser/chromeos/drive/drive_feed_loader_observer.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FEED_LOADER_OBSERVER_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FEED_LOADER_OBSERVER_H_
-#include <string>
-
namespace base {
class FilePath;
}
diff --git a/chrome/browser/chromeos/drive/drive_file_system_metadata.h b/chrome/browser/chromeos/drive/drive_file_system_metadata.h
index 047f1d8..7a256d6 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_metadata.h
+++ b/chrome/browser/chromeos/drive/drive_file_system_metadata.h
@@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_METADATA_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_METADATA_H_
-#include <string>
-
#include "base/basictypes.h"
#include "base/time.h"
#include "chrome/browser/chromeos/drive/drive_file_error.h"
diff --git a/chrome/browser/chromeos/drive/drive_file_system_util.h b/chrome/browser/chromeos/drive/drive_file_system_util.h
index 0f9a6a6..49eeeff 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_util.h
+++ b/chrome/browser/chromeos/drive/drive_file_system_util.h
@@ -6,13 +6,10 @@
#define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_
#include <string>
-#include <utility>
-#include <vector>
#include "base/callback_forward.h"
-#include "base/memory/scoped_ptr.h"
#include "base/platform_file.h"
-#include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
+#include "chrome/browser/chromeos/drive/drive_file_error.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc
index 6215b84..f5df202 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.cc
+++ b/chrome/browser/chromeos/drive/drive_scheduler.cc
@@ -61,8 +61,8 @@ DriveScheduler::DriveScheduler(
drive_service_(drive_service),
uploader_(uploader),
profile_(profile),
- weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- initialized_(false) {
+ initialized_(false),
+ weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
for (int i = 0; i < NUM_QUEUES; ++i) {
job_loop_is_running_[i] = false;
diff --git a/chrome/browser/chromeos/drive/drive_scheduler.h b/chrome/browser/chromeos/drive/drive_scheduler.h
index e60f907..fe991e4 100644
--- a/chrome/browser/chromeos/drive/drive_scheduler.h
+++ b/chrome/browser/chromeos/drive/drive_scheduler.h
@@ -377,13 +377,12 @@ class DriveScheduler
Profile* profile_;
- // Note: This should remain the last member so it'll be destroyed and
- // invalidate its weak pointers before any other members are destroyed.
- base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_;
-
// Whether this instance is initialized or not.
bool initialized_;
+ // Note: This should remain the last member so it'll be destroyed and
+ // invalidate its weak pointers before any other members are destroyed.
+ base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DriveScheduler);
};
diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc
index 8d61c70..1a86e98 100644
--- a/chrome/browser/chromeos/drive/drive_system_service.cc
+++ b/chrome/browser/chromeos/drive/drive_system_service.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_util.h"
+#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/drive_api_service.h"
#include "chrome/browser/google_apis/drive_api_util.h"
#include "chrome/browser/google_apis/drive_uploader.h"
diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc
index bc13d24..600cbf8 100644
--- a/chrome/browser/chromeos/drive/search_metadata.cc
+++ b/chrome/browser/chromeos/drive/search_metadata.cc
@@ -113,7 +113,7 @@ class SearchMetadataHelper {
// Search is complete. Send the result to the callback.
std::sort(results_->begin(), results_->end(), &CompareByTimestamp);
if (results_->size() > static_cast<size_t>(at_most_num_matches_)) {
- // Don't use resize() as it requres a default constructor.
+ // Don't use resize() as it requires a default constructor.
results_->erase(results_->begin() + at_most_num_matches_,
results_->end());
}
diff --git a/chrome/browser/chromeos/drive/search_metadata.h b/chrome/browser/chromeos/drive/search_metadata.h
index 9cb7beb..8e13e11 100644
--- a/chrome/browser/chromeos/drive/search_metadata.h
+++ b/chrome/browser/chromeos/drive/search_metadata.h
@@ -27,12 +27,12 @@ struct MetadataSearchResult {
DriveEntryProto entry_proto;
// The base name to be displayed in the UI. The parts matched the search
- // query are highlited with <b> tag. Meta characters are escaped like &lt;
+ // query are highlighted with <b> tag. Meta characters are escaped like &lt;
//
// Why HTML? we could instead provide matched ranges using pairs of
// integers, but this is fragile as we'll eventually converting strings
// from UTF-8 (StringValue in base/values.h uses std::string) to UTF-16
- // when sending strings from C++ to JavaSCript.
+ // when sending strings from C++ to JavaScript.
//
// Why <b> instead of <strong>? Because <b> is shorter.
std::string highlighted_base_name;
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index 69fe342..5f93629 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -11,7 +11,7 @@
#include "base/message_loop_proxy.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/google_apis/auth_service_observer.h"
-#include "chrome/browser/google_apis/base_operations.h"
+#include "chrome/browser/google_apis/operation_registry.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
diff --git a/chrome/browser/google_apis/auth_service.h b/chrome/browser/google_apis/auth_service.h
index d14aab4..c336b4d3 100644
--- a/chrome/browser/google_apis/auth_service.h
+++ b/chrome/browser/google_apis/auth_service.h
@@ -11,7 +11,6 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "chrome/browser/google_apis/auth_service_interface.h"
-#include "chrome/browser/google_apis/base_operations.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -47,7 +46,7 @@ class AuthService : public AuthServiceInterface,
virtual void RemoveObserver(AuthServiceObserver* observer) OVERRIDE;
virtual void Initialize(Profile* profile) OVERRIDE;
virtual void StartAuthentication(OperationRegistry* registry,
- const AuthStatusCallback& callback) OVERRIDE;
+ const AuthStatusCallback& callback) OVERRIDE;
virtual bool HasAccessToken() const OVERRIDE;
virtual bool HasRefreshToken() const OVERRIDE;
virtual const std::string& access_token() const OVERRIDE;
diff --git a/chrome/browser/google_apis/auth_service_interface.h b/chrome/browser/google_apis/auth_service_interface.h
index 14e3e2eb..a5db30c 100644
--- a/chrome/browser/google_apis/auth_service_interface.h
+++ b/chrome/browser/google_apis/auth_service_interface.h
@@ -7,15 +7,15 @@
#include <string>
-#include "chrome/browser/google_apis/base_operations.h"
+#include "base/callback_forward.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
class Profile;
namespace google_apis {
-class OperationRegistry;
class AuthServiceObserver;
+class OperationRegistry;
// Called when fetching of access token is complete.
typedef base::Callback<void(GDataErrorCode error,
diff --git a/chrome/browser/google_apis/base_operations.h b/chrome/browser/google_apis/base_operations.h
index 0b1d1ca7..885264c 100644
--- a/chrome/browser/google_apis/base_operations.h
+++ b/chrome/browser/google_apis/base_operations.h
@@ -15,13 +15,10 @@
#include "chrome/browser/google_apis/drive_upload_mode.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/operation_registry.h"
-#include "google_apis/gaia/oauth2_access_token_consumer.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
-class OAuth2AccessTokenFetcher;
-
namespace base {
class Value;
} // namespace base
@@ -32,7 +29,7 @@ class URLRequestContextGetter;
namespace google_apis {
-// Callback used to pass parsed JSON from ParseJson(). If parsing error occures,
+// Callback used to pass parsed JSON from ParseJson(). If parsing error occurs,
// then the passed argument is null.
typedef base::Callback<void(scoped_ptr<base::Value> value)> ParseJsonCallback;
diff --git a/chrome/browser/google_apis/drive_api_operations.h b/chrome/browser/google_apis/drive_api_operations.h
index 514f7be..95eb236 100644
--- a/chrome/browser/google_apis/drive_api_operations.h
+++ b/chrome/browser/google_apis/drive_api_operations.h
@@ -279,7 +279,7 @@ class InsertResourceOperation : public EntryActionOperation {
// This class performs the operation for removing a resource from a directory.
// Note that we use "delete" for the name of this class, which comes from the
// operation name of the Drive API v2, although we prefer "remove" for that
-// sence in "drive/google_api"
+// sense in "drive/google_api"
// Also note that this is the operation of "Children: delete" of the Drive API
// v2. https://developers.google.com/drive/v2/reference/children/delete
class DeleteResourceOperation : public EntryActionOperation {
diff --git a/chrome/browser/google_apis/drive_api_service.cc b/chrome/browser/google_apis/drive_api_service.cc
index 66edb1b..130eeb8 100644
--- a/chrome/browser/google_apis/drive_api_service.cc
+++ b/chrome/browser/google_apis/drive_api_service.cc
@@ -12,6 +12,7 @@
#include "base/task_runner_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/values.h"
+#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/drive_api_operations.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
diff --git a/chrome/browser/google_apis/drive_api_service.h b/chrome/browser/google_apis/drive_api_service.h
index 649c79f..9dd5549 100644
--- a/chrome/browser/google_apis/drive_api_service.h
+++ b/chrome/browser/google_apis/drive_api_service.h
@@ -9,7 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
-#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/auth_service_observer.h"
#include "chrome/browser/google_apis/drive_api_url_generator.h"
#include "chrome/browser/google_apis/drive_service_interface.h"
@@ -144,7 +143,7 @@ class DriveAPIService : public DriveServiceInterface,
const std::string& search_query,
const GetResourceListCallback& callback);
- // AuthService::Observer override.
+ // AuthServiceObserver override.
virtual void OnOAuth2RefreshTokenChanged() OVERRIDE;
// DriveServiceObserver Overrides
diff --git a/chrome/browser/google_apis/drive_api_url_generator.h b/chrome/browser/google_apis/drive_api_url_generator.h
index 0e7fd44..c1990d3c 100644
--- a/chrome/browser/google_apis/drive_api_url_generator.h
+++ b/chrome/browser/google_apis/drive_api_url_generator.h
@@ -45,7 +45,7 @@ class DriveApiUrlGenerator {
GURL GetFilelistUrl(
const GURL& override_url, const std::string& search_string) const;
- // Returns a URL to fecth a file content.
+ // Returns a URL to fetch a file content.
GURL GetFileUrl(const std::string& file_id) const;
// Returns a URL to trash a resource with the given |resource_id|.
diff --git a/chrome/browser/google_apis/gdata_wapi_parser.h b/chrome/browser/google_apis/gdata_wapi_parser.h
index 4b04c0a..bc5c702 100644
--- a/chrome/browser/google_apis/gdata_wapi_parser.h
+++ b/chrome/browser/google_apis/gdata_wapi_parser.h
@@ -17,8 +17,6 @@
#include "chrome/browser/google_apis/drive_entry_kinds.h"
#include "googleurl/src/gurl.h"
-class Profile;
-
namespace base {
class FilePath;
class DictionaryValue;
diff --git a/chrome/browser/google_apis/gdata_wapi_service.h b/chrome/browser/google_apis/gdata_wapi_service.h
index 49895ac..3542588 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.h
+++ b/chrome/browser/google_apis/gdata_wapi_service.h
@@ -139,7 +139,7 @@ class GDataWapiService : public DriveServiceInterface,
ObserverList<DriveServiceObserver> observers_;
// Operation objects should hold a copy of this, rather than a const
// reference, as they may outlive this object.
- GDataWapiUrlGenerator url_generator_;
+ const GDataWapiUrlGenerator url_generator_;
const std::string custom_user_agent_;
DISALLOW_COPY_AND_ASSIGN(GDataWapiService);
diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator.cc b/chrome/browser/google_apis/gdata_wapi_url_generator.cc
index 58bfdc2..516858c 100644
--- a/chrome/browser/google_apis/gdata_wapi_url_generator.cc
+++ b/chrome/browser/google_apis/gdata_wapi_url_generator.cc
@@ -23,7 +23,7 @@ const char kGetResourceListURLForAllDocuments[] =
const char kGetResourceListURLForDirectoryFormat[] =
"/feeds/default/private/full/%s/contents/-/mine";
-// Content URL for modification in a particular directory specifyied by "%s"
+// Content URL for modification in a particular directory specified by "%s"
// which will be replaced with its resource id.
const char kContentURLFormat[] = "/feeds/default/private/full/%s/contents";
diff --git a/chrome/browser/google_apis/test_util.h b/chrome/browser/google_apis/test_util.h
index 9f1cae8..447b1fd 100644
--- a/chrome/browser/google_apis/test_util.h
+++ b/chrome/browser/google_apis/test_util.h
@@ -9,7 +9,8 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
-#include "googleurl/src/gurl.h"
+
+class GURL;
namespace base {
class FilePath;
diff --git a/chrome/browser/google_apis/time_util.h b/chrome/browser/google_apis/time_util.h
index 222045b..5b5b195 100644
--- a/chrome/browser/google_apis/time_util.h
+++ b/chrome/browser/google_apis/time_util.h
@@ -9,8 +9,6 @@
#include "base/string_piece.h"
-class Profile;
-
namespace base {
class Time;
} // namespace base