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

Side by Side Diff: Source/bindings/dart/DartController.h

Issue 24989007: Model each Dart library as its own ScriptState when devtools are enabled. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011, Google Inc. 1 // Copyright 2011, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 #include <wtf/HashMap.h> 37 #include <wtf/HashMap.h>
38 #include <wtf/Vector.h> 38 #include <wtf/Vector.h>
39 #include <wtf/text/WTFString.h> 39 #include <wtf/text/WTFString.h>
40 40
41 struct NPObject; 41 struct NPObject;
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 class DartApplicationLoader; 45 class DartApplicationLoader;
46 class DartDOMData; 46 class DartDOMData;
47 class DartScriptState;
47 class DOMWindow; 48 class DOMWindow;
48 class Frame; 49 class Frame;
49 class ScriptExecutionContext; 50 class ScriptExecutionContext;
51 class ScriptState;
50 52
51 // This class provides the linkage between a Frame and its attached 53 // This class provides the linkage between a Frame and its attached
52 // Dart isolates. It is similar to ScriptController for JavaScript. 54 // Dart isolates. It is similar to ScriptController for JavaScript.
53 // The DartController is owned by its Frame. 55 // The DartController is owned by its Frame.
54 class DartController { 56 class DartController {
55 public: 57 public:
56 DartController(Frame*); 58 DartController(Frame*);
57 virtual ~DartController(); 59 virtual ~DartController();
58 60
59 void evaluate(const ScriptSourceCode&); 61 void evaluate(const ScriptSourceCode&);
60 void isolatedWorldCreated(v8::Handle<v8::Context>); 62 void isolatedWorldCreated(v8::Handle<v8::Context>);
61 63
62 // Exposes NPObject instance to Dart environment. 64 // Exposes NPObject instance to Dart environment.
63 void bindToWindowObject(Frame*, const String& key, NPObject*); 65 void bindToWindowObject(Frame*, const String& key, NPObject*);
64 NPObject* npObject(const String& key); 66 NPObject* npObject(const String& key);
65 67
66 void clearWindowShell(); 68 void clearWindowShell();
67 69
68 Dart_Handle callFunction(Dart_Handle function, int argc, Dart_Handle* argv); 70 Dart_Handle callFunction(Dart_Handle function, int argc, Dart_Handle* argv);
69 71
70 void startDart(); 72 void startDart();
71 73
72 Frame* frame() const { return m_frame; } 74 Frame* frame() const { return m_frame; }
75 void collectScriptStates(ScriptState* v8ScriptState, Vector<ScriptState*>& r esult);
76 void collectScriptStatesForIsolate(Dart_Isolate, v8::Handle<v8::Context> v8C ontext, Vector<ScriptState*>& result);
73 77
74 void spawnDomIsolateFromSelf(const String& libraryUrl, const String& entryPo int, DartDOMData* parentDOMData, Dart_Port replyTo); 78 void spawnDomIsolateFromSelf(const String& libraryUrl, const String& entryPo int, DartDOMData* parentDOMData, Dart_Port replyTo);
75 void spawnDomIsolateFromUrl(const String& url, Dart_Port replyTo); 79 void spawnDomIsolateFromUrl(const String& url, Dart_Port replyTo);
76 80
77 static DartController* retrieve(Frame*); 81 static DartController* retrieve(Frame*);
78 static DartController* retrieve(ScriptExecutionContext*); 82 static DartController* retrieve(ScriptExecutionContext*);
79 83
80 private: 84 private:
81 static void initVMIfNeeded(); 85 static void initVMIfNeeded();
82 86
(...skipping 11 matching lines...) Expand all
94 void didLeaveScriptContext(int recursion); 98 void didLeaveScriptContext(int recursion);
95 99
96 // The frame that owns this controller. 100 // The frame that owns this controller.
97 Frame* m_frame; 101 Frame* m_frame;
98 102
99 bool m_scriptsLoaded; 103 bool m_scriptsLoaded;
100 104
101 // Isolates associated with scripts in this document. 105 // Isolates associated with scripts in this document.
102 Vector<Dart_Isolate> m_isolates; 106 Vector<Dart_Isolate> m_isolates;
103 107
108 typedef HashMap<intptr_t, DartScriptState*> LibraryIdMap;
109 typedef HashMap<Dart_Isolate, LibraryIdMap*> ScriptStatesMap;
110 ScriptStatesMap m_scriptStates;
111
104 typedef HashMap<String, NPObject*> NPObjectMap; 112 typedef HashMap<String, NPObject*> NPObjectMap;
105 NPObjectMap m_npObjectMap; 113 NPObjectMap m_npObjectMap;
106 114
107 friend class DartScriptRunner; 115 friend class DartScriptRunner;
108 }; 116 };
109 117
110 } 118 }
111 119
112 #endif // DartController_h 120 #endif // DartController_h
OLDNEW
« no previous file with comments | « LayoutTests/dart/inspector/evaluate-in-console-expected.txt ('k') | Source/bindings/dart/DartController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698