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

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

Issue 10873029: Migrate WebRequestRedirectByRegExAction to use RE2 and roll RE2 to revision 97:401ab4168e8e (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 4 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 ecde852e5965cc1a9d7e0c58e3ebdcc0e0ef6290..e6a54d79f44f76125a2fca2aeb21c75ee0972fcc 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h
@@ -16,7 +16,6 @@
#include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h"
#include "chrome/common/extensions/api/events.h"
#include "googleurl/src/gurl.h"
-#include "unicode/regex.h"
class WebRequestPermission;
@@ -38,6 +37,10 @@ namespace net {
class URLRequest;
}
+namespace re2 {
+class RE2;
+}
+
namespace extensions {
typedef linked_ptr<extension_web_request_api_helpers::EventResponseDelta>
@@ -236,11 +239,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, ...).
+ explicit 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
@@ -256,8 +258,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