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

Side by Side Diff: runtime/bin/extensions.h

Issue 1401253004: Cleanup the extensions code to avoid the duplication that was introduced in the quick fix to turn t… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | runtime/bin/extensions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_EXTENSIONS_H_ 5 #ifndef BIN_EXTENSIONS_H_
6 #define BIN_EXTENSIONS_H_ 6 #define BIN_EXTENSIONS_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
11 11
12 namespace dart { 12 namespace dart {
13 namespace bin { 13 namespace bin {
14 14
15 class Extensions { 15 class Extensions {
16 public: 16 public:
17 // TODO(whesse): Make extension load from a relative path relative to 17 // TODO(whesse): Make extension load from a relative path relative to
18 // the library it is in. Currently loads from current working directory. 18 // the library it is in. Currently loads from current working directory.
19 static Dart_Handle LoadExtension(const char* extension_directory, 19 static Dart_Handle LoadExtension(const char* extension_directory,
20 const char* extension_filename, 20 const char* extension_filename,
21 const char* extension_name, 21 const char* extension_name,
22 Dart_Handle parent_library); 22 Dart_Handle parent_library);
23 23
24 // Platform-specific implementations. 24 // Platform-specific implementations.
25 static void* LoadExtensionLibrary(const char* library_file); 25 static void* LoadExtensionLibrary(const char* library_file);
26 static void* ResolveSymbol(void* lib_handle, const char* symbol); 26 static void* ResolveSymbol(void* lib_handle, const char* symbol);
27 27
28 private: 28 private:
29 static Dart_Handle LoadExtensionLibrary(const char* library_file, 29 static Dart_Handle GetError();
30 void** library);
31 static Dart_Handle ResolveSymbol(void* lib_handle,
32 const char* symbol,
33 void** init_func);
34 30
35 // The returned string must be freed. 31 // The returned string must be freed.
36 static char* Concatenate(const char** strings); 32 static char* Concatenate(const char** strings);
37 33
38 DISALLOW_ALLOCATION(); 34 DISALLOW_ALLOCATION();
39 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions); 35 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions);
40 }; 36 };
41 37
42 } // namespace bin 38 } // namespace bin
43 } // namespace dart 39 } // namespace dart
44 40
45 #endif // BIN_EXTENSIONS_H_ 41 #endif // BIN_EXTENSIONS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698