summaryrefslogtreecommitdiff
path: root/chromium/v8/samples
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@theqtcompany.com>2014-12-05 15:04:29 +0100
committerAndras Becsi <andras.becsi@theqtcompany.com>2014-12-09 10:49:28 +0100
commitaf6588f8d723931a298c995fa97259bb7f7deb55 (patch)
tree060ca707847ba1735f01af2372e0d5e494dc0366 /chromium/v8/samples
parent2fff84d821cc7b1c785f6404e0f8091333283e74 (diff)
downloadqtwebengine-chromium-af6588f8d723931a298c995fa97259bb7f7deb55.tar.gz
BASELINE: Update chromium to 40.0.2214.28 and ninja to 1.5.3.
Change-Id: I759465284fd64d59ad120219cbe257f7402c4181 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/v8/samples')
-rw-r--r--chromium/v8/samples/lineprocessor.cc14
-rw-r--r--chromium/v8/samples/process.cc9
-rw-r--r--chromium/v8/samples/samples.gyp3
-rw-r--r--chromium/v8/samples/shell.cc14
4 files changed, 30 insertions, 10 deletions
diff --git a/chromium/v8/samples/lineprocessor.cc b/chromium/v8/samples/lineprocessor.cc
index edb0ba0a1e6..69bfab49ba6 100644
--- a/chromium/v8/samples/lineprocessor.cc
+++ b/chromium/v8/samples/lineprocessor.cc
@@ -25,14 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <v8.h>
+#include <include/v8.h>
-#include <v8-debug.h>
+#include <include/libplatform/libplatform.h>
+#include <include/v8-debug.h>
#include <fcntl.h>
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
/**
* This sample program should demonstrate certain aspects of debugging
@@ -254,8 +255,13 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
int result = RunMain(argc, argv);
v8::V8::Dispose();
+ v8::V8::ShutdownPlatform();
+ delete platform;
return result;
}
@@ -300,7 +306,7 @@ void ReportException(v8::Isolate* isolate, v8::TryCatch* try_catch) {
printf("%s\n", exception_string);
} else {
// Print (filename):(line number): (message).
- v8::String::Utf8Value filename(message->GetScriptResourceName());
+ v8::String::Utf8Value filename(message->GetScriptOrigin().ResourceName());
const char* filename_string = ToCString(filename);
int linenum = message->GetLineNumber();
printf("%s:%i: %s\n", filename_string, linenum, exception_string);
diff --git a/chromium/v8/samples/process.cc b/chromium/v8/samples/process.cc
index b279a8d32ef..e5c9b7a53cf 100644
--- a/chromium/v8/samples/process.cc
+++ b/chromium/v8/samples/process.cc
@@ -25,10 +25,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <v8.h>
+#include <include/v8.h>
+
+#include <include/libplatform/libplatform.h>
-#include <string>
#include <map>
+#include <string>
#ifdef COMPRESS_STARTUP_DATA_BZ2
#error Using compressed startup data is not supported for this sample
@@ -644,6 +646,9 @@ void PrintMap(map<string, string>* m) {
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
map<string, string> options;
string file;
ParseOptions(argc, argv, &options, &file);
diff --git a/chromium/v8/samples/samples.gyp b/chromium/v8/samples/samples.gyp
index dfc7410070b..0c4c705609a 100644
--- a/chromium/v8/samples/samples.gyp
+++ b/chromium/v8/samples/samples.gyp
@@ -35,9 +35,10 @@
'type': 'executable',
'dependencies': [
'../tools/gyp/v8.gyp:v8',
+ '../tools/gyp/v8.gyp:v8_libplatform',
],
'include_dirs': [
- '../include',
+ '..',
],
'conditions': [
['v8_enable_i18n_support==1', {
diff --git a/chromium/v8/samples/shell.cc b/chromium/v8/samples/shell.cc
index aebe49d49e7..b66e8f7453d 100644
--- a/chromium/v8/samples/shell.cc
+++ b/chromium/v8/samples/shell.cc
@@ -25,12 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <v8.h>
+#include <include/v8.h>
+
+#include <include/libplatform/libplatform.h>
+
#include <assert.h>
#include <fcntl.h>
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef COMPRESS_STARTUP_DATA_BZ2
#error Using compressed startup data is not supported for this sample
@@ -78,6 +81,9 @@ class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
ShellArrayBufferAllocator array_buffer_allocator;
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
@@ -97,6 +103,8 @@ int main(int argc, char* argv[]) {
if (run_shell) RunShell(context);
}
v8::V8::Dispose();
+ v8::V8::ShutdownPlatform();
+ delete platform;
return result;
}
@@ -358,7 +366,7 @@ void ReportException(v8::Isolate* isolate, v8::TryCatch* try_catch) {
fprintf(stderr, "%s\n", exception_string);
} else {
// Print (filename):(line number): (message).
- v8::String::Utf8Value filename(message->GetScriptResourceName());
+ v8::String::Utf8Value filename(message->GetScriptOrigin().ResourceName());
const char* filename_string = ToCString(filename);
int linenum = message->GetLineNumber();
fprintf(stderr, "%s:%i: %s\n", filename_string, linenum, exception_string);