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

Unified Diff: sky/engine/bindings/core/v8/ScriptRegexp.h

Issue 727593004: Wire up the Inspector V8 Debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Actually works Created 6 years, 1 month 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
Index: sky/engine/bindings/core/v8/ScriptRegexp.h
diff --git a/sky/engine/platform/Widget.cpp b/sky/engine/bindings/core/v8/ScriptRegexp.h
similarity index 66%
copy from sky/engine/platform/Widget.cpp
copy to sky/engine/bindings/core/v8/ScriptRegexp.h
index 35cc161efdc9cb2bc8d62d3d399d0fcd17d02e29..4e768e9b969a25544ee3bb1c54ba9cbb43673872 100644
--- a/sky/engine/platform/Widget.cpp
+++ b/sky/engine/bindings/core/v8/ScriptRegexp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,31 +24,34 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "platform/Widget.h"
+#ifndef ScriptRegexp_h
+#define ScriptRegexp_h
eseidel 2014/11/18 19:38:47 This definitely is not needed. I just had too muc
-
-#include "wtf/Assertions.h"
+#include "bindings/core/v8/ScopedPersistent.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/text/WTFString.h"
+#include <v8.h>
namespace blink {
-Widget::Widget()
- : m_parent(0)
-{
-}
-
-Widget::~Widget()
-{
-}
-
-Widget* Widget::root() const
-{
- const Widget* top = this;
- while (top->parent())
- top = top->parent();
- if (top->isFrameView())
- return const_cast<Widget*>(static_cast<const Widget*>(top));
- return 0;
-}
+enum MultilineMode {
+ MultilineDisabled,
+ MultilineEnabled
+};
+
+class ScriptRegexp {
+ WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(ScriptRegexp);
+public:
+ ScriptRegexp(const String&, TextCaseSensitivity, MultilineMode = MultilineDisabled);
+
+ int match(const String&, int startFrom = 0, int* matchLength = 0) const;
+
+ bool isValid() const { return !m_regex.isEmpty(); }
+
+private:
+ ScopedPersistent<v8::RegExp> m_regex;
+};
} // namespace blink
+
+#endif // ScriptRegexp_h

Powered by Google App Engine
This is Rietveld 408576698