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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2382883005: Implement OffscreenCanvas.commit() on Unaccelerated 2D on worker (Closed)
Patch Set: style Created 4 years, 2 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } else { 271 } else {
272 DVLOG(1) << "Disabling sandbox support for testing."; 272 DVLOG(1) << "Disabling sandbox support for testing.";
273 } 273 }
274 #endif 274 #endif
275 275
276 // ChildThread may not exist in some tests. 276 // ChildThread may not exist in some tests.
277 if (ChildThreadImpl::current()) { 277 if (ChildThreadImpl::current()) {
278 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter(); 278 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter();
279 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); 279 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender();
280 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter(); 280 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter();
281 shared_bitmap_manager_ =
282 ChildThreadImpl::current()->shared_bitmap_manager();
281 blob_registry_.reset(new WebBlobRegistryImpl( 283 blob_registry_.reset(new WebBlobRegistryImpl(
282 RenderThreadImpl::current()->GetIOTaskRunner().get(), 284 RenderThreadImpl::current()->GetIOTaskRunner().get(),
283 base::ThreadTaskRunnerHandle::Get(), thread_safe_sender_.get())); 285 base::ThreadTaskRunnerHandle::Get(), thread_safe_sender_.get()));
284 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get())); 286 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get()));
285 web_database_observer_impl_.reset( 287 web_database_observer_impl_.reset(
286 new WebDatabaseObserverImpl(sync_message_filter_.get())); 288 new WebDatabaseObserverImpl(sync_message_filter_.get()));
287 } 289 }
288 290
289 top_level_blame_context_.Initialize(); 291 top_level_blame_context_.Initialize();
290 renderer_scheduler_->SetTopLevelBlameContext(&top_level_blame_context_); 292 renderer_scheduler_->SetTopLevelBlameContext(&top_level_blame_context_);
291 } 293 }
292 294
293 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() { 295 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() {
294 WebFileSystemImpl::DeleteThreadSpecificInstance(); 296 WebFileSystemImpl::DeleteThreadSpecificInstance();
295 renderer_scheduler_->SetTopLevelBlameContext(nullptr); 297 renderer_scheduler_->SetTopLevelBlameContext(nullptr);
298 shared_bitmap_manager_ = nullptr;
296 } 299 }
297 300
298 void RendererBlinkPlatformImpl::Shutdown() { 301 void RendererBlinkPlatformImpl::Shutdown() {
299 #if !defined(OS_ANDROID) && !defined(OS_WIN) 302 #if !defined(OS_ANDROID) && !defined(OS_WIN)
300 // SandboxSupport contains a map of WebFontFamily objects, which hold 303 // SandboxSupport contains a map of WebFontFamily objects, which hold
301 // WebCStrings, which become invalidated when blink is shut down. Hence, we 304 // WebCStrings, which become invalidated when blink is shut down. Hence, we
302 // need to clear that map now, just before blink::shutdown() is called. 305 // need to clear that map now, just before blink::shutdown() is called.
303 sandbox_support_.reset(); 306 sandbox_support_.reset();
304 #endif 307 #endif
305 } 308 }
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 bool is_software_rendering = host->gpu_info().software_rendering; 1139 bool is_software_rendering = host->gpu_info().software_rendering;
1137 1140
1138 return new WebGraphicsContext3DProviderImpl(std::move(provider), 1141 return new WebGraphicsContext3DProviderImpl(std::move(provider),
1139 is_software_rendering); 1142 is_software_rendering);
1140 } 1143 }
1141 1144
1142 //------------------------------------------------------------------------------ 1145 //------------------------------------------------------------------------------
1143 1146
1144 std::unique_ptr<cc::SharedBitmap> 1147 std::unique_ptr<cc::SharedBitmap>
1145 RendererBlinkPlatformImpl::allocateSharedBitmap(const blink::WebSize& size) { 1148 RendererBlinkPlatformImpl::allocateSharedBitmap(const blink::WebSize& size) {
1146 return ChildThreadImpl::current() 1149 return shared_bitmap_manager_
1147 ->shared_bitmap_manager()
1148 ->AllocateSharedBitmap(gfx::Size(size.width, size.height)); 1150 ->AllocateSharedBitmap(gfx::Size(size.width, size.height));
1149 } 1151 }
1150 1152
1151 //------------------------------------------------------------------------------ 1153 //------------------------------------------------------------------------------
1152 1154
1153 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() { 1155 blink::WebCompositorSupport* RendererBlinkPlatformImpl::compositorSupport() {
1154 return &compositor_support_; 1156 return &compositor_support_;
1155 } 1157 }
1156 1158
1157 //------------------------------------------------------------------------------ 1159 //------------------------------------------------------------------------------
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 return &trial_token_validator_; 1338 return &trial_token_validator_;
1337 } 1339 }
1338 1340
1339 void RendererBlinkPlatformImpl::workerContextCreated( 1341 void RendererBlinkPlatformImpl::workerContextCreated(
1340 const v8::Local<v8::Context>& worker) { 1342 const v8::Local<v8::Context>& worker) {
1341 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( 1343 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
1342 worker); 1344 worker);
1343 } 1345 }
1344 1346
1345 } // namespace content 1347 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698