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

Side by Side Diff: gin/initialize.cc

Issue 67763002: Add gin, a lightweight bindings system for V8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Aaron's comments Created 7 years, 1 month 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
« no previous file with comments | « gin/initialize.h ('k') | gin/per_isolate_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gin/initialize.h"
6
7 #include <stdlib.h>
8 #include <string.h>
9
10 #include "gin/array_buffer.h"
11 #include "gin/per_isolate_data.h"
12
13 namespace gin {
14
15 namespace {
16
17 bool GenerateEntropy(unsigned char* buffer, size_t amount) {
18 // TODO(abarth): Gin needs a source of entropy.
19 return false;
20 }
21
22 const char kFlags[] = "--use_strict --harmony";
23
24 }
25
26 void Initialize() {
27 v8::V8::SetArrayBufferAllocator(ArrayBufferAllocator::SharedInstance());
28 v8::V8::InitializeICU();
29 v8::V8::SetFlagsFromString(kFlags, strlen(kFlags));
30 v8::V8::SetEntropySource(&GenerateEntropy);
31 v8::V8::Initialize();
32
33 v8::Isolate* isolate = v8::Isolate::GetCurrent();
34 v8::HandleScope handle_scope(isolate);
35 new PerIsolateData(isolate);
36 }
37
38 } // namespace gin
OLDNEW
« no previous file with comments | « gin/initialize.h ('k') | gin/per_isolate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698