source: webkit/trunk/JavaScriptCore/kjs/SourceProvider.h@ 38137

Last change on this file since 38137 was 38137, checked in by [email protected], 17 years ago

2008-11-05 Cameron Zwarich <[email protected]>

Rubber-stamped by Sam Weinig.

Move more files to the runtime subdirectory of JavaScriptCore.

JavaScriptCore:

  • API/APICast.h:
  • API/JSBase.cpp:
  • API/JSCallbackObject.cpp:
  • API/JSClassRef.cpp:
  • API/JSClassRef.h:
  • API/JSStringRefCF.cpp:
  • API/JSValueRef.cpp:
  • API/OpaqueJSString.cpp:
  • API/OpaqueJSString.h:
  • AllInOneFile.cpp:
  • GNUmakefile.am:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp:
  • VM/Machine.cpp:
  • VM/RegisterFile.h:
  • debugger/Debugger.h:
  • kjs/SourceProvider.h:
  • kjs/TypeInfo.h: Removed.
  • kjs/collector.cpp: Removed.
  • kjs/collector.h: Removed.
  • kjs/completion.h: Removed.
  • kjs/create_hash_table:
  • kjs/identifier.cpp: Removed.
  • kjs/identifier.h: Removed.
  • kjs/interpreter.cpp: Removed.
  • kjs/interpreter.h: Removed.
  • kjs/lexer.cpp:
  • kjs/lexer.h:
  • kjs/lookup.cpp: Removed.
  • kjs/lookup.h: Removed.
  • kjs/nodes.cpp:
  • kjs/nodes.h:
  • kjs/operations.cpp: Removed.
  • kjs/operations.h: Removed.
  • kjs/protect.h: Removed.
  • kjs/regexp.cpp: Removed.
  • kjs/regexp.h: Removed.
  • kjs/ustring.cpp: Removed.
  • kjs/ustring.h: Removed.
  • pcre/pcre_exec.cpp:
  • profiler/CallIdentifier.h:
  • profiler/Profile.h:
  • runtime/ArrayConstructor.cpp:
  • runtime/ArrayPrototype.cpp:
  • runtime/ArrayPrototype.h:
  • runtime/Collector.cpp: Copied from kjs/collector.cpp.
  • runtime/Collector.h: Copied from kjs/collector.h.
  • runtime/CollectorHeapIterator.h:
  • runtime/Completion.h: Copied from kjs/completion.h.
  • runtime/ErrorPrototype.cpp:
  • runtime/Identifier.cpp: Copied from kjs/identifier.cpp.
  • runtime/Identifier.h: Copied from kjs/identifier.h.
  • runtime/InitializeThreading.cpp:
  • runtime/Interpreter.cpp: Copied from kjs/interpreter.cpp.
  • runtime/Interpreter.h: Copied from kjs/interpreter.h.
  • runtime/JSCell.h:
  • runtime/JSGlobalData.cpp:
  • runtime/JSGlobalData.h:
  • runtime/JSLock.cpp:
  • runtime/JSNumberCell.cpp:
  • runtime/JSNumberCell.h:
  • runtime/JSObject.cpp:
  • runtime/JSValue.h:
  • runtime/Lookup.cpp: Copied from kjs/lookup.cpp.
  • runtime/Lookup.h: Copied from kjs/lookup.h.
  • runtime/MathObject.cpp:
  • runtime/NativeErrorPrototype.cpp:
  • runtime/NumberPrototype.cpp:
  • runtime/Operations.cpp: Copied from kjs/operations.cpp.
  • runtime/Operations.h: Copied from kjs/operations.h.
  • runtime/PropertyMapHashTable.h:
  • runtime/Protect.h: Copied from kjs/protect.h.
  • runtime/RegExp.cpp: Copied from kjs/regexp.cpp.
  • runtime/RegExp.h: Copied from kjs/regexp.h.
  • runtime/RegExpConstructor.cpp:
  • runtime/RegExpObject.h:
  • runtime/RegExpPrototype.cpp:
  • runtime/SmallStrings.h:
  • runtime/StringObjectThatMasqueradesAsUndefined.h:
  • runtime/StructureID.cpp:
  • runtime/StructureID.h:
  • runtime/StructureIDTransitionTable.h:
  • runtime/SymbolTable.h:
  • runtime/TypeInfo.h: Copied from kjs/TypeInfo.h.
  • runtime/UString.cpp: Copied from kjs/ustring.cpp.
  • runtime/UString.h: Copied from kjs/ustring.h.
  • wrec/CharacterClassConstructor.h:
  • wrec/WREC.h:

