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

Side by Side Diff: gin/initialize.cc

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

Powered by Google App Engine
This is Rietveld 408576698