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

Unified Diff: third_party/WebKit/public/web/WebRange.h

Issue 2199523002: Convert WebRange to be a simple pair of numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot the exports. Created 4 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 | « third_party/WebKit/public/web/WebLocalFrame.h ('k') | third_party/WebKit/public/web/WebSurroundingText.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/WebRange.h
diff --git a/third_party/WebKit/public/web/WebRange.h b/third_party/WebKit/public/web/WebRange.h
index fd5ca00e1b9df079c70462bbc9e05f03d5012cf9..36dcbea6b118f7c46b3a0a93937796e1cb8f06f2 100644
--- a/third_party/WebKit/public/web/WebRange.h
+++ b/third_party/WebKit/public/web/WebRange.h
@@ -31,47 +31,33 @@
#ifndef WebRange_h
#define WebRange_h
-#include "WebFrame.h"
#include "public/platform/WebCommon.h"
-#include "public/platform/WebPrivatePtr.h"
-#include "public/platform/WebVector.h"
namespace blink {
class Range;
class WebString;
+class LocalFrame;
-// Provides readonly access to some properties of a DOM range.
-class WebRange {
+class WebRange final {
public:
- ~WebRange() { reset(); }
+ BLINK_EXPORT WebRange(int start, int length);
- WebRange() { }
- WebRange(const WebRange& r) { assign(r); }
- WebRange& operator=(const WebRange& r)
- {
- assign(r);
- return *this;
- }
+ int startOffset() const { return m_start; }
+ int endOffset() const { return m_end; }
+ int length() const { return m_end - m_start; }
- BLINK_EXPORT void reset();
- BLINK_EXPORT void assign(const WebRange&);
-
- bool isNull() const { return m_private.isNull(); }
-
- BLINK_EXPORT int startOffset() const;
- BLINK_EXPORT int endOffset() const;
- BLINK_EXPORT WebString toPlainText() const;
-
- BLINK_EXPORT static WebRange fromDocumentRange(WebLocalFrame*, int start, int length);
+ bool isNull() const { return m_start == -1 && m_end == -1; }
#if BLINK_IMPLEMENTATION
WebRange(Range*);
- operator Range*() const;
+
+ Range* createRange(LocalFrame*) const;
#endif
private:
- WebPrivatePtr<Range> m_private;
+ int m_start = -1;
+ int m_end = -1;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/public/web/WebLocalFrame.h ('k') | third_party/WebKit/public/web/WebSurroundingText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698