summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authoryurys <yurys@chromium.org>2014-09-11 00:23:16 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-11 07:32:50 +0000
commit07e7a118841a8f06d6634d20b978b5a3bcf183ac (patch)
tree00be2cd71766495f893629e6d900825dbff6ffc6 /mojo
parent1b75265c3c185255edd533340a1167feeb49eb21 (diff)
downloadchromium_src-07e7a118841a8f06d6634d20b978b5a3bcf183ac.zip
chromium_src-07e7a118841a8f06d6634d20b978b5a3bcf183ac.tar.gz
chromium_src-07e7a118841a8f06d6634d20b978b5a3bcf183ac.tar.bz2
Expose platform thread id on blink::WebThread
DevTools code needs access to platform thread id in order to collect Worker thread ids and based on them differentiate worker threads in recorded trace events. Blink part of the change: https://codereview.chromium.org/514193002/ BUG=401895 Review URL: https://codereview.chromium.org/515243002 Cr-Commit-Position: refs/heads/master@{#294345}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/services/html_viewer/webthread_impl.cc8
-rw-r--r--mojo/services/html_viewer/webthread_impl.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/mojo/services/html_viewer/webthread_impl.cc b/mojo/services/html_viewer/webthread_impl.cc
index ee81537..ae108e4 100644
--- a/mojo/services/html_viewer/webthread_impl.cc
+++ b/mojo/services/html_viewer/webthread_impl.cc
@@ -88,6 +88,10 @@ bool WebThreadImpl::isCurrentThread() const {
return thread_->thread_id() == base::PlatformThread::CurrentId();
}
+blink::PlatformThreadId WebThreadImpl::threadId() const {
+ return thread_->thread_id();
+}
+
WebThreadImpl::~WebThreadImpl() {
thread_->Stop();
}
@@ -126,6 +130,10 @@ bool WebThreadImplForMessageLoop::isCurrentThread() const {
return message_loop_->BelongsToCurrentThread();
}
+blink::PlatformThreadId WebThreadImplForMessageLoop::threadId() const {
+ return thread_id_;
+}
+
WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {}
} // namespace mojo
diff --git a/mojo/services/html_viewer/webthread_impl.h b/mojo/services/html_viewer/webthread_impl.h
index 3d22d86..93d7aeb 100644
--- a/mojo/services/html_viewer/webthread_impl.h
+++ b/mojo/services/html_viewer/webthread_impl.h
@@ -21,6 +21,7 @@ class WebThreadBase : public blink::WebThread {
virtual void removeTaskObserver(TaskObserver* observer);
virtual bool isCurrentThread() const = 0;
+ virtual blink::PlatformThreadId threadId() const = 0;
protected:
WebThreadBase();
@@ -46,6 +47,7 @@ class WebThreadImpl : public WebThreadBase {
base::MessageLoop* message_loop() const { return thread_->message_loop(); }
virtual bool isCurrentThread() const;
+ virtual blink::PlatformThreadId threadId() const;
private:
scoped_ptr<base::Thread> thread_;
@@ -65,7 +67,10 @@ class WebThreadImplForMessageLoop : public WebThreadBase {
private:
virtual bool isCurrentThread() const;
+ virtual blink::PlatformThreadId threadId() const;
+
scoped_refptr<base::MessageLoopProxy> message_loop_;
+ blink::PlatformThreadId thread_id_;
};
} // namespace mojo