summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples
diff options
context:
space:
mode:
authorjvoung <jvoung@chromium.org>2015-03-12 12:53:00 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-12 19:53:58 +0000
commitbf0324fc4544f80fdd2e3b85c3efff57188219d0 (patch)
tree5c821b2f514d502f0b76937d4a19efea69e744a6 /native_client_sdk/src/examples
parent2d70efc4dca3c4d3ee074ca45f1bc50a09220f3c (diff)
downloadchromium_src-bf0324fc4544f80fdd2e3b85c3efff57188219d0.zip
chromium_src-bf0324fc4544f80fdd2e3b85c3efff57188219d0.tar.gz
chromium_src-bf0324fc4544f80fdd2e3b85c3efff57188219d0.tar.bz2
NaCl: Update revision in DEPS, 22906ee -> 71515be (and delete benchmarks)
This reverts the benchmarks from the SDK: https://codereview.chromium.org/664543003/ The reason is that 48faafe deleted the benchmarks from the NaCl repo, and the SDK uses those files. and this pulls in the following Native Client changes: 88acb3a: (jfb@chromium.org) Remove Werror from GCC build 9ca84c2: (jfb@chromium.org) PNaCl: Update LLVM revision in pnacl/COMPONENT_REVISIONS 4be3959: (stichnot@chromium.org) Build Subzero when using the cmake build. add84fa: (jvoung@chromium.org) Avoid building and archiving the x86-64 pnacl-sz.nexe. 3c3ff25: (mtrofin@chromium.org) pull clang-format binaries d562d3c: (jfb@chromium.org) Update revision for PNaCl 8bf7e07: (jvoung@chromium.org) PNaCl: Update LLVM revision in pnacl/COMPONENT_REVISIONS 48faafe: (jfb@chromium.org) Delete flaky benchmark test a76bb7a: (phosek@chromium.org) Adds new configuration info for CPU features 7117385: (dschuff@chromium.org) PNaCl: Update LLVM revision in pnacl/COMPONENT_REVISIONS 72e0e5f: (jvoung@chromium.org) Exit cleanly for the SRPC "log" requests instead of generating crash reports. 9c50b0b: (dschuff@chromium.org) Update revision for PNaCl 7088f2f: (jfb@chromium.org) compiler_rt build: pass in ARCH 9a9538e: (jfb@chromium.org) PNaCl: Update compiler-rt revision in pnacl/COMPONENT_REVISIONS af415e6: (stichnot@chromium.org) Enable the use of ccache when using Chrome's clang or clang++. 71515be: (jfb@chromium.org) Update revision for PNaCl BUG= https://code.google.com/p/nativeclient/issues/detail?id=3987 TEST=browser_tests and nacl_integration CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_chromium_dbg_32_ng,linux_arm_compile,linux_nacl_sdk_build Review URL: https://codereview.chromium.org/1002833002 Cr-Commit-Position: refs/heads/master@{#320350}
Diffstat (limited to 'native_client_sdk/src/examples')
-rw-r--r--native_client_sdk/src/examples/benchmarks/example.dsc41
-rw-r--r--native_client_sdk/src/examples/benchmarks/example.js41
-rw-r--r--native_client_sdk/src/examples/benchmarks/framework_ppapi.cc82
-rw-r--r--native_client_sdk/src/examples/benchmarks/index.html34
4 files changed, 0 insertions, 198 deletions
diff --git a/native_client_sdk/src/examples/benchmarks/example.dsc b/native_client_sdk/src/examples/benchmarks/example.dsc
deleted file mode 100644
index f2c3af6..0000000
--- a/native_client_sdk/src/examples/benchmarks/example.dsc
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- 'TOOLS': ['pnacl'],
- 'SEARCH': [
- '.',
- '../../resources',
- '../../../../native_client/tests/benchmark',
- '../../../../native_client/src',
- ],
- 'TARGETS': [
- {
- 'NAME' : 'benchmarks',
- 'TYPE' : 'main',
- 'SOURCES' : [
- 'benchmark_binarytrees_c.c',
- 'benchmark_binarytrees.cc',
- 'benchmark_chameneos_c.c',
- 'benchmark_chameneos.cc',
- 'benchmark_life.cc',
- 'benchmark_nbody_c.c',
- 'benchmark_nbody.cc',
- 'framework.cc',
- 'framework.h',
- 'framework_ppapi.cc',
- 'thread_pool.h',
- 'thread_pool.cc'
- ],
- 'DEPS': [],
- 'LIBS': ['sdk_util', 'ppapi_cpp', 'ppapi', 'pthread']
- }
- ],
- 'DATA': [
- 'example.js',
- 'third_party/computer_language_benchmarks_game/binarytrees.c',
- 'third_party/computer_language_benchmarks_game/chameneos.c',
- 'third_party/computer_language_benchmarks_game/nbody.c',
- ],
- 'DEST': 'examples/benchmarks',
- 'NAME': 'benchmarks',
- 'TITLE': "Benchmark Suite",
- 'GROUP': 'Benchmarks'
-}
diff --git a/native_client_sdk/src/examples/benchmarks/example.js b/native_client_sdk/src/examples/benchmarks/example.js
deleted file mode 100644
index 62c1c81..0000000
--- a/native_client_sdk/src/examples/benchmarks/example.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-function moduleDidLoad() {
-}
-
-
-// Add event listeners after the NaCl module has loaded. These listeners will
-// forward messages to the NaCl module via postMessage()
-function attachListeners() {
- setTimeout(function() { common.updateStatus('READY TO RUN'); }, 200);
- document.getElementById('benchmark').addEventListener('click',
- function() {
- common.naclModule.postMessage({'message' : 'run_benchmark'});
- common.updateStatus('BENCHMARKING... (please wait)');
- var window = document.getElementById('result').contentWindow;
- window.document.writeln('<samp>Starting Benchmark Suite<br>');
- window.document.writeln('<table>');
- });
-}
-
-
-// Handle a message coming from the NaCl module.
-function handleMessage(message_event) {
- if (message_event.data.message == 'benchmark_result') {
- // benchmark result
- var name = message_event.data.benchmark.name;
- var result = message_event.data.benchmark.result;
- var text = '<tr><th>' + name + ': </th><th>' + result + '</th></tr>';
- console.log(text);
- var window = document.getElementById('result').contentWindow;
- window.document.writeln(text);
- }
- if (message_event.data.message == 'benchmark_finish') {
- common.updateStatus('READY TO RUN');
- var window = document.getElementById('result').contentWindow;
- window.document.writeln('</table>');
- window.document.writeln('Finished<br><br></samp>');
- }
-}
diff --git a/native_client_sdk/src/examples/benchmarks/framework_ppapi.cc b/native_client_sdk/src/examples/benchmarks/framework_ppapi.cc
deleted file mode 100644
index 1dc07f1..0000000
--- a/native_client_sdk/src/examples/benchmarks/framework_ppapi.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <ppapi/cpp/input_event.h>
-#include <ppapi/cpp/instance.h>
-#include <ppapi/cpp/module.h>
-#include <ppapi/cpp/point.h>
-#include <ppapi/cpp/var.h>
-#include <ppapi/cpp/var_array.h>
-#include <ppapi/cpp/var_dictionary.h>
-#include <ppapi/utility/completion_callback_factory.h>
-#include <stdint.h>
-#include <sys/time.h>
-
-#include <iomanip>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "framework.h"
-
-void BenchmarkPost(Benchmark* b, double median, double range, void* data) {
- pp::VarDictionary benchmark;
- benchmark.Set("name", b->Name());
- std::ostringstream result;
- result << std::fixed << std::setw(8) << std::setprecision(5) <<
- median << " seconds";
- benchmark.Set("result", result.str());
- pp::VarDictionary message;
- message.Set("message", "benchmark_result");
- message.Set("benchmark", benchmark);
- pp::Instance* instance = static_cast<pp::Instance*>(data);
- instance->PostMessage(message);
-}
-
-// Pepper framework
-
-class BenchmarksInstance : public pp::Instance {
- public:
- explicit BenchmarksInstance(PP_Instance instance)
- : pp::Instance(instance),
- callback_factory_(this) {}
-
- ~BenchmarksInstance() {}
-
- virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) {
- RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
- return true;
- }
-
- virtual void HandleMessage(const pp::Var& var) {
- if (var.is_dictionary()) {
- pp::VarDictionary dictionary(var);
- std::string message = dictionary.Get("message").AsString();
- if (message == "run_benchmark") {
- BenchmarkSuite::Run("", BenchmarkPost, this);
- pp::VarDictionary message;
- message.Set("message", "benchmark_finish");
- PostMessage(message);
- }
- }
- }
-
- private:
- pp::CompletionCallbackFactory<BenchmarksInstance> callback_factory_;
-};
-
-class BenchmarksModule : public pp::Module {
- public:
- BenchmarksModule() : pp::Module() {}
- virtual ~BenchmarksModule() {}
-
- virtual pp::Instance* CreateInstance(PP_Instance instance) {
- return new BenchmarksInstance(instance);
- }
-};
-
-
-namespace pp {
-Module* CreateModule() { return new BenchmarksModule(); }
-} // namespace pp
diff --git a/native_client_sdk/src/examples/benchmarks/index.html b/native_client_sdk/src/examples/benchmarks/index.html
deleted file mode 100644
index 898b918..0000000
--- a/native_client_sdk/src/examples/benchmarks/index.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-<head>
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="Expires" content="-1">
- <title>{{title}}</title>
- <script type="text/javascript" src="common.js"></script>
- <script type="text/javascript" src="example.js"></script>
-</head>
-<body data-width="0" data-height="0" {{attrs}}>
- <h1>{{title}}</h1>
- <h2>Status: <code id="statusField">NO-STATUS</code></h2>
- <!-- The NaCl plugin will be embedded inside the element with id "listener".
- See common.js.-->
- <div>
- A benchmark suite for Native Client.
- <br>
- <input type="submit" id="benchmark" value="Run Benchmarks">
- <br>
- <iframe width="640" height="200" id="result" name="result"> </iframe>
- <br>
- BinaryTrees, Chameneos, and NBody can be found on the
- <a href="http://benchmarksgame.alioth.debian.org/">
- Computer Language Benchmark Game site.
- </a>
- </div>
- <div id="listener"></div>
-</body>
-</html>