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

Side by Side Diff: Source/bindings/v8/WorkerScriptController.cpp

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 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 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 contextType = &V8ServiceWorkerGlobalScope::wrapperTypeInfo; 141 contextType = &V8ServiceWorkerGlobalScope::wrapperTypeInfo;
142 else if (!m_workerGlobalScope.isDedicatedWorkerGlobalScope()) 142 else if (!m_workerGlobalScope.isDedicatedWorkerGlobalScope())
143 contextType = &V8SharedWorkerGlobalScope::wrapperTypeInfo; 143 contextType = &V8SharedWorkerGlobalScope::wrapperTypeInfo;
144 v8::Handle<v8::Function> workerGlobalScopeConstructor = m_perContextData->co nstructorForType(contextType); 144 v8::Handle<v8::Function> workerGlobalScopeConstructor = m_perContextData->co nstructorForType(contextType);
145 v8::Local<v8::Object> jsWorkerGlobalScope = V8ObjectConstructor::newInstance (workerGlobalScopeConstructor); 145 v8::Local<v8::Object> jsWorkerGlobalScope = V8ObjectConstructor::newInstance (workerGlobalScopeConstructor);
146 if (jsWorkerGlobalScope.IsEmpty()) { 146 if (jsWorkerGlobalScope.IsEmpty()) {
147 disposeContext(); 147 disposeContext();
148 return false; 148 return false;
149 } 149 }
150 150
151 V8DOMWrapper::associateObjectWithWrapper<V8WorkerGlobalScope>(PassRefPtr<Wor kerGlobalScope>(m_workerGlobalScope), contextType, jsWorkerGlobalScope, m_isolat e, WrapperConfiguration::Dependent); 151 V8DOMWrapper::associateObjectWithWrapper<V8WorkerGlobalScope>(PassRefPtrWill BeRawPtr<WorkerGlobalScope>(&m_workerGlobalScope), contextType, jsWorkerGlobalSc ope, m_isolate, WrapperConfiguration::Dependent);
152 152
153 // Insert the object instance as the prototype of the shadow object. 153 // Insert the object instance as the prototype of the shadow object.
154 v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_perCont extData->context()->Global()->GetPrototype()); 154 v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_perCont extData->context()->Global()->GetPrototype());
155 globalObject->SetPrototype(jsWorkerGlobalScope); 155 globalObject->SetPrototype(jsWorkerGlobalScope);
156 156
157 return true; 157 return true;
158 } 158 }
159 159
160 ScriptValue WorkerScriptController::evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionSt ate* state) 160 ScriptValue WorkerScriptController::evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionSt ate* state)
161 { 161 {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 v8::Handle<v8::Context> context = isolate->GetCurrentContext(); 273 v8::Handle<v8::Context> context = isolate->GetCurrentContext();
274 v8::Handle<v8::Object> global = V8WorkerGlobalScope::findInstanceInPrototype Chain(context->Global(), isolate); 274 v8::Handle<v8::Object> global = V8WorkerGlobalScope::findInstanceInPrototype Chain(context->Global(), isolate);
275 // Return 0 if the current executing context is not the worker context. 275 // Return 0 if the current executing context is not the worker context.
276 if (global.IsEmpty()) 276 if (global.IsEmpty())
277 return 0; 277 return 0;
278 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ; 278 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ;
279 return workerGlobalScope->script(); 279 return workerGlobalScope->script();
280 } 280 }
281 281
282 } // namespace WebCore 282 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/workers/worker-supplement-gc-expected.txt ('k') | Source/core/loader/WorkerThreadableLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698