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

Side by Side Diff: Source/bindings/v8/DOMRequestState.h

Issue 186633002: Change RefPtr<DOMWrapperWorld> that causes reference cycles to DOMWrapperWorld* Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 29 matching lines...) Expand all
40 : m_isolate(toIsolate(executionContext)) 40 : m_isolate(toIsolate(executionContext))
41 , m_executionContext(executionContext) 41 , m_executionContext(executionContext)
42 , m_world(DOMWrapperWorld::current(m_isolate)) 42 , m_world(DOMWrapperWorld::current(m_isolate))
43 { 43 {
44 ASSERT(m_executionContext); 44 ASSERT(m_executionContext);
45 } 45 }
46 46
47 void clear() 47 void clear()
48 { 48 {
49 m_executionContext = 0; 49 m_executionContext = 0;
50 m_world.clear(); 50 m_world = 0;
51 } 51 }
52 52
53 class Scope { 53 class Scope {
54 public: 54 public:
55 explicit Scope(DOMRequestState& state) 55 explicit Scope(DOMRequestState& state)
56 : m_handleScope(state.isolate()) 56 : m_handleScope(state.isolate())
57 , m_contextScope(state.context()) 57 , m_contextScope(state.context())
58 { 58 {
59 } 59 }
60 private: 60 private:
61 v8::HandleScope m_handleScope; 61 v8::HandleScope m_handleScope;
62 v8::Context::Scope m_contextScope; 62 v8::Context::Scope m_contextScope;
63 }; 63 };
64 64
65 v8::Local<v8::Context> context() 65 v8::Local<v8::Context> context()
66 { 66 {
67 ASSERT(m_executionContext); 67 ASSERT(m_executionContext);
68 return toV8Context(m_executionContext, m_world.get()); 68 return toV8Context(m_executionContext, m_world);
69 } 69 }
70 70
71 v8::Isolate* isolate() const 71 v8::Isolate* isolate() const
72 { 72 {
73 return m_isolate; 73 return m_isolate;
74 } 74 }
75 75
76 bool isValid() const { return m_executionContext; } 76 bool isValid() const { return m_executionContext; }
77 77
78 private: 78 private:
79 v8::Isolate* m_isolate; 79 v8::Isolate* m_isolate;
80 ExecutionContext* m_executionContext; 80 ExecutionContext* m_executionContext;
81 RefPtr<DOMWrapperWorld> m_world; 81 DOMWrapperWorld* m_world;
82 }; 82 };
83 83
84 } 84 }
85 #endif 85 #endif
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestCallbackInterface.cpp ('k') | Source/bindings/v8/DOMWrapperWorld.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698