Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home for chromium.org
« Groups Home
chromeos: Stop exposing DriveDownloadObserver::GetDriv eTempDownloadPath (issue 11369019)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
hashim...@chromium.org  
View profile  
 More options Nov 1 2012, 3:04 am
From: hashim...@chromium.org
Date: Thu, 01 Nov 2012 07:04:55 +0000
Local: Thurs, Nov 1 2012 3:04 am
Subject: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
Reviewers: kinaba,

Message:
Please review

Description:
chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownloadPath

There is no need to make the function public static when it can live in the
nameless namespace.

BUG=None
TEST=build

Please review this at https://codereview.chromium.org/11369019/

SVN Base: svn://svn.chromium.org/chrome/trunk/src

Affected files:
   M chrome/browser/chromeos/drive/drive_download_observer.h
   M chrome/browser/chromeos/drive/drive_download_observer.cc

Index: chrome/browser/chromeos/drive/drive_download_observer.cc
diff --git a/chrome/browser/chromeos/drive/drive_download_observer.cc  
b/chrome/browser/chromeos/drive/drive_download_observer.cc
index  
000e5e96601694f96b9d5596be1b34bb767ebc08..56e84ac90c129720620ad2d866e3ea852 1bb587f  
100644
--- a/chrome/browser/chromeos/drive/drive_download_observer.cc
+++ b/chrome/browser/chromeos/drive/drive_download_observer.cc
@@ -91,8 +91,7 @@ class DriveUserData : public base::SupportsUserData::Data  
{

  // Extracts UploadingUserData* from |download|.
  UploadingUserData* GetUploadingUserData(DownloadItem* download) {
-  return static_cast<UploadingUserData*>(
-      download->GetUserData(&kUploadingKey));
+  return  
static_cast<UploadingUserData*>(download->GetUserData(&kUploadingKey));
  }

  const UploadingUserData* GetUploadingUserData(const DownloadItem*  
download) {
@@ -102,8 +101,7 @@ const UploadingUserData* GetUploadingUserData(const  
DownloadItem* download) {

  // Extracts DriveUserData* from |download|.
  DriveUserData* GetDriveUserData(DownloadItem* download) {
-  return static_cast<DriveUserData*>(
-      download->GetUserData(&kGDataPathKey));
+  return  
static_cast<DriveUserData*>(download->GetUserData(&kGDataPathKey));
  }

  const DriveUserData* GetDriveUserData(const DownloadItem* download) {
@@ -125,6 +123,19 @@ DriveSystemService* GetSystemService(Profile* profile)  
{
    return system_service;
  }

+// Creates a temporary file |drive_tmp_download_path| in
+// |drive_tmp_download_dir|. Must be called on a thread that allows file
+// operations.
+void GetDriveTempDownloadPath(const FilePath& drive_tmp_download_dir,
+                              FilePath* drive_tmp_download_path) {
+  bool created = file_util::CreateDirectory(drive_tmp_download_dir);
+  DCHECK(created) << "Can not create temp download directory at "
+                  << drive_tmp_download_dir.value();
+  created = file_util::CreateTemporaryFileInDir(drive_tmp_download_dir,
+                                                drive_tmp_download_path);
+  DCHECK(created) << "Temporary download file creation failed";
+}
+
  // Substitutes virtual drive path for local temporary path.
  void SubstituteDriveDownloadPathInternal(
      Profile* profile,
@@ -140,7 +151,7 @@ void SubstituteDriveDownloadPathInternal(
    FilePath* drive_tmp_download_path(new FilePath());
    BrowserThread::GetBlockingPool()->PostTaskAndReply(
        FROM_HERE,
-      base::Bind(&DriveDownloadObserver::GetDriveTempDownloadPath,
+      base::Bind(&GetDriveTempDownloadPath,
                   drive_tmp_download_dir,
                   drive_tmp_download_path),
        base::Bind(&RunSubstituteDriveDownloadCallback,
@@ -323,20 +334,6 @@ int DriveDownloadObserver::PercentComplete(const  
DownloadItem* download) {
    return -1;
  }

-// |drive_tmp_download_path| is set to a temporary local download path in
-// ~/GCache/v1/tmp/downloads/
-// static
-void DriveDownloadObserver::GetDriveTempDownloadPath(
-    const FilePath& drive_tmp_download_dir,
-    FilePath* drive_tmp_download_path) {
-  bool created = file_util::CreateDirectory(drive_tmp_download_dir);
-  DCHECK(created) << "Can not create temp download directory at "
-                  << drive_tmp_download_dir.value();
-  created = file_util::CreateTemporaryFileInDir(drive_tmp_download_dir,
-                                                drive_tmp_download_path);
-  DCHECK(created) << "Temporary download file creation failed";
-}
-
  void DriveDownloadObserver::ManagerGoingDown(
      DownloadManager* download_manager) {
    download_manager->RemoveObserver(this);
Index: chrome/browser/chromeos/drive/drive_download_observer.h
diff --git a/chrome/browser/chromeos/drive/drive_download_observer.h  
b/chrome/browser/chromeos/drive/drive_download_observer.h
index  
bba420a282a917f3fcbd0a3960607727530d7b3c..536e81d7d3e1b5a87908178ffa329cf76 c0ee43e  
100644
--- a/chrome/browser/chromeos/drive/drive_download_observer.h
+++ b/chrome/browser/chromeos/drive/drive_download_observer.h
@@ -20,7 +20,6 @@ class Profile;

  namespace google_apis {
  class DocumentEntry;
-class DriveUploader;
  }

  namespace drive {
@@ -42,9 +41,11 @@ class DriveDownloadObserver : public  
content::DownloadManager::Observer,
                    const FilePath& drive_tmp_download_path);

    typedef base::Callback<void(const FilePath&)>
-    SubstituteDriveDownloadPathCallback;
-  static void SubstituteDriveDownloadPath(Profile* profile,
-      const FilePath& drive_path, content::DownloadItem* download,
+      SubstituteDriveDownloadPathCallback;
+  static void SubstituteDriveDownloadPath(
+      Profile* profile,
+      const FilePath& drive_path,
+      content::DownloadItem* download,
        const SubstituteDriveDownloadPathCallback& callback);

    // Sets drive path, for example, '/special/drive/MyFolder/MyFile',
@@ -71,9 +72,8 @@ class DriveDownloadObserver : public  
content::DownloadManager::Observer,
    // becomes ready to complete.  If this method is called multiple times  
with
    // the download not ready to complete, only the last |complete_callback|
    // passed to this method for |download| will be called.
-  static bool IsReadyToComplete(
-      content::DownloadItem* download,
-      const base::Closure& complete_callback);
+  static bool IsReadyToComplete(content::DownloadItem* download,
+                                const base::Closure& complete_callback);

    // Returns the count of bytes confirmed as uploaded so far for |
download|.
    static int64 GetUploadedBytes(const content::DownloadItem* download);
@@ -82,12 +82,6 @@ class DriveDownloadObserver : public  
content::DownloadManager::Observer,
    // progress is unknown, returns -1.
    static int PercentComplete(const content::DownloadItem* download);

-  // Create a temporary file |drive_tmp_download_path| in
-  // |drive_tmp_download_dir|. Must be called on a thread that allows file
-  // operations.
-  static void GetDriveTempDownloadPath(const FilePath&  
drive_tmp_download_dir,
-                                       FilePath* drive_tmp_download_path);
-
   private:
    // Structure containing arguments required to process uploading.
    // For internal use, to avoid passing all of the parameters every time


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kin...@chromium.org  
View profile  
 More options Nov 1 2012, 3:07 am
From: kin...@chromium.org
Date: Thu, 01 Nov 2012 07:06:59 +0000
Local: Thurs, Nov 1 2012 3:06 am
Subject: Re: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
commit-...@chromium.org  
View profile  
 More options Nov 1 2012, 5:40 am
From: commit-...@chromium.org
Date: Thu, 01 Nov 2012 09:40:15 +0000
Local: Thurs, Nov 1 2012 5:40 am
Subject: Re: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
CQ is trying da patch. Follow status at
https://chromium-status.appspot.com/cq/hashim...@chromium.org/11369019/1

https://chromiumcodereview.appspot.com/11369019/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
commit-...@chromium.org  
View profile  
 More options Nov 1 2012, 7:34 am
From: commit-...@chromium.org
Date: Thu, 01 Nov 2012 11:34:25 +0000
Local: Thurs, Nov 1 2012 7:34 am
Subject: Re: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
Retried try job too often for step(s) interactive_ui_tests

https://chromiumcodereview.appspot.com/11369019/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
commit-...@chromium.org  
View profile  
 More options Nov 1 2012, 9:18 am
From: commit-...@chromium.org
Date: Thu, 01 Nov 2012 13:18:14 +0000
Local: Thurs, Nov 1 2012 9:18 am
Subject: Re: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
CQ is trying da patch. Follow status at
https://chromium-status.appspot.com/cq/hashim...@chromium.org/11369019/1

https://chromiumcodereview.appspot.com/11369019/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
commit-...@chromium.org  
View profile  
 More options Nov 1 2012, 9:38 am
From: commit-...@chromium.org
Date: Thu, 01 Nov 2012 13:38:22 +0000
Local: Thurs, Nov 1 2012 9:38 am
Subject: Re: chromeos: Stop exposing DriveDownloadObserver::GetDriveTempDownl oadPath (issue 11369019)
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »