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

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

Issue 23206002: skia: Added chrome implementation of SkDiscardableMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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/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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "content/renderer/skia_benchmarking_extension.h" 83 #include "content/renderer/skia_benchmarking_extension.h"
84 #include "grit/content_resources.h" 84 #include "grit/content_resources.h"
85 #include "ipc/ipc_channel_handle.h" 85 #include "ipc/ipc_channel_handle.h"
86 #include "ipc/ipc_forwarding_message_filter.h" 86 #include "ipc/ipc_forwarding_message_filter.h"
87 #include "ipc/ipc_platform_file.h" 87 #include "ipc/ipc_platform_file.h"
88 #include "media/base/audio_hardware_config.h" 88 #include "media/base/audio_hardware_config.h"
89 #include "media/base/media.h" 89 #include "media/base/media.h"
90 #include "media/filters/gpu_video_decoder_factories.h" 90 #include "media/filters/gpu_video_decoder_factories.h"
91 #include "net/base/net_errors.h" 91 #include "net/base/net_errors.h"
92 #include "net/base/net_util.h" 92 #include "net/base/net_util.h"
93 #include "skia/ext/sk_discardable_memory_chrome.h"
94 #include "third_party/skia/include/core/SkGraphics.h"
93 #include "third_party/WebKit/public/platform/WebString.h" 95 #include "third_party/WebKit/public/platform/WebString.h"
94 #include "third_party/WebKit/public/web/WebColorName.h" 96 #include "third_party/WebKit/public/web/WebColorName.h"
95 #include "third_party/WebKit/public/web/WebDatabase.h" 97 #include "third_party/WebKit/public/web/WebDatabase.h"
96 #include "third_party/WebKit/public/web/WebDocument.h" 98 #include "third_party/WebKit/public/web/WebDocument.h"
97 #include "third_party/WebKit/public/web/WebFrame.h" 99 #include "third_party/WebKit/public/web/WebFrame.h"
98 #include "third_party/WebKit/public/web/WebImageCache.h" 100 #include "third_party/WebKit/public/web/WebImageCache.h"
99 #include "third_party/WebKit/public/web/WebKit.h" 101 #include "third_party/WebKit/public/web/WebKit.h"
100 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" 102 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h"
101 #include "third_party/WebKit/public/web/WebPopupMenu.h" 103 #include "third_party/WebKit/public/web/WebPopupMenu.h"
102 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 104 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 // Note that under Linux, the media library will normally already have 409 // Note that under Linux, the media library will normally already have
408 // been initialized by the Zygote before this instance became a Renderer. 410 // been initialized by the Zygote before this instance became a Renderer.
409 base::FilePath media_path; 411 base::FilePath media_path;
410 PathService::Get(DIR_MEDIA_LIBS, &media_path); 412 PathService::Get(DIR_MEDIA_LIBS, &media_path);
411 if (!media_path.empty()) 413 if (!media_path.empty())
412 media::InitializeMediaLibrary(media_path); 414 media::InitializeMediaLibrary(media_path);
413 415
414 memory_pressure_listener_.reset(new base::MemoryPressureListener( 416 memory_pressure_listener_.reset(new base::MemoryPressureListener(
415 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)))); 417 base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this))));
416 418
419 SkGraphics::SetSkDiscardableMemoryFactory(
420 skia::SkDiscardableMemoryFactoryChrome::GetInstance());
421
417 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); 422 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, "");
418 } 423 }
419 424
420 RenderThreadImpl::~RenderThreadImpl() { 425 RenderThreadImpl::~RenderThreadImpl() {
421 } 426 }
422 427
423 void RenderThreadImpl::Shutdown() { 428 void RenderThreadImpl::Shutdown() {
424 FOR_EACH_OBSERVER( 429 FOR_EACH_OBSERVER(
425 RenderProcessObserver, observers_, OnRenderProcessShutdown()); 430 RenderProcessObserver, observers_, OnRenderProcessShutdown());
426 431
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 1317
1313 } 1318 }
1314 1319
1315 void RenderThreadImpl::SampleGamepads(WebKit::WebGamepads* data) { 1320 void RenderThreadImpl::SampleGamepads(WebKit::WebGamepads* data) {
1316 if (!gamepad_shared_memory_reader_) 1321 if (!gamepad_shared_memory_reader_)
1317 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); 1322 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader);
1318 gamepad_shared_memory_reader_->SampleGamepads(*data); 1323 gamepad_shared_memory_reader_->SampleGamepads(*data);
1319 } 1324 }
1320 1325
1321 } // namespace content 1326 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | skia/ext/sk_discardable_memory_chrome.h » ('j') | skia/ext/sk_discardable_memory_chrome.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698