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

Side by Side Diff: gin/public/isolate_holder.h

Issue 1848423002: Convert //gin to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/public/context_holder.h ('k') | gin/test/v8_test.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 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_ 5 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_
6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_ 6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "gin/gin_export.h" 11 #include "gin/gin_export.h"
11 #include "gin/public/v8_idle_task_runner.h" 12 #include "gin/public/v8_idle_task_runner.h"
12 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
13 14
14 namespace gin { 15 namespace gin {
15 16
16 class PerIsolateData; 17 class PerIsolateData;
17 class RunMicrotasksObserver; 18 class RunMicrotasksObserver;
18 class V8IsolateMemoryDumpProvider; 19 class V8IsolateMemoryDumpProvider;
19 20
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // MessageLoop's thread. 68 // MessageLoop's thread.
68 void AddRunMicrotasksObserver(); 69 void AddRunMicrotasksObserver();
69 70
70 // This method should also only be called once, and on the MessageLoop's 71 // This method should also only be called once, and on the MessageLoop's
71 // thread. 72 // thread.
72 void RemoveRunMicrotasksObserver(); 73 void RemoveRunMicrotasksObserver();
73 74
74 // This method returns if v8::Locker is needed to access isolate. 75 // This method returns if v8::Locker is needed to access isolate.
75 AccessMode access_mode() const { return access_mode_; } 76 AccessMode access_mode() const { return access_mode_; }
76 77
77 void EnableIdleTasks(scoped_ptr<V8IdleTaskRunner> idle_task_runner); 78 void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner);
78 79
79 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for 80 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for
80 // testing. 81 // testing.
81 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing() 82 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing()
82 const { 83 const {
83 return isolate_memory_dump_provider_.get(); 84 return isolate_memory_dump_provider_.get();
84 } 85 }
85 86
86 private: 87 private:
87 v8::Isolate* isolate_; 88 v8::Isolate* isolate_;
88 scoped_ptr<PerIsolateData> isolate_data_; 89 std::unique_ptr<PerIsolateData> isolate_data_;
89 scoped_ptr<RunMicrotasksObserver> task_observer_; 90 std::unique_ptr<RunMicrotasksObserver> task_observer_;
90 scoped_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; 91 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_;
91 AccessMode access_mode_; 92 AccessMode access_mode_;
92 93
93 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); 94 DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
94 }; 95 };
95 96
96 } // namespace gin 97 } // namespace gin
97 98
98 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ 99 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_
OLDNEW
« no previous file with comments | « gin/public/context_holder.h ('k') | gin/test/v8_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698