Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/v8/SourceMap.h |
| diff --git a/third_party/WebKit/Source/core/inspector/v8/SourceMap.h b/third_party/WebKit/Source/core/inspector/v8/SourceMap.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7a7e955a654932cec111d258149a489877bdbb2e |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/inspector/v8/SourceMap.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2016 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 SourceMap_h |
| +#define SourceMap_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/Noncopyable.h" |
| +#include "wtf/OwnPtr.h" |
| +#include "wtf/PassOwnPtr.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class JSONObject; |
| + |
| +class CORE_EXPORT SourceMap: public NoBaseWillBeGarbageCollected<SourceMap> { |
| + WTF_MAKE_NONCOPYABLE(SourceMap); |
| +public: |
| + class CORE_EXPORT Entry: public NoBaseWillBeGarbageCollectedFinalized<SourceMap> { |
|
sof
2016/01/16 07:25:05
Unless Entry will gain fields that refer to Oilpan
|
| + WTF_MAKE_NONCOPYABLE(Entry); |
| + public: |
| + int line; |
| + int column; |
| + String sourceURL; |
| + int sourceLine; |
| + int sourceColumn; |
| + |
| + Entry(int line, int column, const String& sourceURL = String(), int sourceLine = 0, int sourceColumn = 0); |
| + Entry() |
| + : line(0) |
| + , column(0) |
| + , sourceLine(0) |
| + , sourceColumn(0) |
| + { |
| + } |
| + |
| + DECLARE_TRACE(); |
| + }; |
| + |
| + static PassOwnPtrWillBeRawPtr<SourceMap> parse(const String& json, int offsetLine = 0, int offsetColumn = 0); |
| + |
| + const Entry* findEntry(int line, int column); |
| + |
| + DECLARE_TRACE(); |
| + |
| +private: |
| + SourceMap() { } |
| + |
| + bool parseSection(PassRefPtr<JSONObject> sectionObject, int offsetLine, int offsetColumn); |
| + bool parseMap(PassRefPtr<JSONObject> mapObject, int offsetLine, int offsetColumn); |
| + |
| + WillBeHeapVector<OwnPtrWillBeMember<Entry>> m_mappings; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // SourceMap_h |