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

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

Issue 186473003: Refactor native extension shared library lookup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add check for loading from http(s): Created 6 years, 9 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 (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_url, 19 static Dart_Handle LoadExtension(const char* extension_directory,
20 const char* extension_filename,
21 const char* extension_name,
20 Dart_Handle parent_library); 22 Dart_Handle parent_library);
21 23
22 private: 24 private:
23 // The returned string must be freed. 25 // The returned string must be freed.
24 static char* Concatenate(const char** strings); 26 static char* Concatenate(const char** strings);
25 27
26 // Platform-specific implementations. 28 // Platform-specific implementations.
27 static void* LoadExtensionLibrary(const char* library_path, 29 static void* LoadExtensionLibrary(const char* library_file);
28 const char* extension_name);
29 static void* ResolveSymbol(void* lib_handle, const char* symbol); 30 static void* ResolveSymbol(void* lib_handle, const char* symbol);
30 31
31 DISALLOW_ALLOCATION(); 32 DISALLOW_ALLOCATION();
32 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions); 33 DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions);
33 }; 34 };
34 35
35 } // namespace bin 36 } // namespace bin
36 } // namespace dart 37 } // namespace dart
37 38
38 #endif // BIN_EXTENSIONS_H_ 39 #endif // BIN_EXTENSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698