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

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

Issue 1447563002: Implement frame attribution (FrameBlamer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure blame context is initialized early enough Created 4 years, 8 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "content/renderer/webpublicsuffixlist_impl.h" 77 #include "content/renderer/webpublicsuffixlist_impl.h"
78 #include "gpu/config/gpu_info.h" 78 #include "gpu/config/gpu_info.h"
79 #include "ipc/ipc_sync_message_filter.h" 79 #include "ipc/ipc_sync_message_filter.h"
80 #include "media/audio/audio_output_device.h" 80 #include "media/audio/audio_output_device.h"
81 #include "media/base/audio_hardware_config.h" 81 #include "media/base/audio_hardware_config.h"
82 #include "media/base/mime_util.h" 82 #include "media/base/mime_util.h"
83 #include "media/blink/webcontentdecryptionmodule_impl.h" 83 #include "media/blink/webcontentdecryptionmodule_impl.h"
84 #include "media/filters/stream_parser_factory.h" 84 #include "media/filters/stream_parser_factory.h"
85 #include "storage/common/database/database_identifier.h" 85 #include "storage/common/database/database_identifier.h"
86 #include "storage/common/quota/quota_types.h" 86 #include "storage/common/quota/quota_types.h"
87 #include "third_party/WebKit/public/platform/BlameContext.h"
87 #include "third_party/WebKit/public/platform/FilePathConversion.h" 88 #include "third_party/WebKit/public/platform/FilePathConversion.h"
88 #include "third_party/WebKit/public/platform/URLConversion.h" 89 #include "third_party/WebKit/public/platform/URLConversion.h"
89 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" 90 #include "third_party/WebKit/public/platform/WebBlobRegistry.h"
90 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" 91 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h"
91 #include "third_party/WebKit/public/platform/WebFileInfo.h" 92 #include "third_party/WebKit/public/platform/WebFileInfo.h"
92 #include "third_party/WebKit/public/platform/WebGamepads.h" 93 #include "third_party/WebKit/public/platform/WebGamepads.h"
93 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" 94 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
94 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" 95 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h"
95 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" 96 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h"
96 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 97 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // ChildThread may not exist in some tests. 262 // ChildThread may not exist in some tests.
262 if (ChildThreadImpl::current()) { 263 if (ChildThreadImpl::current()) {
263 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter(); 264 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter();
264 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); 265 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender();
265 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter(); 266 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter();
266 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get())); 267 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get()));
267 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get())); 268 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get()));
268 web_database_observer_impl_.reset( 269 web_database_observer_impl_.reset(
269 new WebDatabaseObserverImpl(sync_message_filter_.get())); 270 new WebDatabaseObserverImpl(sync_message_filter_.get()));
270 } 271 }
272
273 top_level_blame_context_.Initialize();
274 renderer_scheduler_->SetTopLevelBlameContext(&top_level_blame_context_);
271 } 275 }
272 276
273 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() { 277 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() {
274 WebFileSystemImpl::DeleteThreadSpecificInstance(); 278 WebFileSystemImpl::DeleteThreadSpecificInstance();
279 renderer_scheduler_->SetTopLevelBlameContext(nullptr);
275 } 280 }
276 281
277 void RendererBlinkPlatformImpl::Shutdown() { 282 void RendererBlinkPlatformImpl::Shutdown() {
278 #if !defined(OS_ANDROID) && !defined(OS_WIN) 283 #if !defined(OS_ANDROID) && !defined(OS_WIN)
279 // SandboxSupport contains a map of WebFontFamily objects, which hold 284 // SandboxSupport contains a map of WebFontFamily objects, which hold
280 // WebCStrings, which become invalidated when blink is shut down. Hence, we 285 // WebCStrings, which become invalidated when blink is shut down. Hence, we
281 // need to clear that map now, just before blink::shutdown() is called. 286 // need to clear that map now, just before blink::shutdown() is called.
282 sandbox_support_.reset(); 287 sandbox_support_.reset();
283 #endif 288 #endif
284 } 289 }
285 290
286 //------------------------------------------------------------------------------ 291 //------------------------------------------------------------------------------
287 292
288 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { 293 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() {
289 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 294 ChildThreadImpl* child_thread = ChildThreadImpl::current();
290 // There may be no child thread in RenderViewTests. These tests can still use 295 // There may be no child thread in RenderViewTests. These tests can still use
291 // data URLs to bypass the ResourceDispatcher. 296 // data URLs to bypass the ResourceDispatcher.
292 return new content::WebURLLoaderImpl( 297 return new content::WebURLLoaderImpl(
293 child_thread ? child_thread->resource_dispatcher() : NULL, 298 child_thread ? child_thread->resource_dispatcher() : NULL,
294 make_scoped_ptr(currentThread()->getWebTaskRunner()->clone())); 299 make_scoped_ptr(currentThread()->getWebTaskRunner()->clone()));
295 } 300 }
296 301
297 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { 302 blink::WebThread* RendererBlinkPlatformImpl::currentThread() {
298 if (main_thread_->isCurrentThread()) 303 if (main_thread_->isCurrentThread())
299 return main_thread_.get(); 304 return main_thread_.get();
300 return BlinkPlatformImpl::currentThread(); 305 return BlinkPlatformImpl::currentThread();
301 } 306 }
302 307
308 blink::BlameContext* RendererBlinkPlatformImpl::topLevelBlameContext() {
309 return &top_level_blame_context_;
310 }
311
303 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() { 312 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() {
304 blink::WebClipboard* clipboard = 313 blink::WebClipboard* clipboard =
305 GetContentClient()->renderer()->OverrideWebClipboard(); 314 GetContentClient()->renderer()->OverrideWebClipboard();
306 if (clipboard) 315 if (clipboard)
307 return clipboard; 316 return clipboard;
308 return clipboard_.get(); 317 return clipboard_.get();
309 } 318 }
310 319
311 blink::WebMimeRegistry* RendererBlinkPlatformImpl::mimeRegistry() { 320 blink::WebMimeRegistry* RendererBlinkPlatformImpl::mimeRegistry() {
312 return mime_registry_.get(); 321 return mime_registry_.get();
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 } 1272 }
1264 1273
1265 //------------------------------------------------------------------------------ 1274 //------------------------------------------------------------------------------
1266 1275
1267 blink::WebTrialTokenValidator* 1276 blink::WebTrialTokenValidator*
1268 RendererBlinkPlatformImpl::trialTokenValidator() { 1277 RendererBlinkPlatformImpl::trialTokenValidator() {
1269 return &trial_token_validator_; 1278 return &trial_token_validator_;
1270 } 1279 }
1271 1280
1272 } // namespace content 1281 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | content/renderer/top_level_blame_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698