OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 #include "core/workers/WorkerScriptLoader.h" | 40 #include "core/workers/WorkerScriptLoader.h" |
41 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
42 #include "wtf/MainThread.h" | 42 #include "wtf/MainThread.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 inline Worker::Worker(ExecutionContext* context) | 46 inline Worker::Worker(ExecutionContext* context) |
47 : AbstractWorker(context) | 47 : AbstractWorker(context) |
48 , m_contextProxy(0) | 48 , m_contextProxy(0) |
49 { | 49 { |
50 ScriptWrappable::init(this); | |
51 } | 50 } |
52 | 51 |
53 PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const S
tring& url, ExceptionState& exceptionState) | 52 PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const S
tring& url, ExceptionState& exceptionState) |
54 { | 53 { |
55 ASSERT(isMainThread()); | 54 ASSERT(isMainThread()); |
56 Document* document = toDocument(context); | 55 Document* document = toDocument(context); |
57 UseCounter::count(context, UseCounter::WorkerStart); | 56 UseCounter::count(context, UseCounter::WorkerStart); |
58 if (!document->page()) { | 57 if (!document->page()) { |
59 exceptionState.throwDOMException(InvalidAccessError, "The context provid
ed is invalid."); | 58 exceptionState.throwDOMException(InvalidAccessError, "The context provid
ed is invalid."); |
60 return nullptr; | 59 return nullptr; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 135 } |
137 m_scriptLoader = nullptr; | 136 m_scriptLoader = nullptr; |
138 } | 137 } |
139 | 138 |
140 void Worker::trace(Visitor* visitor) | 139 void Worker::trace(Visitor* visitor) |
141 { | 140 { |
142 AbstractWorker::trace(visitor); | 141 AbstractWorker::trace(visitor); |
143 } | 142 } |
144 | 143 |
145 } // namespace blink | 144 } // namespace blink |
OLD | NEW |