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

Side by Side Diff: gin/per_context_data.cc

Issue 179803007: Refactors parts of gin: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gin_shell Created 6 years, 9 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/modules/timer_unittest.cc ('k') | gin/public/context_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_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
(...skipping 22 matching lines...) Expand all
33 33
34 SuplementVector supplements; 34 SuplementVector supplements;
35 supplements.swap(supplements_); 35 supplements.swap(supplements_);
36 36
37 for (SuplementVector::iterator it = supplements.begin(); 37 for (SuplementVector::iterator it = supplements.begin();
38 it != supplements.end(); ++it) { 38 it != supplements.end(); ++it) {
39 (*it)->Detach(context); 39 (*it)->Detach(context);
40 } 40 }
41 } 41 }
42 42
43 // static
43 PerContextData* PerContextData::From(v8::Handle<v8::Context> context) { 44 PerContextData* PerContextData::From(v8::Handle<v8::Context> context) {
44 return static_cast<PerContextData*>( 45 return static_cast<PerContextData*>(
45 context->GetAlignedPointerFromEmbedderData(kEncodedValueIndex)); 46 context->GetAlignedPointerFromEmbedderData(kEncodedValueIndex));
46 } 47 }
47 48
48 void PerContextData::AddSupplement(scoped_ptr<ContextSupplement> supplement) { 49 void PerContextData::AddSupplement(scoped_ptr<ContextSupplement> supplement) {
49 supplements_.push_back(supplement.release()); 50 supplements_.push_back(supplement.release());
50 } 51 }
51 52
52 } // namespace gin 53 } // namespace gin
OLDNEW
« no previous file with comments | « gin/modules/timer_unittest.cc ('k') | gin/public/context_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698