summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrickyz <rickyz@chromium.org>2015-06-23 16:20:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-23 23:21:57 +0000
commitf5f91f945f8c03393460d7375f8837078f50cf85 (patch)
treea9f56d2bf63ef50e82344fbbfec73a8797ae7c72
parent8bbe9f1f6330fa413176d5fec312b9a6f9442031 (diff)
downloadchromium_src-f5f91f945f8c03393460d7375f8837078f50cf85.zip
chromium_src-f5f91f945f8c03393460d7375f8837078f50cf85.tar.gz
chromium_src-f5f91f945f8c03393460d7375f8837078f50cf85.tar.bz2
Implement Platform::getUniqueIdForProcess.
BUG=501069,499332 Review URL: https://codereview.chromium.org/1186933004 Cr-Commit-Position: refs/heads/master@{#335801}
-rw-r--r--components/html_viewer/blink_platform_impl.cc7
-rw-r--r--components/html_viewer/blink_platform_impl.h1
-rw-r--r--content/child/blink_platform_impl.cc7
-rw-r--r--content/child/blink_platform_impl.h1
4 files changed, 16 insertions, 0 deletions
diff --git a/components/html_viewer/blink_platform_impl.cc b/components/html_viewer/blink_platform_impl.cc
index 6a8032b..04b5ef4 100644
--- a/components/html_viewer/blink_platform_impl.cc
+++ b/components/html_viewer/blink_platform_impl.cc
@@ -13,6 +13,7 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "base/trace_event/trace_event.h"
#include "components/html_viewer/blink_resource_constants.h"
#include "components/html_viewer/web_clipboard_impl.h"
#include "components/html_viewer/web_cookie_jar_impl.h"
@@ -133,6 +134,12 @@ blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() {
return &compositor_support_;
}
+uint32_t BlinkPlatformImpl::getUniqueIdForProcess() {
+ // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's
+ // ready.
+ return base::trace_event::TraceLog::GetInstance()->process_id();
+}
+
void BlinkPlatformImpl::createMessageChannel(
blink::WebMessagePortChannel** channel1,
blink::WebMessagePortChannel** channel2) {
diff --git a/components/html_viewer/blink_platform_impl.h b/components/html_viewer/blink_platform_impl.h
index b651e04..ffc0110d 100644
--- a/components/html_viewer/blink_platform_impl.h
+++ b/components/html_viewer/blink_platform_impl.h
@@ -54,6 +54,7 @@ class BlinkPlatformImpl : public blink::Platform {
size_t length);
virtual bool isThreadedCompositingEnabled();
virtual blink::WebCompositorSupport* compositorSupport();
+ uint32_t getUniqueIdForProcess() override;
void createMessageChannel(blink::WebMessagePortChannel** channel1,
blink::WebMessagePortChannel** channel2) override;
virtual blink::WebURLLoader* createURLLoader();
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 8c19647..404a82b 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -30,6 +30,7 @@
#include "base/time/time.h"
#include "base/trace_event/memory_allocator_dump_guid.h"
#include "base/trace_event/memory_dump_manager.h"
+#include "base/trace_event/trace_event.h"
#include "blink/public/resources/grit/blink_image_resources.h"
#include "blink/public/resources/grit/blink_resources.h"
#include "components/mime_util/mime_util.h"
@@ -1304,6 +1305,12 @@ size_t BlinkPlatformImpl::maxDecodedImageBytes() {
#endif
}
+uint32_t BlinkPlatformImpl::getUniqueIdForProcess() {
+ // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's
+ // ready.
+ return base::trace_event::TraceLog::GetInstance()->process_id();
+}
+
scoped_refptr<base::SingleThreadTaskRunner>
BlinkPlatformImpl::MainTaskRunnerForCurrentThread() {
if (main_thread_task_runner_.get() &&
diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h
index 849eeed..3c45894 100644
--- a/content/child/blink_platform_impl.h
+++ b/content/child/blink_platform_impl.h
@@ -81,6 +81,7 @@ class CONTENT_EXPORT BlinkPlatformImpl
virtual blink::WebDiscardableMemory* allocateAndLockDiscardableMemory(
size_t bytes);
virtual size_t maxDecodedImageBytes();
+ virtual uint32_t getUniqueIdForProcess();
virtual blink::WebURLLoader* createURLLoader();
virtual blink::WebSocketHandle* createWebSocketHandle();
virtual blink::WebString userAgent();