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

Side by Side Diff: gin/per_context_data.cc

Issue 1112923003: Replace Handle<> with Local in remaining gin/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « gin/per_context_data.h ('k') | gin/per_context_data_unittest.cc » ('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_context_data.h" 5 #include "gin/per_context_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gin/public/context_holder.h" 8 #include "gin/public/context_holder.h"
9 #include "gin/public/wrapper_info.h" 9 #include "gin/public/wrapper_info.h"
10 10
11 namespace gin { 11 namespace gin {
12 12
13 PerContextData::PerContextData(ContextHolder* context_holder, 13 PerContextData::PerContextData(ContextHolder* context_holder,
14 v8::Handle<v8::Context> context) 14 v8::Local<v8::Context> context)
15 : context_holder_(context_holder), 15 : context_holder_(context_holder),
16 runner_(NULL) { 16 runner_(NULL) {
17 context->SetAlignedPointerInEmbedderData( 17 context->SetAlignedPointerInEmbedderData(
18 kPerContextDataStartIndex + kEmbedderNativeGin, this); 18 kPerContextDataStartIndex + kEmbedderNativeGin, this);
19 } 19 }
20 20
21 PerContextData::~PerContextData() { 21 PerContextData::~PerContextData() {
22 v8::HandleScope handle_scope(context_holder_->isolate()); 22 v8::HandleScope handle_scope(context_holder_->isolate());
23 context_holder_->context()->SetAlignedPointerInEmbedderData( 23 context_holder_->context()->SetAlignedPointerInEmbedderData(
24 kPerContextDataStartIndex + kEmbedderNativeGin, NULL); 24 kPerContextDataStartIndex + kEmbedderNativeGin, NULL);
25 } 25 }
26 26
27 // static 27 // static
28 PerContextData* PerContextData::From(v8::Handle<v8::Context> context) { 28 PerContextData* PerContextData::From(v8::Local<v8::Context> context) {
29 return static_cast<PerContextData*>( 29 return static_cast<PerContextData*>(
30 context->GetAlignedPointerFromEmbedderData(kEncodedValueIndex)); 30 context->GetAlignedPointerFromEmbedderData(kEncodedValueIndex));
31 } 31 }
32 32
33 } // namespace gin 33 } // namespace gin
OLDNEW
« no previous file with comments | « gin/per_context_data.h ('k') | gin/per_context_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698