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

Side by Side Diff: Source/bindings/core/v8/V8BindingForTesting.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed patch conflict Created 5 years, 4 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 | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8DOMActivityLogger.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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 V8BindingForTesting_h 5 #ifndef V8BindingForTesting_h
6 #define V8BindingForTesting_h 6 #define V8BindingForTesting_h
7 7
8 #include "bindings/core/v8/DOMWrapperWorld.h" 8 #include "bindings/core/v8/DOMWrapperWorld.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "wtf/Allocator.h"
10 #include "wtf/Forward.h" 11 #include "wtf/Forward.h"
11 12
12 #include <v8.h> 13 #include <v8.h>
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class ScriptStateForTesting : public ScriptState { 17 class ScriptStateForTesting : public ScriptState {
17 public: 18 public:
18 static PassRefPtr<ScriptStateForTesting> create(v8::Local<v8::Context>, Pass RefPtr<DOMWrapperWorld>); 19 static PassRefPtr<ScriptStateForTesting> create(v8::Local<v8::Context>, Pass RefPtr<DOMWrapperWorld>);
19 ExecutionContext* executionContext() const override; 20 ExecutionContext* executionContext() const override;
20 void setExecutionContext(ExecutionContext*) override; 21 void setExecutionContext(ExecutionContext*) override;
21 private: 22 private:
22 ScriptStateForTesting(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); 23 ScriptStateForTesting(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>);
23 ExecutionContext* m_executionContext; 24 ExecutionContext* m_executionContext;
24 }; 25 };
25 26
26 class V8TestingScope { 27 class V8TestingScope {
28 DISALLOW_ALLOCATION();
27 public: 29 public:
28 explicit V8TestingScope(v8::Isolate*); 30 explicit V8TestingScope(v8::Isolate*);
29 ScriptState* scriptState() const; 31 ScriptState* scriptState() const;
30 v8::Isolate* isolate() const; 32 v8::Isolate* isolate() const;
31 v8::Local<v8::Context> context() const; 33 v8::Local<v8::Context> context() const;
32 ~V8TestingScope(); 34 ~V8TestingScope();
33 35
34 private: 36 private:
35 v8::HandleScope m_handleScope; 37 v8::HandleScope m_handleScope;
36 v8::Context::Scope m_contextScope; 38 v8::Context::Scope m_contextScope;
37 RefPtr<ScriptState> m_scriptState; 39 RefPtr<ScriptState> m_scriptState;
38 }; 40 };
39 41
40 } // namespace blink 42 } // namespace blink
41 43
42 #endif // V8BindingForTesting_h 44 #endif // V8BindingForTesting_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8DOMActivityLogger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698