summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 17:09:01 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 17:09:01 +0000
commit4129132ccbbc05abb8bfd89b3d7d5316c4d7d136 (patch)
treeb01682d5ad9a9e73c64217299c383f2d281a9864 /chrome
parent8bad4795cbf8afd699f6c3dc111c8dba11a280d3 (diff)
downloadchromium_src-4129132ccbbc05abb8bfd89b3d7d5316c4d7d136.zip
chromium_src-4129132ccbbc05abb8bfd89b3d7d5316c4d7d136.tar.gz
chromium_src-4129132ccbbc05abb8bfd89b3d7d5316c4d7d136.tar.bz2
Rename DownloadRequestManager to DownloadRequestLimiter.
We already have too many classes named Manager in the download code. This also contains some minor cleanup changes like comment updates. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3011001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_process.cc4
-rw-r--r--chrome/browser/browser_process.h4
-rw-r--r--chrome/browser/download/download_request_infobar_delegate.cc5
-rw-r--r--chrome/browser/download/download_request_infobar_delegate.h8
-rw-r--r--chrome/browser/download/download_request_infobar_delegate_unittest.cc4
-rw-r--r--chrome/browser/download/download_request_limiter.cc (renamed from chrome/browser/download/download_request_manager.cc)92
-rw-r--r--chrome/browser/download/download_request_limiter.h (renamed from chrome/browser/download/download_request_manager.h)51
-rw-r--r--chrome/browser/download/download_request_limiter_unittest.cc (renamed from chrome/browser/download/download_request_manager_unittest.cc)96
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.cc2
-rw-r--r--chrome/browser/renderer_host/download_throttling_resource_handler.h10
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h2
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc4
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.h8
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc9
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_view_win.cc2
-rw-r--r--chrome/chrome_browser.gypi6
-rw-r--r--chrome/chrome_tests.gypi4
17 files changed, 156 insertions, 155 deletions
diff --git a/chrome/browser/browser_process.cc b/chrome/browser/browser_process.cc
index 4500117..d1e7c28 100644
--- a/chrome/browser/browser_process.cc
+++ b/chrome/browser/browser_process.cc
@@ -8,8 +8,8 @@
BrowserProcess* g_browser_process = NULL;
-DownloadRequestManager* BrowserProcess::download_request_manager() {
+DownloadRequestLimiter* BrowserProcess::download_request_limiter() {
ResourceDispatcherHost* rdh = resource_dispatcher_host();
- return rdh ? rdh->download_request_manager() : NULL;
+ return rdh ? rdh->download_request_limiter() : NULL;
}
diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
index f99245b..a85c6c6 100644
--- a/chrome/browser/browser_process.h
+++ b/chrome/browser/browser_process.h
@@ -19,7 +19,7 @@
class AutomationProviderList;
class Clipboard;
class DevToolsManager;
-class DownloadRequestManager;
+class DownloadRequestLimiter;
class GoogleURLTracker;
class IntranetRedirectDetector;
class IconManager;
@@ -127,7 +127,7 @@ class BrowserProcess {
virtual const std::string& GetApplicationLocale() = 0;
virtual void SetApplicationLocale(const std::string& locale) = 0;
- DownloadRequestManager* download_request_manager();
+ DownloadRequestLimiter* download_request_limiter();
// Returns an event that is signaled when the browser shutdown.
virtual base::WaitableEvent* shutdown_event() = 0;
diff --git a/chrome/browser/download/download_request_infobar_delegate.cc b/chrome/browser/download/download_request_infobar_delegate.cc
index 88c83fc..4a401bb 100644
--- a/chrome/browser/download/download_request_infobar_delegate.cc
+++ b/chrome/browser/download/download_request_infobar_delegate.cc
@@ -11,7 +11,7 @@
#include "grit/theme_resources.h"
DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate(TabContents* tab,
- DownloadRequestManager::TabDownloadState* host)
+ DownloadRequestLimiter::TabDownloadState* host)
: ConfirmInfoBarDelegate(tab),
host_(host) {
if (tab)
@@ -50,9 +50,10 @@ std::wstring DownloadRequestInfoBarDelegate::GetButtonLabel(
bool DownloadRequestInfoBarDelegate::Accept() {
if (host_) {
+ // Accept() call will nullify host_ if no further prompts are required.
host_->Accept();
}
- // Accept() call will nullify host_ if no furthur prompts are required.
+
return !host_;
}
diff --git a/chrome/browser/download/download_request_infobar_delegate.h b/chrome/browser/download/download_request_infobar_delegate.h
index 112c2e2..700c629 100644
--- a/chrome/browser/download/download_request_infobar_delegate.h
+++ b/chrome/browser/download/download_request_infobar_delegate.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_INFOBAR_DELEGATE_H_
#include "base/basictypes.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
class TabContents;
@@ -18,11 +18,11 @@ class TabContents;
class DownloadRequestInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
DownloadRequestInfoBarDelegate(
- TabContents* tab, DownloadRequestManager::TabDownloadState* host);
+ TabContents* tab, DownloadRequestLimiter::TabDownloadState* host);
virtual ~DownloadRequestInfoBarDelegate();
- void set_host(DownloadRequestManager::TabDownloadState* host) {
+ void set_host(DownloadRequestLimiter::TabDownloadState* host) {
host_ = host;
}
@@ -42,7 +42,7 @@ class DownloadRequestInfoBarDelegate : public ConfirmInfoBarDelegate {
virtual bool Cancel();
private:
- DownloadRequestManager::TabDownloadState* host_;
+ DownloadRequestLimiter::TabDownloadState* host_;
DISALLOW_COPY_AND_ASSIGN(DownloadRequestInfoBarDelegate);
};
diff --git a/chrome/browser/download/download_request_infobar_delegate_unittest.cc b/chrome/browser/download/download_request_infobar_delegate_unittest.cc
index 663f8b7..1ceb247 100644
--- a/chrome/browser/download/download_request_infobar_delegate_unittest.cc
+++ b/chrome/browser/download/download_request_infobar_delegate_unittest.cc
@@ -3,10 +3,10 @@
// found in the LICENSE file.
#include "chrome/browser/download/download_request_infobar_delegate.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "testing/gtest/include/gtest/gtest.h"
-class MockTabDownloadState : public DownloadRequestManager::TabDownloadState {
+class MockTabDownloadState : public DownloadRequestLimiter::TabDownloadState {
public:
MockTabDownloadState() : responded_(false), accepted_(false) {
}
diff --git a/chrome/browser/download/download_request_manager.cc b/chrome/browser/download/download_request_limiter.cc
index 6c06435..472a2c5 100644
--- a/chrome/browser/download/download_request_manager.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
+#include "base/stl_util-inl.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/download/download_request_infobar_delegate.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
@@ -15,13 +16,13 @@
// TabDownloadState ------------------------------------------------------------
-DownloadRequestManager::TabDownloadState::TabDownloadState(
- DownloadRequestManager* host,
+DownloadRequestLimiter::TabDownloadState::TabDownloadState(
+ DownloadRequestLimiter* host,
NavigationController* controller,
NavigationController* originating_controller)
: host_(host),
controller_(controller),
- status_(DownloadRequestManager::ALLOW_ONE_DOWNLOAD),
+ status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD),
download_count_(0),
infobar_(NULL) {
Source<NavigationController> notification_source(controller);
@@ -35,7 +36,7 @@ DownloadRequestManager::TabDownloadState::TabDownloadState(
initial_page_host_ = active_entry->url().host();
}
-DownloadRequestManager::TabDownloadState::~TabDownloadState() {
+DownloadRequestLimiter::TabDownloadState::~TabDownloadState() {
// We should only be destroyed after the callbacks have been notified.
DCHECK(callbacks_.empty());
@@ -43,14 +44,14 @@ DownloadRequestManager::TabDownloadState::~TabDownloadState() {
DCHECK(!infobar_);
}
-void DownloadRequestManager::TabDownloadState::OnUserGesture() {
+void DownloadRequestLimiter::TabDownloadState::OnUserGesture() {
if (is_showing_prompt()) {
// Don't change the state if the user clicks on the page some where.
return;
}
- if (status_ != DownloadRequestManager::ALLOW_ALL_DOWNLOADS &&
- status_ != DownloadRequestManager::DOWNLOADS_NOT_ALLOWED) {
+ if (status_ != DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS &&
+ status_ != DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED) {
// Revert to default status.
host_->Remove(this);
// WARNING: We've been deleted.
@@ -58,30 +59,30 @@ void DownloadRequestManager::TabDownloadState::OnUserGesture() {
}
}
-void DownloadRequestManager::TabDownloadState::PromptUserForDownload(
+void DownloadRequestLimiter::TabDownloadState::PromptUserForDownload(
TabContents* tab,
- DownloadRequestManager::Callback* callback) {
+ DownloadRequestLimiter::Callback* callback) {
callbacks_.push_back(callback);
if (is_showing_prompt())
return; // Already showing prompt.
- if (DownloadRequestManager::delegate_) {
- NotifyCallbacks(DownloadRequestManager::delegate_->ShouldAllowDownload());
+ if (DownloadRequestLimiter::delegate_) {
+ NotifyCallbacks(DownloadRequestLimiter::delegate_->ShouldAllowDownload());
} else {
infobar_ = new DownloadRequestInfoBarDelegate(tab, this);
}
}
-void DownloadRequestManager::TabDownloadState::Cancel() {
+void DownloadRequestLimiter::TabDownloadState::Cancel() {
NotifyCallbacks(false);
}
-void DownloadRequestManager::TabDownloadState::Accept() {
+void DownloadRequestLimiter::TabDownloadState::Accept() {
NotifyCallbacks(true);
}
-void DownloadRequestManager::TabDownloadState::Observe(
+void DownloadRequestLimiter::TabDownloadState::Observe(
NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
@@ -109,8 +110,8 @@ void DownloadRequestManager::TabDownloadState::Observe(
return;
}
- if (status_ == DownloadRequestManager::ALLOW_ALL_DOWNLOADS ||
- status_ == DownloadRequestManager::DOWNLOADS_NOT_ALLOWED) {
+ if (status_ == DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS ||
+ status_ == DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED) {
// User has either allowed all downloads or canceled all downloads. Only
// reset the download state if the user is navigating to a different
// host (or host is empty).
@@ -135,11 +136,11 @@ void DownloadRequestManager::TabDownloadState::Observe(
host_->Remove(this);
}
-void DownloadRequestManager::TabDownloadState::NotifyCallbacks(bool allow) {
+void DownloadRequestLimiter::TabDownloadState::NotifyCallbacks(bool allow) {
status_ = allow ?
- DownloadRequestManager::ALLOW_ALL_DOWNLOADS :
- DownloadRequestManager::DOWNLOADS_NOT_ALLOWED;
- std::vector<DownloadRequestManager::Callback*> callbacks;
+ DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS :
+ DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED;
+ std::vector<DownloadRequestLimiter::Callback*> callbacks;
bool change_status = false;
// Selectively send first few notifications only if number of downloads exceed
@@ -154,7 +155,7 @@ void DownloadRequestManager::TabDownloadState::NotifyCallbacks(bool allow) {
}
callbacks.swap(callbacks_);
} else {
- std::vector<DownloadRequestManager::Callback*>::iterator start, end;
+ std::vector<DownloadRequestLimiter::Callback*>::iterator start, end;
start = callbacks_.begin();
end = callbacks_.begin() + kMaxDownloadsAtOnce;
callbacks.assign(start, end);
@@ -162,31 +163,31 @@ void DownloadRequestManager::TabDownloadState::NotifyCallbacks(bool allow) {
change_status = true;
}
- for (size_t i = 0; i < callbacks.size(); ++i) {
+ for (size_t i = 0; i < callbacks.size(); ++i)
host_->ScheduleNotification(callbacks[i], allow);
- }
+
if (change_status)
- status_ = DownloadRequestManager::PROMPT_BEFORE_DOWNLOAD;
+ status_ = DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD;
}
-// DownloadRequestManager ------------------------------------------------------
+// DownloadRequestLimiter ------------------------------------------------------
-DownloadRequestManager::DownloadRequestManager() {
+DownloadRequestLimiter::DownloadRequestLimiter() {
}
-DownloadRequestManager::~DownloadRequestManager() {
+DownloadRequestLimiter::~DownloadRequestLimiter() {
// All the tabs should have closed before us, which sends notification and
// removes from state_map_. As such, there should be no pending callbacks.
DCHECK(state_map_.empty());
}
-DownloadRequestManager::DownloadStatus
- DownloadRequestManager::GetDownloadStatus(TabContents* tab) {
+DownloadRequestLimiter::DownloadStatus
+ DownloadRequestLimiter::GetDownloadStatus(TabContents* tab) {
TabDownloadState* state = GetDownloadState(&tab->controller(), NULL, false);
return state ? state->download_status() : ALLOW_ONE_DOWNLOAD;
}
-void DownloadRequestManager::CanDownloadOnIOThread(int render_process_host_id,
+void DownloadRequestLimiter::CanDownloadOnIOThread(int render_process_host_id,
int render_view_id,
Callback* callback) {
// This is invoked on the IO thread. Schedule the task to run on the UI
@@ -194,11 +195,11 @@ void DownloadRequestManager::CanDownloadOnIOThread(int render_process_host_id,
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
ChromeThread::PostTask(
ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(this, &DownloadRequestManager::CanDownload,
+ NewRunnableMethod(this, &DownloadRequestLimiter::CanDownload,
render_process_host_id, render_view_id, callback));
}
-void DownloadRequestManager::OnUserGesture(TabContents* tab) {
+void DownloadRequestLimiter::OnUserGesture(TabContents* tab) {
TabDownloadState* state = GetDownloadState(&tab->controller(), NULL, false);
if (!state)
return;
@@ -207,11 +208,11 @@ void DownloadRequestManager::OnUserGesture(TabContents* tab) {
}
// static
-void DownloadRequestManager::SetTestingDelegate(TestingDelegate* delegate) {
+void DownloadRequestLimiter::SetTestingDelegate(TestingDelegate* delegate) {
delegate_ = delegate;
}
-DownloadRequestManager::TabDownloadState* DownloadRequestManager::
+DownloadRequestLimiter::TabDownloadState* DownloadRequestLimiter::
GetDownloadState(NavigationController* controller,
NavigationController* originating_controller,
bool create) {
@@ -229,7 +230,7 @@ DownloadRequestManager::TabDownloadState* DownloadRequestManager::
return state;
}
-void DownloadRequestManager::CanDownload(int render_process_host_id,
+void DownloadRequestLimiter::CanDownload(int render_process_host_id,
int render_view_id,
Callback* callback) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
@@ -244,7 +245,7 @@ void DownloadRequestManager::CanDownload(int render_process_host_id,
CanDownloadImpl(originating_tab, callback);
}
-void DownloadRequestManager::CanDownloadImpl(
+void DownloadRequestLimiter::CanDownloadImpl(
TabContents* originating_tab,
Callback* callback) {
// FYI: Chrome Frame overrides CanDownload in ExternalTabContainer in order
@@ -268,7 +269,7 @@ void DownloadRequestManager::CanDownloadImpl(
switch (state->download_status()) {
case ALLOW_ALL_DOWNLOADS:
if (state->download_count() && !(state->download_count() %
- DownloadRequestManager::kMaxDownloadsAtOnce))
+ DownloadRequestLimiter::kMaxDownloadsAtOnce))
state->set_download_status(PROMPT_BEFORE_DOWNLOAD);
ScheduleNotification(callback, true);
state->increment_download_count();
@@ -293,16 +294,15 @@ void DownloadRequestManager::CanDownloadImpl(
}
}
-void DownloadRequestManager::ScheduleNotification(Callback* callback,
+void DownloadRequestLimiter::ScheduleNotification(Callback* callback,
bool allow) {
ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(
- this, &DownloadRequestManager::NotifyCallback, callback, allow));
+ this, &DownloadRequestLimiter::NotifyCallback, callback, allow));
}
-void DownloadRequestManager::NotifyCallback(Callback* callback, bool allow) {
- // We better be on the IO thread now.
+void DownloadRequestLimiter::NotifyCallback(Callback* callback, bool allow) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
if (allow)
callback->ContinueDownload();
@@ -310,12 +310,12 @@ void DownloadRequestManager::NotifyCallback(Callback* callback, bool allow) {
callback->CancelDownload();
}
-void DownloadRequestManager::Remove(TabDownloadState* state) {
- DCHECK(state_map_.find(state->controller()) != state_map_.end());
+void DownloadRequestLimiter::Remove(TabDownloadState* state) {
+ DCHECK(ContainsKey(state_map_, state->controller()));
state_map_.erase(state->controller());
delete state;
}
// static
-DownloadRequestManager::TestingDelegate* DownloadRequestManager::delegate_ =
+DownloadRequestLimiter::TestingDelegate* DownloadRequestLimiter::delegate_ =
NULL;
diff --git a/chrome/browser/download/download_request_manager.h b/chrome/browser/download/download_request_limiter.h
index 97fa7f8..f5b4cfa 100644
--- a/chrome/browser/download/download_request_manager.h
+++ b/chrome/browser/download/download_request_limiter.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_
-#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_
+#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_
#include <map>
#include <string>
@@ -17,9 +17,9 @@ class DownloadRequestInfoBarDelegate;
class NavigationController;
class TabContents;
-// DownloadRequestManager is responsible for determining whether a download
+// DownloadRequestLimiter is responsible for determining whether a download
// should be allowed or not. It is designed to keep pages from downloading
-// multiple files without user interaction. DownloadRequestManager is invoked
+// multiple files without user interaction. DownloadRequestLimiter is invoked
// from ResourceDispatcherHost any time a download begins
// (CanDownloadOnIOThread). The request is processed on the UI thread, and the
// request is notified (back on the IO thread) as to whether the download should
@@ -39,9 +39,8 @@ class TabContents;
// choice stays until the user navigates to a different host. For example, if
// the user allowed the download, multiple downloads are allowed without any
// user intervention until the user navigates to a different host.
-
-class DownloadRequestManager
- : public base::RefCountedThreadSafe<DownloadRequestManager> {
+class DownloadRequestLimiter
+ : public base::RefCountedThreadSafe<DownloadRequestLimiter> {
public:
// Download status for a particular page. See class description for details.
enum DownloadStatus {
@@ -68,7 +67,7 @@ class DownloadRequestManager
// TabDownloadState maintains the download state for a particular tab.
// TabDownloadState prompts the user with an infobar as necessary.
// TabDownloadState deletes itself (by invoking
- // DownloadRequestManager::Remove) as necessary.
+ // DownloadRequestLimiter::Remove) as necessary.
class TabDownloadState : public NotificationObserver {
public:
// Creates a new TabDownloadState. |controller| is the controller the
@@ -77,16 +76,16 @@ class DownloadRequestManager
// the initial download. If |originating_controller| is null, |controller|
// is used. |originating_controller| is typically null, but differs from
// |controller| in the case of a constrained popup requesting the download.
- TabDownloadState(DownloadRequestManager* host,
+ TabDownloadState(DownloadRequestLimiter* host,
NavigationController* controller,
NavigationController* originating_controller);
virtual ~TabDownloadState();
// Status of the download.
- void set_download_status(DownloadRequestManager::DownloadStatus status) {
+ void set_download_status(DownloadRequestLimiter::DownloadStatus status) {
status_ = status;
}
- DownloadRequestManager::DownloadStatus download_status() const {
+ DownloadRequestLimiter::DownloadStatus download_status() const {
return status_;
}
@@ -99,14 +98,14 @@ class DownloadRequestManager
}
// Invoked when a user gesture occurs (mouse click, enter or space). This
- // may result in invoking Remove on DownloadRequestManager.
+ // may result in invoking Remove on DownloadRequestLimiter.
void OnUserGesture();
// Asks the user if they really want to allow the download.
// See description above CanDownloadOnIOThread for details on lifetime of
// callback.
void PromptUserForDownload(TabContents* tab,
- DownloadRequestManager::Callback* callback);
+ DownloadRequestLimiter::Callback* callback);
// Are we showing a prompt to the user?
bool is_showing_prompt() const { return (infobar_ != NULL); }
@@ -124,7 +123,7 @@ class DownloadRequestManager
TabDownloadState()
: host_(NULL),
controller_(NULL),
- status_(DownloadRequestManager::ALLOW_ONE_DOWNLOAD),
+ status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD),
download_count_(0),
infobar_(NULL) {
}
@@ -139,14 +138,14 @@ class DownloadRequestManager
// Updates status_ appropriately.
void NotifyCallbacks(bool allow);
- DownloadRequestManager* host_;
+ DownloadRequestLimiter* host_;
NavigationController* controller_;
// Host of the first page the download started on. This may be empty.
std::string initial_page_host_;
- DownloadRequestManager::DownloadStatus status_;
+ DownloadRequestLimiter::DownloadStatus status_;
size_t download_count_;
@@ -154,7 +153,7 @@ class DownloadRequestManager
// dialog.
// See description above CanDownloadOnIOThread for details on lifetime of
// callbacks.
- std::vector<DownloadRequestManager::Callback*> callbacks_;
+ std::vector<DownloadRequestLimiter::Callback*> callbacks_;
// Used to remove observers installed on NavigationController.
NotificationRegistrar registrar_;
@@ -165,7 +164,7 @@ class DownloadRequestManager
DISALLOW_COPY_AND_ASSIGN(TabDownloadState);
};
- DownloadRequestManager();
+ DownloadRequestLimiter();
// Returns the download status for a page. This does not change the state in
// anyway.
@@ -174,7 +173,7 @@ class DownloadRequestManager
// Updates the state of the page as necessary and notifies the callback.
// WARNING: both this call and the callback are invoked on the io thread.
//
- // DownloadRequestManager does not retain/release the Callback. It is up to
+ // DownloadRequestLimiter does not retain/release the Callback. It is up to
// the caller to ensure the callback is valid until the request is complete.
void CanDownloadOnIOThread(int render_process_host_id,
int render_view_id,
@@ -186,11 +185,11 @@ class DownloadRequestManager
void OnUserGesture(TabContents* tab);
private:
- friend class base::RefCountedThreadSafe<DownloadRequestManager>;
- friend class DownloadRequestManagerTest;
+ friend class base::RefCountedThreadSafe<DownloadRequestLimiter>;
+ friend class DownloadRequestLimiterTest;
friend class TabDownloadState;
- ~DownloadRequestManager();
+ ~DownloadRequestLimiter();
// For unit tests. If non-null this is used instead of creating a dialog.
class TestingDelegate {
@@ -207,7 +206,7 @@ class DownloadRequestManager
// See TabDownloadState's constructor description for details on the two
// controllers.
//
- // The returned TabDownloadState is owned by the DownloadRequestManager and
+ // The returned TabDownloadState is owned by the DownloadRequestLimiter and
// deleted when no longer needed (the Remove method is invoked).
TabDownloadState* GetDownloadState(
NavigationController* controller,
@@ -246,7 +245,7 @@ class DownloadRequestManager
static TestingDelegate* delegate_;
- DISALLOW_COPY_AND_ASSIGN(DownloadRequestManager);
+ DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter);
};
-#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_
diff --git a/chrome/browser/download/download_request_manager_unittest.cc b/chrome/browser/download/download_request_limiter_unittest.cc
index 3e5e454..d8582a9 100644
--- a/chrome/browser/download/download_request_manager_unittest.cc
+++ b/chrome/browser/download/download_request_limiter_unittest.cc
@@ -3,17 +3,17 @@
// found in the LICENSE file.
#include "chrome/browser/chrome_thread.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
-class DownloadRequestManagerTest
+class DownloadRequestLimiterTest
: public RenderViewHostTestHarness,
- public DownloadRequestManager::Callback {
+ public DownloadRequestLimiter::Callback {
public:
- DownloadRequestManagerTest() : io_thread_(ChromeThread::IO, &message_loop_) {}
+ DownloadRequestLimiterTest() : io_thread_(ChromeThread::IO, &message_loop_) {}
virtual void SetUp() {
RenderViewHostTestHarness::SetUp();
@@ -21,13 +21,13 @@ class DownloadRequestManagerTest
allow_download_ = true;
ask_allow_count_ = cancel_count_ = continue_count_ = 0;
- download_request_manager_ = new DownloadRequestManager();
- test_delegate_.reset(new DownloadRequestManagerTestDelegate(this));
- DownloadRequestManager::SetTestingDelegate(test_delegate_.get());
+ download_request_limiter_ = new DownloadRequestLimiter();
+ test_delegate_.reset(new DownloadRequestLimiterTestDelegate(this));
+ DownloadRequestLimiter::SetTestingDelegate(test_delegate_.get());
}
virtual void TearDown() {
- DownloadRequestManager::SetTestingDelegate(NULL);
+ DownloadRequestLimiter::SetTestingDelegate(NULL);
RenderViewHostTestHarness::TearDown();
}
@@ -44,7 +44,7 @@ class DownloadRequestManagerTest
}
void CanDownload() {
- download_request_manager_->CanDownloadImpl(
+ download_request_limiter_->CanDownloadImpl(
controller().tab_contents(), this);
message_loop_.RunAllPending();
}
@@ -55,11 +55,11 @@ class DownloadRequestManagerTest
}
protected:
- class DownloadRequestManagerTestDelegate
- : public DownloadRequestManager::TestingDelegate {
+ class DownloadRequestLimiterTestDelegate
+ : public DownloadRequestLimiter::TestingDelegate {
public:
- explicit DownloadRequestManagerTestDelegate(
- DownloadRequestManagerTest* test)
+ explicit DownloadRequestLimiterTestDelegate(
+ DownloadRequestLimiterTest* test)
: test_(test) { }
virtual bool ShouldAllowDownload() {
@@ -67,11 +67,11 @@ class DownloadRequestManagerTest
}
private:
- DownloadRequestManagerTest* test_;
+ DownloadRequestLimiterTest* test_;
};
- scoped_ptr<DownloadRequestManagerTestDelegate> test_delegate_;
- scoped_refptr<DownloadRequestManager> download_request_manager_;
+ scoped_ptr<DownloadRequestLimiterTestDelegate> test_delegate_;
+ scoped_refptr<DownloadRequestLimiter> download_request_limiter_;
// Number of times ContinueDownload was invoked.
int continue_count_;
@@ -89,16 +89,16 @@ class DownloadRequestManagerTest
};
// http://code.google.com/p/chromium/issues/detail?id=39753
-TEST_F(DownloadRequestManagerTest, FLAKY_Allow) {
+TEST_F(DownloadRequestLimiterTest, FLAKY_Allow) {
// All tabs should initially start at ALLOW_ONE_DOWNLOAD.
- ASSERT_EQ(DownloadRequestManager::ALLOW_ONE_DOWNLOAD,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Ask if the tab can do a download. This moves to PROMPT_BEFORE_DOWNLOAD.
CanDownload();
- ASSERT_EQ(DownloadRequestManager::PROMPT_BEFORE_DOWNLOAD,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// We should have been told we can download.
ASSERT_EQ(1, continue_count_);
@@ -112,8 +112,8 @@ TEST_F(DownloadRequestManagerTest, FLAKY_Allow) {
// This should ask us if the download is allowed.
ASSERT_EQ(1, ask_allow_count_);
ask_allow_count_ = 0;
- ASSERT_EQ(DownloadRequestManager::ALLOW_ALL_DOWNLOADS,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// We should have been told we can download.
ASSERT_EQ(1, continue_count_);
@@ -124,8 +124,8 @@ TEST_F(DownloadRequestManagerTest, FLAKY_Allow) {
CanDownload();
// The state is at allow_all, which means the delegate shouldn't be asked.
ASSERT_EQ(0, ask_allow_count_);
- ASSERT_EQ(DownloadRequestManager::ALLOW_ALL_DOWNLOADS,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// We should have been told we can download.
ASSERT_EQ(1, continue_count_);
@@ -133,7 +133,7 @@ TEST_F(DownloadRequestManagerTest, FLAKY_Allow) {
continue_count_ = 0;
}
-TEST_F(DownloadRequestManagerTest, ResetOnNavigation) {
+TEST_F(DownloadRequestLimiterTest, ResetOnNavigation) {
NavigateAndCommit(GURL("http://foo.com/bar"));
// Do two downloads, allowing the second so that we end up with allow all.
@@ -141,8 +141,8 @@ TEST_F(DownloadRequestManagerTest, ResetOnNavigation) {
allow_download_ = true;
CanDownload();
ask_allow_count_ = continue_count_ = cancel_count_ = 0;
- ASSERT_EQ(DownloadRequestManager::ALLOW_ALL_DOWNLOADS,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Navigate to a new URL with the same host, which shouldn't reset the allow
@@ -153,38 +153,38 @@ TEST_F(DownloadRequestManagerTest, ResetOnNavigation) {
ASSERT_EQ(0, cancel_count_);
ASSERT_EQ(0, ask_allow_count_);
ask_allow_count_ = continue_count_ = cancel_count_ = 0;
- ASSERT_EQ(DownloadRequestManager::ALLOW_ALL_DOWNLOADS,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Do a user gesture, because we're at allow all, this shouldn't change the
// state.
- download_request_manager_->OnUserGesture(controller().tab_contents());
- ASSERT_EQ(DownloadRequestManager::ALLOW_ALL_DOWNLOADS,
- download_request_manager_->GetDownloadStatus(
+ download_request_limiter_->OnUserGesture(controller().tab_contents());
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Navigate to a completely different host, which should reset the state.
NavigateAndCommit(GURL("http://fooey.com"));
- ASSERT_EQ(DownloadRequestManager::ALLOW_ONE_DOWNLOAD,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
}
-TEST_F(DownloadRequestManagerTest, ResetOnUserGesture) {
+TEST_F(DownloadRequestLimiterTest, ResetOnUserGesture) {
NavigateAndCommit(GURL("http://foo.com/bar"));
// Do one download, which should change to prompt before download.
CanDownload();
ask_allow_count_ = continue_count_ = cancel_count_ = 0;
- ASSERT_EQ(DownloadRequestManager::PROMPT_BEFORE_DOWNLOAD,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Do a user gesture, which should reset back to allow one.
- download_request_manager_->OnUserGesture(controller().tab_contents());
- ASSERT_EQ(DownloadRequestManager::ALLOW_ONE_DOWNLOAD,
- download_request_manager_->GetDownloadStatus(
+ download_request_limiter_->OnUserGesture(controller().tab_contents());
+ ASSERT_EQ(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// Ask twice, which triggers calling the delegate. Don't allow the download
@@ -192,14 +192,14 @@ TEST_F(DownloadRequestManagerTest, ResetOnUserGesture) {
allow_download_ = false;
CanDownload();
CanDownload();
- ASSERT_EQ(DownloadRequestManager::DOWNLOADS_NOT_ALLOWED,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// A user gesture now should NOT change the state.
- download_request_manager_->OnUserGesture(controller().tab_contents());
- ASSERT_EQ(DownloadRequestManager::DOWNLOADS_NOT_ALLOWED,
- download_request_manager_->GetDownloadStatus(
+ download_request_limiter_->OnUserGesture(controller().tab_contents());
+ ASSERT_EQ(DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
// And make sure we really can't download.
ask_allow_count_ = continue_count_ = cancel_count_ = 0;
@@ -208,7 +208,7 @@ TEST_F(DownloadRequestManagerTest, ResetOnUserGesture) {
ASSERT_EQ(0, continue_count_);
ASSERT_EQ(1, cancel_count_);
// And the state shouldn't have changed.
- ASSERT_EQ(DownloadRequestManager::DOWNLOADS_NOT_ALLOWED,
- download_request_manager_->GetDownloadStatus(
+ ASSERT_EQ(DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED,
+ download_request_limiter_->GetDownloadStatus(
controller().tab_contents()));
}
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
index 726ae83..f3408d4 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
@@ -29,7 +29,7 @@ DownloadThrottlingResourceHandler::DownloadThrottlingResourceHandler(
ignore_on_read_complete_(in_complete) {
// Pause the request.
host_->PauseRequest(render_process_host_id_, request_id_, true);
- host_->download_request_manager()->CanDownloadOnIOThread(
+ host_->download_request_limiter()->CanDownloadOnIOThread(
render_process_host_id_, render_view_id, this);
}
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.h b/chrome/browser/renderer_host/download_throttling_resource_handler.h
index 5fd0be6..e4f025b 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.h
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.h
@@ -7,7 +7,7 @@
#include <string>
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/renderer_host/resource_handler.h"
#include "googleurl/src/gurl.h"
@@ -17,15 +17,15 @@ class URLRequest;
// DownloadThrottlingResourceHandler is used to determine if a download should
// be allowed. When a DownloadThrottlingResourceHandler is created it pauses the
-// download and asks the DownloadRequestManager if the download should be
-// allowed. The DownloadRequestManager notifies us asynchronously as to whether
+// download and asks the DownloadRequestLimiter if the download should be
+// allowed. The DownloadRequestLimiter notifies us asynchronously as to whether
// the download is allowed or not. If the download is allowed the request is
// resumed, a DownloadResourceHandler is created and all EventHandler methods
// are delegated to it. If the download is not allowed the request is canceled.
class DownloadThrottlingResourceHandler
: public ResourceHandler,
- public DownloadRequestManager::Callback {
+ public DownloadRequestLimiter::Callback {
public:
DownloadThrottlingResourceHandler(ResourceDispatcherHost* host,
URLRequest* request,
@@ -51,7 +51,7 @@ class DownloadThrottlingResourceHandler
const std::string& security_info);
virtual void OnRequestClosed();
- // DownloadRequestManager::Callback implementation:
+ // DownloadRequestLimiter::Callback implementation:
virtual void CancelDownload();
virtual void ContinueDownload();
virtual int GetRequestId();
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index eb2a555..9050cbd 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -205,7 +205,7 @@ class RenderViewHostDelegate {
public:
// Notification the user has made a gesture while focus was on the
// page. This is used to avoid uninitiated user downloads (aka carpet
- // bombing), see DownloadRequestManager for details.
+ // bombing), see DownloadRequestLimiter for details.
virtual void OnUserGesture() = 0;
// A find operation in the current page completed.
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 130997ac..eab9da82 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/cross_site_request_manager.h"
#include "chrome/browser/download/download_file.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/download/save_file_manager.h"
#include "chrome/browser/extensions/user_script_listener.h"
#include "chrome/browser/external_protocol_handler.h"
@@ -193,7 +193,7 @@ std::vector<int> GetAllNetErrorCodes() {
ResourceDispatcherHost::ResourceDispatcherHost()
: ALLOW_THIS_IN_INITIALIZER_LIST(
download_file_manager_(new DownloadFileManager(this))),
- download_request_manager_(new DownloadRequestManager()),
+ download_request_limiter_(new DownloadRequestLimiter()),
ALLOW_THIS_IN_INITIALIZER_LIST(
save_file_manager_(new SaveFileManager(this))),
user_script_listener_(new UserScriptListener(&resource_queue_)),
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h
index 244f99e..00d19e0 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.h
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.h
@@ -30,7 +30,7 @@
class CrossSiteResourceHandler;
class DownloadFileManager;
-class DownloadRequestManager;
+class DownloadRequestLimiter;
class LoginHandler;
class PluginService;
class ResourceDispatcherHostRequestInfo;
@@ -172,8 +172,8 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
return download_file_manager_;
}
- DownloadRequestManager* download_request_manager() const {
- return download_request_manager_.get();
+ DownloadRequestLimiter* download_request_limiter() const {
+ return download_request_limiter_.get();
}
SaveFileManager* save_file_manager() const {
@@ -441,7 +441,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate {
scoped_refptr<DownloadFileManager> download_file_manager_;
// Determines whether a download is allowed.
- scoped_refptr<DownloadRequestManager> download_request_manager_;
+ scoped_refptr<DownloadRequestLimiter> download_request_limiter_;
// We own the save file manager.
scoped_refptr<SaveFileManager> save_file_manager_;
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 5457a0d..d3f2729 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -34,7 +34,7 @@
#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/history/top_sites.h"
@@ -1856,9 +1856,10 @@ void TabContents::GenerateKeywordIfNecessary(
void TabContents::OnUserGesture() {
// See comment in RenderViewHostDelegate::OnUserGesture as to why we do this.
- DownloadRequestManager* drm = g_browser_process->download_request_manager();
- if (drm)
- drm->OnUserGesture(this);
+ DownloadRequestLimiter* limiter =
+ g_browser_process->download_request_limiter();
+ if (limiter)
+ limiter->OnUserGesture(this);
ExternalProtocolHandler::OnUserGesture();
controller_.OnUserGesture();
}
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
index 6c70040..4d974f3 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
@@ -13,7 +13,7 @@
#include "base/win_util.h"
#include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/download/download_request_manager.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_view_host_factory.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index ed32143..aebb115 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -473,7 +473,7 @@
'browser/chromeos/login/password_changed_view.cc',
'browser/chromeos/login/password_changed_view.h',
'browser/chromeos/login/registration_screen.cc',
- 'browser/chromeos/login/registration_screen.h',
+ 'browser/chromeos/login/registration_screen.h',
'browser/chromeos/login/rounded_rect_painter.cc',
'browser/chromeos/login/rounded_rect_painter.h',
'browser/chromeos/login/screen_locker.cc',
@@ -1126,8 +1126,8 @@
'browser/download/download_manager.h',
'browser/download/download_request_infobar_delegate.h',
'browser/download/download_request_infobar_delegate.cc',
- 'browser/download/download_request_manager.cc',
- 'browser/download/download_request_manager.h',
+ 'browser/download/download_request_limiter.cc',
+ 'browser/download/download_request_limiter.h',
'browser/download/download_shelf.cc',
'browser/download/download_shelf.h',
'browser/download/download_started_animation.h',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 3b21a6d..2a2cbcd 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -780,7 +780,7 @@
'browser/dom_ui/shown_sections_handler_unittest.cc',
'browser/download/download_manager_unittest.cc',
'browser/download/download_request_infobar_delegate_unittest.cc',
- 'browser/download/download_request_manager_unittest.cc',
+ 'browser/download/download_request_limiter_unittest.cc',
'browser/download/save_package_unittest.cc',
'browser/encoding_menu_controller_unittest.cc',
'browser/extensions/convert_user_script_unittest.cc',
@@ -2513,7 +2513,7 @@
# If a test bundle is added to this coverage_build target it
# necessarily means this file (chrome_tests.gypi) is changed,
# so the action is run (coverage_bundles.py is generated).
- # Exceptions to that rule are theoretically possible
+ # Exceptions to that rule are theoretically possible
# (e.g. re-gyp with a GYP_DEFINES set).
# Else it's the same list of bundles as last time. They are
# built (since on the deps list) but the action may not run.