OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "bindings/v8/V8HiddenPropertyName.h" | 37 #include "bindings/v8/V8HiddenPropertyName.h" |
38 #include "bindings/v8/WorkerScriptController.h" | 38 #include "bindings/v8/WorkerScriptController.h" |
39 #include "core/page/Frame.h" | 39 #include "core/page/Frame.h" |
40 #include "core/workers/WorkerGlobalScope.h" | 40 #include "core/workers/WorkerGlobalScope.h" |
41 #include <v8.h> | 41 #include <v8.h> |
42 #include "wtf/Assertions.h" | 42 #include "wtf/Assertions.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 ScriptState::ScriptState(v8::Handle<v8::Context> context) | 46 ScriptState::ScriptState(v8::Handle<v8::Context> context) |
47 : m_context(context) | 47 : m_context(context->GetIsolate(), context) |
48 , m_isolate(context->GetIsolate()) | 48 , m_isolate(context->GetIsolate()) |
49 { | 49 { |
50 m_context.makeWeak(this, &makeWeakCallback); | 50 m_context.makeWeak(this, &makeWeakCallback); |
51 } | 51 } |
52 | 52 |
53 ScriptState::~ScriptState() | 53 ScriptState::~ScriptState() |
54 { | 54 { |
55 } | 55 } |
56 | 56 |
57 DOMWindow* ScriptState::domWindow() const | 57 DOMWindow* ScriptState::domWindow() const |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 { | 117 { |
118 WorkerScriptController* script = workerGlobalScope->script(); | 118 WorkerScriptController* script = workerGlobalScope->script(); |
119 if (!script) | 119 if (!script) |
120 return 0; | 120 return 0; |
121 | 121 |
122 v8::HandleScope handleScope(script->isolate()); | 122 v8::HandleScope handleScope(script->isolate()); |
123 return ScriptState::forContext(script->context()); | 123 return ScriptState::forContext(script->context()); |
124 } | 124 } |
125 | 125 |
126 } | 126 } |
OLD | NEW |