Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
commit 76ed114b44c1857ee939d2a37dcdd7875a5909db 2 parents b410107 + 0ea2aa0
@neraliu authored
View
2  README.md
@@ -40,3 +40,5 @@ and many others [companion projects](http://code.google.com/p/phantomjs/wiki/Who
- Explore the complete [documentation](http://code.google.com/p/phantomjs/wiki/PhantomJS?tm=6).
- Read tons of [user articles](http://code.google.com/p/phantomjs/wiki/ExternalArticles) on using PhantomJS.
- Join the [mailing-list](http://groups.google.com/group/phantomjs) and discuss with other PhantomJS fans.
+
+PhantomJS is free software/open source, and is distributed under the [BSD license](http://opensource.org/licenses/BSD-3-Clause). It contains third-party code, see the included `third-party.txt` file for the license information on third-party code.
View
2  deploy/package.sh
@@ -42,7 +42,7 @@ echo
echo -n "copying files..."
cp $src/bin/phantomjs $dest/bin
-cp -r $src/{ChangeLog,examples,LICENSE.BSD,README.md} $dest/
+cp -r $src/{ChangeLog,examples,LICENSE.BSD,third-party.txt,README.md} $dest/
echo "done"
echo
View
23 src/main.cpp
@@ -42,6 +42,8 @@
#include <QApplication>
#ifdef Q_OS_WIN32
+using namespace google_breakpad;
+static google_breakpad::ExceptionHandler* eh;
#if !defined(QT_SHARED) && !defined(QT_DLL)
#include <QtPlugin>
@@ -92,7 +94,26 @@ int main(int argc, char** argv, const char** envp)
#ifdef Q_OS_MAC
google_breakpad::ExceptionHandler eh("/tmp", NULL, Utils::exceptionHandler, NULL, true, NULL);
#endif
-
+#ifdef Q_OS_WIN32
+ // This is needed for CRT to not show dialog for invalid param
+ // failures and instead let the code handle it.
+ _CrtSetReportMode(_CRT_ASSERT, 0);
+
+ DWORD cbBuffer = ExpandEnvironmentStrings(TEXT("%TEMP%"), NULL, 0);
+
+ if (cbBuffer == 0) {
+ eh = new ExceptionHandler(TEXT("."), NULL, Utils::exceptionHandler, NULL, ExceptionHandler::HANDLER_ALL);
+ } else {
+ LPWSTR szBuffer = reinterpret_cast<LPWSTR>(malloc(sizeof(TCHAR) * (cbBuffer + 1)));
+
+ if (ExpandEnvironmentStrings(TEXT("%TEMP%"), szBuffer, cbBuffer + 1) > 0) {
+ wstring lpDumpPath(szBuffer);
+ eh = new ExceptionHandler(lpDumpPath, NULL, Utils::exceptionHandler, NULL, ExceptionHandler::HANDLER_ALL);
+ }
+ free(szBuffer);
+ }
+#endif
+
QApplication app(argc, argv);
app.setWindowIcon(QIcon(":/phantomjs-icon.png"));
View
4 src/phantomjs.pro
@@ -108,6 +108,10 @@ mac {
win32-msvc* {
LIBS += -lCrypt32
+ INCLUDEPATH += breakpad/src
+ SOURCES += breakpad/src/client/windows/handler/exception_handler.cc \
+ breakpad/src/client/windows/crash_generation/crash_generation_client.cc \
+ breakpad/src/common/windows/guid_string.cc
CONFIG(static) {
DEFINES += STATIC_BUILD
QTPLUGIN += \
View
19 src/utils.cpp
@@ -71,7 +71,23 @@ void Utils::messageHandler(QtMsgType type, const char *msg)
abort();
}
}
-
+#ifdef Q_OS_WIN32
+bool Utils::exceptionHandler(const TCHAR* dump_path, const TCHAR* minidump_id,
+ void* context, EXCEPTION_POINTERS* exinfo,
+ MDRawAssertionInfo *assertion, bool succeeded)
+{
+ Q_UNUSED(exinfo);
+ Q_UNUSED(assertion);
+ Q_UNUSED(context);
+
+ fprintf(stderr, "PhantomJS has crashed. Please read the crash reporting guide at " \
+ "https://code.google.com/p/phantomjs/wiki/CrashReporting and file a " \
+ "bug report at https://code.google.com/p/phantomjs/issues/entry with the " \
+ "crash dump file attached: %ls\\%ls.dmp\n",
+ dump_path, minidump_id);
+ return succeeded;
+}
+#else
bool Utils::exceptionHandler(const char* dump_path, const char* minidump_id, void* context, bool succeeded)
{
Q_UNUSED(context);
@@ -82,6 +98,7 @@ bool Utils::exceptionHandler(const char* dump_path, const char* minidump_id, voi
dump_path, minidump_id);
return succeeded;
}
+#endif
QVariant Utils::coffee2js(const QString &script)
{
View
8 src/utils.h
@@ -38,6 +38,10 @@
#include "csconverter.h"
#include "encoding.h"
+#ifdef Q_OS_WIN32
+#include "client/windows/handler/exception_handler.h"
+#endif
+
class QTemporaryFile;
/**
* Aggregate common utility functions.
@@ -49,7 +53,11 @@ class Utils
public:
static void showUsage();
static void messageHandler(QtMsgType type, const char *msg);
+#ifdef Q_OS_WIN32
+ static bool exceptionHandler(const wchar_t* dump_path, const wchar_t* minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo *assertion, bool succeeded);
+#else
static bool exceptionHandler(const char* dump_path, const char* minidump_id, void* context, bool succeeded);
+#endif
static QVariant coffee2js(const QString &script);
static bool injectJsInFrame(const QString &jsFilePath, const QString &libraryPath, QWebFrame *targetFrame, const bool startingScript = false);
static bool injectJsInFrame(const QString &jsFilePath, const Encoding &jsFileEnc, const QString &libraryPath, QWebFrame *targetFrame, const bool startingScript = false);
View
40 third-party.txt
@@ -0,0 +1,40 @@
+This document contains the list of Third Party Software included with
+PhantomJS, along with the license information.
+
+Third Party Software may impose additional restrictions and it is the
+user's responsibility to ensure that they have met the licensing
+requirements of PhantomJS and the relevant license of the Third Party
+Software they are using.
+
+Qt - http://qt-project.org/
+License: GNU Lesser General Public License (LGPL) version 2.1.
+Reference: http://qt-project.org/doc/qt-4.8/lgpl.html.
+
+WebKit - http://www.webkit.org/
+License: GNU Lesser General Public License (LGPL) version 2.1 and BSD.
+Reference: http://www.webkit.org/coding/lgpl-license.html and
+http://www.webkit.org/coding/bsd-license.html.
+
+Mongoose - https://github.com/valenok/mongoose
+License: MIT
+Reference: https://github.com/valenok/mongoose/blob/master/LICENSE
+
+Breakpad - http://code.google.com/p/google-breakpad/
+License: BSD.
+Reference: http://code.google.com/p/google-breakpad/source/browse/trunk/COPYING.
+
+Linenoise - https://github.com/tadmarshall/linenoise
+License: BSD.
+Reference: https://github.com/tadmarshall/linenoise/blob/master/linenoise.h.
+
+CoffeeScript - http://coffeescript.org/
+License: MIT.
+Reference: https://github.com/jashkenas/coffee-script/blob/master/README.
+
+GIFLIB - http://giflib.sourceforge.net/
+License: MIT
+Reference: http://giflib.cvs.sourceforge.net/viewvc/giflib/giflib/COPYING
+
+wkhtmlpdf - http://code.google.com/p/wkhtmltopdf/
+License: GNU Lesser General Public License (LGPL)
+Reference: http://code.google.com/p/wkhtmltopdf/
Please sign in to comment.
Something went wrong with that request. Please try again.