WebCore:

  • ForwardingHeaders/kjs/collector.h: Removed.
  • ForwardingHeaders/kjs/completion.h: Removed.
  • ForwardingHeaders/kjs/identifier.h: Removed.
  • ForwardingHeaders/kjs/interpreter.h: Removed.
  • ForwardingHeaders/kjs/lookup.h: Removed.
  • ForwardingHeaders/kjs/operations.h: Removed.
  • ForwardingHeaders/kjs/protect.h: Removed.
  • ForwardingHeaders/kjs/ustring.h: Removed.
  • ForwardingHeaders/runtime/Collector.h: Copied from ForwardingHeaders/kjs/collector.h.
  • ForwardingHeaders/runtime/Completion.h: Copied from ForwardingHeaders/kjs/completion.h.
  • ForwardingHeaders/runtime/Identifier.h: Copied from ForwardingHeaders/kjs/identifier.h.
  • ForwardingHeaders/runtime/Interpreter.h: Copied from ForwardingHeaders/kjs/interpreter.h.
  • ForwardingHeaders/runtime/Lookup.h: Copied from ForwardingHeaders/kjs/lookup.h.
  • ForwardingHeaders/runtime/Operations.h: Copied from ForwardingHeaders/kjs/operations.h.
  • ForwardingHeaders/runtime/Protect.h: Copied from ForwardingHeaders/kjs/protect.h.
  • ForwardingHeaders/runtime/UString.h: Copied from ForwardingHeaders/kjs/ustring.h.
  • bindings/js/GCController.cpp:
  • bindings/js/JSCustomPositionCallback.h:
  • bindings/js/JSCustomPositionErrorCallback.h:
  • bindings/js/JSCustomSQLStatementCallback.h:
  • bindings/js/JSCustomSQLStatementErrorCallback.h:
  • bindings/js/JSCustomSQLTransactionErrorCallback.h:
  • bindings/js/JSCustomVoidCallback.h:
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSEventListener.h:
  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptController.cpp:
  • bindings/js/ScriptController.h:
  • bindings/objc/WebScriptObject.mm:
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/NP_jsobject.cpp:
  • bridge/c/c_class.cpp:
  • bridge/jni/jni_class.cpp:
  • bridge/jni/jni_jsobject.mm:
  • bridge/npruntime.cpp:
  • bridge/runtime_root.h:
  • history/CachedPage.h:
  • html/CanvasRenderingContext2D.cpp:
  • html/HTMLCanvasElement.cpp:
  • inspector/InspectorController.cpp:
  • inspector/JavaScriptCallFrame.cpp:
  • page/Console.cpp:
  • page/Page.cpp:
  • platform/text/AtomicString.cpp:
  • platform/text/PlatformString.h:

WebKit/mac:

  • ForwardingHeaders/kjs/collector.h: Removed.
  • ForwardingHeaders/kjs/identifier.h: Removed.
  • ForwardingHeaders/kjs/interpreter.h: Removed.
  • ForwardingHeaders/kjs/lookup.h: Removed.
  • ForwardingHeaders/kjs/operations.h: Removed.
  • ForwardingHeaders/kjs/protect.h: Removed.
  • ForwardingHeaders/runtime/Interpreter.h: Copied from ForwardingHeaders/kjs/interpreter.h.
  • WebView/WebScriptDebugDelegate.mm:

WebKit/wx:

  • WebFrame.cpp:
  • WebView.cpp:
File size: 2.9 KB
Line 
1/*
2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef SourceProvider_h
30#define SourceProvider_h
31
32#include "UString.h"
33#include <wtf/RefCounted.h>
34
35namespace JSC {
36
37 class SourceProvider : public RefCounted<SourceProvider> {
38 public:
39 SourceProvider(const UString& url)
40 : m_url(url)
41 {
42 }
43 virtual ~SourceProvider() { }
44
45 virtual UString getRange(int start, int end) const = 0;
46 virtual const UChar* data() const = 0;
47 virtual int length() const = 0;
48
49 const UString& url() { return m_url; }
50 intptr_t asID() { return reinterpret_cast<intptr_t>(this); }
51
52 private:
53 UString m_url;
54 };
55
56 class UStringSourceProvider : public SourceProvider {
57 public:
58 static PassRefPtr<UStringSourceProvider> create(const UString& source, const UString& url)
59 {
60 return adoptRef(new UStringSourceProvider(source, url));
61 }
62
63 UString getRange(int start, int end) const { return m_source.substr(start, end - start); }
64 const UChar* data() const { return m_source.data(); }
65 int length() const { return m_source.size(); }
66
67 private:
68 UStringSourceProvider(const UString& source, const UString& url)
69 : SourceProvider(url)
70 , m_source(source)
71 {
72 }
73
74 UString m_source;
75 };
76
77} // namespace JSC
78
79#endif // SourceProvider_h
Note: See TracBrowser for help on using the repository browser.