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

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

Issue 104433004: Enable VM service inside Dartium Renderer processes (Closed) Base URL: svn://svn.chromium.org/multivm/branches/1650/blink
Patch Set: Created 7 years 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
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef DartService_h
6 #define DartService_h
7
8 #include <dart_api.h>
9 #include <dart_native_api.h>
10
11 namespace WebCore {
12
13 class DartServiceInternal;
14 class Document;
15
16 class DartServiceRequest {
17 public:
18 DartServiceRequest(const char* request);
19 virtual ~DartServiceRequest();
20
21 // Override this method and it will be called when
22 // the response has been received from the VM service.
23 virtual void ResponseReady(const char* response) = 0;
24
25 char* GetRequestString() { return m_request; }
Jacob 2013/12/05 19:31:31 can this at least be a const char*? To meet WebKi
Cutch 2013/12/05 22:48:15 Done.
26 private:
27 char* m_request;
28 };
29
30
31 class DartService {
32 public:
33 // Returns false if service could not be started.
34 static bool Start(Document*);
35 static bool Stop();
36
37 // Error message if startup failed.
38 static const char* GetErrorMessage();
39
40 static Dart_Port port();
41 static Dart_Port GetRequestPort() { return m_requestPort; }
42 static bool IsRunning();
43
44 static bool SendIsolateStartupMessage();
45 static bool SendIsolateShutdownMessage();
46 static void MakeServiceRequest(DartServiceRequest*);
47 static void VmServiceShutdownCallback(void* callbackData);
48
49 private:
50 static void SetupNativePort();
51 static void NativePortMessageHandler(Dart_Port destPortId, Dart_CObject* mes sage);
52 static void ShutdownNativePort();
53 static Dart_Handle GetSource(const char* name);
54 static Dart_Handle LoadScript(const char* name);
55 static Dart_Handle LoadSources(Dart_Handle library, const char** names);
56 static Dart_Handle LoadSource(Dart_Handle library, const char* name);
57 static Dart_Handle LoadResources(Dart_Handle library);
58 static Dart_Handle LoadResource(Dart_Handle library, const char* name, const char* prefix);
59 static Dart_Handle LibraryTagHandler(Dart_LibraryTag, Dart_Handle library, D art_Handle url);
60 static Dart_NativeFunction NativeResolver(Dart_Handle name, int numArguments );
61 static Dart_Isolate m_isolate;
62 static Dart_Port m_port;
63 static Dart_Port m_requestPort;
64 static Dart_Port m_nativePort;
65 static const char* m_errorMsg;
66 friend class DartServiceInternal;
67 };
68
69 }
70
71 #endif // DartService_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698