Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 #include "third_party/WebKit/public/web/WebColorName.h" | 128 #include "third_party/WebKit/public/web/WebColorName.h" |
| 129 #include "third_party/WebKit/public/web/WebDatabase.h" | 129 #include "third_party/WebKit/public/web/WebDatabase.h" |
| 130 #include "third_party/WebKit/public/web/WebDocument.h" | 130 #include "third_party/WebKit/public/web/WebDocument.h" |
| 131 #include "third_party/WebKit/public/web/WebFrame.h" | 131 #include "third_party/WebKit/public/web/WebFrame.h" |
| 132 #include "third_party/WebKit/public/web/WebImageCache.h" | 132 #include "third_party/WebKit/public/web/WebImageCache.h" |
| 133 #include "third_party/WebKit/public/web/WebKit.h" | 133 #include "third_party/WebKit/public/web/WebKit.h" |
| 134 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 134 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
| 135 #include "third_party/WebKit/public/web/WebPopupMenu.h" | 135 #include "third_party/WebKit/public/web/WebPopupMenu.h" |
| 136 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 136 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 137 #include "third_party/WebKit/public/web/WebScriptController.h" | 137 #include "third_party/WebKit/public/web/WebScriptController.h" |
| 138 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | |
| 138 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 139 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 139 #include "third_party/WebKit/public/web/WebView.h" | 140 #include "third_party/WebKit/public/web/WebView.h" |
| 140 #include "third_party/skia/include/core/SkGraphics.h" | 141 #include "third_party/skia/include/core/SkGraphics.h" |
| 141 #include "ui/base/layout.h" | 142 #include "ui/base/layout.h" |
| 142 #include "ui/base/ui_base_switches.h" | 143 #include "ui/base/ui_base_switches.h" |
| 143 #include "v8/include/v8.h" | 144 #include "v8/include/v8.h" |
| 144 | 145 |
| 145 #if defined(OS_ANDROID) | 146 #if defined(OS_ANDROID) |
| 146 #include <cpu-features.h> | 147 #include <cpu-features.h> |
| 147 #include "content/renderer/android/synchronous_compositor_factory.h" | 148 #include "content/renderer/android/synchronous_compositor_factory.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 #ifdef ENABLE_VTUNE_JIT_INTERFACE | 180 #ifdef ENABLE_VTUNE_JIT_INTERFACE |
| 180 #include "v8/src/third_party/vtune/v8-vtune.h" | 181 #include "v8/src/third_party/vtune/v8-vtune.h" |
| 181 #endif | 182 #endif |
| 182 | 183 |
| 183 using base::ThreadRestrictions; | 184 using base::ThreadRestrictions; |
| 184 using blink::WebDocument; | 185 using blink::WebDocument; |
| 185 using blink::WebFrame; | 186 using blink::WebFrame; |
| 186 using blink::WebNetworkStateNotifier; | 187 using blink::WebNetworkStateNotifier; |
| 187 using blink::WebRuntimeFeatures; | 188 using blink::WebRuntimeFeatures; |
| 188 using blink::WebScriptController; | 189 using blink::WebScriptController; |
| 190 using blink::WebSecurityOrigin; | |
| 189 using blink::WebSecurityPolicy; | 191 using blink::WebSecurityPolicy; |
| 190 using blink::WebString; | 192 using blink::WebString; |
| 191 using blink::WebView; | 193 using blink::WebView; |
| 192 | 194 |
| 193 namespace content { | 195 namespace content { |
| 194 | 196 |
| 195 namespace { | 197 namespace { |
| 196 | 198 |
| 197 const int64 kInitialIdleHandlerDelayMs = 1000; | 199 const int64 kInitialIdleHandlerDelayMs = 1000; |
| 198 const int64 kLongIdleHandlerDelayMs = 30*1000; | 200 const int64 kLongIdleHandlerDelayMs = 30*1000; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() { | 381 blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() { |
| 380 blink::WebGraphicsContext3D::Attributes attributes; | 382 blink::WebGraphicsContext3D::Attributes attributes; |
| 381 attributes.shareResources = true; | 383 attributes.shareResources = true; |
| 382 attributes.depth = false; | 384 attributes.depth = false; |
| 383 attributes.stencil = false; | 385 attributes.stencil = false; |
| 384 attributes.antialias = false; | 386 attributes.antialias = false; |
| 385 attributes.noAutomaticFlushes = true; | 387 attributes.noAutomaticFlushes = true; |
| 386 return attributes; | 388 return attributes; |
| 387 } | 389 } |
| 388 | 390 |
| 391 void RegisterSecureOriginsWhitelist() { | |
|
jochen (gone - plz use gerrit)
2015/04/30 07:15:32
this can be moved to chrome now, no? somewhere in
kinuko
2015/04/30 08:16:25
Oops, yes actually I already had the code in chrom
| |
| 392 std::set<std::string> schemes; | |
| 393 std::set<GURL> origins; | |
| 394 GetContentClient()->AddSecureSchemesAndOrigins(&schemes, &origins); | |
| 395 for (const auto& origin : origins) | |
| 396 WebSecurityPolicy::addOriginTrustworthyWhiteList( | |
| 397 WebSecurityOrigin::create(origin)); | |
| 398 } | |
| 399 | |
| 389 } // namespace | 400 } // namespace |
| 390 | 401 |
| 391 // For measuring memory usage after each task. Behind a command line flag. | 402 // For measuring memory usage after each task. Behind a command line flag. |
| 392 class MemoryObserver : public base::MessageLoop::TaskObserver { | 403 class MemoryObserver : public base::MessageLoop::TaskObserver { |
| 393 public: | 404 public: |
| 394 MemoryObserver() {} | 405 MemoryObserver() {} |
| 395 ~MemoryObserver() override {} | 406 ~MemoryObserver() override {} |
| 396 | 407 |
| 397 void WillProcessTask(const base::PendingTask& pending_task) override {} | 408 void WillProcessTask(const base::PendingTask& pending_task) override {} |
| 398 | 409 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); | 570 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); |
| 560 | 571 |
| 561 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter()); | 572 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter()); |
| 562 | 573 |
| 563 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); | 574 AddFilter((new EmbeddedWorkerContextMessageFilter())->GetFilter()); |
| 564 | 575 |
| 565 GetContentClient()->renderer()->RenderThreadStarted(); | 576 GetContentClient()->renderer()->RenderThreadStarted(); |
| 566 | 577 |
| 567 InitSkiaEventTracer(); | 578 InitSkiaEventTracer(); |
| 568 | 579 |
| 580 RegisterSecureOriginsWhitelist(); | |
| 581 | |
| 569 const base::CommandLine& command_line = | 582 const base::CommandLine& command_line = |
| 570 *base::CommandLine::ForCurrentProcess(); | 583 *base::CommandLine::ForCurrentProcess(); |
| 571 | 584 |
| 572 is_impl_side_painting_enabled_ = | 585 is_impl_side_painting_enabled_ = |
| 573 !command_line.HasSwitch(switches::kDisableImplSidePainting); | 586 !command_line.HasSwitch(switches::kDisableImplSidePainting); |
| 574 cc_blink::WebLayerImpl::SetImplSidePaintingEnabled( | 587 cc_blink::WebLayerImpl::SetImplSidePaintingEnabled( |
| 575 is_impl_side_painting_enabled_); | 588 is_impl_side_painting_enabled_); |
| 576 | 589 |
| 577 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy); | 590 is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy); |
| 578 is_one_copy_enabled_ = !command_line.HasSwitch(switches::kDisableOneCopy); | 591 is_one_copy_enabled_ = !command_line.HasSwitch(switches::kDisableOneCopy); |
| (...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1895 } | 1908 } |
| 1896 | 1909 |
| 1897 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1910 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 1898 size_t erased = | 1911 size_t erased = |
| 1899 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1912 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 1900 routing_id_); | 1913 routing_id_); |
| 1901 DCHECK_EQ(1u, erased); | 1914 DCHECK_EQ(1u, erased); |
| 1902 } | 1915 } |
| 1903 | 1916 |
| 1904 } // namespace content | 1917 } // namespace content |
| OLD | NEW |