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

Side by Side Diff: gin/per_isolate_data.cc

Issue 172133002: gin: Make it possible to use gin array buffers when running on top of blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 6 years, 10 months 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/per_isolate_data.h ('k') | gin/public/isolate_holder.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/per_isolate_data.h" 5 #include "gin/per_isolate_data.h"
6 #include "gin/public/gin_embedders.h" 6 #include "gin/public/gin_embedders.h"
7 7
8 using v8::ArrayBuffer;
8 using v8::Eternal; 9 using v8::Eternal;
9 using v8::Isolate; 10 using v8::Isolate;
10 using v8::Local; 11 using v8::Local;
11 using v8::Object; 12 using v8::Object;
12 using v8::FunctionTemplate; 13 using v8::FunctionTemplate;
13 using v8::ObjectTemplate; 14 using v8::ObjectTemplate;
14 15
15 namespace gin { 16 namespace gin {
16 17
17 PerIsolateData::PerIsolateData(Isolate* isolate) 18 PerIsolateData::PerIsolateData(Isolate* isolate,
18 : isolate_(isolate) { 19 ArrayBuffer::Allocator* allocator)
20 : isolate_(isolate), allocator_(allocator) {
19 isolate_->SetData(kEmbedderNativeGin, this); 21 isolate_->SetData(kEmbedderNativeGin, this);
20 } 22 }
21 23
22 PerIsolateData::~PerIsolateData() { 24 PerIsolateData::~PerIsolateData() {
23 isolate_->SetData(kEmbedderNativeGin, NULL); 25 isolate_->SetData(kEmbedderNativeGin, NULL);
24 } 26 }
25 27
26 PerIsolateData* PerIsolateData::From(Isolate* isolate) { 28 PerIsolateData* PerIsolateData::From(Isolate* isolate) {
27 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin)); 29 return static_cast<PerIsolateData*>(isolate->GetData(kEmbedderNativeGin));
28 } 30 }
(...skipping 18 matching lines...) Expand all
47 49
48 v8::Local<v8::FunctionTemplate> PerIsolateData::GetFunctionTemplate( 50 v8::Local<v8::FunctionTemplate> PerIsolateData::GetFunctionTemplate(
49 WrapperInfo* info) { 51 WrapperInfo* info) {
50 FunctionTemplateMap::iterator it = function_templates_.find(info); 52 FunctionTemplateMap::iterator it = function_templates_.find(info);
51 if (it == function_templates_.end()) 53 if (it == function_templates_.end())
52 return v8::Local<v8::FunctionTemplate>(); 54 return v8::Local<v8::FunctionTemplate>();
53 return it->second.Get(isolate_); 55 return it->second.Get(isolate_);
54 } 56 }
55 57
56 } // namespace gin 58 } // namespace gin
OLDNEW
« no previous file with comments | « gin/per_isolate_data.h ('k') | gin/public/isolate_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698