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

Unified Diff: base/native_library.h

Issue 206713004: Report PPAPI plugin load error code to UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BASE_EXPORT 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/native_library_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/native_library.h
diff --git a/base/native_library.h b/base/native_library.h
index d7513d0b050e181b4df913e276b39051aef5318f..1e764da89aa6846c4d5b646a301d0d28ad9de799 100644
--- a/base/native_library.h
+++ b/base/native_library.h
@@ -8,8 +8,11 @@
// This file defines a cross-platform "NativeLibrary" type which represents
// a loadable module.
+#include <string>
+
#include "base/base_export.h"
#include "base/compiler_specific.h"
+#include "base/strings/string16.h"
#include "build/build_config.h"
#if defined(OS_WIN)
@@ -18,8 +21,6 @@
#import <CoreFoundation/CoreFoundation.h>
#endif // OS_*
-#include "base/strings/string16.h"
-
namespace base {
class FilePath;
@@ -50,11 +51,26 @@ typedef NativeLibraryStruct* NativeLibrary;
typedef void* NativeLibrary;
#endif // OS_*
+struct BASE_EXPORT NativeLibraryLoadError {
+#if defined(OS_WIN)
+ NativeLibraryLoadError() : code(0) {}
+#endif // OS_WIN
+
+ // Returns a string representation of the load error.
+ std::string ToString() const;
+
+#if defined(OS_WIN)
+ DWORD code;
+#else
+ std::string message;
+#endif // OS_WIN
+};
+
// Loads a native library from disk. Release it with UnloadNativeLibrary when
// you're done. Returns NULL on failure.
-// If |error| is not NULL, it may be filled in with an error message on error.
+// If |error| is not NULL, it may be filled in on load error.
BASE_EXPORT NativeLibrary LoadNativeLibrary(const FilePath& library_path,
- std::string* error);
+ NativeLibraryLoadError* error);
#if defined(OS_WIN)
// Loads a native library from disk. Release it with UnloadNativeLibrary when
« no previous file with comments | « no previous file | base/native_library_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698