summaryrefslogtreecommitdiffstats
path: root/ios/web/web_thread.cc
blob: 7fa4c06f8b7e35439c66f62c2443b8366b3a873b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ios/web/public/web_thread.h"

#include "content/public/browser/browser_thread.h"
#include "ios/web/web_thread_impl.h"

namespace web {

// static
bool WebThread::PostTask(ID identifier,
                         const tracked_objects::Location& from_here,
                         const base::Closure& task) {
  return content::BrowserThread::PostTask(
      BrowserThreadIDFromWebThreadID(identifier), from_here, task);
}

// static
bool WebThread::PostDelayedTask(ID identifier,
                                const tracked_objects::Location& from_here,
                                const base::Closure& task,
                                base::TimeDelta delay) {
  return content::BrowserThread::PostDelayedTask(
      BrowserThreadIDFromWebThreadID(identifier), from_here, task, delay);
}

// static
bool WebThread::PostTaskAndReply(ID identifier,
                                 const tracked_objects::Location& from_here,
                                 const base::Closure& task,
                                 const base::Closure& reply) {
  return content::BrowserThread::PostTaskAndReply(
      BrowserThreadIDFromWebThreadID(identifier), from_here, task, reply);
}

// static
bool WebThread::PostBlockingPoolTask(const tracked_objects::Location& from_here,
                                     const base::Closure& task) {
  return content::BrowserThread::PostBlockingPoolTask(from_here, task);
}

// static
bool WebThread::PostBlockingPoolSequencedTask(
    const std::string& sequence_token_name,
    const tracked_objects::Location& from_here,
    const base::Closure& task) {
  return content::BrowserThread::PostBlockingPoolSequencedTask(
      sequence_token_name, from_here, task);
}

// static
base::SequencedWorkerPool* WebThread::GetBlockingPool() {
  return content::BrowserThread::GetBlockingPool();
}

// static
base::MessageLoop* WebThread::UnsafeGetMessageLoopForThread(ID identifier) {
  return content::BrowserThread::UnsafeGetMessageLoopForThread(
      BrowserThreadIDFromWebThreadID(identifier));
}

// static
bool WebThread::CurrentlyOn(ID identifier) {
  return content::BrowserThread::CurrentlyOn(
      BrowserThreadIDFromWebThreadID(identifier));
}

// static
scoped_refptr<base::MessageLoopProxy> WebThread::GetMessageLoopProxyForThread(
    ID identifier) {
  return content::BrowserThread::GetMessageLoopProxyForThread(
      BrowserThreadIDFromWebThreadID(identifier));
}

// static
std::string WebThread::GetDCheckCurrentlyOnErrorMessage(ID expected) {
  return content::BrowserThread::GetDCheckCurrentlyOnErrorMessage(
      BrowserThreadIDFromWebThreadID(expected));
}

}  // namespace web