Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h

Issue 10826120: Migrate WebRequestRedirectByRegExAction to use RE2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
index 96d0a3d42e1dbb65ea27a36429f7de38db23bf68..1ff387b8e93d0170897490ffb62866ae72816ef9 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
@@ -15,7 +15,6 @@
#include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h"
#include "chrome/common/extensions/api/events.h"
#include "googleurl/src/gurl.h"
-#include "unicode/regex.h"
class WebRequestPermission;
@@ -37,6 +36,10 @@ namespace net {
class URLRequest;
}
+namespace re2 {
+class RE2;
+}
+
namespace extensions {
typedef linked_ptr<extension_web_request_api_helpers::EventResponseDelta>
@@ -246,11 +249,10 @@ class WebRequestRedirectToEmptyDocumentAction : public WebRequestAction {
// Action that instructs to redirect a network request.
class WebRequestRedirectByRegExAction : public WebRequestAction {
public:
- // The |to_pattern| has to be passed in ICU syntax.
- // TODO(battre): Change this to Perl style when migrated to RE2.
- explicit WebRequestRedirectByRegExAction(
- scoped_ptr<icu::RegexPattern> from_pattern,
- const std::string& to_pattern);
+ // The |to_pattern| has to be passed in RE2 syntax with the exception that
+ // capture groups are referenced in Perl style ($1, $2, ...).
+ WebRequestRedirectByRegExAction(scoped_ptr<re2::RE2> from_pattern,
+ const std::string& to_pattern);
virtual ~WebRequestRedirectByRegExAction();
// Conversion of capture group styles between Perl style ($1, $2, ...) and
@@ -268,8 +270,8 @@ class WebRequestRedirectByRegExAction : public WebRequestAction {
const base::Time& extension_install_time) const OVERRIDE;
private:
- scoped_ptr<icu::RegexPattern> from_pattern_;
- icu::UnicodeString to_pattern_;
+ scoped_ptr<re2::RE2> from_pattern_;
+ std::string to_pattern_;
DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectByRegExAction);
};
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698