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

Side by Side Diff: Source/core/workers/Worker.cpp

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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) 2008, 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 { 49 {
50 ScriptWrappable::init(this); 50 ScriptWrappable::init(this);
51 } 51 }
52 52
53 PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) 53 PassRefPtr<Worker> Worker::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState)
54 { 54 {
55 ASSERT(isMainThread()); 55 ASSERT(isMainThread());
56 Document* document = toDocument(context); 56 Document* document = toDocument(context);
57 UseCounter::count(context, UseCounter::WorkerStart); 57 UseCounter::count(context, UseCounter::WorkerStart);
58 ASSERT(document->page()); 58 ASSERT(document->page());
59 WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvid er::from(document->page()); 59 WorkerGlobalScopeProxyProvider* proxyProvider = WorkerGlobalScopeProxyProvid er::from(*document->page());
60 ASSERT(proxyProvider); 60 ASSERT(proxyProvider);
61 61
62 RefPtr<Worker> worker = adoptRef(new Worker(context)); 62 RefPtr<Worker> worker = adoptRef(new Worker(context));
63 63
64 worker->suspendIfNeeded(); 64 worker->suspendIfNeeded();
65 65
66 KURL scriptURL = worker->resolveURL(url, exceptionState); 66 KURL scriptURL = worker->resolveURL(url, exceptionState);
67 if (scriptURL.isEmpty()) 67 if (scriptURL.isEmpty())
68 return 0; 68 return 0;
69 69
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 startMode = PauseWorkerGlobalScopeOnStart; 128 startMode = PauseWorkerGlobalScopeOnStart;
129 m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode) ; 129 m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionC ontext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), startMode) ;
130 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa der->identifier(), m_scriptLoader->script()); 130 InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoa der->identifier(), m_scriptLoader->script());
131 } 131 }
132 m_scriptLoader = nullptr; 132 m_scriptLoader = nullptr;
133 133
134 unsetPendingActivity(this); 134 unsetPendingActivity(this);
135 } 135 }
136 136
137 } // namespace WebCore 137 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698