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

Side by Side Diff: third_party/WebKit/WebCore/dom/Worker.cpp

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return static_cast<Document*>(scriptExecutionContext()); 87 return static_cast<Document*>(scriptExecutionContext());
88 } 88 }
89 89
90 void Worker::postMessage(const String& message) 90 void Worker::postMessage(const String& message)
91 { 91 {
92 m_messagingProxy->postMessageToWorkerContext(message); 92 m_messagingProxy->postMessageToWorkerContext(message);
93 } 93 }
94 94
95 void Worker::terminate() 95 void Worker::terminate()
96 { 96 {
97 m_messagingProxy->terminate(); 97 m_messagingProxy->terminateWorkerContext();
98 } 98 }
99 99
100 bool Worker::canSuspend() const 100 bool Worker::canSuspend() const
101 { 101 {
102 // FIXME: It is not currently possible to suspend a worker, so pages with wo rkers can not go into page cache. 102 // FIXME: It is not currently possible to suspend a worker, so pages with wo rkers can not go into page cache.
103 return false; 103 return false;
104 } 104 }
105 105
106 void Worker::stop() 106 void Worker::stop()
107 { 107 {
108 terminate(); 108 terminate();
109 } 109 }
110 110
111 bool Worker::hasPendingActivity() const 111 bool Worker::hasPendingActivity() const
112 { 112 {
113 return m_messagingProxy->workerThreadHasPendingActivity() || ActiveDOMObject ::hasPendingActivity(); 113 return m_messagingProxy->hasPendingActivity() || ActiveDOMObject::hasPending Activity();
114 } 114 }
115 115
116 void Worker::notifyFinished(CachedResource* unusedResource) 116 void Worker::notifyFinished(CachedResource* unusedResource)
117 { 117 {
118 ASSERT_UNUSED(unusedResource, unusedResource == m_cachedScript); 118 ASSERT_UNUSED(unusedResource, unusedResource == m_cachedScript);
119 119
120 if (m_cachedScript->errorOccurred()) 120 if (m_cachedScript->errorOccurred())
121 dispatchErrorEvent(); 121 dispatchErrorEvent();
122 else { 122 else {
123 String userAgent = document()->frame() ? document()->frame()->loader()-> userAgent(m_scriptURL) : String(); 123 String userAgent = document()->frame() ? document()->frame()->loader()-> userAgent(m_scriptURL) : String();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 return !event->defaultPrevented(); 197 return !event->defaultPrevented();
198 } 198 }
199 199
200 } // namespace WebCore 200 } // namespace WebCore
201 201
202 #endif // ENABLE(WORKERS) 202 #endif // ENABLE(WORKERS)
203 203
204 204
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/dom/Node.cpp ('k') | third_party/WebKit/WebCore/dom/WorkerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698